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