Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fun4All_EICAnalysis_Exclusive.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Fun4All_EICAnalysis_Exclusive.C
1 
3  const int nEvents = 100,
4  const char * inputFile = "/sphenix/user/gregtom3/data/Summer2018/track2cluster_studies/sartre_20x250_dvmp_G4.root",
5  const char * outputFile = "out.root"
6  )
7 {
8 
9  bool readdst = true;
10  bool readhepmc = false;
11 
12  //---------------
13  // Load libraries
14  //---------------
15 
16  gSystem->Load("libfun4all.so");
17  gSystem->Load("libphhepmc.so");
18  gSystem->Load("libeicana.so");
19 
20  //---------------
21  // Fun4All server
22  //---------------
23 
25  se->Verbosity(0);
26  // just if we set some flags somewhere in this macro
28 
29  //--------------
30  // Analysis modules
31  //--------------
32 
33  ExclusiveReco *ana = new ExclusiveReco(outputFile);
34  ana->set_do_process_dvmp( true );
35  se->registerSubsystem( ana );
36 
37  //--------------
38  // IO management
39  //--------------
40 
41  /* Read DST Files */
42  if ( readdst )
43  {
44  Fun4AllInputManager *hitsin = new Fun4AllDstInputManager("DSTin");
45  hitsin->fileopen(inputFile);
46  se->registerInputManager(hitsin);
47  }
48  /* Read HepMC ASCII files */
49  else if ( readhepmc )
50  {
52  se->registerInputManager( in );
53  se->fileopen( in->Name().c_str(), inputFile );
54  }
55 
56 
57  //-----------------
58  // Event processing
59  //-----------------
60  if (nEvents < 0)
61  {
62  return;
63  }
64  // if we run the particle generator and use 0 it'll run forever
65  if (nEvents == 0 && !readdst && !readhepmc)
66  {
67  cout << "using 0 for number of events is a bad idea when using particle generators" << endl;
68  cout << "it will run forever, so I just return without running anything" << endl;
69  return;
70  }
71 
72  se->run(nEvents);
73 
74  //-----
75  // Exit
76  //-----
77 
78  se->End();
79  std::cout << "All done" << std::endl;
80  delete se;
81  gSystem->Exit(0);
82 }