FairRoot/PandaRoot
anaMvdEvent.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 = 0;
5 
6  // Input file (MC events)
7  TString MCFile = "Mvd_Pions_0GeV1_1.root";
8  // Parameter file
9  TString parFile = "Mvd_Pions_0GeV1_1Param.root";
10  // Parameter output file
12  // Number of events to process
13  Int_t startEvent = 0;
14  Int_t stopEvent = 300;
15  // ---- Load libraries -------------------------------------------------
16 // gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
17  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
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 RiemannFile = creator.GetTrackFindingFileName(false).c_str();
24  TString outFile = "Dummy.root";
25 
26  std::cout << "MCFile : " << MCFile.Data()<< std::endl;
27  std::cout << "DigiFile: " << DigiFile.Data()<< std::endl;
28  std::cout << "RecoFile: " << RecoFile.Data()<< std::endl;
29  std::cout << "RiemannFile: " << RiemannFile.Data() << std::endl;
30  // --- Now choose concrete engines for the different tasks -------------
31  // ------------------------------------------------------------------------
32 
33 
34  // In general, the following parts need not be touched
35  // ========================================================================
36 
37 
38 
39 
40  // ----- Timer --------------------------------------------------------
41  TStopwatch timer;
42  timer.Start();
43  // ------------------------------------------------------------------------
44 
45 
46 
47  // ----- Reconstruction run -------------------------------------------
48  CbmRunAna *fRun= new CbmRunAna();
49 
50  fRun->SetInputFile(MCFile);
51  fRun->AddFriend(DigiFile);
52  fRun->AddFriend(RecoFile);
53  fRun->AddFriend(RiemannFile);
54 
55  fRun->SetOutputFile(outFile);
56  // ------------------------------------------------------------------------
57 
58 
59 
60  // ----- Parameter database --------------------------------------------
61  CbmRuntimeDb* rtdb = fRun->GetRuntimeDb();
62 
63  CbmParRootFileIo* parInput1 = new CbmParRootFileIo(kTRUE);
64  parInput1->open(parFile.Data(),"UPDATE");
65 // CbmParAsciiFileIo* parInput1 = new CbmParAsciiFileIo();
66 // parInput1->open(parFile.Data(),"in");
67 
68  rtdb->setFirstInput(parInput1);
70 // CbmParRootFileIo* output=new CbmParRootFileIo(kParameterMerged);
71 // output->open(parOutFile.Data(),"RECREATE");
72 
73 // fRun->LoadGeometry();
74 
75  // ------------------------------------------------------------------------
76 
77 
78 
79  // =========================================================================
80  // ====== Hit Producers ======
81  // =========================================================================
82 
83  // ----- MVD hit producer --------------------------------------------
84 
85 
87  eventAna->SetVerbose(iVerbose);
88  fRun->AddTask(eventAna);
89 
90  rtdb->setOutput(parInput1);
91  rtdb->print();
92  // ===== End of HitProducers =====
93  // =========================================================================
94 // PndMvdGeoPar* geoPar = (PndMvdGeoPar*)(rtdb->getContainer("PndMvdGeoPar"));
95 
96  // ----- Intialise and run --------------------------------------------
97  fRun->Init();
98 
99  fRun->Run(startEvent,stopEvent);
100 
101  TCanvas* c1 = new TCanvas();
102  c1->Divide(3,4);
103  c1->cd(1);
104  eventAna->DrawTracksPerEvent();
105  c1->cd(2);
106  eventAna->DrawHitsPerTrack();
107  c1->cd(3);
108  eventAna->DrawEnergyPerHit();
109  c1->cd(4);
110  eventAna->DrawPointRes();
111  eventAna->DrawPointResS("same");
112  eventAna->DrawPointResD("same");
113  eventAna->DrawPointResM("same");
114  c1->cd(5);
115  eventAna->DrawEnergyRes();
116  c1->cd(6);
117  eventAna->DrawDigisPerCluster();
118  c1->cd(4);
119  eventAna->DrawPointResStrip("same");
120  c1->cd(5);
121  eventAna->DrawEnergyResStrip("same");
122  c1->cd(6);
123  eventAna->DrawDigisPerClusterStrip("same");
124  c1->cd(10);
125  eventAna->DrawPtRes();
126  c1->cd(11);
127  eventAna->DrawPRes();
128  c1->cd(7);
129  eventAna->DrawRiemannRes();
130  eventAna->DrawRiemannFakes("same");
131  c1->cd(8);
132  eventAna->DrawRiemannTracksPerTrack();
133  eventAna->DrawRiemannTracksPerTrackAdd("same");
134 
135  // ------------------------------------------------------------------------
136 
137 // rtdb->saveOutput();
138  // ----- Finish -------------------------------------------------------
139  timer.Stop();
140  Double_t rtime = timer.RealTime();
141  Double_t ctime = timer.CpuTime();
142  cout << endl << endl;
143  cout << "Macro finished succesfully." << endl;
144  cout << "Output file is " << outFile << endl;
145  cout << "Parameter file is " << parFile << endl;
146  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
147  cout << endl;
148  // ------------------------------------------------------------------------
149 
150 
151 }
void DrawPointRes(TString opt="")
void DrawRiemannTracksPerTrackAdd(TString opt="")
TString RecoFile
Bool_t kParameterMerged
Definition: sim_emc_apd.C:113
PndMvdEventAnaTask * eventAna
Definition: anaMvdEvent.C:86
TString outFile
Definition: hit_dirc.C:17
void DrawPointResStrip(TString opt="")
Int_t startEvent
void DrawEnergyPerHit(TString opt="")
void DrawEnergyResStrip(TString opt="")
void DrawPRes(TString opt="")
void DrawTracksPerEvent(TString opt="")
TString RiemannFile
Definition: anaMvdEvent.C:23
FairRunAna * fRun
Definition: hit_dirc.C:58
TString DigiFile
virtual InitStatus Init()
void DrawDigisPerCluster(TString opt="")
Int_t stopEvent
A simple class which adds the corresponding file extensions to a given base class.
Double_t
TString parFile
Definition: hit_dirc.C:14
void DrawRiemannRes(TString opt="")
TStopwatch timer
Definition: hit_dirc.C:51
void DrawPointResD(TString opt="")
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
c1
Definition: plot_dirc.C:35
FairParRootFileIo * parInput1
Definition: hit_dirc.C:67
Double_t ctime
Definition: hit_dirc.C:114
void DrawPointResS(TString opt="")
void DrawEnergyRes(TString opt="")
void DrawRiemannFakes(TString opt="")
PndMvdCreateDefaultApvMap * creator
void DrawPointResM(TString opt="")
void DrawPtRes(TString opt="")
Int_t iVerbose
TString MCFile
Double_t rtime
Definition: hit_dirc.C:113
TString parOutFile
void DrawHitsPerTrack(TString opt="")
void DrawRiemannTracksPerTrack(TString opt="")
void DrawDigisPerClusterStrip(TString opt="")