FairRoot/PandaRoot
run_reco_sttcu_evt.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 inDigiFile = "evt_digi_stt.root";
8  TString inSimFile = "evt_points_stt.root";
9 
10  // Parameter file
11  TString parFile = "evt_params_stt.root";
12 
13  // Output file
14  TString outFile = "evt_reco_stt.root";
15 
16  // Number of events to process
17  Int_t nEvents = 0;
18 
19  // ---- Load libraries -------------------------------------------------
20  gROOT->LoadMacro("$VMCWORKDIR/gconfig/rootlogon.C");
21  rootlogon();
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(inDigiFile);
35  fRun->AddFriend(inSimFile);
36  fRun->SetOutputFile(outFile);
37  FairGeane *Geane = new FairGeane();
38  fRun->AddTask(Geane);
39  // ------------------------------------------------------------------------
40 
41  // ----- Parameter database --------------------------------------------
42  TString allDigiFile = sysFile+"/macro/params/all.par";
43 
44  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
45  FairParRootFileIo* parInput1 = new FairParRootFileIo();
46  parInput1->open(parFile.Data());
47 
48  FairParAsciiFileIo* parIo1 = new FairParAsciiFileIo();
49  parIo1->open(allDigiFile.Data(),"in");
50 
51  rtdb->setFirstInput(parInput1);
52  rtdb->setSecondInput(parIo1);
53  // ------------------------------------------------------------------------
54 
56  mvdTrackFinder->SetVerbose(iVerbose);
57  mvdTrackFinder->SetPersistence(kFALSE);
58  mvdTrackFinder->SetMaxDist(0.05);
59  fRun->AddTask(mvdTrackFinder);
60 
61  // PndSttTrackFinderIdeal* sttTrackFinder = new PndSttTrackFinderIdeal(iVerbose);
63  PndSttFindTracks* sttFindTracks = new PndSttFindTracks("Track Finder", "FairTask", sttTrackFinder, iVerbose);
64  sttFindTracks->AddHitCollectionName("STTHit", "STTPoint");
65  sttFindTracks->SetPersistence(kFALSE);
66  fRun->AddTask(sttFindTracks);
67 
68  PndSttMvdTracking * SttMvdTracking = new PndSttMvdTracking(0, false, false);
69  SttMvdTracking->Cleanup();
70  SttMvdTracking->SetPersistence(kFALSE);
71  fRun->AddTask(SttMvdTracking);
72 
73  //PndMCTrackAssociator* trackMC0 = new PndMCTrackAssociator();
74  //trackMC0->SetTrackInBranchName("SttMvdTrack");
75  //trackMC0->SetTrackOutBranchName("SttMvdTrackID");
76  //trackMC0->SetPersistence(kFALSE);
77  //fRun->AddTask(trackMC0);
78 
80  // SttMvdGemTracking->SetPdgFromMC();
81  fRun->AddTask(SttMvdGemTracking);
82 
83  PndMCTrackAssociator* trackMC = new PndMCTrackAssociator();
84  trackMC->SetTrackInBranchName("SttMvdGemTrack");
85  trackMC->SetTrackOutBranchName("SttMvdGemTrackID");
86  fRun->AddTask(trackMC);
87 
89  recoKalman->SetTrackInBranchName("SttMvdGemTrack");
90  recoKalman->SetTrackInIDBranchName("SttMvdGemTrackID");
91  recoKalman->SetTrackOutBranchName("SttMvdGemGenTrack");
92  recoKalman->SetBusyCut(50); // CHECK to be tuned
93  recoKalman->SetIdealHyp(kTRUE);
94  //recoKalman->SetNumIterations(3);
95  fRun->AddTask(recoKalman);
96 
97  PndMCTrackAssociator* trackMC2 = new PndMCTrackAssociator();
98  trackMC2->SetTrackInBranchName("SttMvdGemGenTrack");
99  trackMC2->SetTrackOutBranchName("SttMvdGemGenTrackID");
100  fRun->AddTask(trackMC2);
101 
102  // ----- Intialise and run --------------------------------------------
104  fRun->Init();
105  fRun->Run(0, nEvents);
106 
107  rtdb->saveOutput();
108  rtdb->print();
109 
110  // ------------------------------------------------------------------------
111 
112  // ----- Finish -------------------------------------------------------
113 
114  timer.Stop();
115  Double_t rtime = timer.RealTime();
116  Double_t ctime = timer.CpuTime();
117  cout << endl << endl;
118  cout << "Macro finished succesfully." << endl;
119  cout << "Output file is " << outFile << endl;
120  cout << "Parameter file is " << parFile << endl;
121  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
122  cout << endl;
123  // ------------------------------------------------------------------------
124 
125 
126 }
void SetPersistence(Bool_t persistence)
PndMvdRiemannTrackFinderTask * mvdTrackFinder
TString outFile
Definition: hit_dirc.C:17
void SetIdealHyp(Bool_t opt=kTRUE)
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 sysFile
TString inSimFile
Double_t
TString parFile
Definition: hit_dirc.C:14
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
TString inDigiFile
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)
PndSttMvdGemTracking * SttMvdGemTracking
Int_t iVerbose
PndRecoKalmanTask * recoKalman
Double_t rtime
Definition: hit_dirc.C:113
void AddHitCollectionName(char *hitCollectionName, char *pointCollectionName)