Back to home page

sPhenix code displayed by LXR

 
 

    


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

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