Back to home page

sPhenix code displayed by LXR

 
 

    


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

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 &infile = "/sphenix/lustre01/sphnxpro/production/run3pp/physics/ana573_2026p003_v001/DST_TRKR_TRACKS/run_00079500_00079600/DST_TRKR_TRACKS_run3pp_ana573_2026p003_v001-00079516-00000.root",
0027           const std::string &outdir = "/sphenix/tg/tg01/coldqcd/dillfitz/singletrackan/lumi/"
0028         )
0029 {
0030 
0031   std::string streaming_bcodst = "../streamingbcodsts/DST_STREAMING_BCOINFO-";
0032 
0033   std::string outfile = outdir;
0034   outfile += "DST_STREAMING_LUMIINFO-";
0035   //std::ifstream file(inlist);
0036   //if (!file.is_open()) {
0037   //  std::cerr << "Failed to open file\n";
0038   //}
0039 
0040   // There is probably a better way to do this... revisit!
0041   //std::string infilename;
0042   //if (std::getline(file, infilename)) {
0043       //std::string run_segments = infilename.substr(infilename.size() - 17, 8);
0044       // 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*
0045     std::string run_segments = infile.substr(infile.size() - 19, 14);
0046     std::string runs = infile.substr(infile.size() - 19, 8);
0047     outfile += run_segments;
0048     outfile += ".root";
0049     streaming_bcodst += runs;
0050     streaming_bcodst += ".root";
0051   //} else {
0052   //    std::cout << "File is empty or read failed\n";
0053  // }
0054   gSystem->Load("libg4dst.so");
0055   Fun4AllServer *se = Fun4AllServer::instance();
0056   //se->Verbosity(1);
0057 
0058   StreamingLumiReco *streaming_lumi = new StreamingLumiReco();
0059   //streaming_lumi->Verbosity(10);
0060 
0061   se->registerSubsystem(streaming_lumi);
0062 
0063   Fun4AllInputManager *in_gl1_dst = new Fun4AllDstInputManager("GL1_DSTin");
0064   //in_gl1_dst->AddListFile(inlist);
0065   in_gl1_dst->AddFile(infile);
0066   se->registerInputManager(in_gl1_dst);
0067 
0068   Fun4AllInputManager *in_bco_dst = new Fun4AllDstInputManager("BCO_DSTin");
0069   in_bco_dst->AddFile(streaming_bcodst);
0070   se->registerInputManager(in_bco_dst);
0071 
0072   Fun4AllOutputManager *out = new Fun4AllDstOutputManager("out",outfile);
0073   se->registerOutputManager(out);
0074 
0075   se->run(nEvents);
0076 
0077   se->End();
0078   delete se;
0079   gSystem->Exit(0);
0080 }