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 = 100,
16  const string &inputFile = "/sphenix/lustre01/sphnxpro/rawdata/commissioning/tpc/beam/TPC_ebdc*_beam-00011012-0000.prdf" //
17 )
18 {
19  //---------------
20  // Fun4All server
21  //---------------
23  se->Verbosity(1);
24 
25  string outDir = "/sphenix/u/jamesj3j3/tpc/sPHENIXProjects/beam-run-11012/";
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_skip100.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->skip(100);
47  se->run(nEvents);
48 
49  se->End();
50 
51  delete se;
52  std::cout << "All done processing" << std::endl;
53  gSystem->Exit(0);
54  return 0;
55 }
56 #endif