Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:20:24

0001 #pragma once
0002 #if ROOT_VERSION_CODE >= ROOT_VERSION(6,00,0)
0003 #include <fun4all/SubsysReco.h>
0004 #include <fun4all/Fun4AllServer.h>
0005 #include <fun4all/Fun4AllInputManager.h>
0006 #include <fun4allraw/Fun4AllPrdfInputManager.h>
0007 #include <fun4all/Fun4AllDstInputManager.h>
0008 #include <phool/recoConsts.h>
0009 
0010 #include <caloreco/CaloTowerBuilder.h>
0011 #include <caloreco/CaloWaveformProcessing.h>
0012 
0013 #include <ffamodules/FlagHandler.h>
0014 #include <ffamodules/HeadReco.h>
0015 #include <ffamodules/SyncReco.h>
0016 #include <ffamodules/CDBInterface.h>
0017 
0018 #include <fun4all/Fun4AllDstOutputManager.h>
0019 
0020 R__LOAD_LIBRARY(libfun4all.so)
0021 R__LOAD_LIBRARY(libfun4allraw.so)
0022 R__LOAD_LIBRARY(libcalo_reco.so)
0023 R__LOAD_LIBRARY(libffamodules.so)
0024 
0025 #endif
0026 void Fun4All_CaloProduction(const char *fname = "/gpfs/mnt/gpfs02/sphenix/user/trinn/combined_event_prdfs/calib-00007377-0000.prdf", const char *outfile = "testfile.root", int nskip = 0, int nevents = 0)
0027 { 
0028   Fun4AllServer *se = Fun4AllServer::instance();
0029   se->Verbosity(0);
0030  recoConsts *rc = recoConsts::instance();
0031 
0032  //===============
0033   // conditions DB flags
0034   //===============
0035   // ENABLE::CDB = true;
0036   // global tag
0037   rc->set_StringFlag("CDB_GLOBALTAG","MDC2");
0038   rc->set_uint64Flag("TIMESTAMP",6);
0039 
0040   CaloTowerBuilder *ca = new CaloTowerBuilder();
0041   ca->set_detector_type(CaloTowerBuilder::CEMC);
0042   ca->set_nsamples(31);
0043   ca->set_processing_type(CaloWaveformProcessing::TEMPLATE);
0044   se->registerSubsystem(ca);
0045 
0046   CaloTowerBuilder *ca1 = new CaloTowerBuilder();
0047   ca1->set_detector_type(CaloTowerBuilder::HCALIN);
0048   ca1->set_nsamples(31);
0049   ca1->set_processing_type(CaloWaveformProcessing::TEMPLATE);
0050   se->registerSubsystem(ca1);
0051 
0052   CaloTowerBuilder *ca2 = new CaloTowerBuilder();
0053   ca2->set_detector_type(CaloTowerBuilder::HCALOUT);
0054   ca2->set_nsamples(31);
0055   ca2->set_processing_type(CaloWaveformProcessing::TEMPLATE);
0056   se->registerSubsystem(ca2);
0057 
0058   Fun4AllInputManager *in = new Fun4AllPrdfInputManager("in");
0059   in->fileopen(fname);
0060   se->registerInputManager(in);
0061 
0062   Fun4AllDstOutputManager *out = new Fun4AllDstOutputManager("DSTOUT", outfile);
0063   se->registerOutputManager(out);
0064 
0065 
0066   se->skip(nskip);
0067   se->run(nevents);
0068   se->End();
0069   se->PrintTimer();
0070   gSystem->Exit(0);
0071 }