EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fun4All_Read_Dst.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Fun4All_Read_Dst.C
1 #ifndef MACRO_FUN4ALLREADDST_C
2 #define MACRO_FUN4ALLREADDST_C
3 
4 #include <g4histos/G4HitNtuple.h>
5 
11 #include <fun4all/Fun4AllServer.h>
12 #include <fun4all/SubsysReco.h>
13 
14 #include <phool/recoConsts.h>
15 
16 R__LOAD_LIBRARY(libfun4all.so)
17 R__LOAD_LIBRARY(libg4testbench.so)
18 R__LOAD_LIBRARY(libg4histos.so)
19 
21 {
23  // Make the Server
27  // if you want to fix the random seed to reproduce results
28  // set this flag
29  // rc->set_IntFlag("RANDOMSEED",12345);
30 
31  G4HitNtuple *hits = new G4HitNtuple("Hits", "HitsFromDst.root");
32  hits->AddNode("HoleInBox", 0);
33  se->registerSubsystem(hits);
34 
36  // IOManagers...
38 
39  // Fun4AllDstOutputManager *out = new Fun4AllDstOutputManager("DSTOUT","G4Example01.root");
40  // out->Verbosity(10);
41  // se->registerOutputManager(out);
42 
43  // this (dummy) input manager just drives the event loop
45  in->fileopen("G4Example01.root");
46  se->registerInputManager(in);
47  // events = 0 => run till end of input file
48  if (nEvents < 0)
49  {
50  return 0;
51  }
52  se->run(nEvents);
53  se->End();
54  std::cout << "All done" << std::endl;
55  delete se;
56  gSystem->Exit(0);
57 }
58 
59 #endif