Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:18:06

0001 #ifndef MACRO_FUN4ALL_CALOTREEGEN_C
0002 #define MACRO_FUN4ALL_CALOTREEGEN_C
0003 
0004 #include <ffamodules/CDBInterface.h>
0005 #include <fun4all/Fun4AllUtils.h>
0006 
0007 #include <fun4all/Fun4AllDstInputManager.h>
0008 #include <fun4all/Fun4AllInputManager.h>
0009 #include <fun4all/Fun4AllServer.h>
0010 #include <fun4all/SubsysReco.h>
0011 
0012 #include <fun4all/Fun4AllDstOutputManager.h>
0013 #include <fun4all/Fun4AllOutputManager.h>
0014 #include <fun4all/Fun4AllServer.h>
0015 
0016 #include <phool/PHRandomSeed.h>
0017 #include <phool/recoConsts.h>
0018 
0019 #include <tutorial/caloHistGen.h>
0020 #include <tutorial/CaloOnly.h>
0021 
0022 #include <Calo_Calib.C>
0023 
0024 R__LOAD_LIBRARY(libfun4all.so)
0025 R__LOAD_LIBRARY(libffarawobjects.so)
0026 // R__LOAD_LIBRARY(libcaloHistGen.so)
0027 R__LOAD_LIBRARY( libtutorial.so )
0028 
0029   void Fun4All_CaloHistGen(const int nEvents = 100, const std::string &fnameCalib = "DST_CALO_run2pp_ana450_2024p009-00053018-00001.root", const std::string &fnameRaw = "DST_CALOFITTING_run2pp_ana446_2024p007-00053018-00001.root",const std::string &outName = "commissioning.root", const std::string &dbtag = "ProdA_2024", const std::string &outNamejy = "commissioning.root")
0030 {
0031   Fun4AllServer *se = Fun4AllServer::instance();
0032   recoConsts *rc = recoConsts::instance();
0033   
0034   pair<int, int> runseg = Fun4AllUtils::GetRunSegment(fnameCalib);
0035   int runnumber = runseg.first;
0036 
0037   rc -> set_StringFlag("CDB_GLOBALTAG",dbtag);
0038   rc -> set_uint64Flag("TIMESTAMP",runnumber);
0039   CDBInterface::instance() -> Verbosity(1);
0040 
0041   gSystem->Load("libg4dst");
0042   
0043   Fun4AllInputManager *inRaw = new Fun4AllDstInputManager("DSTRaw");
0044   inRaw->AddFile(fnameRaw);
0045   se->registerInputManager(inRaw);
0046 
0047   Fun4AllInputManager *inCalib = new Fun4AllDstInputManager("DSTCalib");
0048   inCalib->AddFile(fnameCalib);
0049   se->registerInputManager(inCalib);
0050 
0051   Process_Calo_Calib();
0052   
0053   caloHistGen *calo = new caloHistGen(outName);
0054   // What subsystems do you want?
0055   calo->doEMCal(1, "TOWERINFO_CALIB_CEMC");
0056   // Store EMCal clusters?
0057   calo->doClusters(1, "CLUSTERINFO_CEMC");
0058 
0059   // Store HCal information?
0060   calo->doHCals(1, "TOWERINFO_CALIB_HCALOUT", "TOWERINFO_CALIB_HCALIN");
0061 
0062   // Store ZDC information?
0063   calo->doZDC(1, "TOWERINFO_CALIB_ZDC");
0064 
0065   // Store GL1 Information?
0066   calo->doTrig(1, "GL1Packet");
0067 
0068   //reconstruct diphoton pairs?
0069   calo->setPi0Reco(1);
0070   calo->setMaxAlpha(0.7);
0071   calo->setMinClusterE(0.5);
0072 
0073   calo->setTrig("jet");
0074   calo->setTrig("photon");
0075   
0076   se->registerSubsystem(calo);
0077 
0078 //   CaloOnly *calojy = new CaloOnly("CaloOnly", outNamejy);
0079 //   se->registerSubsystem(calojy);
0080 
0081     se->skip(100);
0082   se->run(nEvents);
0083   se->End();
0084   se->PrintTimer();
0085   std::cout << "All done!" << std::endl;
0086 
0087   gSystem->Exit(0);
0088 }
0089 
0090 #endif