Class Reference for E1039 Core & Analysis Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RecoE906Data.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 
9 /*
10 This macro takes severl external input files to run:
11 1. geom.root is the standard geometry dump from running the Fun4Sim macro;
12 2. e906_run7.opts is provided
13 3. digit_028692_009.root is E906 run6 data, can be found at /pnfs/e906/production/digit/R009/02/86
14 
15 This is an example script intended to demonstrate how to run SQReco in a minimalistic fashion, it is NOT
16 suitable for production use and users should develop their own reconstruction macro for their own analysis.
17 */
18 
19 int RecoE906Data(const int nEvents = 1)
20 {
21  const double FMAGSTR = -1.054;
22  const double KMAGSTR = -0.951;
23 
25  rc->set_DoubleFlag("FMAGSTR", FMAGSTR);
26  rc->set_DoubleFlag("KMAGSTR", KMAGSTR);
27  rc->Print();
28 
30  se->Verbosity(100);
31 
32  //JobOptsSvc* jobopt_svc = JobOptsSvc::instance();
33  //jobopt_svc->init("support/e906_run7.opts");
34 
35  GeomSvc::UseDbSvc(false); //set to true to run E1039 style data
36  GeomSvc* geom_svc = GeomSvc::instance();
37 
38  SQReco* reco = new SQReco();
39  reco->Verbosity(100);
40  reco->set_geom_file_name("support/geom.root");
41  reco->set_enable_KF(true); //Kalman filter not needed for the track finding, disabling KF saves a lot of initialization time
42  reco->setInputTy(SQReco::E906); //options are SQReco::E906 and SQReco::E1039
43  reco->setFitterTy(SQReco::KFREF); //not relavant for the track finding
44  reco->set_evt_reducer_opt("aoce"); //if not provided, event reducer will be using JobOptsSvc to intialize; to turn off, set it to "none"
45  reco->set_enable_eval(true);
46  reco->set_eval_file_name("eval.root");
47  se->registerSubsystem(reco);
48 
50  in->Verbosity(0);
51  in->set_tree_name("save");
52  in->set_branch_name("rawEvent");
53  in->fileopen("support/digit_028692_009.root");
54  se->registerInputManager(in);
55 
56  Fun4AllDstOutputManager* out = new Fun4AllDstOutputManager("DSTOUT", "result.root");
57  se->registerOutputManager(out);
58  // out->AddNode("SRawEvent");
59  // out->AddNode("SRecEvent");
60 
61  se->run(nEvents);
62  se->End();
63 
64  delete se;
65  gSystem->Exit(0);
66  return 0;
67 }
int fileopen(const std::string &filenam)
int registerInputManager(Fun4AllInputManager *InManager)
virtual int End()
virtual void set_DoubleFlag(const std::string &name, const double flag)
Definition: PHFlag.cc:77
int RecoE906Data(const int nEvents=1)
Definition: RecoE906Data.C:19
void set_tree_name(const std::string &treeName)
void Print() const
print all the parameters
Definition: recoConsts.cc:185
static Fun4AllServer * instance()
Fun4AllServer * se
static recoConsts * instance()
Definition: recoConsts.cc:7
int registerSubsystem(SubsysReco *subsystem, const std::string &topnodename="TOP")
void set_geom_file_name(const std::string &geomFileName)
Definition: SQReco.h:63
static bool UseDbSvc()
Definition: GeomSvc.h:304
void set_enable_KF(bool enable)
Definition: SQReco.h:66
int run(const int nevnts=0, const bool require_nevents=false)
run n events (0 means up to end of file)
void set_eval_file_name(const TString &evalFileName)
Definition: SQReco.h:60
int registerOutputManager(Fun4AllOutputManager *manager)
Definition: SQReco.h:42
void setInputTy(SQReco::INPUT_TYPE input_ty)
Definition: SQReco.h:56
void set_evt_reducer_opt(const TString &opt)
Definition: SQReco.h:75
void set_enable_eval(bool enable)
Definition: SQReco.h:69
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
void set_branch_name(const std::string &branchName)
void setFitterTy(SQReco::FITTER_TYPE fitter_ty)
Definition: SQReco.h:57