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