FairRoot/PandaRoot
MVDRiemannTrackFinderTest.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 = 3;
5  // Input file (MC events)
6  TString MCFile = "Mvd_Test.root";
7  // Parameter file
8  TString parFile = "MvdParamsReco.root";
9  // Parameter output file
10  TString parOutFile = "MvdParamsTFinder.root";
11  // Number of events to process
12  Int_t nEvents = 10;
13  // ---- Load libraries -------------------------------------------------
14  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
15  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
16 
17  gSystem->Load("libriemann");
18  // ------------------------------------------------------------------------
19  // Output file
20  PndFileNameCreator creator(MCFile.Data());
21  TString DigiFile = creator.GetDigiFileName(false).c_str();
22  TString RecoFile = creator.GetRecoFileName(false).c_str();
23  TString outFile = creator.GetTrackFindingFileName(false).c_str();
24 
25  std::cout << "DigiFile: " << DigiFile.Data()<< std::endl;
26  std::cout << "RecoFile: " << RecoFile.Data()<< std::endl;
27  std::cout << "TrackFinderFile: " << outFile.Data()<< std::endl;
28 
29  // --- Now choose concrete engines for the different tasks -------------
30  // ------------------------------------------------------------------------
31  // In general, the following parts need not be touched
32  // ========================================================================
33 
34  // ----- Timer --------------------------------------------------------
35  TStopwatch timer;
36  timer.Start();
37  // ------------------------------------------------------------------------
38 
39 
40 
41  // ----- Reconstruction run -------------------------------------------
42  CbmRunAna *fRun= new CbmRunAna();
43  fRun->SetInputFile(RecoFile);
44 // fRun->AddFriend(DigiFile);
45 // fRun->AddFriend(RecoFile);
46 
47  fRun->SetOutputFile(outFile);
48  // ------------------------------------------------------------------------
49 
50 
51 
52  // ----- Parameter database --------------------------------------------
53  CbmRuntimeDb* rtdb = fRun->GetRuntimeDb();
54  CbmParRootFileIo* parInput1 = new CbmParRootFileIo();
55 // CbmParAsciiFileIo* parInput1 = new CbmParAsciiFileIo();
56  parInput1->open(parFile.Data(),"READ");
57  rtdb->setFirstInput(parInput1);
58  /*Bool_t kParameterMerged=kTRUE;
59  CbmParRootFileIo* output=new CbmParRootFileIo(kParameterMerged);
60  output->open(parOutFile);
61  rtdb->setOutput(output);
62 */ fRun->LoadGeometry();
63  // ------------------------------------------------------------------------
64 
65 
66 
67  // =========================================================================
68  // ====== Hit Producers ======
69  // =========================================================================
70 
71  // ----- MVD hit producer --------------------------------------------
72 
74  mvdTrackFinder->SetVerbose(iVerbose);
75  fRun->AddTask(mvdTrackFinder);
76 
77  CbmParRootFileIo* output=new CbmParRootFileIo(kTRUE);
78  output->open(parOutFile.Data());
79  rtdb->setOutput(output);
80  rtdb->print();
81  // ===== End of HitProducers =====
82  // =========================================================================
83  PndMvdGeoPar* geoPar = (PndMvdGeoPar*)(rtdb->getContainer("PndMvdGeoPar"));
84 
85  // ----- Intialise and run --------------------------------------------
86  fRun->Init();
87 
88  fRun->Run(0,nEvents);
89  // ------------------------------------------------------------------------
90 
91  rtdb->saveOutput();
92  rtdb->print();
93  // ----- Finish -------------------------------------------------------
94  timer.Stop();
95  Double_t rtime = timer.RealTime();
96  Double_t ctime = timer.CpuTime();
97  cout << endl << endl;
98  cout << "Macro finished succesfully." << endl;
99  cout << "Output file is " << outFile << endl;
100  cout << "Parameter file is " << parFile << endl;
101  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
102  cout << endl;
103  // ------------------------------------------------------------------------
104 
105 
106 }
TString RecoFile
PndMvdRiemannTrackFinderTask * mvdTrackFinder
PndMvdGeoPar * geoPar
TString outFile
Definition: hit_dirc.C:17
FairParRootFileIo * output
Definition: sim_emc_apd.C:120
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
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
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
TString parOutFile