Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2026-07-16 08:16:41

0001 
0002 #include <bcolumicount/StreamingLumiReco.h>
0003 
0004 #include <ffamodules/SyncReco.h>
0005 
0006 #include <fun4all/Fun4AllServer.h>
0007 #include <fun4all/Fun4AllInputManager.h>
0008 #include <fun4all/Fun4AllDstInputManager.h>
0009 #include <fun4all/Fun4AllOutputManager.h>
0010 #include <fun4all/Fun4AllDstOutputManager.h>
0011 
0012 #include <fun4allraw/Fun4AllPrdfInputManager.h>
0013 
0014 
0015 #include <phool/recoConsts.h>
0016 
0017 #include <Rtypes.h> // defines R__LOAD_LIBRARY macro for clang-tidy
0018 #include <TSystem.h>
0019 #include <fstream>
0020 
0021 R__LOAD_LIBRARY(libfun4all.so)
0022 R__LOAD_LIBRARY(libbcolumicount.so)
0023 R__LOAD_LIBRARY(libffamodules.so)
0024 
0025 void Fun4All_StreamingLumi(const int nEvents = 0,
0026               const std::string &inlist = "gl1rawhitdst_small.list")
0027 {
0028 
0029   std::string streaming_bcodst = "DST_STREAMING_BCOINFO-";
0030   std::string outfile = "DST_STREAMING_LUMIINFO-";
0031   std::ifstream file(inlist);
0032   if (!file.is_open()) {
0033     std::cerr << "Failed to open file\n";
0034   }
0035 
0036   // There is probably a better way to do this... revisit!
0037   std::string infilename;
0038   if (std::getline(file, infilename)) {
0039       //std::string run_segments = infilename.substr(infilename.size() - 17, 8);
0040       // if reading in the gl1rwhitdst lists from /sphenix/lustre01/sphnxpro/production/run3pp/physics/ana532_nocdbtag_v001/DST_STREAMING_EVENT_ebdc00_0/run_00081100_00081200/*81100*
0041       std::string run_segments = infilename.substr(infilename.size() - 19, 8);
0042       outfile += run_segments;
0043       outfile += ".root";
0044       streaming_bcodst += run_segments;
0045       streaming_bcodst += ".root";
0046   } else {
0047       std::cout << "File is empty or read failed\n";
0048   }
0049   gSystem->Load("libg4dst.so");
0050   Fun4AllServer *se = Fun4AllServer::instance();
0051   //se->Verbosity(1);
0052 
0053   StreamingLumiReco *streaming_lumi = new StreamingLumiReco();
0054   //streaming_lumi->Verbosity(10);
0055 
0056   se->registerSubsystem(streaming_lumi);
0057 
0058   Fun4AllInputManager *in_gl1_dst = new Fun4AllDstInputManager("GL1_DSTin");
0059   in_gl1_dst->AddListFile(inlist);
0060   se->registerInputManager(in_gl1_dst);
0061 
0062   Fun4AllInputManager *in_bco_dst = new Fun4AllDstInputManager("BCO_DSTin");
0063   in_bco_dst->AddFile(streaming_bcodst);
0064   se->registerInputManager(in_bco_dst);
0065 
0066   Fun4AllOutputManager *out = new Fun4AllDstOutputManager("out",outfile);
0067   se->registerOutputManager(out);
0068 
0069   se->run(nEvents);
0070 
0071   se->End();
0072   delete se;
0073   gSystem->Exit(0);
0074 }