FairRoot/PandaRoot
run_reco_llbar_evtgen.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 = 2;
5 
6  // Input file
7  TString inDigiFile = "llbar_digi_evtgen.root";
8  TString inSimFile = "llbar_sim_evtgen.root";
9 
10  // Parameter file
11  TString parFile = "llbar_params_evtgen.root";
12 
13  // Output file
14  TString outFile = "llbar_reco_evtgen.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 
55 
57  fRun->AddTask(mvdmccls);
58 
59 /*
60 
61 
62 
63  PndMvdRiemannTrackFinderTask* mvdTrackFinder = new PndMvdRiemannTrackFinderTask();
64  mvdTrackFinder->SetVerbose(iVerbose);
65 // mvdTrackFinder->SetPersistence(kFALSE); // warum??
66  mvdTrackFinder->SetPersistence(kTRUE);
67  mvdTrackFinder->SetMaxDist(0.05);
68  fRun->AddTask(mvdTrackFinder);
69 
70  // PndSttTrackFinderIdeal* sttTrackFinder = new PndSttTrackFinderIdeal(iVerbose);
71  PndSttTrackFinderReal* sttTrackFinder = new PndSttTrackFinderReal(0);
72  PndSttFindTracks* sttFindTracks = new PndSttFindTracks("Track Finder", "FairTask", sttTrackFinder, iVerbose);
73  sttFindTracks->AddHitCollectionName("STTHit", "STTPoint");
74  sttFindTracks->SetPersistence(kTRUE);
75  fRun->AddTask(sttFindTracks);
76 
77  PndSttMvdTracking * SttMvdTracking = new PndSttMvdTracking(0, false, false);
78 // SttMvdTracking->Cleanup();
79  SttMvdTracking->SetPersistence(kTRUE);
80  fRun->AddTask(SttMvdTracking);
81 
82  PndMCTrackAssociator* trackMC0 = new PndMCTrackAssociator();
83  trackMC0->SetTrackInBranchName("SttMvdTrack");
84  trackMC0->SetTrackOutBranchName("SttMvdTrackID");
85  trackMC0->SetPersistence(kTRUE);
86  fRun->AddTask(trackMC0);
87 
88  PndSttMvdGemTracking * SttMvdGemTracking = new PndSttMvdGemTracking(0);
89  SttMvdGemTracking->SetPdgFromMC();
90  fRun->AddTask(SttMvdGemTracking);
91 
92  PndMCTrackAssociator* trackMC = new PndMCTrackAssociator();
93  trackMC->SetTrackInBranchName("SttMvdGemTrack");
94  trackMC->SetTrackOutBranchName("SttMvdGemTrackID");
95  fRun->AddTask(trackMC);
96 
97  PndRecoKalmanTask* recoKalman = new PndRecoKalmanTask();
98  recoKalman->SetTrackInBranchName("SttMvdGemTrack");
99  recoKalman->SetTrackInIDBranchName("SttMvdGemTrackID");
100  recoKalman->SetTrackOutBranchName("SttMvdGemGenTrack");
101  recoKalman->SetBusyCut(50); // CHECK to be tuned
102  recoKalman->SetIdealHyp(kTRUE);
103  //recoKalman->SetNumIterations(3);
104  fRun->AddTask(recoKalman);
105 
106  PndMCTrackAssociator* trackMC2 = new PndMCTrackAssociator();
107  trackMC2->SetTrackInBranchName("SttMvdGemGenTrack");
108  trackMC2->SetTrackOutBranchName("SttMvdGemGenTrackID");
109  fRun->AddTask(trackMC2);
110 
111 
112 */
113  // ----- Intialise and run --------------------------------------------
115  fRun->Init();
116  fRun->Run(0, nEvents);
117 
118  rtdb->saveOutput();
119  rtdb->print();
120 
121  // ------------------------------------------------------------------------
122 
123  // ----- Finish -------------------------------------------------------
124 
125  timer.Stop();
126  Double_t rtime = timer.RealTime();
127  Double_t ctime = timer.CpuTime();
128  cout << endl << endl;
129  cout << "Macro finished succesfully." << endl;
130  cout << "Output file is " << outFile << endl;
131  cout << "Parameter file is " << parFile << endl;
132  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
133  cout << endl;
134  // ------------------------------------------------------------------------
135 
136 
137 }
Int_t nEvents
TString parFile
TStopwatch timer
Double_t rtime
FairParAsciiFileIo * parIo1
TString outFile
TString allDigiFile
TString inSimFile
Double_t
static void Init(Int_t MapVersion)
FairRunAna * fRun
FairGeane * Geane
FairRuntimeDb * rtdb
TString inDigiFile
PndMvdClusterTask * mvdmccls
Int_t iVerbose
TString sysFile
FairParRootFileIo * parInput1
Double_t ctime