FairRoot/PandaRoot
reco2_complete.C
Go to the documentation of this file.
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  FairGeane *Geane = new FairGeane();
32  fRun->AddTask(Geane);
33 
34  // ----- Parameter database --------------------------------------------
35  TString emcDigiFile = gSystem->Getenv("VMCWORKDIR");
36  emcDigiFile += "/macro/params/";
37  emcDigiFile += digiFile;
38 
39  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
40  FairParRootFileIo* parInput1 = new FairParRootFileIo();
41  parInput1->open(parFile.Data());
42 
43  FairParAsciiFileIo* parIo1 = new FairParAsciiFileIo();
44  parIo1->open(emcDigiFile.Data(),"in");
45 
46  rtdb->setFirstInput(parInput1);
47  rtdb->setSecondInput(parIo1);
48 
49  // ------------------------------------------------------------------------
50  // use the constructor with input :
51  // printout flag (int) , plotting flag (bool), MC comparison flag (bool), SciTil.
52  PndTrkTracking2* tracking = new PndTrkTracking2(0,false,false,true);
53  tracking->SetInputBranchName("STTHit","MVDHitsPixel","MVDHitsStrip");
54  // tracking->SetInputBranchName("STTHitMix","MVDHitsPixelMix","MVDHitsStripMix");
55  // don't do the Pattern Recognition second part, starting from the Mvd;
56  tracking->NoMvdAloneTracking();
57  // do Cleanup only when there is Mixing;
58  // tracking->Cleanup();
59  tracking->SetPersistence(kFALSE);
60  fRun->AddTask(tracking);
61 
63  //SttMvdGemTracking->SetPdgFromMC();
64  SttMvdGemTracking->SetPersistence(kFALSE);
65  fRun->AddTask(SttMvdGemTracking);
66 
67 // PndMCTrackAssociator* trackMC = new PndMCTrackAssociator();
68 // trackMC->SetTrackInBranchName("SttMvdGemTrack");
69 // trackMC->SetTrackOutBranchName("SttMvdGemTrackID");
70 // trackMC->SetPersistence(kFALSE);
71 // fRun->AddTask(trackMC);
72 
74  recoKalman->SetTrackInBranchName("SttMvdGemTrack");
75 // recoKalman->SetTrackInIDBranchName("SttMvdGemTrackID");
76  recoKalman->SetTrackOutBranchName("SttMvdGemGenTrack");
77  recoKalman->SetBusyCut(50); // CHECK to be tuned
78  //recoKalman->SetIdealHyp(kTRUE);
79  //recoKalman->SetNumIterations(3);
80  recoKalman->SetTrackRep(0); // 0 Geane (default), 1 RK
81  //recoKalman->SetPropagateToIP(kFALSE);
82  fRun->AddTask(recoKalman);
83 
84 // PndMCTrackAssociator* trackMC2 = new PndMCTrackAssociator();
85 // trackMC2->SetTrackInBranchName("SttMvdGemGenTrack");
86 // trackMC2->SetTrackOutBranchName("SttMvdGemGenTrackID");
87 // fRun->AddTask(trackMC2);
88 
90  fRun->AddTask(trackFts);
91 
92 // PndMCTrackAssociator* trackMCfwd = new PndMCTrackAssociator();
93 // trackMCfwd->SetTrackInBranchName("FTSTrkHough");
94 // trackMCfwd->SetTrackOutBranchName("FTSTrkHoughID");
95 // fRun->AddTask(trackMCfwd);
96 
98  recoKalmanFwd->SetTrackInBranchName("FTSTrkHough");
99  //recoKalmanFwd->SetTrackInIDBranchName("FTSTrkHoughID");
100  recoKalmanFwd->SetTrackOutBranchName("FtsRealGenTrack");
101  recoKalmanFwd->SetBusyCut(50); // CHECK to be tuned
102  //recoKalmanFwd->SetIdealHyp(kTRUE);
103  //recoKalmanFwd->SetNumIterations(3);
104  recoKalmanFwd->SetTrackRep(0); // 0 Geane (default), 1 RK
105  recoKalmanFwd->SetPropagateToIP(kFALSE);
106  fRun->AddTask(recoKalmanFwd);
107 
108 // PndMCTrackAssociator* trackMC3 = new PndMCTrackAssociator();
109 // trackMC3->SetTrackInBranchName("FtsRealGenTrack");
110 // trackMC3->SetTrackOutBranchName("FtsRealGenTrackID");
111 // fRun->AddTask(trackMC3);
112 
113  // ----- Intialise and run --------------------------------------------
115  cout << "fRun->Init()" << endl;
116  fRun->Init();
117 
118  timer.Start();
119  fRun->Run(0,nEvents);
120  // ------------------------------------------------------------------------
121 
122 
123  // ----- Finish -------------------------------------------------------
124  timer.Stop();
125  Double_t rtime = timer.RealTime();
126  Double_t ctime = timer.CpuTime();
127  cout << endl << endl;
128  cout << "Macro finished successfully." << endl;
129  cout << "Output file is " << outFile << endl;
130  cout << "Parameter file is " << parFile << endl;
131  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
132  cout << endl;
133  // ------------------------------------------------------------------------
134  cout << " Test passed" << endl;
135  cout << " All ok " << endl;
136  return 0;
137 }
Interface between PandaRoot (data input and output) and PndFtsHoughTrackFinder (implementation of PR ...
TString outFile
Definition: hit_dirc.C:17
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
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 NoMvdAloneTracking()
void SetBusyCut(Int_t b)
void SetTrackInBranchName(const TString &name)
PndSttMvdGemTracking * SttMvdGemTracking
void SetPropagateToIP(Bool_t opt=kTRUE)
Int_t iVerbose
PndRecoKalmanTask * recoKalman
Double_t rtime
Definition: hit_dirc.C:113
int reco2_complete()
Definition: reco2_complete.C:1