FairRoot/PandaRoot
run_tracking_sttcombi.C
Go to the documentation of this file.
1 {
2  // ========================================================================
3  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
4  Int_t iVerbose = 0;
5 
6  // Input file
7  TString MCFile = "Mvd_Sim.root";
8 
9  // Number of events to process
10  Int_t nEvents = 0;
11 
12  // ---- Load libraries -------------------------------------------------
13  gROOT->LoadMacro("$VMCWORKDIR/gconfig/rootlogon.C");
14  rootlogon();
15 
16  PndFileNameCreator creator(MCFile.Data());
17  TString DigiFile = creator.GetDigiFileName().c_str();
18  TString RecoFile = creator.GetRecoFileName().c_str();
19  TString parFile = creator.GetParFileName().c_str();
20  TString outFile = creator.GetTrackFindingFileName().c_str();
21 
22  TString sysFile = gSystem->Getenv("VMCWORKDIR");
23  // ------------------------------------------------------------------------
24  // In general, the following parts need not be touched
25  // ========================================================================
26 
27  // ----- Timer --------------------------------------------------------
28  TStopwatch timer;
29  timer.Start();
30  // ------------------------------------------------------------------------
31 
32  // ----- Digitization run -------------------------------------------
33  FairRunAna *fRun= new FairRunAna();
34  fRun->SetInputFile(RecoFile);
35  fRun->AddFriend(MCFile);
36  fRun->AddFriend(DigiFile);
37  fRun->RunWithTimeStamps();
38  fRun->SetOutputFile(outFile);
39  FairGeane *Geane = new FairGeane();
40  fRun->AddTask(Geane);
41  // ------------------------------------------------------------------------
42 
43  // ----- Parameter database --------------------------------------------
44  TString allDigiFile = sysFile+"/macro/params/all.par";
45 
46  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
47  FairParRootFileIo* parInput1 = new FairParRootFileIo();
48  parInput1->open(parFile.Data());
49 
50  FairParAsciiFileIo* parIo1 = new FairParAsciiFileIo();
51  parIo1->open(allDigiFile.Data(),"in");
52 
53  rtdb->setFirstInput(parInput1);
54  rtdb->setSecondInput(parIo1);
55  // ------------------------------------------------------------------------
56 
58  mvdTrackFinder->SetVerbose(iVerbose);
59  mvdTrackFinder->SetMaxDist(0.05);
60  mvdTrackFinder->SetPersistence(kTRUE);
61  fRun->AddTask(mvdTrackFinder);
62 
63  // PndSttTrackFinderIdeal* sttTrackFinder = new PndSttTrackFinderIdeal(iVerbose);
65  PndSttFindTracks* sttFindTracks = new PndSttFindTracks("Track Finder", "FairTask", sttTrackFinder, iVerbose);
66  sttFindTracks->AddHitCollectionName("STTHit", "STTPoint");
67  //sttFindTracks->SetPersistence(kFALSE);
68 // fRun->AddTask(sttFindTracks);
69 
70  PndSttMvdTracking * SttMvdTracking = new PndSttMvdTracking(0, false, false);
71  //SttMvdTracking->Cleanup();
72  SttMvdTracking->SetPersistence(kFALSE);
73 // fRun->AddTask(SttMvdTracking);
74 
75  //PndMCTrackAssociator* trackMC0 = new PndMCTrackAssociator();
76  //trackMC0->SetTrackInBranchName("SttMvdTrack");
77  //trackMC0->SetTrackOutBranchName("SttMvdTrackID");
78  //trackMC0->SetPersistence(kFALSE);
79  //fRun->AddTask(trackMC0);
80 
82  //SttMvdGemTracking->SetPdgFromMC();
83 // fRun->AddTask(SttMvdGemTracking);
84 
85  PndMCTrackAssociator* trackMC = new PndMCTrackAssociator();
86  trackMC->SetTrackInBranchName("SttMvdGemTrack");
87  trackMC->SetTrackOutBranchName("SttMvdGemTrackID");
88 // fRun->AddTask(trackMC);
89 
91  recoKalman->SetTrackInBranchName("SttMvdGemTrack");
92 // recoKalman->SetTrackInIDBranchName("SttMvdGemTrackID");
93  recoKalman->SetTrackOutBranchName("SttMvdGemGenTrack");
94  recoKalman->SetBusyCut(50); // CHECK to be tuned
95  //recoKalman->SetIdealHyp(kTRUE);
96  //recoKalman->SetNumIterations(3);
97 // fRun->AddTask(recoKalman);
98 
99  PndMCTrackAssociator* trackMC2 = new PndMCTrackAssociator();
100  trackMC2->SetTrackInBranchName("SttMvdGemGenTrack");
101  trackMC2->SetTrackOutBranchName("SttMvdGemGenTrackID");
102 // fRun->AddTask(trackMC2);
103 
105  trackFts->SetRelativeMomentumSmearing(0.02);
106  trackFts->SetVertexSmearing(0.02, 0.02, 0.02);
107  trackFts->SetTrackingEfficiency(1.);
108  trackFts->SetTrackOutput("FtsIdealTrack");
109 // fRun->AddTask(trackFts);
110 
112  recoKalmanFwd->SetTrackInBranchName("FtsIdealTrack");
113  //recoKalmanFwd->SetTrackInIDBranchName("FtsIdealTrackID");
114  recoKalmanFwd->SetTrackOutBranchName("FtsIdealGenTrack");
115  recoKalmanFwd->SetBusyCut(50); // CHECK to be tuned
116  //recoKalmanFwd->SetIdealHyp(kTRUE);
117  //recoKalmanFwd->SetNumIterations(3);
118 // fRun->AddTask(recoKalmanFwd);
119 
120  PndMCTrackAssociator* trackMC3 = new PndMCTrackAssociator();
121  trackMC3->SetTrackInBranchName("FtsIdealGenTrack");
122  trackMC3->SetTrackOutBranchName("FtsIdealGenTrackID");
123 // fRun->AddTask(trackMC3);
124 
125  // ----- Intialise and run --------------------------------------------
127  fRun->Init();
128  fRun->Run(0, nEvents);
129 
130  rtdb->saveOutput();
131  rtdb->print();
132 
133  // ------------------------------------------------------------------------
134 
135  // ----- Finish -------------------------------------------------------
136 
137  timer.Stop();
138  Double_t rtime = timer.RealTime();
139  Double_t ctime = timer.CpuTime();
140  cout << endl << endl;
141  cout << "Macro finished succesfully." << endl;
142  cout << "Output file is " << outFile << endl;
143  cout << "Parameter file is " << parFile << endl;
144  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
145  cout << endl;
146  // ------------------------------------------------------------------------
147 
148 
149 }
TString RecoFile
PndMvdRiemannTrackFinderTask * mvdTrackFinder
TString outFile
Definition: hit_dirc.C:17
void SetTrackOutput(TString name="FTSTrkIdeal")
void SetTrackingEfficiency(Double_t eff=1.)
TString allDigiFile
Definition: hit_muo.C:36
PndSttTrackFinderReal * sttTrackFinder
void SetTrackOutBranchName(const TString &name)
FairGeane * Geane
FairRunAna * fRun
Definition: hit_dirc.C:58
PndMCTrackAssociator * trackMC2
TString DigiFile
TString sysFile
A simple class which adds the corresponding file extensions to a given base class.
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
PndSttMvdTracking * SttMvdTracking
PndSttFindTracks * sttFindTracks
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)
PndMvdCreateDefaultApvMap * creator
void SetTrackInBranchName(const TString &name)
PndSttMvdGemTracking * SttMvdGemTracking
Int_t iVerbose
TString MCFile
PndRecoKalmanTask * recoKalman
Double_t rtime
Definition: hit_dirc.C:113
void AddHitCollectionName(char *hitCollectionName, char *pointCollectionName)
void SetRelativeMomentumSmearing(Double_t dpop=-1.)