FairRoot/PandaRoot
Functions
detectors/rich/reco_complete.C File Reference

Go to the source code of this file.

Functions

int reco_complete ()
 

Function Documentation

int reco_complete ( )

Definition at line 1 of file detectors/rich/reco_complete.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(), PndFtsTrackerIdeal::SetPersistence(), PndTrkTracking2::SetPersistence(), PndFtsTrackerIdeal::SetRelativeMomentumSmearing(), PndRecoKalmanTask::SetTrackInBranchName(), PndFtsTrackerIdeal::SetTrackingEfficiency(), PndRecoKalmanTask::SetTrackOutBranchName(), PndFtsTrackerIdeal::SetTrackOutput(), PndRecoKalmanTask::SetTrackRep(), PndFtsTrackerIdeal::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->SetRelativeMomentumSmearing(0.05);
92  trackFts->SetVertexSmearing(0.05, 0.05, 0.05);
93  trackFts->SetTrackingEfficiency(1.);
94  trackFts->SetTrackOutput("FtsIdealTrack");
95  trackFts->SetPersistence(kFALSE);
96  fRun->AddTask(trackFts);
97 
98 // PndMCTrackAssociator* trackMCfwd = new PndMCTrackAssociator();
99 // trackMCfwd->SetTrackInBranchName("FtsIdealTrack");
100 // trackMCfwd->SetTrackOutBranchName("FtsIdealTrackID");
101 // fRun->AddTask(trackMCfwd);
102 
104  recoKalmanFwd->SetTrackInBranchName("FtsIdealTrack");
105  //recoKalmanFwd->SetTrackInIDBranchName("FtsIdealTrackID");
106  recoKalmanFwd->SetTrackOutBranchName("FtsIdealGenTrack");
107  recoKalmanFwd->SetBusyCut(50); // CHECK to be tuned
108  //recoKalmanFwd->SetIdealHyp(kTRUE);
109  //recoKalmanFwd->SetNumIterations(3);
110  recoKalmanFwd->SetTrackRep(0); // 0 Geane (default), 1 RK
111  //recoKalmanFwd->SetPropagateToIP(kFALSE);
112  fRun->AddTask(recoKalmanFwd);
113 
114 // PndMCTrackAssociator* trackMC3 = new PndMCTrackAssociator();
115 // trackMC3->SetTrackInBranchName("FtsIdealGenTrack");
116 // trackMC3->SetTrackOutBranchName("FtsIdealGenTrackID");
117 // fRun->AddTask(trackMC3);
118 
119  // ----- Intialise and run --------------------------------------------
121  cout << "fRun->Init()" << endl;
122  fRun->Init();
123 
124  timer.Start();
125  fRun->Run(0,nEvents);
126  // ------------------------------------------------------------------------
127 
128 
129  // ----- Finish -------------------------------------------------------
130  timer.Stop();
131  Double_t rtime = timer.RealTime();
132  Double_t ctime = timer.CpuTime();
133  cout << endl << endl;
134  cout << "Macro finished successfully." << endl;
135  cout << "Output file is " << outFile << endl;
136  cout << "Parameter file is " << parFile << endl;
137  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
138  cout << endl;
139  // ------------------------------------------------------------------------
140  cout << " Test passed" << endl;
141  cout << " All ok " << endl;
142  return 0;
143 }
TString outFile
Definition: hit_dirc.C:17
void SetTrackOutput(TString name="FTSTrkIdeal")
void SetTrackingEfficiency(Double_t eff=1.)
TString digiFile
Definition: bump_emc.C:20
TString emcDigiFile
Definition: bump_emc.C:45
void SetTrackOutBranchName(const TString &name)
FairGeane * Geane
FairRunAna * fRun
Definition: hit_dirc.C:58
Double_t
TString parFile
Definition: hit_dirc.C:14
void SetVertexSmearing(Double_t sigmax=-1., Double_t sigmay=-1., Double_t sigmaz=-1.)
PndRecoKalmanTask * recoKalmanFwd
Int_t nEvents
Definition: hit_dirc.C:11
TStopwatch timer
Definition: hit_dirc.C:51
void SetPersistence(Bool_t persistence)
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 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.)