File indexing completed on 2025-08-03 08:20:30
0001 #include <fun4all/Fun4AllServer.h>
0002 #include <fun4all/Fun4AllInputManager.h>
0003 #include <fun4all/Fun4AllDstOutputManager.h>
0004 #include <fun4allraw/SingleGl1TriggeredInput.h>
0005 #include <fun4allraw/Fun4AllTriggeredInputManager.h>
0006 #include <fun4allraw/InputManagerType.h>
0007 #include <fun4all/Fun4AllOutputManager.h>
0008
0009 #include <ffamodules/FlagHandler.h>
0010 #include <ffamodules/HeadReco.h>
0011 #include <ffamodules/SyncReco.h>
0012
0013 #include <ffarawmodules/ClockDiffCheck.h>
0014
0015 R__LOAD_LIBRARY(libfun4all.so)
0016 R__LOAD_LIBRARY(libfun4allraw.so)
0017 R__LOAD_LIBRARY(libffamodules.so)
0018 R__LOAD_LIBRARY(libffarawmodules.so)
0019
0020 void Fun4All_New_Prdf_Combiner(int nEvents = 0,
0021 const std::string &daqhost = "seb15",
0022 const std::string &outdir = "/sphenix/user/pinkenbu")
0023 {
0024
0025 Fun4AllServer *se = Fun4AllServer::instance();
0026 se->Verbosity(1);
0027
0028 Fun4AllTriggeredInputManager *in = new Fun4AllTriggeredInputManager("Tin");
0029 SingleTriggeredInput *gl1 = new SingleGl1TriggeredInput("Gl1in");
0030 gl1->KeepPackets();
0031 gl1->AddListFile("gl1daq.list");
0032
0033 in->registerGl1TriggeredInput(gl1);
0034 ifstream infile;
0035 SingleTriggeredInput *input = nullptr;
0036 for (int i=0; i<21; i++)
0037 {
0038 char daqhost[200];
0039 char daqlist[200];
0040 sprintf(daqhost,"seb%02d",i);
0041 sprintf(daqlist,"%s.list",daqhost);
0042 infile.open(daqlist);
0043 if (infile.is_open())
0044 {
0045 infile.close();
0046 input = new SingleTriggeredInput(daqhost);
0047 if (strcmp(daqhost,"seb18") == 0)
0048 {
0049 input->KeepPackets();
0050 }
0051
0052
0053 input->AddListFile(daqlist);
0054 in->registerTriggeredInput(input);
0055 }
0056 }
0057 se->registerInputManager(in);
0058
0059 SyncReco *sync = new SyncReco();
0060 se->registerSubsystem(sync);
0061
0062 HeadReco *head = new HeadReco();
0063 se->registerSubsystem(head);
0064 FlagHandler *flag = new FlagHandler();
0065 se->registerSubsystem(flag);
0066
0067
0068 ClockDiffCheck *clkchk = new ClockDiffCheck();
0069
0070 clkchk->set_delBadPkts(true);
0071 se->registerSubsystem(clkchk);
0072 std::string outfile = "DST_TRIGGERED_EVENT_" + daqhost + "_run2auau_new_nocdbtag_v004.root";
0073 Fun4AllOutputManager *out = new Fun4AllDstOutputManager("dstout",outfile);
0074 out->SplitLevel(0);
0075 out->UseFileRule();
0076 out->SetNEvents(100000);
0077
0078
0079
0080 if (nEvents < 0)
0081 {
0082 return;
0083 }
0084 se->run(nEvents);
0085 se->End();
0086 delete se;
0087 std::cout << "all done" << std::endl;
0088 gSystem->Exit(0);
0089 }