FairRoot/PandaRoot
Functions
QA/rich/reco_complete.C File Reference
#include "../auxi.C"

Go to the source code of this file.

Functions

int reco_complete ()
 

Function Documentation

int reco_complete ( )

Definition at line 2 of file QA/rich/reco_complete.C.

References CloseGeoManager(), 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(), PndPersistencyTask::SetPersistency(), PndIdealTrackFinder::SetRelativeMomentumSmearing(), PndRecoKalmanTask::SetTrackInBranchName(), PndIdealTrackFinder::SetTrackingEfficiency(), PndRecoKalmanTask::SetTrackOutBranchName(), PndRecoKalmanTask::SetTrackRep(), PndIdealTrackFinder::SetTrackSelector(), PndIdealTrackFinder::SetVertexSmearing(), SttMvdGemTracking, timer, trackFts, tracking, and TString.

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