File indexing completed on 2025-08-03 08:20:24
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 <calotrigger/MinimumBiasClassifier.h>
0016
0017 #include <calotreegen/caloTreeGen.h>
0018
0019 #include <calovalid/CaloValid.h>
0020
0021 #include <centrality/CentralityReco.h>
0022
0023 #include <globalqa/GlobalQA.h>
0024
0025 #include <ffamodules/CDBInterface.h>
0026 #include <ffamodules/FlagHandler.h>
0027 #include <ffamodules/HeadReco.h>
0028 #include <ffamodules/SyncReco.h>
0029
0030 #include <fun4all/Fun4AllDstInputManager.h>
0031 #include <fun4all/Fun4AllDstOutputManager.h>
0032 #include <fun4all/Fun4AllInputManager.h>
0033 #include <fun4all/Fun4AllRunNodeInputManager.h>
0034 #include <fun4all/Fun4AllServer.h>
0035 #include <fun4all/Fun4AllUtils.h>
0036 #include <fun4all/SubsysReco.h>
0037
0038 #include <phool/recoConsts.h>
0039
0040
0041 R__LOAD_LIBRARY(libfun4all.so)
0042 R__LOAD_LIBRARY(libcalo_reco.so)
0043 R__LOAD_LIBRARY(libcalotrigger.so)
0044 R__LOAD_LIBRARY(libcentrality.so)
0045 R__LOAD_LIBRARY(libffamodules.so)
0046 R__LOAD_LIBRARY(libmbd.so)
0047 R__LOAD_LIBRARY(libepd.so)
0048 R__LOAD_LIBRARY(libzdcinfo.so)
0049 R__LOAD_LIBRARY(libglobalvertex.so)
0050 R__LOAD_LIBRARY(libcalovalid.so)
0051 R__LOAD_LIBRARY(libglobalQA.so)
0052 R__LOAD_LIBRARY(libcaloTreeGen.so)
0053
0054 void Fun4All_Year2_Calib(int nEvents = 100,
0055 const std::string &fname = "DST_CALOFITTING_run2pp_ana487_2024p018_v004-00047289-00000.root",
0056 const std::string &outfile = "DST_CALO_run2pp_ana487_2024p018_v004-00047289-00000.root",
0057 const std::string &outfile_hist = "HIST_CALOQA_run2pp_ana487_2024p018_v004-00047289-00000.root",
0058 const std::string &outfile_tree = "TREE_CALOQA_run2pp_ana487_2024p018_v004-00047289-00000.root",
0059 const std::string &dbtag = "ProdA_2024")
0060 {
0061
0062 CaloTowerDefs::BuilderType buildertype = CaloTowerDefs::kPRDFTowerv4;
0063
0064 Fun4AllServer *se = Fun4AllServer::instance();
0065 se->Verbosity(1);
0066
0067 recoConsts *rc = recoConsts::instance();
0068
0069 pair<int, int> runseg = Fun4AllUtils::GetRunSegment(fname);
0070 int runnumber = runseg.first;
0071
0072
0073 rc->set_StringFlag("CDB_GLOBALTAG", dbtag);
0074 rc->set_uint64Flag("TIMESTAMP", runnumber);
0075 CDBInterface::instance()->Verbosity(1);
0076
0077 FlagHandler *flag = new FlagHandler();
0078 se->registerSubsystem(flag);
0079
0080
0081 MbdReco *mbdreco = new MbdReco();
0082 se->registerSubsystem(mbdreco);
0083
0084
0085 EpdReco *epdreco = new EpdReco();
0086 se->registerSubsystem(epdreco);
0087
0088
0089 ZdcReco *zdcreco = new ZdcReco();
0090 zdcreco->set_zdc1_cut(0.0);
0091 zdcreco->set_zdc2_cut(0.0);
0092 se->registerSubsystem(zdcreco);
0093
0094
0095 GlobalVertexReco *gvertex = new GlobalVertexReco();
0096 se->registerSubsystem(gvertex);
0097
0098 GlobalQA *gqa = new GlobalQA("GlobalQA");
0099 se->registerSubsystem(gqa);
0100
0101
0102
0103 std::cout << "Adding Geometry file" << std::endl;
0104 Fun4AllInputManager *intrue2 = new Fun4AllRunNodeInputManager("DST_GEO");
0105 std::string geoLocation = CDBInterface::instance()->getUrl("calo_geo");
0106 intrue2->AddFile(geoLocation);
0107 se->registerInputManager(intrue2);
0108
0109
0110
0111 Process_Calo_Calib();
0112
0113
0114
0115 CaloValid *ca = new CaloValid("CaloValid");
0116 ca->set_timing_cut_width(200);
0117 se->registerSubsystem(ca);
0118
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135 Fun4AllInputManager *In = new Fun4AllDstInputManager("in");
0136 In->AddFile(fname);
0137 se->registerInputManager(In);
0138
0139 Fun4AllDstOutputManager *out = new Fun4AllDstOutputManager("DSTOUT", outfile);
0140 out->StripNode("TOWERS_CEMC");
0141 out->StripNode("TOWERS_HCALIN");
0142 out->StripNode("TOWERS_HCALOUT");
0143 out->StripNode("TOWERS_ZDC");
0144 out->StripNode("TOWERS_SEPD");
0145 out->StripNode("MBDPackets");
0146 se->registerOutputManager(out);
0147
0148 se->run(nEvents);
0149 se->End();
0150
0151 QAHistManagerDef::saveQARootFile(outfile_hist);
0152
0153 CDBInterface::instance()->Print();
0154 se->PrintTimer();
0155 delete se;
0156 std::cout << "All done!" << std::endl;
0157 gSystem->Exit(0);
0158 }
0159
0160 #endif