Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:14:14

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 #include <hcal_towerid/hcal_towerid.h>
0017 
0018 R__LOAD_LIBRARY(libfun4all.so)
0019 R__LOAD_LIBRARY(libtowerid.so)
0020 R__LOAD_LIBRARY(libmbd_io.so)
0021 R__LOAD_LIBRARY(libcalo_reco.so)
0022 R__LOAD_LIBRARY(libcaloana.so)
0023 R__LOAD_LIBRARY(libffamodules.so)
0024 R__LOAD_LIBRARY(libcalotrigger.so)
0025 R__LOAD_LIBRARY(libcentrality.so)
0026 
0027 /*
0028 R__LOAD_LIBRARY(libcdbobjects.so)
0029 R__LOAD_LIBRARY(libfun4all.so)
0030 R__LOAD_LIBRARY(libtowerid.so)
0031 R__LOAD_LIBRARY(libmbd_io.so)
0032 */
0033 #endif
0034 
0035 void Fun4all_HCalBadTowerID(const int nEvents = 5000, const char *inFile = "/sphenix/lustre01/sphnxpro/commissioning/DST_ana399_2023p008/DST_CALO_run1auau_ana399_2023p008-00020859-0001.root", const char *outName = "output/hottowers.root", const std::string icdbname = "test.root", const std::string ocdbname = "test2.root",float adccut_i = 40, float adccut_o = 40, float sigmas_lo = 2, float sigmas_hi = 5, float inner_f = 0.5, float outer_f = 0.5, int pass = 1)
0036 {
0037   pair<int, int> runseg = Fun4AllUtils::GetRunSegment(inFile);
0038   int runnumber = runseg.first;
0039   int segment = runseg.second;
0040   
0041   hcal_towerid *calo = new hcal_towerid("hcal_towerid", outName, icdbname,ocdbname,adccut_i,adccut_o,sigmas_lo,sigmas_hi,inner_f,outer_f);
0042 
0043   Fun4AllServer *se = Fun4AllServer::instance();
0044   recoConsts *rc = recoConsts::instance();
0045 
0046   if(pass == 0)  
0047     {
0048       se->registerSubsystem(calo);
0049       Fun4AllInputManager *in = new Fun4AllDstInputManager("DSTcalo");
0050       in->AddFile(inFile);
0051       se->registerInputManager(in);
0052       se->run(nEvents);
0053       calo -> FillHistograms(runnumber,segment);
0054       se->End();      
0055       se->PrintTimer();
0056     }
0057   else if(pass == 1)
0058     {  
0059       calo -> Init(NULL);
0060       calo -> CalculateCutOffs(runnumber);
0061       calo -> WriteCDBTree(runnumber);
0062       //calo -> WriteCDBTree(runnumber);
0063     }
0064   std::cout << "All done!" << std::endl;
0065   gSystem->Exit(0);
0066 }