FairRoot/PandaRoot
Functions
run_reco_complete.C File Reference

Go to the source code of this file.

Functions

int run_reco_complete (TString FileName="test")
 

Function Documentation

int run_reco_complete ( TString  FileName = "test")

Definition at line 1 of file run_reco_complete.C.

References allDigiFile, creator, ctime, Double_t, FileName, fRun, Geane, inDigiFile, PndEmcMapper::Init(), inSimFile, iVerbose, mvdmccls, nEvents, outFile, parFile, parInput1, parIo1, recoKalman, rootlogon(), rtdb, rtime, PndRecoKalmanTask::SetBusyCut(), PndRecoKalmanTask::SetTrackInBranchName(), PndRecoKalmanTask::SetTrackOutBranchName(), PndBlackBoxTask::SetVerbose(), sysFile, timer, and TString.

1  {
2  // ========================================================================
3  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
4 
5  Int_t iVerbose = 0;
6 
7  // ---- Load libraries -------------------------------------------------
8  gROOT->LoadMacro("$VMCWORKDIR/gconfig/rootlogon.C");
9  rootlogon();
10  TString sysFile = gSystem->Getenv("VMCWORKDIR");
11  // ------------------------------------------------------------------------
12 
14 
15  // Input file
16  TString inSimFile = creator.GetSimFileName();
17  TString inDigiFile = creator.GetDigiFileName();
18 
19  // Parameter file
20  TString parFile = creator.GetParFileName();
21 
22  // Output file
23  TString outFile = creator.GetRecoFileName();
24 
25  // Number of events to process
26  Int_t nEvents = 0;
27 
28  // ------------------------------------------------------------------------
29  // In general, the following parts need not be touched
30  // ========================================================================
31 
32  // ----- Timer --------------------------------------------------------
33  TStopwatch timer;
34  timer.Start();
35  // ------------------------------------------------------------------------
36 
37  // ----- Reconstruction run -------------------------------------------
38  FairRunAna *fRun= new FairRunAna();
39  fRun->SetInputFile(inDigiFile);
40  fRun->AddFriend(inSimFile);
41  fRun->SetOutputFile(outFile);
42  FairGeane *Geane = new FairGeane();
43  fRun->AddTask(Geane);
44  // ------------------------------------------------------------------------
45 
46  // ----- Parameter database --------------------------------------------
47  TString allDigiFile = sysFile+"/macro/params/all.par";
48 
49  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
50  FairParRootFileIo* parInput1 = new FairParRootFileIo();
51  parInput1->open(parFile.Data());
52 
53  FairParAsciiFileIo* parIo1 = new FairParAsciiFileIo();
54  parIo1->open(allDigiFile.Data(),"in");
55 
56  rtdb->setFirstInput(parInput1);
57  rtdb->setSecondInput(parIo1);
58  // ------------------------------------------------------------------------
59 
60 
62  mvdmccls->SetVerbose(iVerbose);
63  fRun->AddTask(mvdmccls);
64 
65  PndSttMvdGemTrackingIdeal* trackStt = new PndSttMvdGemTrackingIdeal();
66  trackStt->SetRelativeMomentumSmearing(0.05);
67  trackStt->SetVertexSmearing(0.05, 0.05, 0.05);
68  trackStt->SetTrackingEfficiency(1.);
69  trackStt->SetTrackOutput("SttMvdGemIdealTrack");
70  fRun->AddTask(trackStt);
71 
73  recoKalman->SetTrackInBranchName("SttMvdGemIdealTrack");
74  //recoKalman->SetTrackInIDBranchName("SttMvdGemIdealTrackID");
75  recoKalman->SetTrackOutBranchName("SttMvdGemGenTrack");
76  recoKalman->SetBusyCut(50); // CHECK to be tuned
77  //recoKalman->SetIdealHyp(kTRUE);
78  //recoKalman->SetNumIterations(3);
79  fRun->AddTask(recoKalman);
80 
81 
82 // PndMvdRiemannTrackFinderTask* mvdTrackFinderRiemann = new PndMvdRiemannTrackFinderTask();
83 // mvdTrackFinderRiemann->SetVerbose(iVerbose);
84 // // mvdTrackFinder->SetPersistence(kFALSE); // warum??
85 // mvdTrackFinderRiemann->SetPersistence(kTRUE);
86 // mvdTrackFinderRiemann->SetMaxDist(0.05);
87 // fRun->AddTask(mvdTrackFinderRiemann);
88 
89 
90 
91 
92 //
94 // //==========================================
95 // // use the constructor with input :
96 // // printout flag (int) , plotting flag (bool), MC comparison flag (bool), SciTil.
97 // PndTrkTracking* tracking = new PndTrkTracking(0,false,false,false);
98 // tracking->SetInputBranchName("STTHit","MVDHitsPixel","MVDHitsStrip");
99 // // tracking->SetInputBranchName("STTHitMix","MVDHitsPixelMix","MVDHitsStripMix");
100 // // don't do the Pattern Recognition second part, starting from the Mvd;
101 // tracking->NoMvdAloneTracking();
102 // // do Cleanup only when there is Mixing;
103 // // tracking->Cleanup();
104 // fRun->AddTask(tracking);
105 //
106 // PndSttMvdGemTracking * SttMvdGemTracking = new PndSttMvdGemTracking(0);
107 // //SttMvdGemTracking->SetPdgFromMC();
108 // fRun->AddTask(SttMvdGemTracking);
109 //
110 // PndMCTrackAssociator* trackMC = new PndMCTrackAssociator();
111 // trackMC->SetTrackInBranchName("SttMvdGemTrack");
112 // trackMC->SetTrackOutBranchName("SttMvdGemTrackID");
113 // fRun->AddTask(trackMC);
114 //
115 // PndRecoKalmanTask* recoKalman = new PndRecoKalmanTask();
116 // recoKalman->SetTrackInBranchName("SttMvdGemTrack");
117 // recoKalman->SetTrackInIDBranchName("SttMvdGemTrackID");
118 // recoKalman->SetTrackOutBranchName("SttMvdGemGenTrack");
119 // recoKalman->SetBusyCut(50); // CHECK to be tuned
120 // //recoKalman->SetIdealHyp(kTRUE);
121 // //recoKalman->SetNumIterations(3);
122 // fRun->AddTask(recoKalman);
123 //
124 // PndMCTrackAssociator* trackMC2 = new PndMCTrackAssociator();
125 // trackMC2->SetTrackInBranchName("SttMvdGemGenTrack");
126 // trackMC2->SetTrackOutBranchName("SttMvdGemGenTrackID");
127 // fRun->AddTask(trackMC2);
128 //
129 // PndFtsTrackerIdeal* trackFts = new PndFtsTrackerIdeal();
130 // trackFts->SetRelativeMomentumSmearing(0.05);
131 // trackFts->SetVertexSmearing(0.05, 0.05, 0.05);
132 // trackFts->SetTrackingEfficiency(1.);
133 // trackFts->SetTrackOutput("FtsIdealTrack");
134 // fRun->AddTask(trackFts);
135 //
136 // PndRecoKalmanTask* recoKalmanFwd = new PndRecoKalmanTask();
137 // recoKalmanFwd->SetTrackInBranchName("FtsIdealTrack");
138 // //recoKalmanFwd->SetTrackInIDBranchName("FtsIdealTrackID");
139 // recoKalmanFwd->SetTrackOutBranchName("FtsIdealGenTrack");
140 // recoKalmanFwd->SetBusyCut(50); // CHECK to be tuned
141 // //recoKalmanFwd->SetIdealHyp(kTRUE);
142 // //recoKalmanFwd->SetNumIterations(3);
143 // fRun->AddTask(recoKalmanFwd);
144 //
145 // PndMCTrackAssociator* trackMC3 = new PndMCTrackAssociator();
146 // trackMC3->SetTrackInBranchName("FtsIdealGenTrack");
147 // trackMC3->SetTrackOutBranchName("FtsIdealGenTrackID");
148 // fRun->AddTask(trackMC3);
149 
150  // ----- Intialise and run --------------------------------------------
152  fRun->Init();
153  fRun->Run(0, nEvents);
154 
155  rtdb->saveOutput();
156  rtdb->print();
157 
158  // ------------------------------------------------------------------------
159 
160  // ----- Finish -------------------------------------------------------
161 
162  timer.Stop();
163  Double_t rtime = timer.RealTime();
164  Double_t ctime = timer.CpuTime();
165  cout << endl << endl;
166  cout << "Macro finished succesfully." << endl;
167  cout << "Output file is " << outFile << endl;
168  cout << "Parameter file is " << parFile << endl;
169  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
170  cout << endl;
171  // ------------------------------------------------------------------------
172 
173  cout << " Test passed" << endl;
174  cout << " All ok " << endl;
175  return 0;
176 }
TString outFile
Definition: hit_dirc.C:17
TString FileName
PndMvdStripClusterTask * mvdmccls
Definition: runclust.C:45
TString allDigiFile
Definition: hit_muo.C:36
void SetTrackOutBranchName(const TString &name)
FairGeane * Geane
FairRunAna * fRun
Definition: hit_dirc.C:58
TString sysFile
TString inSimFile
A simple class which adds the corresponding file extensions to a given base class.
Double_t
TString parFile
Definition: hit_dirc.C:14
Int_t nEvents
Definition: hit_dirc.C:11
TStopwatch timer
Definition: hit_dirc.C:51
static void Init(Int_t MapVersion)
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
void SetVerbose(Int_t iVerbose)
TString inDigiFile
FairParRootFileIo * parInput1
Definition: hit_dirc.C:67
Double_t ctime
Definition: hit_dirc.C:114
FairParAsciiFileIo * parIo1
Definition: bump_emc.C:53
void SetBusyCut(Int_t b)
PndMvdCreateDefaultApvMap * creator
void SetTrackInBranchName(const TString &name)
Int_t iVerbose
PndRecoKalmanTask * recoKalman
Double_t rtime
Definition: hit_dirc.C:113