File indexing completed on 2025-08-05 08:15:07
0001
0002 #ifndef MACRO_FUN4ALL_READDST_C
0003 #define MACRO_FUN4ALL_READDST_C
0004
0005 #include <tpcrawtottree/TPCRawDataTree.h>
0006
0007 #include <fun4allraw/Fun4AllPrdfInputManager.h>
0008 #include <fun4all/Fun4AllServer.h>
0009
0010 #include <phool/recoConsts.h>
0011
0012 R__LOAD_LIBRARY(libfun4allraw.so)
0013 R__LOAD_LIBRARY(libTPCRawDataTree.so)
0014
0015 int Fun4All_TPC_EventDisplayPrep(const int nEvents = 10,
0016 const string &outDir = "/sphenix/user/rosstom/test/testFiles/",
0017 const string &inputFile = "/sphenix/lustre01/sphnxpro/rawdata/commissioning/TPC_ebdc00_pedestal-00010619-0000.prdf"
0018 )
0019 {
0020
0021
0022
0023 Fun4AllServer *se = Fun4AllServer::instance();
0024 se->Verbosity(1);
0025
0026 string fileName = inputFile;
0027 size_t pos = fileName.find("TPC_ebdc");
0028 fileName.erase(fileName.begin(),fileName.begin()+pos);
0029
0030 TPCRawDataTree *r2tree = new TPCRawDataTree(outDir + fileName + "_TPCRawDataTree.root");
0031
0032
0033 for (int packet = 4000; packet<=4230; packet+=10)
0034 {
0035 r2tree->AddPacket(packet);
0036 r2tree->AddPacket(packet+1);
0037 }
0038
0039 se->registerSubsystem(r2tree);
0040
0041 Fun4AllPrdfInputManager *in1 = new Fun4AllPrdfInputManager("PRDF1");
0042 in1->AddFile(inputFile);
0043 se->registerInputManager(in1);
0044
0045 se->run(nEvents);
0046
0047 se->End();
0048
0049 delete se;
0050 std::cout << "All done processing" << std::endl;
0051 gSystem->Exit(0);
0052 return 0;
0053 }
0054 #endif