FairRoot/PandaRoot
run_reco_stt_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->SetPersistence(kFALSE);
70  fRun->AddTask(SttMvdTracking);
71 
72  PndMCTrackAssociator* trackMC0 = new PndMCTrackAssociator();
73  trackMC0->SetTrackInBranchName("SttMvdTrack");
74  trackMC0->SetTrackOutBranchName("SttMvdTrackID");
75  trackMC0->SetPersistence(kFALSE);
76  fRun->AddTask(trackMC0);
77 
79  SttMvdGemTracking->SetPdgFromMC();
80  fRun->AddTask(SttMvdGemTracking);
81 
83  recoKalman->SetTrackInBranchName("SttMvdGemTrack");
84  recoKalman->SetTrackOutBranchName("SttMvdGemGenTrack");
85  recoKalman->SetBusyCut(50); // CHECK to be tuned
86  //recoKalman->SetNumIterations(3);
87  fRun->AddTask(recoKalman);
88 
89  PndMCTrackAssociator* trackMC = new PndMCTrackAssociator();
90  trackMC->SetTrackInBranchName("SttMvdGemGenTrack");
91  trackMC->SetTrackOutBranchName("SttMvdGemGenTrackID");
92  fRun->AddTask(trackMC);
93 
94  // ----- Intialise and run --------------------------------------------
96  fRun->Init();
97  fRun->Run(0, nEvents);
98 
99  rtdb->saveOutput();
100  rtdb->print();
101 
102  // ------------------------------------------------------------------------
103 
104  // ----- Finish -------------------------------------------------------
105 
106  timer.Stop();
107  Double_t rtime = timer.RealTime();
108  Double_t ctime = timer.CpuTime();
109  cout << endl << endl;
110  cout << "Macro finished succesfully." << endl;
111  cout << "Output file is " << outFile << endl;
112  cout << "Parameter file is " << parFile << endl;
113  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
114  cout << endl;
115  // ------------------------------------------------------------------------
116 
117 
118 }
TString allDigiFile
void SetPersistence(Bool_t persistence)
FairParAsciiFileIo * parIo1
FairGeane * Geane
Int_t nEvents
TStopwatch timer
PndMCTrackAssociator * trackMC
Double_t ctime
PndSttTrackFinderReal * sttTrackFinder
TString parFile
PndSttMvdGemTracking * SttMvdGemTracking
FairRuntimeDb * rtdb
FairParRootFileIo * parInput1
TString inDigiFile
void SetTrackOutBranchName(const TString &name)
TString inSimFile
Double_t
TString outFile
PndRecoKalmanTask * recoKalman
static void Init(Int_t MapVersion)
PndSttFindTracks * sttFindTracks
Double_t rtime
PndMvdRiemannTrackFinderTask * mvdTrackFinder
FairRunAna * fRun
void SetBusyCut(Int_t b)
void SetTrackInBranchName(const TString &name)
Int_t iVerbose
TString sysFile
PndSttMvdTracking * SttMvdTracking
PndMCTrackAssociator * trackMC0
void AddHitCollectionName(char *hitCollectionName, char *pointCollectionName)