FairRoot/PandaRoot
anaMvdTrackFinder.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 trackFile1 = creator.GetTrackFindingFileName(false).c_str();
22  TString trackFile2 = "Mvd_Test_IdealTrackF.root";
23  TString outFile = "Mvd_Dummy_File.root";
24 
25  std::cout << "TrackFinderFile1: " << trackFile1.Data()<< std::endl;
26  std::cout << "TrackFinderFile2: " << trackFile2.Data()<< std::endl;
27  // --- Now choose concrete engines for the different tasks -------------
28  // ------------------------------------------------------------------------
29  // In general, the following parts need not be touched
30  // ========================================================================
31 
32  // ----- Timer --------------------------------------------------------
33  TStopwatch timer;
34  timer.Start();
35  // ------------------------------------------------------------------------
36 
37 
38 
39  // ----- Reconstruction run -------------------------------------------
40  CbmRunAna *fRun= new CbmRunAna();
41  fRun->SetInputFile(trackFile2);
42  fRun->AddFriend(trackFile1);
43 // fRun->AddFriend(RecoFile);
44  fRun->SetOutputFile(outFile);
45  // ------------------------------------------------------------------------
46 
47 
48 
49  // ----- Parameter database --------------------------------------------
50  CbmRuntimeDb* rtdb = fRun->GetRuntimeDb();
51  CbmParRootFileIo* parInput1 = new CbmParRootFileIo();
52 // CbmParAsciiFileIo* parInput1 = new CbmParAsciiFileIo();
53  parInput1->open(parFile.Data(),"READ");
54  rtdb->setFirstInput(parInput1);
55  /*Bool_t kParameterMerged=kTRUE;
56  CbmParRootFileIo* output=new CbmParRootFileIo(kParameterMerged);
57  output->open(parOutFile);
58  rtdb->setOutput(output);
59 */ fRun->LoadGeometry();
60  // ------------------------------------------------------------------------
61 
62 
63 
64  // =========================================================================
65  // ====== Hit Producers ======
66  // =========================================================================
67 
68  // ----- MVD hit producer --------------------------------------------
69 
70  PndMvdTrackFinderAnaTask* mvdTrackFinderAna = new PndMvdTrackFinderAnaTask();
71  fRun->AddTask(mvdTrackFinderAna);
72 
73  CbmParRootFileIo* output=new CbmParRootFileIo(kTRUE);
74  output->open(parOutFile.Data());
75  rtdb->setOutput(output);
76  rtdb->print();
77  // ===== End of HitProducers =====
78  // =========================================================================
79  PndMvdGeoPar* geoPar = (PndMvdGeoPar*)(rtdb->getContainer("PndMvdGeoPar"));
80 
81  // ----- Intialise and run --------------------------------------------
82  fRun->Init();
83 
84  fRun->Run(0,nEvents);
85  // ------------------------------------------------------------------------
86 
87  rtdb->saveOutput();
88  rtdb->print();
89  // ----- Finish -------------------------------------------------------
90  timer.Stop();
91  Double_t rtime = timer.RealTime();
92  Double_t ctime = timer.CpuTime();
93  cout << endl << endl;
94  cout << "Macro finished succesfully." << endl;
95  cout << "Output file is " << outFile << endl;
96  cout << "Parameter file is " << parFile << endl;
97  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
98  cout << endl;
99  // ------------------------------------------------------------------------
100 
101 
102 }
TString trackFile2
PndMvdGeoPar * geoPar
TString outFile
Definition: hit_dirc.C:17
TString trackFile1
FairParRootFileIo * output
Definition: sim_emc_apd.C:120
FairRunAna * fRun
Definition: hit_dirc.C:58
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
PndMvdTrackFinderAnaTask * mvdTrackFinderAna
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