File indexing completed on 2025-08-06 08:16:08
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_UnpackPRDF(const int nEvents = 0,
0016 const string &inputFile = "/sphenix/lustre01/sphnxpro/commissioning/tpc/beam/TPC_ebdc00_beam-00010684-0000.prdf"
0017 )
0018 {
0019
0020
0021
0022 Fun4AllServer *se = Fun4AllServer::instance();
0023 se->Verbosity(1);
0024
0025 string outDir = "/sphenix/user/rosstom/test/testFiles/";
0026
0027 string fileName = inputFile;
0028 size_t pos = fileName.find("TPC_ebdc");
0029 fileName.erase(fileName.begin(),fileName.begin()+pos);
0030
0031 TPCRawDataTree *r2tree = new TPCRawDataTree(outDir + fileName + "_TPCRawDataTree.root");
0032
0033
0034 for (int packet = 4000; packet<=4230; packet+=10)
0035 {
0036 r2tree->AddPacket(packet);
0037 r2tree->AddPacket(packet+1);
0038 }
0039
0040 se->registerSubsystem(r2tree);
0041
0042 Fun4AllPrdfInputManager *in1 = new Fun4AllPrdfInputManager("PRDF1");
0043 in1->AddFile(inputFile);
0044 se->registerInputManager(in1);
0045
0046 se->run(nEvents);
0047
0048 se->End();
0049
0050 delete se;
0051 std::cout << "All done processing" << std::endl;
0052 gSystem->Exit(0);
0053 return 0;
0054 }
0055 #endif