Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fun4All_TestBeam_HCAL_ShowerCalib.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Fun4All_TestBeam_HCAL_ShowerCalib.C
1 #pragma once
2 #if ROOT_VERSION_CODE >= ROOT_VERSION(6,00,0)
3 #include <fun4all/SubsysReco.h>
11 #include <proto4showercalib/Proto4ShowerCalib.h>
12 
13 R__LOAD_LIBRARY(libfun4all.so)
14 R__LOAD_LIBRARY(libPrototype4.so)
15 R__LOAD_LIBRARY(/direct/phenix+u/xusun/WorkSpace/sPHENIX/install/lib/libProto4HCalShowerCalib.so)
16 #endif
17 
18 int Fun4All_TestBeam_HCAL_ShowerCalib(const int nEvents = 10000000, const string runID = "1087") // -5 GeV meson
19 // int Fun4All_TestBeam_HCAL_ShowerCalib(const int nEvents = 10000000, const string runID = "0422") // -8 GeV meson
20 // int Fun4All_TestBeam_HCAL_ShowerCalib(const int nEvents = 10000000, const string runID = "0571") // -12 GeV meson
21 // int Fun4All_TestBeam_HCAL_ShowerCalib(const int nEvents = 10000000, const string runID = "0821") // 60 GeV proton
22 // int Fun4All_TestBeam_HCAL_ShowerCalib(const int nEvents = 10000000, const string runID = "0498") // 120 GeV proton
23 {
24 
25  //---------------
26  // Load libraries
27  //---------------
28  gSystem->Load("libPrototype4.so");
29  gSystem->Load("libfun4all.so");
30  // gSystem->Load("libg4detectors.so");
31  // gSystem->Load("libphhepmc.so");
32  // gSystem->Load("libg4testbench.so");
33  // gSystem->Load("libg4hough.so");
34  // gSystem->Load("libg4eval.so");
35 
36 
37  //---------------
38  // Fun4All server
39  //---------------
40 
42  se->Verbosity(1);
43 
44  //--------------
45  // IO management
46  //--------------
47 
48  bool _is_sim = false;
49  // bool _is_sim = true;
50  // Hits file
51  Fun4AllInputManager *hitsin = new Fun4AllDstInputManager("DSTin");
53  if(_is_sim) inputfile = Form("/sphenix/user/xusun/Simulation/Production/BeamTest_24GeV_%s.root",runID.c_str());
54  if(!_is_sim) inputfile= Form("/sphenix/data/data02/sphenix/t1044/production/production_HCal_0221/beam_0000%s-0000.root",runID.c_str());
55  // if(!_is_sim) inputfile= Form("/sphenix/user/xusun/TestBeam/Production/beam_0000%s.root",runID.c_str());
56  hitsin->fileopen(inputfile);
57 // hitsin->AddListFile(inputFile); // you can also choose this and give a list of DST file names in the file.
58  se->registerInputManager(hitsin);
59 
60  //load your analysis module.
61  gSystem->Load("/direct/phenix+u/xusun/WorkSpace/sPHENIX/install/lib/libProto4HCalShowerCalib.so");
62  std::string outputfile;
63  if(_is_sim) outputfile = Form("/sphenix/user/xusun/Simulation/ShowerCalib/Proto4ShowerInfoSIM_%s.root",runID.c_str());
64  if(!_is_sim) outputfile = Form("/sphenix/user/xusun/TestBeam/ShowerCalib/Proto4ShowerInfoRAW_%s.root",runID.c_str());
65 
66  // This one is an example defined in ../ExampleAnalysisModule/
67  Proto4ShowerCalib* hcal_ana = new Proto4ShowerCalib(outputfile.c_str());
68  hcal_ana->is_sim(_is_sim);
69  hcal_ana->set_runID(runID);
70  se->registerSubsystem(hcal_ana);
71 
72  se->run(nEvents);
73  se->End();
74 
75  std::cout << "All done" << std::endl;
76  delete se;
77  // gSystem->Exit(0);
78 
79  return 0;
80 }