FairRoot/PandaRoot
outdated/tracking/onlineTracking/runReco.C
Go to the documentation of this file.
1 // Reconstruction Macro
2 // based on runMvdReco by Ralf Kliemt
3 
4 // Macro to reconstruct the MVD data in pandaroot
5 // Updated 30.11.2009
6 // Ralf Kliemt
7 runReco(Int_t nEvents=500)
8 {
9  // ========================================================================
10  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
11  Int_t iVerbose = 0;
12 
13  TString MCFile = "Sim_Dpm_500.root";
14  TString parFile = "Sim_Dpm_500_params.root";
15  // ---- Load libraries -------------------------------------------------
16  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
17  // ------------------------------------------------------------------------
18  // Output file
19  PndFileNameCreator creator(MCFile.Data());
20  TString DigiFile = creator.GetDigiFileName().c_str();
21  TString outFile = creator.GetRecoFileName().c_str();
22 
23  std::cout << "MCFile : " << MCFile.Data()<< std::endl;
24  std::cout << "DigiFile: " << DigiFile.Data()<< std::endl;
25  std::cout << "RecoFile: " << outFile.Data()<< std::endl;
26 
27  // ----- Timer --------------------------------------------------------
28  TStopwatch timer;
29  timer.Start();
30  // ------------------------------------------------------------------------
31 
32  // ----- Reconstruction run -------------------------------------------
33  FairRunAna *fRun= new FairRunAna();
34  fRun->SetInputFile(MCFile);
35  fRun->AddFriend(DigiFile);
36  fRun->SetOutputFile(outFile);
37  fRun->RunWithTimeStamps();
38  // ------------------------------------------------------------------------
39 
40 
41 
42  // ----- Parameter database --------------------------------------------
43  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
44  FairParRootFileIo* parInput1 = new FairParRootFileIo(kTRUE);
45  parInput1->open(parFile.Data(),"UPDATE");
46  rtdb->setFirstInput(parInput1);
47 
48  // ----- Default MVD hit producer --------------------------------------------
49 
51  mvdmccls->SetVerbose(iVerbose);
52  fRun->AddTask(mvdmccls);
53 
54 
56  PndSttFindTracks* sttFindTracks = new PndSttFindTracks("Track Finder", "FairTask", sttTrackFinder, iVerbose);
57  //sttFindTracks->AddHitCollectionName("STTHit", "STTPoint");
58  //sttFindTracks->SetPersistence(kFALSE);
59  fRun->AddTask(sttFindTracks);
60 
61 
62  // ----- OR separate tasks ---------------------------------------------------
63  //Double_t chargecut = 1.e5;
64  //PndMvdStripClusterTask* mvdmccls = new PndMvdStripClusterTask();
65  //mvdmccls->SetVerbose(iVerbose);
66  //fRun->AddTask(mvdmccls);
67 // PndMvdPixelClusterTask* mvdClusterizer = new PndMvdPixelClusterTask();
68 // mvdClusterizer->SetVerbose(iVerbose);
69 // fRun->AddTask(mvdClusterizer);
70 
71  rtdb->setOutput(parInput1);
72  rtdb->print();
73 
74  cout << "Geo Man Debug Output:" << endl << gGeoManager << endl;
75 
76  // ===== End of HitProducers =====
77  // =========================================================================
78 // PndMvdGeoPar* geoPar = (PndMvdGeoPar*)(rtdb->getContainer("PndMvdGeoPar"));
79 
80  // ----- Intialise and run --------------------------------------------
81  fRun->Init();
82 
83  cout << "Geo Man Debug Output:" << endl << gGeoManager << endl;
84 
85  fRun->Run(0,nEvents);
86  // ------------------------------------------------------------------------
87 
88  rtdb->saveOutput();
89  rtdb->print();
90  // ----- Finish -------------------------------------------------------
91  timer.Stop();
92  Double_t rtime = timer.RealTime();
93  Double_t ctime = timer.CpuTime();
94  cout << endl << endl;
95  cout << "Macro finished succesfully." << endl;
96  cout << "Output file is " << outFile << endl;
97  cout << "Parameter file is " << parFile << endl;
98  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
99  cout << endl;
100  // ------------------------------------------------------------------------
101 
102 }
TString outFile
Definition: hit_dirc.C:17
PndMvdStripClusterTask * mvdmccls
Definition: runclust.C:45
TGeoManager * gGeoManager
PndSttTrackFinderReal * sttTrackFinder
FairRunAna * fRun
Definition: hit_dirc.C:58
TString DigiFile
A simple class which adds the corresponding file extensions to a given base class.
Double_t
TString parFile
Definition: hit_dirc.C:14
Int_t nEvents
Definition: hit_dirc.C:11
TStopwatch timer
Definition: hit_dirc.C:51
PndSttFindTracks * sttFindTracks
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
void SetVerbose(Int_t iVerbose)
FairParRootFileIo * parInput1
Definition: hit_dirc.C:67
Double_t ctime
Definition: hit_dirc.C:114
PndMvdCreateDefaultApvMap * creator
Int_t iVerbose
TString MCFile
Double_t rtime
Definition: hit_dirc.C:113
runReco(Int_t nEvents=500)