Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2026-10-16 08:19:50

0001 
0002 #include <bcolumicount/BcoLumiReco.h>
0003 #include <ffamodules/SyncReco.h>
0004 
0005 #include <fun4all/Fun4AllServer.h>
0006 #include <fun4all/Fun4AllInputManager.h>
0007 #include <fun4all/Fun4AllOutputManager.h>
0008 #include <fun4all/Fun4AllDstOutputManager.h>
0009 
0010 #include <fun4allraw/Fun4AllPrdfInputManager.h>
0011 
0012 #include <phool/recoConsts.h>
0013 
0014 #include <Rtypes.h> // defines R__LOAD_LIBRARY macro for clang-tidy
0015 #include <TSystem.h>
0016 
0017 #include <fstream>
0018 
0019 R__LOAD_LIBRARY(libbcolumicount.so)
0020 R__LOAD_LIBRARY(libfun4all.so)
0021 R__LOAD_LIBRARY(libffamodules.so)
0022 R__LOAD_LIBRARY(libfun4allraw.so)
0023 
0024 void Fun4All_BcoLumi(const int nEvents = 0,
0025              const std::string &inlist = "gl1daq.list")
0026 {
0027   std::string outfile = "DST_BCOINFO-";
0028   std::ifstream file("gl1daq.list");  // open the file
0029   if (!file.is_open()) {
0030     std::cerr << "Failed to open file\n";
0031   }
0032 
0033   // There is probably a better way to do this... revisit!
0034   std::string infilename;
0035   if (std::getline(file, infilename)) {
0036       std::string run_segments = infilename.substr(infilename.size() - 17, 8);
0037       outfile += run_segments;
0038       outfile += ".root";
0039   } else {
0040       std::cout << "File is empty or read failed\n";
0041   }
0042 
0043   Fun4AllServer *se = Fun4AllServer::instance();
0044   //se->Verbosity(1);
0045 
0046   SyncReco *sync = new SyncReco();
0047   //sync->Verbosity(10);
0048   se->registerSubsystem(sync);
0049 
0050   BcoLumiReco *lumi = new BcoLumiReco();
0051   //lumi->Verbosity(10);
0052   se->registerSubsystem(lumi);
0053 
0054   Fun4AllInputManager *in = new Fun4AllPrdfInputManager("PRDFin");
0055   in->AddListFile(inlist);
0056   se->registerInputManager(in);
0057   Fun4AllOutputManager *out = new Fun4AllDstOutputManager("out",outfile);
0058   se->registerOutputManager(out);
0059 
0060   se->run(nEvents);
0061 
0062   se->End();
0063   delete se;
0064   gSystem->Exit(0);
0065 }