FairRoot/PandaRoot
runLumi5Geane.C
Go to the documentation of this file.
1 int runLumi5Geane(const int nEvents=10, const double mom=15, const int startEvent=0, TString storePath="tmpOutput", const int verboseLevel=0, const bool mergedHits=false)
2 {
3  // ========================================================================
4  // Input file (MC events)
5  TString MCFile = storePath+"/Lumi_MC_";
6  MCFile += startEvent;
7  MCFile += ".root";
8  TString DigiFile = storePath+"/Lumi_digi_";
9  DigiFile += startEvent;
10  DigiFile += ".root";
11  // Digi file
13  if(mergedHits)RecoFile+="/Lumi_recoMerged_";
14  else RecoFile+="/Lumi_reco_";
15  RecoFile += startEvent;
16  RecoFile += ".root";
17  // TCand file
18  TString CandFile = storePath+"/Lumi_TCand_";
19  CandFile += startEvent;
20  CandFile += ".root";
21  // Parameter file
22  TString parFile = storePath+"/Lumi_Params_";
23  parFile += startEvent;
24  parFile += ".root";
25  // Track file
26  TString TrkFile = storePath+"/Lumi_Track_";
27  TrkFile += startEvent;
28  TrkFile += ".root";
29 
30  // ---- Load libraries -------------------------------------------------
31  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
32  gSystem->Load("libSds");
33  gSystem->Load("libSdsReco");
34  gSystem->Load("libLmd");
35  gSystem->Load("libLmdReco");
36  gSystem->Load("libLmdTrk");
37  // ------------------------------------------------------------------------
38 
39 
40  // Output file
41  TString outFile = storePath+"/Lumi_Geane_";
42  outFile += startEvent;
43  outFile += ".root";
44 
45  std::cout << "MCFile : " << MCFile.Data()<< std::endl;
46  std::cout << "DigiFile: " << DigiFile.Data()<< std::endl;
47  std::cout << "RecoFile: " << RecoFile.Data()<< std::endl;
48  std::cout << "TCandFile: " << CandFile.Data()<< std::endl;
49  std::cout << "TrackFile: " << TrkFile.Data()<< std::endl;
50  std::cout << "GeaneFile: " << outFile.Data()<< std::endl;
51  // --- Now choose concrete engines for the different tasks -------------
52  // ------------------------------------------------------------------------
53 
54 
55  // In general, the following parts need not be touched
56  // ========================================================================
57 
58 
59 
60 
61  // ----- Timer ------ --------------------------------------------------
62  TStopwatch timer;
63  timer.Start();
64  // ------------------------------------------------------------------------
65 
66 
67  // ----- Reconstruction run -------------------------------------------
68  FairRunAna *fRun= new FairRunAna();
69  fRun->SetInputFile(MCFile);
70  fRun->AddFriend(DigiFile);
71  fRun->AddFriend(RecoFile);
72  fRun->AddFriend(CandFile);
73  fRun->AddFriend(TrkFile);
74  fRun->SetOutputFile(outFile);
75  // ------------------------------------------------------------------------
76 
77  FairGeane *Geane = new FairGeane();
78  fRun->AddTask(Geane);
79 
80  // ----- Parameter database --------------------------------------------
81  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
82  FairParRootFileIo* parInput1 = new FairParRootFileIo(kTRUE);
83  parInput1->open(parFile.Data());
84  rtdb->setFirstInput(parInput1);
85 
86 
87  // =========================================================================
88  // ====== Geane Back-Propagating ======
89  // =========================================================================
90 
91  // ----- SDS hit producer --------------------------------------------
92 
93  // PndEmcMapper *emcMap = PndEmcMapper::Instance(6);
94  Double_t fpBeam = mom;
95  TVector3 IP(0,0,0);
96  PndLmdGeaneTask* lmdgeane = new PndLmdGeaneTask(fpBeam, IP);
97  lmdgeane->SetVerbose(verboseLevel);
98  fRun->AddTask(lmdgeane);
99  rtdb->setOutput(parInput1);
100  rtdb->print();
101  // ===== End of Geane =====
102  // =========================================================================
103 
104  // ----- Intialise and run --------------------------------------------
105  fRun->Init();
106  // // PndEmcMapper *emcMap = PndEmcMapper::Instance(6);
107  // PndEmcMapper *emcMap = PndEmcMapper::Instance();
108  // //Geane->SetField(fRun->GetField());
109  fRun->Run(0,nEvents);
110  // ------------------------------------------------------------------------
111  rtdb->saveOutput();
112  rtdb->print();
113  // ----- Finish -------------------------------------------------------
114  timer.Stop();
115  Double_t rtime = timer.RealTime();
116  Double_t ctime = timer.CpuTime();
117  cout << endl << endl;
118  cout << "Macro finished succesfully." << endl;
119  cout << "Output file is " << outFile << endl;
120  cout << "Parameter file is " << parFile << endl;
121  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
122  cout << endl;
123  // ------------------------------------------------------------------------
124 
125 
126  return 0;
127 }
int verboseLevel
Definition: Lars/runMvdSim.C:7
TString RecoFile
TString outFile
Definition: hit_dirc.C:17
virtual InitStatus Init()
Int_t startEvent
TString storePath
Double_t mom
Definition: plot_dirc.C:14
FairGeane * Geane
FairRunAna * fRun
Definition: hit_dirc.C:58
TString DigiFile
Double_t
TString parFile
Definition: hit_dirc.C:14
Int_t nEvents
Definition: hit_dirc.C:11
TStopwatch timer
Definition: hit_dirc.C:51
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
FairParRootFileIo * parInput1
Definition: hit_dirc.C:67
Double_t ctime
Definition: hit_dirc.C:114
TString MCFile
int runLumi5Geane(const int nEvents=10, const double mom=15, const int startEvent=0, TString storePath="tmpOutput", const int verboseLevel=0, const bool mergedHits=false)
Definition: runLumi5Geane.C:1
Double_t rtime
Definition: hit_dirc.C:113