Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fun4All_TPC_UnpackPRDF.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Fun4All_TPC_UnpackPRDF.C
1 
2 #ifndef MACRO_FUN4ALL_READDST_C
3 #define MACRO_FUN4ALL_READDST_C
4 
5 #include <tpcrawtottree/TPCRawDataTree.h>
6 
9 
10 #include <phool/recoConsts.h>
11 
12 R__LOAD_LIBRARY(libfun4allraw.so)
13 R__LOAD_LIBRARY(libTPCRawDataTree.so)
14 
15 int Fun4All_TPC_UnpackPRDF(const int nEvents = 0,
16  const string &inputFile = "/sphenix/lustre01/sphnxpro/commissioning/tpc/beam/TPC_ebdc00_beam-00010684-0000.prdf" //
17 )
18 {
19  //---------------
20  // Fun4All server
21  //---------------
23  se->Verbosity(1);
24 
25  string outDir = "/sphenix/user/rosstom/test/testFiles/";
26 
27  string fileName = inputFile;
28  size_t pos = fileName.find("TPC_ebdc");
29  fileName.erase(fileName.begin(),fileName.begin()+pos);
30 
31  TPCRawDataTree *r2tree = new TPCRawDataTree(outDir + fileName + "_TPCRawDataTree.root");
32 
33  // add all possible TPC packet that we need to analyze
34  for (int packet = 4000; packet<=4230; packet+=10)
35  {
36  r2tree->AddPacket(packet);
37  r2tree->AddPacket(packet+1);
38  }
39 
40  se->registerSubsystem(r2tree);
41 
43  in1->AddFile(inputFile);
44  se->registerInputManager(in1);
45 
46  se->run(nEvents);
47 
48  se->End();
49 
50  delete se;
51  std::cout << "All done processing" << std::endl;
52  gSystem->Exit(0);
53  return 0;
54 }
55 #endif