FairRoot/PandaRoot
Functions
macro/examples/llbar/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/examples/llbar/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(), PndFtsTrackerIdeal::SetPersistence(), PndRecoKalmanTask::SetPropagateToIP(), PndFtsTrackerIdeal::SetRelativeMomentumSmearing(), PndRecoKalmanTask::SetTrackInBranchName(), PndFtsTrackerIdeal::SetTrackingEfficiency(), PndRecoKalmanTask::SetTrackOutBranchName(), PndFtsTrackerIdeal::SetTrackOutput(), PndFtsTrackerIdeal::SetVertexSmearing(), timer, trackFts, trackMC, trackMC2, trackMC3, 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  // 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 = "recoideal_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  PndSttMvdGemTrackingIdeal* trackStt = new PndSttMvdGemTrackingIdeal();
52  trackStt->SetRelativeMomentumSmearing(0.05);
53  trackStt->SetVertexSmearing(0.05, 0.05, 0.05);
54  trackStt->SetTrackingEfficiency(1.);
55  trackStt->SetTrackOutput("SttMvdGemIdealTrack");
56  trackStt->SetPersistence(kFALSE);
57  fRun->AddTask(trackStt);
58 
59 
60  PndMCTrackAssociator* trackMC = new PndMCTrackAssociator();
61  trackMC->SetTrackInBranchName("SttMvdGemIdealTrack");
62  trackMC->SetTrackOutBranchName("SttMvdGemIdealTrackID");
63  fRun->AddTask(trackMC);
64 
65 
67  recoKalman->SetTrackInBranchName("SttMvdGemIdealTrack");
68 // recoKalman->SetTrackInIDBranchName("SttMvdGemIdealTrackID");
69  recoKalman->SetTrackOutBranchName("SttMvdGemGenTrack");
70  recoKalman->SetBusyCut(50); // CHECK to be tuned
71  //recoKalman->SetIdealHyp(kTRUE);//Comment out for secondaries
72  //recoKalman->SetNumIterations(3);
73  recoKalman->SetPropagateToIP(kFALSE);//Comment in for secondaries
74  fRun->AddTask(recoKalman);
75 
76  PndMCTrackAssociator* trackMC2 = new PndMCTrackAssociator();
77  trackMC2->SetTrackInBranchName("SttMvdGemGenTrack");
78  trackMC2->SetTrackOutBranchName("SttMvdGemGenTrackID");
79  fRun->AddTask(trackMC2);
80 
82  trackFts->SetRelativeMomentumSmearing(0.05);
83  trackFts->SetVertexSmearing(0.05, 0.05, 0.05);
84  trackFts->SetTrackingEfficiency(1.);
85  trackFts->SetTrackOutput("FtsIdealTrack");
86  trackFts->SetPersistence(kFALSE);
87  fRun->AddTask(trackFts);
88 
89  PndMCTrackAssociator* trackMCfwd = new PndMCTrackAssociator();
90  trackMCfwd->SetTrackInBranchName("FtsIdealTrack");
91  trackMCfwd->SetTrackOutBranchName("FtsIdealTrackID");
92  fRun->AddTask(trackMCfwd);
93 
95  recoKalmanFwd->SetTrackInBranchName("FtsIdealTrack");
96 // recoKalmanFwd->SetTrackInIDBranchName("FtsIdealTrackID");
97  recoKalmanFwd->SetTrackOutBranchName("FtsIdealGenTrack");
98  recoKalmanFwd->SetBusyCut(50); // CHECK to be tuned
99  //recoKalmanFwd->SetIdealHyp(kTRUE);//Comment out for secondaries
100  //recoKalmanFwd->SetNumIterations(3);
101  recoKalmanFwd->SetPropagateToIP(kFALSE);//Comment in for secondaries
102  fRun->AddTask(recoKalmanFwd);
103 
104  PndMCTrackAssociator* trackMC3 = new PndMCTrackAssociator();
105  trackMC3->SetTrackInBranchName("FtsIdealGenTrack");
106  trackMC3->SetTrackOutBranchName("FtsIdealGenTrackID");
107  fRun->AddTask(trackMC3);
108 
109  // ----- Intialise and run --------------------------------------------
111  cout << "fRun->Init()" << endl;
112  fRun->Init();
113 
114  timer.Start();
115  fRun->Run(0,nEvents);
116  // ------------------------------------------------------------------------
117 
118 
119  // ----- Finish -------------------------------------------------------
120  timer.Stop();
121  Double_t rtime = timer.RealTime();
122  Double_t ctime = timer.CpuTime();
123  cout << endl << endl;
124  cout << "Macro finished successfully." << endl;
125  cout << "Output file is " << outFile << endl;
126  cout << "Parameter file is " << parFile << endl;
127  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
128  cout << endl;
129  // ------------------------------------------------------------------------
130  cout << " Test passed" << endl;
131  cout << " All ok " << endl;
132  return 0;
133 }
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
PndMCTrackAssociator * trackMC2
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
PndMCTrackAssociator * trackMC3
PndFtsTrackerIdeal * trackFts
FairParRootFileIo * parInput1
Definition: hit_dirc.C:67
PndMCTrackAssociator * trackMC
Double_t ctime
Definition: hit_dirc.C:114
FairParAsciiFileIo * parIo1
Definition: bump_emc.C:53
void SetBusyCut(Int_t b)
void SetTrackInBranchName(const TString &name)
void SetPropagateToIP(Bool_t opt=kTRUE)
Int_t iVerbose
PndRecoKalmanTask * recoKalman
Double_t rtime
Definition: hit_dirc.C:113
void SetRelativeMomentumSmearing(Double_t dpop=-1.)