FairRoot/PandaRoot
Functions
run_tracking_sttcombi_timebased.C File Reference

Go to the source code of this file.

Functions

int run_tracking_sttcombi_timebased ()
 

Function Documentation

int run_tracking_sttcombi_timebased ( )

Definition at line 1 of file run_tracking_sttcombi_timebased.C.

References PndSttFindTracks::AddHitCollectionName(), allDigiFile, creator, ctime, DigiFile, Double_t, fRun, Geane, PndEmcMapper::Init(), iVerbose, MCFile, mvdTrackFinder, nEvents, outFile, parFile, parInput1, parIo1, RecoFile, recoKalman, recoKalmanFwd, rtdb, rtime, PndRecoKalmanTask::SetBusyCut(), PndMvdRiemannTrackFinderTask::SetMaxDist(), PndMvdRiemannTrackFinderTask::SetPersistence(), PndFtsTrackerIdeal::SetRelativeMomentumSmearing(), PndRecoKalmanTask::SetTrackInBranchName(), PndFtsTrackerIdeal::SetTrackingEfficiency(), PndRecoKalmanTask::SetTrackOutBranchName(), PndFtsTrackerIdeal::SetTrackOutput(), PndMvdRiemannTrackFinderTask::SetVerbose(), PndFtsTrackerIdeal::SetVertexSmearing(), sttFindTracks, SttMvdGemTracking, SttMvdTracking, sttTrackFinder, sysFile, timer, trackFts, trackMC, trackMC2, trackMC3, and TString.

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  PndFileNameCreator creator(MCFile.Data());
13  TString DigiFile = creator.GetDigiFileName("timebased").c_str();
14  TString RecoFile = creator.GetRecoFileName("timebased").c_str();
15  TString parFile = creator.GetParFileName().c_str();
16  TString outFile = creator.GetTrackFindingFileName("timebased").c_str();
17 
18  TString sysFile = gSystem->Getenv("VMCWORKDIR");
19  // ------------------------------------------------------------------------
20  // In general, the following parts need not be touched
21  // ========================================================================
22 
23  // ----- Timer --------------------------------------------------------
24  TStopwatch timer;
25  timer.Start();
26  // ------------------------------------------------------------------------
27 
28  // ----- Digitization run -------------------------------------------
29  FairRunAna *fRun= new FairRunAna();
30  fRun->SetInputFile(RecoFile);
31  fRun->AddFriend(MCFile);
32  fRun->AddFriend(DigiFile);
33  fRun->RunWithTimeStamps();
34  fRun->SetOutputFile(outFile);
35  FairGeane *Geane = new FairGeane();
36  fRun->AddTask(Geane);
37  // ------------------------------------------------------------------------
38 
39  // ----- Parameter database --------------------------------------------
40  TString allDigiFile = sysFile+"/macro/params/all.par";
41 
42  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
43  FairParRootFileIo* parInput1 = new FairParRootFileIo();
44  parInput1->open(parFile.Data());
45 
46  FairParAsciiFileIo* parIo1 = new FairParAsciiFileIo();
47  parIo1->open(allDigiFile.Data(),"in");
48 
49  rtdb->setFirstInput(parInput1);
50  rtdb->setSecondInput(parIo1);
51  // ------------------------------------------------------------------------
52 
54  mvdTrackFinder->SetVerbose(1);
55  mvdTrackFinder->SetMaxDist(0.05);
56  mvdTrackFinder->SetPersistence(kTRUE);
57  fRun->AddTask(mvdTrackFinder);
58 
59  // PndSttTrackFinderIdeal* sttTrackFinder = new PndSttTrackFinderIdeal(iVerbose);
61  PndSttFindTracks* sttFindTracks = new PndSttFindTracks("Track Finder", "FairTask", sttTrackFinder, iVerbose);
62  sttFindTracks->AddHitCollectionName("STTHit", "STTPoint");
63  //sttFindTracks->SetPersistence(kFALSE);
64 // fRun->AddTask(sttFindTracks);
65 
66  PndSttMvdTracking * SttMvdTracking = new PndSttMvdTracking(0, false, false);
67  //SttMvdTracking->Cleanup();
68  SttMvdTracking->SetPersistence(kFALSE);
69 // fRun->AddTask(SttMvdTracking);
70 
71  //PndMCTrackAssociator* trackMC0 = new PndMCTrackAssociator();
72  //trackMC0->SetTrackInBranchName("SttMvdTrack");
73  //trackMC0->SetTrackOutBranchName("SttMvdTrackID");
74  //trackMC0->SetPersistence(kFALSE);
75  //fRun->AddTask(trackMC0);
76 
78  //SttMvdGemTracking->SetPdgFromMC();
79 // fRun->AddTask(SttMvdGemTracking);
80 
81  PndMCTrackAssociator* trackMC = new PndMCTrackAssociator();
82  trackMC->SetTrackInBranchName("SttMvdGemTrack");
83  trackMC->SetTrackOutBranchName("SttMvdGemTrackID");
84 // fRun->AddTask(trackMC);
85 
87  recoKalman->SetTrackInBranchName("SttMvdGemTrack");
88 // recoKalman->SetTrackInIDBranchName("SttMvdGemTrackID");
89  recoKalman->SetTrackOutBranchName("SttMvdGemGenTrack");
90  recoKalman->SetBusyCut(50); // CHECK to be tuned
91  //recoKalman->SetIdealHyp(kTRUE);
92  //recoKalman->SetNumIterations(3);
93 // fRun->AddTask(recoKalman);
94 
95  PndMCTrackAssociator* trackMC2 = new PndMCTrackAssociator();
96  trackMC2->SetTrackInBranchName("SttMvdGemGenTrack");
97  trackMC2->SetTrackOutBranchName("SttMvdGemGenTrackID");
98 // fRun->AddTask(trackMC2);
99 
101  trackFts->SetRelativeMomentumSmearing(0.02);
102  trackFts->SetVertexSmearing(0.02, 0.02, 0.02);
103  trackFts->SetTrackingEfficiency(1.);
104  trackFts->SetTrackOutput("FtsIdealTrack");
105 // fRun->AddTask(trackFts);
106 
108  recoKalmanFwd->SetTrackInBranchName("FtsIdealTrack");
109  //recoKalmanFwd->SetTrackInIDBranchName("FtsIdealTrackID");
110  recoKalmanFwd->SetTrackOutBranchName("FtsIdealGenTrack");
111  recoKalmanFwd->SetBusyCut(50); // CHECK to be tuned
112  //recoKalmanFwd->SetIdealHyp(kTRUE);
113  //recoKalmanFwd->SetNumIterations(3);
114 // fRun->AddTask(recoKalmanFwd);
115 
116  PndMCTrackAssociator* trackMC3 = new PndMCTrackAssociator();
117  trackMC3->SetTrackInBranchName("FtsIdealGenTrack");
118  trackMC3->SetTrackOutBranchName("FtsIdealGenTrackID");
119 // fRun->AddTask(trackMC3);
120 
121  // ----- Intialise and run --------------------------------------------
123  fRun->Init();
124  fRun->Run(0, nEvents);
125 
126  rtdb->saveOutput();
127  rtdb->print();
128 
129  // ------------------------------------------------------------------------
130 
131  // ----- Finish -------------------------------------------------------
132 
133  timer.Stop();
134  Double_t rtime = timer.RealTime();
135  Double_t ctime = timer.CpuTime();
136  cout << endl << endl;
137  cout << "Macro finished succesfully." << endl;
138  cout << "Output file is " << outFile << endl;
139  cout << "Parameter file is " << parFile << endl;
140  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
141  cout << endl;
142  // ------------------------------------------------------------------------
143 
144  return 0;
145 
146 }
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.)