Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fun4All_TPC_UnpackPRDF_Batch.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Fun4All_TPC_UnpackPRDF_Batch.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 
16  const int nEvents = 400,
17  const int sector = 11,
18  const int run = 11127,
19  const string &mode = "beam")
20 {
21  //---------------
22  // Fun4All server
23  //---------------
25  se->Verbosity(1);
26 
27  const string inputFile =
28  Form("/sphenix/lustre01/sphnxpro/commissioning/tpc/%s/TPC_ebdc%02d_%s-000%05d-0000.prdf",
29  mode.c_str(), sector, mode.c_str(), run);
30 
31  string outFile = Form("/phenix/u/jinhuang/links/sPHENIX_work/TPC/commissioning/TPC_ebdc%02d_%s-000%05d-0000.prdf.TPCRawDataTree.root",
32  sector, mode.c_str(), run);
33 
34  string fileName = inputFile;
35  size_t pos = fileName.find("TPC_ebdc");
36  fileName.erase(fileName.begin(), fileName.begin() + pos);
37 
38  TPCRawDataTree *r2tree = new TPCRawDataTree(outFile);
39 
40  // add all possible TPC packet that we need to analyze
41  for (int packet = 4000; packet <= 4230; packet += 10)
42  {
43  r2tree->AddPacket(packet);
44  r2tree->AddPacket(packet + 1);
45  }
46 
47  se->registerSubsystem(r2tree);
48 
50  in1->fileopen(inputFile);
51  se->registerInputManager(in1);
52 
53  // se->skip(8622); //////////////////////////////////////////////////
54  se->run(nEvents);
55 
56  se->End();
57 
58  delete se;
59  std::cout << "All done processing" << std::endl;
60  gSystem->Exit(0);
61  return 0;
62 }
63 #endif
64