FairRoot/PandaRoot
Functions
reco_rich.C File Reference

Go to the source code of this file.

Functions

int reco_rich ()
 

Function Documentation

int reco_rich ( )

Definition at line 1 of file reco_rich.C.

References ctime, digiFile, Double_t, emcDigiFile, fRun, Geane, PndEmcMapper::Init(), iVerbose, nEvents, PndTrkTracking2::NoMvdAloneTracking(), outFile, parFile, parInput1, parIo1, recoKalman, recoKalmanFwd, rtdb, rtime, PndRecoKalmanTask::SetBusyCut(), PndTrkTracking2::SetInputBranchName(), PndIdealTrackFinder::SetOutputBranchName(), PndIdealTrackFinder::SetPersistence(), PndTrkTracking2::SetPersistence(), PndIdealTrackFinder::SetRelativeMomentumSmearing(), PndRecoKalmanTask::SetTrackInBranchName(), PndIdealTrackFinder::SetTrackingEfficiency(), PndRecoKalmanTask::SetTrackOutBranchName(), PndRecoKalmanTask::SetTrackRep(), PndIdealTrackFinder::SetTrackSelector(), PndIdealTrackFinder::SetVertexSmearing(), SttMvdGemTracking, timer, trackFts, tracking, and TString.

2 {
3  // Macro created 20/09/2006 by S.Spataro
4  // It loads a digi file and performs tracking
5 
6  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
7  Int_t iVerbose = 0; // just forget about it, for the moment
8 
9  // Number of events to process
10  Int_t nEvents = 0; // if 0 all the vents will be processed
11 
12  // Parameter file
13  TString parFile = "simparams.root"; // at the moment you do not need it
14 
15  // Digitisation file (ascii)
16  TString digiFile = "all.par";
17 
18  // Output file
19  TString outFile = "reco_complete.root";
20 
21  // ----- Timer --------------------------------------------------------
22  TStopwatch timer;
23  // ------------------------------------------------------------------------
24 
25  // ----- Reconstruction run -------------------------------------------
26  FairRunAna *fRun= new FairRunAna();
27  fRun->SetInputFile("sim_complete.root");
28  fRun->AddFriend("digi_complete.root");
29  fRun->SetOutputFile(outFile);
30  fRun->SetGenerateRunInfo(kFALSE);
31  fRun->SetUseFairLinks(kTRUE);
32  FairGeane *Geane = new FairGeane();
33  fRun->AddTask(Geane);
34 
35  // ----- Parameter database --------------------------------------------
36  TString emcDigiFile = gSystem->Getenv("VMCWORKDIR");
37  emcDigiFile += "/macro/params/";
38  emcDigiFile += digiFile;
39 
40  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
41  FairParRootFileIo* parInput1 = new FairParRootFileIo();
42  parInput1->open(parFile.Data());
43 
44  FairParAsciiFileIo* parIo1 = new FairParAsciiFileIo();
45  parIo1->open(emcDigiFile.Data(),"in");
46 
47  rtdb->setFirstInput(parInput1);
48  rtdb->setSecondInput(parIo1);
49 
50  // ------------------------------------------------------------------------
51  // use the constructor with input :
52  // printout flag (int) , plotting flag (bool), MC comparison flag (bool), SciTil.
53  PndTrkTracking2* tracking = new PndTrkTracking2(0,false,false,true);
54  tracking->SetInputBranchName("STTHit","MVDHitsPixel","MVDHitsStrip");
55  // tracking->SetInputBranchName("STTHitMix","MVDHitsPixelMix","MVDHitsStripMix");
56  // don't do the Pattern Recognition second part, starting from the Mvd;
57  tracking->NoMvdAloneTracking();
58  // do Cleanup only when there is Mixing;
59  // tracking->Cleanup();
60  tracking->SetPersistence(kFALSE);
61  fRun->AddTask(tracking);
62 
64  //SttMvdGemTracking->SetPdgFromMC();
65  SttMvdGemTracking->SetPersistence(kFALSE);
66  fRun->AddTask(SttMvdGemTracking);
67 
68 // PndMCTrackAssociator* trackMC = new PndMCTrackAssociator();
69 // trackMC->SetTrackInBranchName("SttMvdGemTrack");
70 // trackMC->SetTrackOutBranchName("SttMvdGemTrackID");
71 // trackMC->SetPersistence(kFALSE);
72 // fRun->AddTask(trackMC);
73 
75  recoKalman->SetTrackInBranchName("SttMvdGemTrack");
76 // recoKalman->SetTrackInIDBranchName("SttMvdGemTrackID");
77  recoKalman->SetTrackOutBranchName("SttMvdGemGenTrack");
78  recoKalman->SetBusyCut(50); // CHECK to be tuned
79 // recoKalman->SetIdealHyp(kTRUE);
80  //recoKalman->SetNumIterations(3);
81  recoKalman->SetTrackRep(0); // 0 Geane (default), 1 RK
82  //recoKalman->SetPropagateToIP(kFALSE);
83  fRun->AddTask(recoKalman);
84 
85 // PndMCTrackAssociator* trackMC2 = new PndMCTrackAssociator();
86 // trackMC2->SetTrackInBranchName("SttMvdGemGenTrack");
87 // trackMC2->SetTrackOutBranchName("SttMvdGemGenTrackID");
88 // fRun->AddTask(trackMC2);
89 
91  trackFts->SetTrackSelector("FtsTrackFunctor");
92  trackFts->SetRelativeMomentumSmearing(0.05);
93  trackFts->SetVertexSmearing(0.05, 0.05, 0.05);
94  trackFts->SetTrackingEfficiency(1.);
95  trackFts->SetOutputBranchName("FtsIdealTrack");
96  trackFts->SetPersistence(kFALSE);
97  fRun->AddTask(trackFts);
98 
99 // PndMCTrackAssociator* trackMCfwd = new PndMCTrackAssociator();
100 // trackMCfwd->SetTrackInBranchName("FtsIdealTrack");
101 // trackMCfwd->SetTrackOutBranchName("FtsIdealTrackID");
102 // fRun->AddTask(trackMCfwd);
103 
105  recoKalmanFwd->SetTrackInBranchName("FtsIdealTrack");
106  //recoKalmanFwd->SetTrackInIDBranchName("FtsIdealTrackID");
107  recoKalmanFwd->SetTrackOutBranchName("FtsIdealGenTrack");
108  recoKalmanFwd->SetBusyCut(50); // CHECK to be tuned
109  //recoKalmanFwd->SetIdealHyp(kTRUE);
110  //recoKalmanFwd->SetNumIterations(3);
111  recoKalmanFwd->SetTrackRep(0); // 0 Geane (default), 1 RK
112  //recoKalmanFwd->SetPropagateToIP(kFALSE);
113  fRun->AddTask(recoKalmanFwd);
114 
115 // PndMCTrackAssociator* trackMC3 = new PndMCTrackAssociator();
116 // trackMC3->SetTrackInBranchName("FtsIdealGenTrack");
117 // trackMC3->SetTrackOutBranchName("FtsIdealGenTrackID");
118 // fRun->AddTask(trackMC3);
119 
120  PndIdealTrackFinder* idealTracking = new PndIdealTrackFinder();
121  idealTracking->SetTrackSelector("FtsTrackFunctor");
122  fRun->AddTask(idealTracking);
123 
124  // ----- Intialise and run --------------------------------------------
126  cout << "fRun->Init()" << endl;
127  fRun->Init();
128 
129  timer.Start();
130  fRun->Run(0,nEvents);
131  // ------------------------------------------------------------------------
132 
133 
134  // ----- Finish -------------------------------------------------------
135  timer.Stop();
136  Double_t rtime = timer.RealTime();
137  Double_t ctime = timer.CpuTime();
138  cout << endl << endl;
139  cout << "Macro finished successfully." << endl;
140  cout << "Output file is " << outFile << endl;
141  cout << "Parameter file is " << parFile << endl;
142  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
143  cout << endl;
144  // ------------------------------------------------------------------------
145  cout << " Test passed" << endl;
146  cout << " All ok " << endl;
147  return 0;
148 }
TString outFile
Definition: hit_dirc.C:17
void SetTrackingEfficiency(Double_t eff=1.)
Ideal track finder for all types of tracking detectors The PndIdealTrackFinder combines all hits in ...
TString digiFile
Definition: bump_emc.C:20
void SetPersistence(Bool_t persistence)
virtual void SetOutputBranchName(TString name)
TString emcDigiFile
Definition: bump_emc.C:45
void SetTrackOutBranchName(const TString &name)
FairGeane * Geane
FairRunAna * fRun
Definition: hit_dirc.C:58
Double_t
void SetTrackSelector(TString selector)
TString parFile
Definition: hit_dirc.C:14
PndRecoKalmanTask * recoKalmanFwd
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 SetPersistence(Bool_t persistence)
PndTrkTracking * tracking
PndFtsTrackerIdeal * trackFts
FairParRootFileIo * parInput1
Definition: hit_dirc.C:67
Double_t ctime
Definition: hit_dirc.C:114
FairParAsciiFileIo * parIo1
Definition: bump_emc.C:53
void SetInputBranchName(const char *string1, const char *string2, const char *string3)
void SetTrackRep(Short_t num)
void SetVertexSmearing(Double_t sigmax=-1., Double_t sigmay=-1., Double_t sigmaz=-1.)
void NoMvdAloneTracking()
void SetBusyCut(Int_t b)
void SetTrackInBranchName(const TString &name)
PndSttMvdGemTracking * SttMvdGemTracking
Int_t iVerbose
PndRecoKalmanTask * recoKalman
Double_t rtime
Definition: hit_dirc.C:113
void SetRelativeMomentumSmearing(Double_t dpop=-1.)