FairRoot/PandaRoot
Functions
macro/outdated/run/recoideal_complete.C File Reference

Go to the source code of this file.

Functions

int recoideal_complete ()
 

Function Documentation

int recoideal_complete ( )

Definition at line 1 of file macro/outdated/run/recoideal_complete.C.

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

2 {
3  // Macro created 20/09/2006 by S.Spataro
4  // It loads a simulation file and digitize hits for EMC
5 
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->SetUseFairLinks(kTRUE);
32  fRun->SetGenerateRunInfo(kFALSE);
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  PndIdealTrackFinder* trackStt = new PndIdealTrackFinder();
53  trackStt->SetTrackSelector("NoFtsTrackFunctor");
54  trackStt->SetRelativeMomentumSmearing(0.05);
55  trackStt->SetVertexSmearing(0.05, 0.05, 0.05);
56  trackStt->SetTrackingEfficiency(1.);
57  trackStt->SetOutputBranchName("SttMvdGemIdealTrack");
58  trackStt->SetPersistence(kFALSE);
59  fRun->AddTask(trackStt);
60 
61  /*
62  PndMCTrackAssociator* trackMC = new PndMCTrackAssociator();
63  trackMC->SetTrackInBranchName("SttMvdGemIdealTrack");
64  trackMC->SetTrackOutBranchName("SttMvdGemIdealTrackID");
65  fRun->AddTask(trackMC);
66  */
67 
69  recoKalman->SetTrackInBranchName("SttMvdGemIdealTrack");
70  //recoKalman->SetTrackInIDBranchName("SttMvdGemIdealTrackID");
71  recoKalman->SetTrackOutBranchName("SttMvdGemGenTrack");
72  recoKalman->SetBusyCut(50); // CHECK to be tuned
73  //recoKalman->SetIdealHyp(kTRUE);
74  //recoKalman->SetNumIterations(3);
75  fRun->AddTask(recoKalman);
76 
77 // PndMCTrackAssociator* trackMC2 = new PndMCTrackAssociator();
78 // trackMC2->SetTrackInBranchName("SttMvdGemGenTrack");
79 // trackMC2->SetTrackOutBranchName("SttMvdGemGenTrackID");
80 // fRun->AddTask(trackMC2);
81 
83  trackFts->SetTrackSelector("FtsTrackFunctor");
84  trackFts->SetRelativeMomentumSmearing(0.05);
85  trackFts->SetVertexSmearing(0.05, 0.05, 0.05);
86  trackFts->SetTrackingEfficiency(1.);
87  trackFts->SetOutputBranchName("FtsIdealTrack");
88  trackFts->SetPersistence(kFALSE);
89  fRun->AddTask(trackFts);
90 
91 // PndMCTrackAssociator* trackMCfwd = new PndMCTrackAssociator();
92 // trackMCfwd->SetTrackInBranchName("FtsIdealTrack");
93 // trackMCfwd->SetTrackOutBranchName("FtsIdealTrackID");
94 // fRun->AddTask(trackMCfwd);
95 
97  recoKalmanFwd->SetTrackInBranchName("FtsIdealTrack");
98  //recoKalmanFwd->SetTrackInIDBranchName("FtsIdealTrackID");
99  recoKalmanFwd->SetTrackOutBranchName("FtsIdealGenTrack");
100  recoKalmanFwd->SetBusyCut(50); // CHECK to be tuned
101  //recoKalmanFwd->SetIdealHyp(kTRUE);
102  //recoKalmanFwd->SetNumIterations(3);
103  fRun->AddTask(recoKalmanFwd);
104 
105 // PndMCTrackAssociator* trackMC3 = new PndMCTrackAssociator();
106 // trackMC3->SetTrackInBranchName("FtsIdealGenTrack");
107 // trackMC3->SetTrackOutBranchName("FtsIdealGenTrackID");
108 // fRun->AddTask(trackMC3);
109 
110  // ----- Intialise and run --------------------------------------------
112  cout << "fRun->Init()" << endl;
113  fRun->Init();
114 
115  timer.Start();
116  fRun->Run(0,nEvents);
117  // ------------------------------------------------------------------------
118 
119 
120  // ----- Finish -------------------------------------------------------
121  timer.Stop();
122  Double_t rtime = timer.RealTime();
123  Double_t ctime = timer.CpuTime();
124  cout << endl << endl;
125  cout << "Macro finished successfully." << endl;
126  cout << "Output file is " << outFile << endl;
127  cout << "Parameter file is " << parFile << endl;
128  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
129  cout << endl;
130  // ------------------------------------------------------------------------
131  cout << " Test passed" << endl;
132  cout << " All ok " << endl;
133  return 0;
134 }
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
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 SetVertexSmearing(Double_t sigmax=-1., Double_t sigmay=-1., Double_t sigmaz=-1.)
void SetBusyCut(Int_t b)
void SetTrackInBranchName(const TString &name)
Int_t iVerbose
PndRecoKalmanTask * recoKalman
Double_t rtime
Definition: hit_dirc.C:113
void SetRelativeMomentumSmearing(Double_t dpop=-1.)