File indexing completed on 2025-12-18 09:22:11
0001 #include <emcnoisytowerfinder/emcNoisyTowerFinder.h>
0002
0003 #include <cdbobjects/CDBTTree.h>
0004
0005 #include <fun4all/Fun4AllServer.h>
0006 #include <fun4all/Fun4AllInputManager.h>
0007 #include <fun4all/Fun4AllDstInputManager.h>
0008 #include <fun4all/Fun4AllDstOutputManager.h>
0009 #include <fun4all/Fun4AllOutputManager.h>
0010 #include <fun4all/Fun4AllUtils.h>
0011 #include <fun4all/SubsysReco.h>
0012
0013 #include <phool/PHRandomSeed.h>
0014 #include <phool/recoConsts.h>
0015
0016 #include <Rtypes.h> // for R__LOAD_LIBRARY macro
0017 #include <TSystem.h>
0018
0019 R__LOAD_LIBRARY(libcdbobjects.so)
0020 R__LOAD_LIBRARY(libfun4all.so)
0021 R__LOAD_LIBRARY(libmbd_io.so)
0022 R__LOAD_LIBRARY(libemcNoisyTowerFinder.so)
0023
0024 void Fun4All_EMCalBadTowerID(const int nEvents = 5000, const std::string &inFile = "DST_CALO_run1auau_ana391_2023p006-00021813-1388.root", const std::string &inName = "commissioning3.root", const std::string& = "test.root", float = 150, float = 150,float = 4, float = 4, float = 0.05, float = 0.05, float = 1.0, int pass = 0)
0025 {
0026
0027
0028 std::pair<int, int> runseg = Fun4AllUtils::GetRunSegment(inFile);
0029 int runnumber = runseg.first;
0030 int segment = runseg.second;
0031
0032 emcNoisyTowerFinder *calo = new emcNoisyTowerFinder("noisyTowerFinder",inName);
0033
0034
0035 Fun4AllServer *se = Fun4AllServer::instance();
0036
0037
0038 if(pass == 0)
0039 {
0040 se->registerSubsystem(calo);
0041 Fun4AllInputManager *in = new Fun4AllDstInputManager("DSTcalo");
0042 in->AddFile(inFile);
0043 se->registerInputManager(in);
0044 se->run(nEvents);
0045 calo->FillHistograms(runnumber,segment);
0046 se->End();
0047 se->PrintTimer();
0048 }
0049 else if(pass == 1)
0050 {
0051 calo->Init(nullptr);
0052 calo->CalculateCutOffs(runnumber);
0053 calo->WriteCDBTree(runnumber);
0054 }
0055
0056
0057
0058 std::cout << "All done!" << std::endl;
0059 gSystem->Exit(0);
0060 }
0061