FairRoot/PandaRoot
reco_fts.C
Go to the documentation of this file.
1 int reco_fts()
2 {
3  // Macro created 20/09/2006 by S.Spataro
4  // It loads a digi file and performs tracking
5 
6  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
7  Int_t iVerbose = 0; // just forget about it, for the moment
8 
9  // Number of events to process
10  Int_t nEvents = 0; // if 0 all the vents will be processed
11 
12  // Parameter file
13  TString parFile = "simparams.root"; // at the moment you do not need it
14 
15  // Digitisation file (ascii)
16  TString digiFile = "all.par";
17 
18  // Output file
19  TString outFile = "reco_complete.root";
20 
21  // ----- Timer --------------------------------------------------------
22  TStopwatch timer;
23  // ------------------------------------------------------------------------
24 
25  // ----- Reconstruction run -------------------------------------------
26  FairRunAna *fRun= new FairRunAna();
27  fRun->SetInputFile("sim_complete.root");
28  fRun->AddFriend("digi_complete.root");
29  fRun->SetOutputFile(outFile);
30  fRun->SetGenerateRunInfo(kFALSE);
31  FairGeane *Geane = new FairGeane();
32  fRun->AddTask(Geane);
33 
34  // ----- Parameter database --------------------------------------------
35  TString emcDigiFile = gSystem->Getenv("VMCWORKDIR");
36  emcDigiFile += "/macro/params/";
37  emcDigiFile += digiFile;
38 
39  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
40  FairParRootFileIo* parInput1 = new FairParRootFileIo();
41  parInput1->open(parFile.Data());
42 
43  FairParAsciiFileIo* parIo1 = new FairParAsciiFileIo();
44  parIo1->open(emcDigiFile.Data(),"in");
45 
46  rtdb->setFirstInput(parInput1);
47  rtdb->setSecondInput(parIo1);
48 
49 
50 
51 
52 
54  // trackFts->SetTrackOutput("FtsHoughTrack");
55  // trackFts->SetPersistence(kTRUE);
56  Int_t debugLevel = 1;
57  debugLevel *= PndFtsHoughTrackerTask::kHoughSpaces; // sed -i 's/PndFtsHoughSpace/TH2S/g' *histo*.rtg
59 // debugLevel *= PndFtsHoughTrackerTask::kEachFoundPeakSeparately;
61 // debugLevel *= PndFtsHoughTrackerTask::kMcTruthPeaksProjected;
62 // debugLevel *= PndFtsHoughTrackerTask::kHitCurvesExclusively;
63 // debugLevel *= PndFtsHoughTrackerTask::kHitCurvesProjected;
64 // trackFts->SetSaveDebugInfo(debugLevel); // Make sure that /home/plots is writable for output of debugging histograms
65  trackFts->SetVerbose(1);
66  fRun->AddTask(trackFts);
67 
68  // PndMCTrackAssociator* trackMCfwd = new PndMCTrackAssociator();
69  // trackMCfwd->SetTrackInBranchName("FtsIdealTrack");
70  // trackMCfwd->SetTrackOutBranchName("FtsIdealTrackID");
71  // fRun->AddTask(trackMCfwd);
72  //
73  // PndRecoKalmanTask* recoKalmanFwd = new PndRecoKalmanTask();
74  // recoKalmanFwd->SetTrackInBranchName("FtsIdealTrack");
75  // //recoKalmanFwd->SetTrackInIDBranchName("FtsIdealTrackID");
76  // recoKalmanFwd->SetTrackOutBranchName("FtsIdealGenTrack");
77  // recoKalmanFwd->SetBusyCut(50); // CHECK to be tuned
78  // //recoKalmanFwd->SetIdealHyp(kTRUE);
79  // //recoKalmanFwd->SetNumIterations(3);
80  // recoKalmanFwd->SetTrackRep(0); // 0 Geane (default), 1 RK
81  // //recoKalmanFwd->SetPropagateToIP(kFALSE);
82  // fRun->AddTask(recoKalmanFwd);
83  //
84  // PndMCTrackAssociator* trackMC3 = new PndMCTrackAssociator();
85  // trackMC3->SetTrackInBranchName("FtsIdealGenTrack");
86  // trackMC3->SetTrackOutBranchName("FtsIdealGenTrackID");
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  cout << " Test passed" << endl;
111  cout << " All ok " << endl;
112  return 0;
113 }
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
TString emcDigiFile
Definition: bump_emc.C:45
FairGeane * Geane
FairRunAna * fRun
Definition: hit_dirc.C:58
int reco_fts()
Definition: reco_fts.C:1
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_t iVerbose
Double_t rtime
Definition: hit_dirc.C:113