Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:24:01

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 #include <Rtypes.h>
0024 #include <TSystem.h>
0025 
0026 R__LOAD_LIBRARY(libfun4all.so)
0027 R__LOAD_LIBRARY(libfun4allraw.so)
0028 R__LOAD_LIBRARY(libcalo_reco.so)
0029 R__LOAD_LIBRARY(libffamodules.so)
0030 
0031 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)
0032 { 
0033   Fun4AllServer *se = Fun4AllServer::instance();
0034   se->Verbosity(0);
0035  recoConsts *rc = recoConsts::instance();
0036 
0037  //===============
0038   // conditions DB flags
0039   //===============
0040   rc->set_StringFlag("CDB_GLOBALTAG","MDC2");
0041   rc->set_uint64Flag("TIMESTAMP",6);
0042 
0043   CaloTowerBuilder *ca = new CaloTowerBuilder();
0044   ca->set_detector_type(CaloTowerDefs::CEMC);
0045   ca->set_nsamples(31);
0046   ca->set_processing_type(CaloWaveformProcessing::TEMPLATE);
0047   se->registerSubsystem(ca);
0048 
0049   CaloTowerBuilder *ca1 = new CaloTowerBuilder();
0050   ca1->set_detector_type(CaloTowerDefs::HCALIN);
0051   ca1->set_nsamples(31);
0052   ca1->set_processing_type(CaloWaveformProcessing::TEMPLATE);
0053   se->registerSubsystem(ca1);
0054 
0055   CaloTowerBuilder *ca2 = new CaloTowerBuilder();
0056   ca2->set_detector_type(CaloTowerDefs::HCALOUT);
0057   ca2->set_nsamples(31);
0058   ca2->set_processing_type(CaloWaveformProcessing::TEMPLATE);
0059   se->registerSubsystem(ca2);
0060 
0061   //default is FAST
0062   CaloTowerBuilder *ca3 = new CaloTowerBuilder();
0063   ca3->set_detector_type(CaloTowerDefs::ZDC);
0064   ca3->set_nsamples(31);
0065   se->registerSubsystem(ca3);
0066 
0067   CaloGeomMapping *cgm = new CaloGeomMapping();
0068   cgm->set_detector_name("CEMC");
0069   se->registerSubsystem(cgm);
0070 
0071   CaloGeomMapping *cgm1 = new CaloGeomMapping();
0072   cgm1->set_detector_name("HCALIN");
0073   se->registerSubsystem(cgm1);
0074 
0075   CaloGeomMapping *cgm2 = new CaloGeomMapping();
0076   cgm2->set_detector_name("HCALOUT");
0077   se->registerSubsystem(cgm2);
0078 
0079   Fun4AllInputManager *in = new Fun4AllPrdfInputManager("in");
0080   in->fileopen(fname);
0081   se->registerInputManager(in);
0082 
0083   Fun4AllDstOutputManager *out = new Fun4AllDstOutputManager("DSTOUT", outfile);
0084   se->registerOutputManager(out);
0085 
0086 
0087   se->skip(nskip);
0088   se->run(nevents);
0089   CDBInterface::instance()->Print(); // print used DB files
0090   se->End();
0091   se->PrintTimer();
0092   gSystem->Exit(0);
0093 }
0094 
0095 #endif