Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:13:26

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   // towerinfov1=kPRDFTowerv1, v2=:kWaveformTowerv2, v3=kPRDFWaveform, v4=kPRDFTowerv4
0059   CaloTowerDefs::BuilderType buildertype = CaloTowerDefs::kPRDFTowerv4;
0060   string triggercountfilename = dir+"/trigout/triggercounter_5z_"+to_string(rn)+"_"+to_string(nproc)+".root";
0061   Fun4AllServer *se = Fun4AllServer::instance();
0062   se->Verbosity(0);
0063 
0064   recoConsts *rc = recoConsts::instance();
0065 
0066   int runnumber = rn;
0067 
0068   // conditions DB flags and timestamp
0069   rc->set_StringFlag("CDB_GLOBALTAG", "ProdA_2024");
0070   rc->set_uint64Flag("TIMESTAMP", runnumber);
0071   CDBInterface::instance()->Verbosity(1);
0072 
0073   FlagHandler *flag = new FlagHandler();
0074   se->registerSubsystem(flag);
0075 
0076   // MBD/BBC Reconstruction
0077   MbdReco *mbdreco = new MbdReco();
0078   se->registerSubsystem(mbdreco);
0079 
0080 
0081   // Official vertex storage
0082   GlobalVertexReco *gvertex = new GlobalVertexReco();
0083   se->registerSubsystem(gvertex);
0084 
0085 
0086   // Geometry
0087   //std::cout << "Adding Geometry file" << std::endl;
0088   //Fun4AllInputManager *intrue2 = new Fun4AllRunNodeInputManager("DST_GEO");
0089   //std::string geoLocation = CDBInterface::instance()->getUrl("calo_geo");
0090   //intrue2->AddFile(geoLocation);
0091   //se->registerInputManager(intrue2);
0092 
0093   /////////////////////////////////////////////////////
0094   // Set status of CALO towers, Calibrate towers,  Cluster
0095   //Process_Calo_Calib();
0096 
0097 
0098   Fun4AllInputManager *in_1 = new Fun4AllDstInputManager("DSTin1");
0099   string line1;
0100   line1 = "./dsts/"+to_string(rn)+"/"+to_string(rn)+"_"+to_string(nproc)+".root";
0101   in_1->AddFile(line1);
0102   se->registerInputManager( in_1 );
0103   
0104   triggercountmodule* trig = new triggercountmodule(triggercountfilename, rn, nproc, nfile, debug);
0105   se->registerSubsystem(trig);
0106   ///////////////////////////////////
0107   // Validation
0108 
0109   // caloTreeGen *caloTree = new caloTreeGen(outfile_tree);
0110   // //enable subsystems
0111   // caloTree->doEMCal(1, "TOWERINFO_CALIB_CEMC");
0112   // caloTree->doClusters(1, "CLUSTERINFO_CEMC");
0113   // caloTree->doHCals(1, "TOWERINFO_CALIB_HCALOUT", "TOWERINFO_CALIB_HCALIN");
0114   // caloTree->doZDC(1, "TOWERINFO_CALIB_ZDC");
0115   // caloTree->doTrig(1, "GL1Packet");
0116 
0117   // //set subsystem cuts
0118   // caloTree->setEMCalThresh(0.7);
0119   // caloTree->setClusterThresh(0.5);
0120   // caloTree->doClusterDetails(1);
0121   // caloTree->setOHCalThresh(0.5);
0122   // caloTree->setIHCalThresh(0.1);
0123   // se->registerSubsystem(caloTree);
0124 
0125   se->run(0);
0126   se->End();
0127 
0128   se->PrintTimer();
0129   delete se;
0130   std::cout << "All done!" << std::endl;
0131   gSystem->Exit(0);
0132 }
0133 
0134 //#endif