File indexing completed on 2025-12-16 09:24:08
0001 #include <fun4all/Fun4AllServer.h>
0002 #include <fun4all/Fun4AllInputManager.h>
0003 #include <fun4all/Fun4AllOutputManager.h>
0004
0005 #include <fun4allraw/SingleMvtxPoolInput.h>
0006 #include <fun4allraw/Fun4AllEventOutputManager.h>
0007
0008 #include <Rtypes.h> // for R__LOAD_LIBRARY
0009
0010 R__LOAD_LIBRARY(libfun4all.so)
0011 R__LOAD_LIBRARY(libfun4allraw.so)
0012 R__LOAD_LIBRARY(libffarawmodules.so)
0013
0014 SingleMvtxPoolInput *sngl[24]{};
0015
0016 std::vector<std::string> infile;
0017
0018
0019 void Fun4All_SingleMvtx(int = 0,
0020 const std::string &input_file00 = "mvtx-flx0.list",
0021 const std::string &input_file01 = "mvtx-flx1.list",
0022 const std::string &input_file02 = "mvtx-flx2.list",
0023 const std::string &input_file03 = "mvtx-flx3.list",
0024 const std::string &input_file04 = "mvtx-flx4.list",
0025 const std::string &input_file05 = "mvtx-flx5.list"
0026 )
0027 {
0028 infile.push_back(input_file00);
0029 infile.push_back(input_file01);
0030 infile.push_back(input_file02);
0031 infile.push_back(input_file03);
0032 infile.push_back(input_file04);
0033 infile.push_back(input_file05);
0034
0035 Fun4AllServer *se = Fun4AllServer::instance();
0036 se->Verbosity(1);
0037
0038
0039
0040
0041 int i = 0;
0042 for (const auto& iter : infile)
0043 {
0044 sngl[i]= new SingleMvtxPoolInput("MVTX_" + std::to_string(i));
0045 sngl[i]->Verbosity(3);
0046 sngl[i]->SetBcoRange(10);
0047 sngl[i]->AddListFile(iter);
0048 i++;
0049 }
0050
0051
0052
0053
0054 }
0055
0056 void Run(const int nEvents = 1)
0057 {
0058 for (int i = 0; i < nEvents; i++)
0059 {
0060 bool quit = false;
0061 for (auto *iter : sngl)
0062 {
0063 iter->FillPool(10);
0064 if (iter->AllDone())
0065 {
0066 quit = true;
0067 }
0068 }
0069 if (quit)
0070 {
0071 break;
0072 }
0073 }
0074 }
0075
0076 void RunBclk(const uint64_t bclk = 0)
0077 {
0078 for (auto *iter : sngl)
0079 {
0080 iter->FillPool(bclk);
0081 }
0082 }
0083
0084 void CleanUp()
0085 {
0086 for (auto *iter : sngl)
0087 {
0088 iter->ClearCurrentEvent();
0089 }
0090 }
0091
0092 void Verbosity(int v)
0093 {
0094 for (auto *iter : sngl)
0095 {
0096 iter->Verbosity(v);
0097 }
0098 }
0099
0100 void Print(const std::string &what = "ALL", int i = -1)
0101 {
0102 if (i < 0)
0103 {
0104 for (auto *iter : sngl)
0105 {
0106 iter->Print(what);
0107 }
0108 return;
0109 }
0110 }