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