Class Reference for E1039 Core & Analysis Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
run.C
Go to the documentation of this file.
1 #include <TSystem.h>
2 
3 R__LOAD_LIBRARY(libinterface_main)
4 R__LOAD_LIBRARY(libfun4all)
5 R__LOAD_LIBRARY(libg4detectors)
6 R__LOAD_LIBRARY(libg4eval)
7 R__LOAD_LIBRARY(libktracker)
8 R__LOAD_LIBRARY(libanamodule)
9 
10 int run(const int nEvents = 1)
11 {
12  const double FMAGSTR = -1.054;
13  const double KMAGSTR = -0.951;
14  const bool cosmic = true;
15 
17  rc->set_DoubleFlag("FMAGSTR", FMAGSTR);
18  rc->set_DoubleFlag("KMAGSTR", KMAGSTR);
19  if(cosmic)
20  {
21  rc->init("cosmic");
22  rc->set_BoolFlag("COARSE_MODE", true);
23  rc->set_DoubleFlag("KMAGSTR", 0.);
24  rc->set_DoubleFlag("FMAGSTR", 0.);
25  }
26  rc->Print();
27 
28  GeomSvc::UseDbSvc(true);
29  GeomSvc* geom_svc = GeomSvc::instance();
30 
32  se->Verbosity(0);
33 
34  AnaModule* ana = new AnaModule();
35  ana->set_output_filename("ana.root");
36  ana->registerDetector("DP1TL"); //register detector by its name, all detectors that do not directly partipate the tracking can be used
37  ana->registerDetector("DP1TR");
38  ana->registerDetector("DP1BL");
39  ana->registerDetector("DP1BR");
40  ana->registerDetector("DP2TL");
41  ana->registerDetector("DP2TR");
42  ana->registerDetector("DP2BL");
43  ana->registerDetector("DP2BR");
44  ana->registerDetector("P1X1");
45  ana->registerDetector("P1X2");
46  ana->registerDetector("P2X1");
47  ana->registerDetector("P2X2");
48  ana->registerDetector("P1Y1");
49  ana->registerDetector("P1Y2");
50  ana->registerDetector("P2Y1");
51  ana->registerDetector("P2Y2");
52  se->registerSubsystem(ana);
53 
55  in->Verbosity(0);
56  in->fileopen("data.root");
57  se->registerInputManager(in);
58 
59  //we do not really need an output manager
60  //Fun4AllDstOutputManager* out = new Fun4AllDstOutputManager("DSTOUT", "result.root");
61  //se->registerOutputManager(out);
62 
63  se->run(nEvents);
64 
65  // finish job - close and save output files
66  se->End();
67  se->PrintTimer();
68  std::cout << "All done" << std::endl;
69 
70  delete se;
71  gSystem->Exit(0);
72  return 0;
73 }
int registerInputManager(Fun4AllInputManager *InManager)
virtual int End()
virtual void set_DoubleFlag(const std::string &name, const double flag)
Definition: PHFlag.cc:77
virtual void set_BoolFlag(const std::string &name, const bool flag)
Definition: PHFlag.cc:179
void init(int runNo=0, bool verbose=false)
initialize the constants by the runNo - not implemented yet
Definition: recoConsts.cc:157
void Print() const
print all the parameters
Definition: recoConsts.cc:185
static Fun4AllServer * instance()
Fun4AllServer * se
void PrintTimer(const std::string &name="")
int run(const int nEvents=1)
Definition: run.C:10
static recoConsts * instance()
Definition: recoConsts.cc:7
int registerSubsystem(SubsysReco *subsystem, const std::string &topnodename="TOP")
static bool UseDbSvc()
Definition: GeomSvc.h:304
int run(const int nevnts=0, const bool require_nevents=false)
run n events (0 means up to end of file)
void set_output_filename(const TString &n)
Definition: AnaModule.h:32
void ana()
Definition: ana.C:291
virtual void Verbosity(const int ival)
Sets the verbosity of this module (0 by default=quiet).
Definition: Fun4AllBase.h:58
static GeomSvc * instance()
singlton instance
Definition: GeomSvc.cxx:211
virtual int fileopen(const std::string &)
void registerDetector(TString name)
Definition: AnaModule.cxx:106