Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fun4All_EICAnalysis_DISReco.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Fun4All_EICAnalysis_DISReco.C
1 
3  const int nEvents = 1000,
4  const char * inputFile = "/gpfs/mnt/gpfs02/phenix/scratch/spjeffas/g4sim/G4_Leptoquark_DST_p250_e20_1000events_1seed_DIScharged.root",
5  //const char * inputFile = "G4EICDetector_DIS_10x250_20events.root",
6  //const char * inputFile = "G4EICDetector_DIS_SingleParticle_ele_10GeV_m05eta.root",
7  //const char * inputFile = "G4EICDetector_DIS_SingleParticle_ele_10GeV_m2eta.root",
8  const char * outputFile = "eicana_disreco_test2.root"
9  )
10 {
11 
12  bool readdst = true;
13  bool readhepmc = false;
14 
15  //---------------
16  // Load libraries
17  //---------------
18 
19  gSystem->Load("libeicana.so");
20  gSystem->Load("libfun4all.so");
21  gSystem->Load("libg4detectors.so");
22  gSystem->Load("libphhepmc.so");
23  // gSystem->Load("libg4testbench.so");
24  // gSystem->Load("libg4hough.so");
25  // gSystem->Load("libcemc.so");
26  gSystem->Load("libg4bbc.so");
27  gSystem->Load("libg4eval.so");
28 
29  //---------------
30  // Fun4All server
31  //---------------
32 
34  se->Verbosity(0);
35  // just if we set some flags somewhere in this macro
37 
38  //--------------
39  // Analysis modules
40  //--------------
41 
42  gROOT->LoadMacro("G4_FastSim_Reco_EIC.C");
44 
45  DISKinematicsReco *ana = new DISKinematicsReco(outputFile);
46  ana->set_do_process_truth( true );
47  ana->set_do_process_geant4_cluster( true );
48  se->registerSubsystem( ana );
49 
50  //--------------
51  // IO management
52  //--------------
53 
54  /* Read DST Files */
55  if ( readdst )
56  {
57  Fun4AllInputManager *hitsin = new Fun4AllDstInputManager("DSTin");
58  hitsin->fileopen(inputFile);
59  se->registerInputManager(hitsin);
60  }
61  /* Read HepMC ASCII files */
62  else if ( readhepmc )
63  {
65  se->registerInputManager( in );
66  se->fileopen( in->Name().c_str(), inputFile );
67  }
68 
69 
70  //-----------------
71  // Event processing
72  //-----------------
73  if (nEvents < 0)
74  {
75  return;
76  }
77  // if we run the particle generator and use 0 it'll run forever
78  if (nEvents == 0 && !readhits && !readhepmc)
79  {
80  cout << "using 0 for number of events is a bad idea when using particle generators" << endl;
81  cout << "it will run forever, so I just return without running anything" << endl;
82  return;
83  }
84 
85  se->run(nEvents);
86 
87  //-----
88  // Exit
89  //-----
90 
91  se->End();
92  std::cout << "All done" << std::endl;
93  delete se;
94  gSystem->Exit(0);
95 }