FairRoot/PandaRoot
runLumi3Finder.C
Go to the documentation of this file.
1 int runLumi3Finder(const int nEvents=100000, const int startEvent=0, TString storePath="tmpOutput", const int verboseLevel=0, TString Method="Follow", const bool missPl=false)
4 {
5  // ----- Timer --------------------------------------------------------
6  TStopwatch timer;
7  timer.Start();
8  // ------------------------------------------------------------------------
9 
10  // ========================================================================
11  // Input file (MC events)
12  TString MCFile = storePath+"/Lumi_MC_";
13  MCFile += startEvent;
14  MCFile += ".root";
15  TString DigiFile = storePath+"/Lumi_digi_";
16  DigiFile += startEvent;
17  DigiFile += ".root";
18  // Digi file
19  TString RecoFile = storePath+"/Lumi_reco_";
20  RecoFile += startEvent;
21  RecoFile += ".root";
22  // Parameter file
23  TString parFile = storePath+"/Lumi_Params_";
24  parFile += startEvent;
25  parFile += ".root";
26 
27  // ---- Load libraries -------------------------------------------------
28  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
29  gSystem->Load("libSds");
30  gSystem->Load("libSdsReco");
31  gSystem->Load("libLmd");
32  gSystem->Load("libLmdReco");
33  gSystem->Load("libLmdTrk");
34  // ------------------------------------------------------------------------
35  // Output file
36  TString outFile = storePath+"/Lumi_TCand_";
37  outFile += startEvent;
38  outFile += ".root";
39 
40  std::cout << "MCFile : " << MCFile.Data()<< std::endl;
41  std::cout << "DigiFile: " << DigiFile.Data()<< std::endl;
42  std::cout << "RecoFile: " << RecoFile.Data()<< std::endl;
43  std::cout << "TCandFile: " << outFile.Data()<< std::endl;
44  // --- Now choose concrete engines for the different tasks -------------
45  // ------------------------------------------------------------------------
46 
47 
48  // In general, the following parts need not be touched
49  // ========================================================================
50 
51 
52 
53 
54  // // ----- Timer --------------------------------------------------------
55  // TStopwatch timer;
56  // timer.Start();
57  // // ------------------------------------------------------------------------
58 
59 
60  // ----- Reconstruction run -------------------------------------------
61  FairRunAna *fRun= new FairRunAna();
62  fRun->SetInputFile(MCFile);
63  fRun->AddFriend(DigiFile);
64  fRun->AddFriend(RecoFile);
65 
66  fRun->SetOutputFile(outFile);
67  // ------------------------------------------------------------------------
68 
69 
70  // ----- Parameter database --------------------------------------------
71  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
72  FairParRootFileIo* parInput1 = new FairParRootFileIo(kTRUE);
73  parInput1->open(parFile.Data(),"UPDATE");
74  rtdb->setFirstInput(parInput1);
75 
76 
77  // =========================================================================
78  // ====== Track Finder ======
79  // =========================================================================
80 
81  // ----- MVD hit producer --------------------------------------------
82  if(Method=="Follow"){
83  int FinderMode=0;
84  if(missPl==true) FinderMode=1;
85  // PndLmdTrackFinderTask* lmdfinder = new PndLmdTrackFinderTask(FinderMode);
86  PndLmdTrackFinderTask* lmdfinder = new PndLmdTrackFinderTask(missPl, "LMDHitsStrip","LMDStripClusterCand","LMDStripDigis",8);
87  lmdfinder->SetInaccuracy(0.01);
88  lmdfinder->SetSensStripFlag(true);
89  lmdfinder->SetVerbose(verboseLevel);
90  fRun->AddTask(lmdfinder);
91  }
92  else{
93  if(Method=="CA"){
94  PndLmdTrackFinderCATask* lmdfinder = new PndLmdTrackFinderCATask(missPl,0.012,8,4,"LMDHitsStrip","LMDStripClusterCand","LMDStripDigis");
95  lmdfinder->SetSensStripFlag(true);
96  lmdfinder->SetVerbose(verboseLevel);
97  fRun->AddTask(lmdfinder);
98  }
99  else{
100  cout<<"Method "<<Method<<" doesn't exist!"<<endl;
101  break;
102  }
103  }
104  // lmdfinder->SetVerbose(verboseLevel);
105  // fRun->AddTask(lmdfinder);
106 
107  rtdb->setOutput(parInput1);
108  rtdb->print();
109  // ===== End of TrackFinding =====
110  // =========================================================================
111 
112 
113  // ----- Intialise and run --------------------------------------------
114  fRun->Init();
115 
116  fRun->Run(0,nEvents);
117  // ------------------------------------------------------------------------
118 
119  rtdb->saveOutput();
120  rtdb->print();
121  // ----- Finish -------------------------------------------------------
122  timer.Stop();
123  Double_t rtime = timer.RealTime();
124  Double_t ctime = timer.CpuTime();
125  cout << endl << endl;
126  cout << "Macro finished succesfully." << endl;
127  cout << "Output file is " << outFile << endl;
128  cout << "Parameter file is " << parFile << endl;
129  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
130  cout << endl;
131  // ------------------------------------------------------------------------
132 
133 
134  return 0;
135 }
int runLumi3Finder(const int nEvents=100000, const int startEvent=0, TString storePath="tmpOutput", const int verboseLevel=0, TString Method="Follow", const bool missPl=false)
Definition: runLumi3Finder.C:3
int verboseLevel
Definition: Lars/runMvdSim.C:7
TString RecoFile
TString outFile
Definition: hit_dirc.C:17
Int_t startEvent
TString storePath
FairRunAna * fRun
Definition: hit_dirc.C:58
TString DigiFile
void SetInaccuracy(Double_t accu)
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
void SetVerbose(Int_t verbose)
void SetVerbose(Int_t verbose)
TString MCFile
Double_t rtime
Definition: hit_dirc.C:113