File indexing completed on 2025-08-03 08:20:23
0001 #ifndef FUN4ALL_CALOPRODUCTION_C
0002 #define FUN4ALL_CALOPRODUCTION_C
0003
0004 #include <caloreco/CaloTowerBuilder.h>
0005 #include <caloreco/CaloWaveformProcessing.h>
0006 #include <caloreco/CaloGeomMapping.h>
0007
0008 #include <ffamodules/FlagHandler.h>
0009 #include <ffamodules/HeadReco.h>
0010 #include <ffamodules/SyncReco.h>
0011 #include <ffamodules/CDBInterface.h>
0012
0013 #include <fun4allraw/Fun4AllPrdfInputManager.h>
0014
0015 #include <fun4all/Fun4AllDstOutputManager.h>
0016 #include <fun4all/Fun4AllInputManager.h>
0017 #include <fun4all/Fun4AllServer.h>
0018 #include <fun4all/SubsysReco.h>
0019
0020
0021 #include <phool/recoConsts.h>
0022
0023
0024
0025 R__LOAD_LIBRARY(libfun4all.so)
0026 R__LOAD_LIBRARY(libfun4allraw.so)
0027 R__LOAD_LIBRARY(libcalo_reco.so)
0028 R__LOAD_LIBRARY(libffamodules.so)
0029
0030 void Fun4All_CaloProduction(const std::string &fname = "/sphenix/user/trinn/combined_event_prdfs/calib-00007377-0000.prdf", const std::string &outfile = "testfile.root", int nskip = 0, int nevents = 0)
0031 {
0032 Fun4AllServer *se = Fun4AllServer::instance();
0033 se->Verbosity(0);
0034 recoConsts *rc = recoConsts::instance();
0035
0036
0037
0038
0039 rc->set_StringFlag("CDB_GLOBALTAG","MDC2");
0040 rc->set_uint64Flag("TIMESTAMP",6);
0041
0042 CaloTowerBuilder *ca = new CaloTowerBuilder();
0043 ca->set_detector_type(CaloTowerBuilder::CEMC);
0044 ca->set_nsamples(31);
0045 ca->set_processing_type(CaloWaveformProcessing::TEMPLATE);
0046 se->registerSubsystem(ca);
0047
0048 CaloTowerBuilder *ca1 = new CaloTowerBuilder();
0049 ca1->set_detector_type(CaloTowerBuilder::HCALIN);
0050 ca1->set_nsamples(31);
0051 ca1->set_processing_type(CaloWaveformProcessing::TEMPLATE);
0052 se->registerSubsystem(ca1);
0053
0054 CaloTowerBuilder *ca2 = new CaloTowerBuilder();
0055 ca2->set_detector_type(CaloTowerBuilder::HCALOUT);
0056 ca2->set_nsamples(31);
0057 ca2->set_processing_type(CaloWaveformProcessing::TEMPLATE);
0058 se->registerSubsystem(ca2);
0059
0060
0061 CaloTowerBuilder *ca3 = new CaloTowerBuilder();
0062 ca3->set_detector_type(CaloTowerBuilder::ZDC);
0063 ca3->set_nsamples(31);
0064 se->registerSubsystem(ca3);
0065
0066 CaloGeomMapping *cgm = new CaloGeomMapping();
0067 cgm->set_detector_name("CEMC");
0068 se->registerSubsystem(cgm);
0069
0070 CaloGeomMapping *cgm1 = new CaloGeomMapping();
0071 cgm1->set_detector_name("HCALIN");
0072 se->registerSubsystem(cgm1);
0073
0074 CaloGeomMapping *cgm2 = new CaloGeomMapping();
0075 cgm2->set_detector_name("HCALOUT");
0076 se->registerSubsystem(cgm2);
0077
0078 Fun4AllInputManager *in = new Fun4AllPrdfInputManager("in");
0079 in->fileopen(fname);
0080 se->registerInputManager(in);
0081
0082 Fun4AllDstOutputManager *out = new Fun4AllDstOutputManager("DSTOUT", outfile);
0083 se->registerOutputManager(out);
0084
0085
0086 se->skip(nskip);
0087 se->run(nevents);
0088 CDBInterface::instance()->Print();
0089 se->End();
0090 se->PrintTimer();
0091 gSystem->Exit(0);
0092 }
0093
0094 #endif