Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2026-04-07 08:10:33

0001 //#ifndef FUN4ALL_YEAR2_C
0002 //#define FUN4ALL_YEAR2_C
0003 
0004 #include <Calo_Calib.C>
0005 #include <QA.C>
0006 
0007 #include <mbd/MbdReco.h>
0008 
0009 #include <epd/EpdReco.h>
0010 
0011 #include <zdcinfo/ZdcReco.h>
0012 
0013 #include <globalvertex/GlobalVertexReco.h>
0014 
0015 #include <ffamodules/CDBInterface.h>
0016 #include <ffamodules/FlagHandler.h>
0017 #include <ffamodules/HeadReco.h>
0018 #include <ffamodules/SyncReco.h>
0019 
0020 #include <fun4allraw/Fun4AllPrdfInputManager.h>
0021 
0022 #include <fun4all/Fun4AllDstInputManager.h>
0023 #include <fun4all/Fun4AllDstOutputManager.h>
0024 #include <fun4all/Fun4AllInputManager.h>
0025 #include <fun4all/Fun4AllRunNodeInputManager.h>
0026 #include <fun4all/Fun4AllServer.h>
0027 #include <fun4all/Fun4AllUtils.h>
0028 #include <fun4all/SubsysReco.h>
0029 
0030 #include <phool/recoConsts.h>
0031 
0032 #include <calotrigger/MinimumBiasClassifier.h>
0033 #include <centrality/CentralityReco.h>
0034 
0035 #include <calotreegen/caloTreeGen.h>
0036 #include <calovalid/CaloValid.h>
0037 #include <globalqa/GlobalQA.h>
0038 
0039 #include <triggercountmodule/triggercountmodule.h>
0040 
0041 R__LOAD_LIBRARY(libfun4all.so)
0042 R__LOAD_LIBRARY(libfun4allraw.so)
0043 R__LOAD_LIBRARY(libcalo_reco.so)
0044 R__LOAD_LIBRARY(libcalotrigger.so)
0045 R__LOAD_LIBRARY(libcentrality.so)
0046 R__LOAD_LIBRARY(libffamodules.so)
0047 R__LOAD_LIBRARY(libmbd.so)
0048 R__LOAD_LIBRARY(libepd.so)
0049 R__LOAD_LIBRARY(libzdcinfo.so)
0050 R__LOAD_LIBRARY(libglobalvertex.so)
0051 R__LOAD_LIBRARY(libcalovalid.so)
0052 R__LOAD_LIBRARY(libglobalQA.so)
0053 R__LOAD_LIBRARY(libcaloTreeGen.so)
0054 R__LOAD_LIBRARY(libtriggercountmodule.so)
0055 
0056 void run_earlydata_2(int nproc = 0, int debug = 0, int rn = 0, int nfile = 0, string dir = ".")
0057 {
0058   int clt = 1;
0059   // towerinfov1=kPRDFTowerv1, v2=:kWaveformTowerv2, v3=kPRDFWaveform, v4=kPRDFTowerv4
0060   CaloTowerDefs::BuilderType buildertype = CaloTowerDefs::kPRDFTowerv4;
0061   string triggercountfilename = dir+"/trigout/triggercounter_5z_"+to_string(rn)+"_"+to_string(nproc)+(clt?"_clt":"")+".root";
0062   Fun4AllServer *se = Fun4AllServer::instance();
0063   se->Verbosity(0);
0064 
0065   recoConsts *rc = recoConsts::instance();
0066 
0067   int runnumber = rn;
0068 
0069   // conditions DB flags and timestamp
0070   rc->set_StringFlag("CDB_GLOBALTAG", "ProdA_2024");
0071   rc->set_uint64Flag("TIMESTAMP", runnumber);
0072   CDBInterface::instance()->Verbosity(1);
0073 
0074   FlagHandler *flag = new FlagHandler();
0075   se->registerSubsystem(flag);
0076 
0077   // MBD/BBC Reconstruction
0078   MbdReco *mbdreco = new MbdReco();
0079   se->registerSubsystem(mbdreco);
0080 
0081 
0082   // Official vertex storage
0083   GlobalVertexReco *gvertex = new GlobalVertexReco();
0084   se->registerSubsystem(gvertex);
0085 
0086 
0087   // Geometry
0088   //std::cout << "Adding Geometry file" << std::endl;
0089   //Fun4AllInputManager *intrue2 = new Fun4AllRunNodeInputManager("DST_GEO");
0090   //std::string geoLocation = CDBInterface::instance()->getUrl("calo_geo");
0091   //intrue2->AddFile(geoLocation);
0092   //se->registerInputManager(intrue2);
0093 
0094   /////////////////////////////////////////////////////
0095   // Set status of CALO towers, Calibrate towers,  Cluster
0096   //Process_Calo_Calib();
0097 
0098 
0099   Fun4AllInputManager *in_1 = new Fun4AllDstInputManager("DSTin1");
0100   string line1;
0101   line1 = "./dsts/"+to_string(rn)+"/"+to_string(rn)+"_"+to_string(nproc)+".root";
0102   in_1->AddFile(line1);
0103   se->registerInputManager( in_1 );
0104   
0105   triggercountmodule* trig = new triggercountmodule(triggercountfilename, rn, nproc, nfile, debug, "triggercountmodule", clt);
0106   se->registerSubsystem(trig);
0107   ///////////////////////////////////
0108   // Validation
0109 
0110   // caloTreeGen *caloTree = new caloTreeGen(outfile_tree);
0111   // //enable subsystems
0112   // caloTree->doEMCal(1, "TOWERINFO_CALIB_CEMC");
0113   // caloTree->doClusters(1, "CLUSTERINFO_CEMC");
0114   // caloTree->doHCals(1, "TOWERINFO_CALIB_HCALOUT", "TOWERINFO_CALIB_HCALIN");
0115   // caloTree->doZDC(1, "TOWERINFO_CALIB_ZDC");
0116   // caloTree->doTrig(1, "GL1Packet");
0117 
0118   // //set subsystem cuts
0119   // caloTree->setEMCalThresh(0.7);
0120   // caloTree->setClusterThresh(0.5);
0121   // caloTree->doClusterDetails(1);
0122   // caloTree->setOHCalThresh(0.5);
0123   // caloTree->setIHCalThresh(0.1);
0124   // se->registerSubsystem(caloTree);
0125 
0126   se->run(0);
0127   se->End();
0128 
0129   se->PrintTimer();
0130   delete se;
0131   std::cout << "All done!" << std::endl;
0132   gSystem->Exit(0);
0133 }
0134 
0135 //#endif