FairRoot/PandaRoot
QA/ftstrk/reco.C
Go to the documentation of this file.
1 #include "../auxi.C"
2 int reco(Int_t nEvents = 5)
3 {
4  // Macro created 20/09/2006 by S.Spataro
5  // It loads a digi file and performs tracking
6 
7  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
8  Int_t iVerbose = 0; // just forget about it, for the moment
9 
10  // Number of events to process
11  //Int_t nEvents = 0; // if 0 all the vents will be processed
12 
13  // Parameter file
14  TString parFile = "data/simparams.root"; // at the moment you do not need it
15 
16  // Digitisation file (ascii)
17  //TString digiFile = "all.par";
18  //TString digiFile = "ftsInitial.par";
19  TString digiFile = "fts.par";
20 
21  // Output file
22  TString outFile = "data/reco.root";
23 
24  // ----- Timer --------------------------------------------------------
25  TStopwatch timer;
26  // ------------------------------------------------------------------------
27 
28  // ----- Reconstruction run -------------------------------------------
29  FairRunAna *fRun= new FairRunAna();
30  fRun->SetInputFile("data/sim.root");
31  fRun->AddFriend("data/digi.root");
32  fRun->SetOutputFile(outFile);
33  fRun->SetGenerateRunInfo(kFALSE);
34  FairGeane *Geane = new FairGeane();
35  fRun->AddTask(Geane);
36 
37  // ----- Parameter database --------------------------------------------
38  TString emcDigiFile = gSystem->Getenv("VMCWORKDIR");
39  emcDigiFile += "/macro/params/";
40  emcDigiFile += digiFile;
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(emcDigiFile.Data(),"in");
48 
49  rtdb->setFirstInput(parInput1);
50  rtdb->setSecondInput(parIo1);
51 
53  trackFts->SetTrackOutput("FtsHoughTrack");
54  trackFts->SetPersistency(kTRUE);
55  Int_t debugLevel = 1;
56 
57  debugLevel *= PndFtsHoughTrackerTask::kHoughSpaces; // sed -i 's/PndFtsHoughSpace/TH2S/g' *histo*.rtg
64  trackFts->SetSaveDebugInfo(debugLevel); // Make sure that /home/plots is writable for output of debugging histograms
65  trackFts->SetVerbose(0);
66  fRun->AddTask(trackFts);
67 
68  //PndMCTrackAssociator* trackMCfwd = new PndMCTrackAssociator();
69  //trackMCfwd->SetTrackInBranchName("FtsHoughTrack");
70  //trackMCfwd->SetTrackOutBranchName("FtsHoughTrackID");
71  //fRun->AddTask(trackMCfwd);
72 
73  //PndRecoKalmanTask* recoKalmanFwd = new PndRecoKalmanTask();
74  //recoKalmanFwd->SetTrackInBranchName("FtsHoughTrack");
75  //recoKalmanFwd->SetTrackInIDBranchName("FtsHoughTrackID");
76  //recoKalmanFwd->SetTrackOutBranchName("FtsHoughGenTrack");
79  //recoKalmanFwd->SetNumIterations(3);
80  //recoKalmanFwd->SetTrackRep(0); // 0 Geane (default), 1 RK
82  //fRun->AddTask(recoKalmanFwd);
83 
84  //PndMCTrackAssociator* trackMC3 = new PndMCTrackAssociator();
85  //trackMC3->SetTrackInBranchName("FtsHoughGenTrack");
86  //trackMC3->SetTrackOutBranchName("FtsHoughGenTrackID");
87  //fRun->AddTask(trackMC3);
88 
89  // ----- Intialise and run --------------------------------------------
91  cout << "fRun->Init()" << endl;
92  fRun->Init();
93 
94  timer.Start();
95  fRun->Run(0,nEvents);
96  // ------------------------------------------------------------------------
97 
98 
99  // ----- Finish -------------------------------------------------------
100  timer.Stop();
101  Double_t rtime = timer.RealTime();
102  Double_t ctime = timer.CpuTime();
103  cout << endl << endl;
104  cout << "Macro finished successfully." << endl;
105  cout << "Output file is " << outFile << endl;
106  cout << "Parameter file is " << parFile << endl;
107  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
108  cout << endl;
109 
110  // Send cool info to the Dashboard
111  cout << "<DartMeasurement name=\"Time\" type=\"numeric/double\">";
112  cout << rtime;
113  cout << "</DartMeasurement>" << endl;
114  Float_t cpuUsage=ctime/rtime;
115  cout << "<DartMeasurement name=\"CpuLoad\" type=\"numeric/double\">";
116  cout << cpuUsage;
117  cout << "</DartMeasurement>" << endl;
118  FairSystemInfo sysInfo;
119  Float_t maxMemory=sysInfo.GetMaxMemory();
120  cout << "<DartMeasurement name=\"MaxMemory\" type=\"numeric/double\">";
121  cout << maxMemory;
122  cout << "</DartMeasurement>" << endl;
123  // done sending Info
124 
125  // ------------------------------------------------------------------------
126  cout << "Macro finished successfully." << endl;
127  //return 0;
128  CloseGeoManager();
129  return 0;
130 }
Interface between PandaRoot (data input and output) and PndFtsHoughTrackFinder (implementation of PR ...
TString outFile
Definition: hit_dirc.C:17
TString digiFile
Definition: bump_emc.C:20
void SetPersistency(Bool_t val=kTRUE)
TString emcDigiFile
Definition: bump_emc.C:45
void SetSaveDebugInfo(Int_t saveDebugInfo)
void CloseGeoManager()
Definition: QA/auxi.C:11
FairGeane * Geane
FairRunAna * fRun
Definition: hit_dirc.C:58
Double_t
TString parFile
Definition: hit_dirc.C:14
Int_t nEvents
Definition: hit_dirc.C:11
TStopwatch timer
Definition: hit_dirc.C:51
static void Init(Int_t MapVersion)
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
PndFtsTrackerIdeal * trackFts
FairParRootFileIo * parInput1
Definition: hit_dirc.C:67
Double_t ctime
Definition: hit_dirc.C:114
FairParAsciiFileIo * parIo1
Definition: bump_emc.C:53
void SetVerbose(Int_t verbose)
int reco()
Int_t iVerbose
Double_t rtime
Definition: hit_dirc.C:113