FairRoot/PandaRoot
PndCATrackPerformanceBase.cxx
Go to the documentation of this file.
1 // $Id: PndCAPerformanceBase.cxx,v 1.11 2010/08/26 15:05:50 ikulakov Exp $
2 // **************************************************************************
3 // This file is property of and copyright by the ALICE HLT Project *
4 // ALICE Experiment at CERN, All rights reserved. *
5 // *
6 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
7 // Ivan Kisel <kisel@kip.uni-heidelberg.de> *
8 // for The ALICE HLT Project. *
9 // *
10 // Developed by: Igor Kulakov <I.Kulakov@gsi.de> *
11 // Maksym Zyzak <M.Zyzak@gsi.de> *
12 // *
13 // Permission to use, copy, modify and distribute this software and its *
14 // documentation strictly for non-commercial purposes is hereby granted *
15 // without fee, provided that the above copyright notice appears in all *
16 // copies and that both the copyright notice and this permission notice *
17 // appear in the supporting documentation. The authors make no claims *
18 // about the suitability of this software for any purpose. It is *
19 // provided "as is" without express or implied warranty. *
20 // *
21 //***************************************************************************
22 #ifdef DO_TPCCATRACKER_EFF_PERFORMANCE
23 
24 #include "PndCACounters.h"
25 
27 #include "PndCAPerformanceBase.h"
28 
29 #include "PndCAMCTrack.h"
30 #ifndef HLTCA_STANDALONE
31 #include "PndCAMCPoint.h"
32 #endif
33 
34 
35 
36 #include "TMath.h"
37 #include "TROOT.h"
38 #include "Riostream.h"
39 #include "TFile.h"
40 #include "TH1.h"
41 #include "TH2.h"
42 #include "TProfile.h"
43 #include "TStyle.h"
44 
45 
46 PndCATrackPerformanceBase::PndCATrackPerformanceBase()
47 {
48  const int NHisto_tmp = NTracksPulls + NHitsPulls + NHits2DPulls
49  + NAllHisto + NAllProfiles + NAll2DHisto
50  + NGhostsHisto + NGhostsProfiles + NGhosts2DHisto
51  + NRecoTracksHisto + NRecoTracksProfiles + NRecoTracks2DHisto;
52 
53  NHisto = NHisto_tmp;
54  fHistosInfo = new THistoInfo[NHisto];
55  fHistos = new TH1*[NHisto];
56 
57  const double MaxMomentum = 5.;
58  const double MaxPt = 5.;
59  const double MaxPhi = 180.;
60  const int MaxNHits = 50.;
61  const double MaxChi2 = 10.;
62  const double PullWidth = 7.;
63  const THistoInfo tmp[NHisto_tmp]=
64  {
65  THistoInfo( "resY", "track y residual [cm]", 30, -.05, .05, 0,0,0, "Residual (y^{reco} - y^{mc}) [cm]","Entries" ),
66  THistoInfo( "resZ", "track z residual [cm]", 30, -2.5, 2.5, 0,0,0, "Residual (z^{reco} - z^{mc}) [cm]","Entries" ),
67  THistoInfo( "resSinPhi", "track sin#phi residual ", 30, -0.01, 0.01, 0,0,0, "Residual (sin#phi^{reco} - sin#phi^{mc}) [rad]","Entries" ),
68  THistoInfo( "resDzDs", "track dz/ds residual ", 30, -0.25, 0.25, 0,0,0, "Residual (dz/ds^{reco} - dz/ds^{mc})","Entries" ),
69  THistoInfo( "resPt", "track p_{t} resolution", 30, -0.3, 0.3, 0,0,0, "Resolution (p_{t}^{reco} - p_{t}^{mc})/p_{t}^{mc} [%]","Entries" ),
70 
71  THistoInfo( "pullY", "track y pull", 30, -PullWidth, PullWidth, 0,0,0, "Pull y" ),
72  THistoInfo( "pullZ", "track z pull", 30, -PullWidth, PullWidth, 0,0,0, "Pull z" ),
73  THistoInfo( "pullSinPhi", "track sin#phi pull", 30, -PullWidth, PullWidth, 0,0,0, "Pull sin#phi" ),
74  THistoInfo( "pullDzDs", "track dz/ds pull", 30, -PullWidth, PullWidth, 0,0,0, "Pull dz/ds" ),
75  THistoInfo( "pullQPt", "track q/p_{t} pull", 30, -PullWidth, PullWidth, 0,0,0, "Pull q/p_{t}" ),
76 
77  THistoInfo( "resXHit", "hits X resolution [cm]", 100, 3, 3, 0,0,0, "Residual (x^{reco} - x^{mc}) [cm]","Entries" ),
78  THistoInfo( "resYHit", "hits Y resolution [cm]", 100, -0.6, 0.6, 0,0,0, "Residual (y^{reco} - y^{mc}) [cm]","Entries" ),
79  THistoInfo( "resZHit", "hits Z resolution [cm]", 100, -100., 100., 0,0,0, "Residual (z^{reco} - z^{mc}) [cm]","Entries" ),
80 
81  THistoInfo( "pullYHit", "hits Y pull", 30, -PullWidth, PullWidth, 0,0,0, "Pull y" ),
82  THistoInfo( "pullZHit", "hits Z pull", 30, -PullWidth, PullWidth, 0,0,0, "Pull z" ),
83 
84  THistoInfo( "xMCPoint", "MCPoint X position [cm]", 500, 0, 250, 0,0,0, "x^{mc} [cm]","Entries" ),
85  THistoInfo( "rMCPoint", "MCPoint R position [cm]", 500, 0, 250, 0,0,0, "r^{mc} [cm]","Entries" ),
86 
87  THistoInfo( "resXHitVsZ", "hits X resolution [cm] vs Z", 50, -220, 220, 100, -1.25, 1.25, "z [cm]", "Residual (x^{reco} - x^{mc}) [cm]" ),
88  THistoInfo( "resYHitVsZ", "hits Y resolution [cm] vs Z", 50, -220, 220, 100, -0.25, 0.25, "z [cm]", "Residual (y^{reco} - y^{mc}) [cm]" ),
89  THistoInfo( "resZHitVsZ", "hits Z resolution [cm] vs Z", 50, -220, 220, 100, -1.00, 1.00, "z [cm]","Residual (z^{reco} - z^{mc}) [cm]" ),
90  THistoInfo( "resXHitVsX", "hits X resolution [cm] vs X", 50, 50, 200, 100, -1.25, 1.25, "x [cm]", "Residual (x^{reco} - x^{mc}) [cm]" ),
91  THistoInfo( "resYHitVsX", "hits Y resolution [cm] vs X", 50, 50, 200, 100, -0.25, 0.25, "x [cm]", "Residual (y^{reco} - y^{mc}) [cm]" ),
92  THistoInfo( "resZHitVsX", "hits Z resolution [cm] vs X", 50, 50, 200, 100, -1., 1., "x [cm]","Residual (z^{reco} - z^{mc}) [cm]" ),
93  THistoInfo( "resXHitVsIS", "hits X resolution [cm] vs IS", 52, 0, 25, 100, -1.25, 1.25, "i Slice", "Residual (x^{reco} - x^{mc}) [cm]" ),
94  THistoInfo( "resYHitVsIS", "hits Y resolution [cm] vs IS", 52, 0, 25, 100, -0.25, 0.25, "i Slice", "Residual (y^{reco} - y^{mc}) [cm]" ),
95  THistoInfo( "resZHitVsIS", "hits Z resolution [cm] vs IS", 52, 0, 25, 100, -1., 1., "i Slice","Residual (z^{reco} - z^{mc}) [cm]" ),
96 
97 
98  THistoInfo( "purity", "Purity of tracks", 101, 0.005, 1.005,
99  0,0,0, "Purity", "Entries" ),
100  THistoInfo( "mcTrackNRecoHits", "NRecoHits on MCTrack", MaxNHits+1, 0, MaxNHits,
101  0,0,0, "Purity", "Entries" ),
102  THistoInfo( "mcTracksVsP", "MCTracks p^{mc} distribution, MCTrack has >= 1 hit", 50, 0., MaxMomentum,
103  0,0,0, "p^{mc} [GeV/c]", "Entries" ),
104  THistoInfo( "recoAbleMCTracksVsP", "Reconstructable MCTracks p^{mc} distribution", 50, 0., MaxMomentum,
105  0,0,0, "p^{mc} [GeV/c]", "Entries" ),
106  THistoInfo( "nHitsOverNMCPointsVsRow", "nHits / NMCPoints Vs Row", MaxNHits+1, 0, MaxNHits,
107  0,0,0, "Row", "NHits / NMCPoints" ),
108  THistoInfo( "nHitsOverNMCPointsVsMCMom", "nHits / NMCPoints Vs MCMomentum", 50, 0, MaxMomentum,
109  0,0,0, "MCMomentum", "NHits / NMCPoints" ),
110  THistoInfo( "nHitsOverNMCPointsVsMCDzDs", "nHits / NMCPoints Vs MCTrack DzDs", 50, -10, 10,
111  0,0,0, "MCMomentum", "NHits / NMCPoints" ),
112  THistoInfo( "nHitsOverNMCPointsVsNMCTracks", "nHits / NMCPoints Vs NMCTracks", 20, 0, 5000,
113  0,0,0, "NMCTracks", "NHits / NMCPoints" ),
114  THistoInfo( "nMCPointsVsMCMom", "NMCPoints Vs MCMomentum", 50, 0, MaxMomentum,
115  MaxNHits*3+1,0,MaxNHits*3, "MCMomentum", "NMCPoints" ),
116 
117 
118  THistoInfo( "ghostsLength", "N_{hits} distribution, ghost tracks", MaxNHits+1, 0., MaxNHits,
119  0,0,0, "Number of hits", "Entries" ), // nGhosts vs nHits in reco track
120  THistoInfo( "ghostsRMom", "p^{reco} distribution, ghost tracks", 50, 0., MaxMomentum,
121  0,0,0, "p^{reco} [GeV/c]", "Entries" ), // nGhosts vs momentum of reco track
122  THistoInfo( "ghostsMCMom", "p^{MC} distribution, ghost tracks", 50, 0., MaxMomentum,
123  0,0,0, "p^{MC} [GeV/c]", "Entries" ), // nGhosts vs momentum of MC track
124  THistoInfo( "ghostsRPt", "p_{t}^{reco} distribution, ghost tracks", 50, 0., MaxPt,
125  0,0,0, "p_{t}^{reco} [GeV/c]", "Entries" ), // nGhosts vs Pt of reco track
126  THistoInfo( "ghostsMCPt", "p_{t}^{MC} distribution, ghost tracks", 50, 0., MaxPt,
127  0,0,0, "p_{t}^{MC} [GeV/c]", "Entries" ), // nGhosts vs Pt of MC track
128  THistoInfo( "ghostsChi2", "#chi^{2} distribution, ghost tracks", 50, 0., MaxChi2*10,
129  0,0,0, "#chi^{2}", "Entries" ),
130  THistoInfo( "ghostsProb", "prob distribution, ghost tracks", 100, 0., 1,
131  0,0,0, "prob", "Entries" ),
132  THistoInfo( "ghostsLengthAndRMom", "N Ghosts vs N Hits and Momentum", MaxNHits+1, 0., MaxNHits, 50, 0., MaxMomentum,
133  "Number of hits", "p^{reco} [GeV/c]" ),
134  THistoInfo( "ghostsLengthAndMCMom", "N Ghosts vs N Hits and Momentum", MaxNHits+1, 0., MaxNHits, 50, 0., MaxMomentum,
135  "Number of hits", "p^{MC} [GeV/c]" ),
136  THistoInfo( "ghostsLengthAndChi2", "N Ghosts vs N Hits and Chi2", MaxNHits+1, 0., MaxNHits, 50, 0., MaxChi2*10,
137  "Number of hits", "p^{reco} [GeV/c]" ),
138 
139  THistoInfo( "recosLength", "N_{hits} distribution, reco tracks", MaxNHits+1, 0., MaxNHits,
140  0,0,0, "Number of hits", "Entries" ), // vs nHits in reco track
141  THistoInfo( "recosRMom", "p^{reco} distribution, reco tracks", 50, 0., MaxMomentum,
142  0,0,0, "p^{reco} [GeV/c]", "Entries" ), // vs momentum of reco track
143  THistoInfo( "recosMCMom", "p^{MC} distribution, reco tracks", 50, 0., MaxMomentum,
144  0,0,0, "p^{MC} [GeV/c]", "Entries" ), // vs momentum of MC track
145  THistoInfo( "recosRPt", "p_{t}^{reco} distribution, reco tracks", 50, 0., MaxPt,
146  0,0,0, "p_{t}^{reco} [GeV/c]", "Entries" ), // vs Pt of reco track
147  THistoInfo( "recosMCPt", "p_{t}^{MC} distribution, reco tracks", 50, 0., MaxPt,
148  0,0,0, "p_{t}^{MC} [GeV/c]", "Entries" ), // vs Pt of MC track
149  THistoInfo( "recosChi2", "#chi^{2} distribution, reco tracks", 50, 0., MaxChi2,
150  0,0,0, "#chi^{2}", "Entries" ),
151  THistoInfo( "recosProb", "prob distribution, reco tracks", 100, 0., 1,
152  0,0,0, "prob", "Entries" ),
153  THistoInfo( "recosRefProb", "prob distribution, reference reco tracks", 100, 0., 1,
154  0,0,0, "prob", "Entries" ),
155  THistoInfo( "nHitsRecoTOverNHitsMCT", "nHitsRecoTOverNHitsMCT", 50, 0., 2,
156  0,0,0, "NHits^{reco} / NHits^{mc}", "Entries" ),
157  THistoInfo( "recosEffVsMCNHits", "Reconstruction Efficiency vs N Hits", MaxNHits+1, 0., MaxNHits,
158  0,0,0, "Number of hits", "Efficiency [%]" ), // eff vs nHits in MC track
159  THistoInfo( "recosEffVsMCMom", "Reconstruction Efficiency vs Momentum, All tracks", 50, 0., MaxMomentum,
160  0,0,100, "p^{MC} [GeV/c]", "Efficiency [%]"),// eff vs mom in MC track
161  THistoInfo( "recosEffVsMCMomPrim", "Reconstruction Efficiency vs Momentum, Primary Tracks", 50, 0., MaxMomentum,
162  0,0,100, "p^{MC} [GeV/c]", "Efficiency [%]"),// eff vs mom in MC track
163  THistoInfo( "recosEffVsMCMomRefPrim","Reconstruction Efficiency vs Momentum, Reference Primary Tracks", 50, 0., MaxMomentum,
164  0,0,100, "p^{MC} [GeV/c]", "Efficiency [%]"),// eff vs mom in MC track
165  THistoInfo( "recosEffVsMCMomSec", "Reconstruction Efficiency vs Momentum, Secondary Tracks", 50, 0., MaxMomentum,
166  0,0,100, "p^{MC} [GeV/c]", "Efficiency [%]"),// eff vs mom in MC track
167  THistoInfo( "recosEffVsMCPtAll", "Reconstruction Efficiency vs Pt, All Tracks", 50, 0., MaxPt,
168  0,0,100, "p_{t}^{MC} [GeV/c]", "Efficiency [%]"),// eff vs pt of all MC tracks
169  THistoInfo( "recosEffVsMCPtPrim", "Reconstruction Efficiency vs Pt, Primary", 50, 0., MaxPt,
170  0,0,100, "p_{t}^{MC} [GeV/c]", "Efficiency [%]"),// eff vs pt of primary MC tracks
171  THistoInfo( "recosEffVsMCPtRefPrim", "Reconstruction Efficiency vs Pt, Ref Primary", 50, 0., MaxPt,
172  0,0,100, "p_{t}^{MC} [GeV/c]", "Efficiency [%]"),// eff vs pt of ref primary MC tracks
173  THistoInfo( "recosEffVsMCPtSec", "Reconstruction Efficiency vs Pt, Secondary", 50, 0., MaxPt,
174  0,0,100, "p_{t}^{MC} [GeV/c]", "Efficiency [%]"),// eff vs pt of secondary MC tracks
175  THistoInfo( "recosEffVsMCPhiAll", "Reconstruction Efficiency vs Phi, All Tracks", 120, -MaxPhi, MaxPhi,
176  0,0,100, "#phi", "Efficiency [%]"),// eff vs Phi of all tracks
177  THistoInfo( "recosEffVsMCPhiPrim", "Reconstruction Efficiency vs Phi, Primary Tracks", 120, -MaxPhi, MaxPhi,
178  0,0,100, "#phi", "Efficiency [%]"),// eff vs Phi of primary tracks
179  THistoInfo( "recosEffVsMCPhiRefPrim", "Reconstruction Efficiency vs Phi, Ref Primary Tracks", 120, -MaxPhi, MaxPhi,
180  0,0,100, "#phi", "Efficiency [%]"),// eff vs Phi of ref primary
181  THistoInfo( "recosEffVsMCPhiSec", "Reconstruction Efficiency vs Phi, Secondary Tracks", 120, -MaxPhi, MaxPhi,
182  0,0,100, "#phi", "Efficiency [%]"),// eff vs Phi of secondary
183  THistoInfo( "recosEffVsNMCTracks", "Reconstruction Efficiency vs NMCTracks, All tracks", 20, 0., 5000,
184  0,0,100, "NMCTracks", "Efficiency [%]"),
185  THistoInfo( "recosLengthAndRMom", "N Reco Tracks vs N Hits and Momentum", MaxNHits+1, 0., MaxNHits, 50, 0., MaxMomentum,
186  "Number of hits", "p^{reco} [GeV/c]" ),
187  THistoInfo( "recosLengthAndMCMom", "N Reco Tracks vs N Hits and Momentum", MaxNHits+1, 0., MaxNHits, 50, 0., MaxMomentum,
188  "Number of hits", "p^{MC} [GeV/c]" ),
189  THistoInfo( "recosLengthAndChi2", "N Reco Tracks vs N Hits and Chi2", MaxNHits+1, 0., MaxNHits, 50, 0., MaxChi2,
190  "Number of hits", "p^{reco} [GeV/c]" )
191  };
192  for (int iHisto = 0; iHisto < NHisto; iHisto++){
193  fHistosInfo[iHisto] = tmp[iHisto];
194  }
195 
196  for( int i=0; i < NHisto; i++ ){
197  fHistos[i] = 0;
198  }
199 }
200 
201 
202 void PndCATrackPerformanceBase::CreateHistos(string histoDir, TFile* outFile)
203 {
204  TDirectory *curdir = gDirectory;
205  if ( (histoDir != "") && outFile) { // create in file
206  outFile->cd();
207  fHistoDir = outFile->mkdir( TString(histoDir) );
208  fHistoDir->cd();
209  gDirectory->mkdir( "TrackFit" );
210  gDirectory->cd( "TrackFit" );
211 
212  int ih = 0; // i of Histo
213  for( int i = 0; i < NTracksPulls + NHitsPulls; i++, ih++ ){ // TODO separate Track & Hits pulls
214  fHistos[ih] = new TH1D(fHistosInfo[ih].name, fHistosInfo[ih].title, fHistosInfo[ih].nx, fHistosInfo[ih].left, fHistosInfo[ih].right);
215  fHistos[ih]->GetXaxis()->SetTitle(fHistosInfo[ih].XAxisName.Data());
216  fHistos[ih]->GetYaxis()->SetTitle(fHistosInfo[ih].YAxisName.Data());
217  }
218 
219  for( int i = 0; i < NHits2DPulls; i++, ih++ ){
220  fHistos[ih] = new TH2D(fHistosInfo[ih].name, fHistosInfo[ih].title, fHistosInfo[ih].nx, fHistosInfo[ih].left, fHistosInfo[ih].right, fHistosInfo[ih].ny, fHistosInfo[ih].low, fHistosInfo[ih].up);
221  fHistos[ih]->GetXaxis()->SetTitle(fHistosInfo[ih].XAxisName.Data());
222  fHistos[ih]->GetYaxis()->SetTitle(fHistosInfo[ih].YAxisName.Data());
223  }
224 
225  gDirectory->cd( ".." );
226  gDirectory->mkdir( "AllTracks" );
227  gDirectory->cd( "AllTracks" );
228 
229  for( int i = 0; i < NAllHisto; i++, ih++ ){
230  fHistos[ih] = new TH1D(fHistosInfo[ih].name, fHistosInfo[ih].title, fHistosInfo[ih].nx, fHistosInfo[ih].left, fHistosInfo[ih].right);
231  fHistos[ih]->GetXaxis()->SetTitle(fHistosInfo[ih].XAxisName.Data());
232  fHistos[ih]->GetYaxis()->SetTitle(fHistosInfo[ih].YAxisName.Data());
233  }
234  for( int i = 0; i < NAllProfiles; i++, ih++ ){
235  fHistos[ih] = new TProfile(fHistosInfo[ih].name, fHistosInfo[ih].title, fHistosInfo[ih].nx, fHistosInfo[ih].left, fHistosInfo[ih].right, fHistosInfo[ih].low, fHistosInfo[ih].up);
236  fHistos[ih]->GetXaxis()->SetTitle(fHistosInfo[ih].XAxisName.Data());
237  fHistos[ih]->GetYaxis()->SetTitle(fHistosInfo[ih].YAxisName.Data());
238  fHistos[ih]->SetMarkerColor(2);
239  fHistos[ih]->SetLineColor(2);
240  }
241  for( int i = 0; i < NAll2DHisto; i++, ih++ ){
242  fHistos[ih] = new TH2D(fHistosInfo[ih].name, fHistosInfo[ih].title, fHistosInfo[ih].nx, fHistosInfo[ih].left, fHistosInfo[ih].right, fHistosInfo[ih].ny, fHistosInfo[ih].low, fHistosInfo[ih].up);
243  fHistos[ih]->GetXaxis()->SetTitle(fHistosInfo[ih].XAxisName.Data());
244  fHistos[ih]->GetYaxis()->SetTitle(fHistosInfo[ih].YAxisName.Data());
245  // fHistos[ih]->SetDrawOption("colz"); doesn't help
246  }
247 
248  gDirectory->cd( ".." );
249  gDirectory->mkdir( "Ghosts" );
250  gDirectory->cd( "Ghosts" );
251 
252  for( int i = 0; i < NGhostsHisto; i++, ih++ ){
253  fHistos[ih] = new TH1D(fHistosInfo[ih].name, fHistosInfo[ih].title, fHistosInfo[ih].nx, fHistosInfo[ih].left, fHistosInfo[ih].right);
254  fHistos[ih]->GetXaxis()->SetTitle(fHistosInfo[ih].XAxisName.Data());
255  fHistos[ih]->GetYaxis()->SetTitle(fHistosInfo[ih].YAxisName.Data());
256  }
257  for( int i = 0; i < NGhostsProfiles; i++, ih++ ){
258  fHistos[ih] = new TProfile(fHistosInfo[ih].name, fHistosInfo[ih].title, fHistosInfo[ih].nx, fHistosInfo[ih].left, fHistosInfo[ih].right, fHistosInfo[ih].low, fHistosInfo[ih].up);
259  fHistos[ih]->GetXaxis()->SetTitle(fHistosInfo[ih].XAxisName.Data());
260  fHistos[ih]->GetYaxis()->SetTitle(fHistosInfo[ih].YAxisName.Data());
261  fHistos[ih]->SetMarkerColor(2);
262  fHistos[ih]->SetLineColor(2);
263  }
264  for( int i = 0; i < NGhosts2DHisto; i++, ih++ ){
265  fHistos[ih] = new TH2D(fHistosInfo[ih].name, fHistosInfo[ih].title, fHistosInfo[ih].nx, fHistosInfo[ih].left, fHistosInfo[ih].right, fHistosInfo[ih].ny, fHistosInfo[ih].low, fHistosInfo[ih].up);
266  fHistos[ih]->GetXaxis()->SetTitle(fHistosInfo[ih].XAxisName.Data());
267  fHistos[ih]->GetYaxis()->SetTitle(fHistosInfo[ih].YAxisName.Data());
268  // fHistos[ih]->SetDrawOption("colz"); doesn't help
269  }
270 
271  gDirectory->cd( ".." );
272  gDirectory->mkdir( "RecoTracks" );
273  gDirectory->cd( "RecoTracks" );
274 
275  for( int i = 0; i < NRecoTracksHisto; i++, ih++ ){
276  fHistos[ih] = new TH1D(fHistosInfo[ih].name, fHistosInfo[ih].title, fHistosInfo[ih].nx, fHistosInfo[ih].left, fHistosInfo[ih].right);
277  fHistos[ih]->GetXaxis()->SetTitle(fHistosInfo[ih].XAxisName.Data());
278  fHistos[ih]->GetYaxis()->SetTitle(fHistosInfo[ih].YAxisName.Data());
279  }
280 
281  for( int i = 0; i < NRecoTracksProfiles; i++, ih++ ){
282  fHistos[ih] = new TProfile(fHistosInfo[ih].name, fHistosInfo[ih].title, fHistosInfo[ih].nx, fHistosInfo[ih].left, fHistosInfo[ih].right, fHistosInfo[ih].low, fHistosInfo[ih].up );
283  fHistos[ih]->GetXaxis()->SetTitle(fHistosInfo[ih].XAxisName.Data());
284  fHistos[ih]->GetYaxis()->SetTitle(fHistosInfo[ih].YAxisName.Data());
285  fHistos[ih]->SetMarkerColor(2);
286  fHistos[ih]->SetLineColor(2);
287  }
288  for( int i = 0; i < NRecoTracks2DHisto; i++, ih++ ){
289  fHistos[ih] = new TH2D(fHistosInfo[ih].name, fHistosInfo[ih].title, fHistosInfo[ih].nx, fHistosInfo[ih].left, fHistosInfo[ih].right, fHistosInfo[ih].ny, fHistosInfo[ih].low, fHistosInfo[ih].up);
290  fHistos[ih]->GetXaxis()->SetTitle(fHistosInfo[ih].XAxisName.Data());
291  fHistos[ih]->GetYaxis()->SetTitle(fHistosInfo[ih].YAxisName.Data());
292  // fHistos[ih]->SetDrawOption("colz"); doesn't help
293  }
294 
295  gDirectory->cd( ".." );
296  curdir->cd();
297  }
298  else{ // create not in file
299  static int iaddName = 0; // haven't any subfolders so create with different names
300  TString addName = TString(iaddName);
301  int ih = 0; // i of Histo
302  for( int i = 0; i < NTracksPulls + NHitsPulls; i++, ih++, addName = TString(iaddName++) ){
303  fHistos[ih] = new TH1D(fHistosInfo[ih].name+addName, fHistosInfo[ih].title, fHistosInfo[ih].nx, fHistosInfo[ih].left, fHistosInfo[ih].right);
304  fHistos[ih]->GetXaxis()->SetTitle(fHistosInfo[ih].XAxisName.Data());
305  fHistos[ih]->GetYaxis()->SetTitle(fHistosInfo[ih].YAxisName.Data());
306  }
307  for( int i = 0; i < NHits2DPulls; i++, ih++, addName = TString(iaddName++) ){
308  fHistos[ih] = new TH2D(fHistosInfo[ih].name+addName, fHistosInfo[ih].title, fHistosInfo[ih].nx, fHistosInfo[ih].left, fHistosInfo[ih].right, fHistosInfo[ih].ny, fHistosInfo[ih].low, fHistosInfo[ih].up);
309  fHistos[ih]->GetXaxis()->SetTitle(fHistosInfo[ih].XAxisName.Data());
310  fHistos[ih]->GetYaxis()->SetTitle(fHistosInfo[ih].YAxisName.Data());
311  }
312 
313  for( int i = 0; i < NAllHisto; i++, ih++, addName = TString(iaddName++) ){
314  fHistos[ih] = new TH1D(fHistosInfo[ih].name+addName, fHistosInfo[ih].title, fHistosInfo[ih].nx, fHistosInfo[ih].left, fHistosInfo[ih].right);
315  fHistos[ih]->GetXaxis()->SetTitle(fHistosInfo[ih].XAxisName.Data());
316  fHistos[ih]->GetYaxis()->SetTitle(fHistosInfo[ih].YAxisName.Data());
317  }
318  for( int i = 0; i < NAllProfiles; i++, ih++, addName = TString(iaddName++) ){
319  fHistos[ih] = new TProfile(fHistosInfo[ih].name+addName, fHistosInfo[ih].title, fHistosInfo[ih].nx, fHistosInfo[ih].left, fHistosInfo[ih].right);
320  fHistos[ih]->GetXaxis()->SetTitle(fHistosInfo[ih].XAxisName.Data());
321  fHistos[ih]->GetYaxis()->SetTitle(fHistosInfo[ih].YAxisName.Data());
322  }
323  for( int i = 0; i < NAll2DHisto; i++, ih++, addName = TString(iaddName++) ){
324  fHistos[ih] = new TH2D(fHistosInfo[ih].name+addName, fHistosInfo[ih].title, fHistosInfo[ih].nx, fHistosInfo[ih].left, fHistosInfo[ih].right, fHistosInfo[ih].ny, fHistosInfo[ih].low, fHistosInfo[ih].up);
325  fHistos[ih]->GetXaxis()->SetTitle(fHistosInfo[ih].XAxisName.Data());
326  fHistos[ih]->GetYaxis()->SetTitle(fHistosInfo[ih].YAxisName.Data());
327  }
328 
329  for( int i = 0; i < NGhostsHisto; i++, ih++, addName = TString(iaddName++) ){
330  fHistos[ih] = new TH1D(fHistosInfo[ih].name+addName, fHistosInfo[ih].title, fHistosInfo[ih].nx, fHistosInfo[ih].left, fHistosInfo[ih].right);
331  fHistos[ih]->GetXaxis()->SetTitle(fHistosInfo[ih].XAxisName.Data());
332  fHistos[ih]->GetYaxis()->SetTitle(fHistosInfo[ih].YAxisName.Data());
333  }
334  for( int i = 0; i < NGhostsProfiles; i++, ih++, addName = TString(iaddName++) ){
335  fHistos[ih] = new TProfile(fHistosInfo[ih].name+addName, fHistosInfo[ih].title, fHistosInfo[ih].nx, fHistosInfo[ih].left, fHistosInfo[ih].right);
336  fHistos[ih]->GetXaxis()->SetTitle(fHistosInfo[ih].XAxisName.Data());
337  fHistos[ih]->GetYaxis()->SetTitle(fHistosInfo[ih].YAxisName.Data());
338  }
339  for( int i = 0; i < NGhosts2DHisto; i++, ih++, addName = TString(iaddName++) ){
340  fHistos[ih] = new TH2D(fHistosInfo[ih].name+addName, fHistosInfo[ih].title, fHistosInfo[ih].nx, fHistosInfo[ih].left, fHistosInfo[ih].right, fHistosInfo[ih].ny, fHistosInfo[ih].low, fHistosInfo[ih].up);
341  fHistos[ih]->GetXaxis()->SetTitle(fHistosInfo[ih].XAxisName.Data());
342  fHistos[ih]->GetYaxis()->SetTitle(fHistosInfo[ih].YAxisName.Data());
343  }
344 
345  for( int i = 0; i < NRecoTracksHisto; i++, ih++, addName = TString(iaddName++) ){
346  fHistos[ih] = new TH1D(fHistosInfo[ih].name+addName, fHistosInfo[ih].title, fHistosInfo[ih].nx, fHistosInfo[ih].left, fHistosInfo[ih].right);
347  fHistos[ih]->GetXaxis()->SetTitle(fHistosInfo[ih].XAxisName.Data());
348  fHistos[ih]->GetYaxis()->SetTitle(fHistosInfo[ih].YAxisName.Data());
349  }
350  for( int i = 0; i < NRecoTracksProfiles; i++, ih++, addName = TString(iaddName++) ){
351  fHistos[ih] = new TProfile(fHistosInfo[ih].name+addName, fHistosInfo[ih].title, fHistosInfo[ih].nx, fHistosInfo[ih].left, fHistosInfo[ih].right);
352  fHistos[ih]->GetXaxis()->SetTitle(fHistosInfo[ih].XAxisName.Data());
353  fHistos[ih]->GetYaxis()->SetTitle(fHistosInfo[ih].YAxisName.Data());
354  }
355  for( int i = 0; i < NRecoTracks2DHisto; i++, ih++, addName = TString(iaddName++) ){
356  fHistos[ih] = new TH2D(fHistosInfo[ih].name+addName, fHistosInfo[ih].title, fHistosInfo[ih].nx, fHistosInfo[ih].left, fHistosInfo[ih].right, fHistosInfo[ih].ny, fHistosInfo[ih].low, fHistosInfo[ih].up);
357  fHistos[ih]->GetXaxis()->SetTitle(fHistosInfo[ih].XAxisName.Data());
358  fHistos[ih]->GetYaxis()->SetTitle(fHistosInfo[ih].YAxisName.Data());
359  }
360 
361  for( int i = 0; i < NHisto; i++ ){
362  fHistos[i]->SetDirectory(0);
363  }
364  }
365  SetHistoCreated();
366 }
367 
368 
369 void PndCATrackPerformanceBase::FillHistos()
370 {
371  for ( int iMCTr = 0; iMCTr < nMCTracks; iMCTr++ ) {
372  PndCAPerformanceMCTrackData &mcD = mcData[iMCTr];
373  PndCAMCTrack &mcTr = (*fMCTracks)[iMCTr];
374 
375  const int Multiplicity = (*fMCTracks).size();
376 
377  if( mcTr.NHits() > 0 )
378  GetHisto("mcTracksVsP")->Fill( mcTr.P() );
379 
380  if ( mcD.IsReconstructable() ) {
381  //all reconstructed tracks
382 
383  double PhiMC = TMath::RadToDeg()*TMath::ATan2(mcTr.Py(),mcTr.Px());
384 
385  GetHisto("recoAbleMCTracksVsP")->Fill( mcTr.P() );
386 
387  GetHisto("recosEffVsMCMom") ->Fill( mcTr.P(), mcD.IsReconstructed()*100 );
388  GetHisto("recosEffVsMCNHits") ->Fill( mcTr.NHits(), mcD.IsReconstructed()*100 );
389  GetHisto("recosEffVsMCPtAll") ->Fill( mcTr.Pt(), mcD.IsReconstructed()*100 );
390  GetHisto("recosEffVsMCPhiAll")->Fill( PhiMC, mcD.IsReconstructed()*100 );
391  GetHisto("recosEffVsNMCTracks")->Fill( Multiplicity, mcD.IsReconstructed()*100 );
392 
393  if(mcTr.MotherId() == -1) {
394  //all reconstructed primary tracks
395  GetHisto("recosEffVsMCMomPrim") ->Fill( mcTr.P(), mcD.IsReconstructed()*100 );
396  GetHisto("recosEffVsMCPtPrim") ->Fill( mcTr.Pt(), mcD.IsReconstructed()*100 );
397  GetHisto("recosEffVsMCPhiPrim") ->Fill( PhiMC, mcD.IsReconstructed()*100 );
398  if(mcTr.Set() == 2) {
399  //reconstructed reference primary tracks
400  GetHisto("recosEffVsMCMomRefPrim") ->Fill( mcTr.P(), mcD.IsReconstructed()*100 );
401  GetHisto("recosEffVsMCPtRefPrim") ->Fill( mcTr.Pt(), mcD.IsReconstructed()*100 );
402  GetHisto("recosEffVsMCPhiRefPrim") ->Fill( PhiMC, mcD.IsReconstructed()*100 );
403  }
404  }
405  else if(mcTr.MotherId() > -1) {
406  //reconstructed secondary tracks
407  GetHisto("recosEffVsMCMomSec") ->Fill( mcTr.P(), mcD.IsReconstructed()*100 );
408  GetHisto("recosEffVsMCPtSec") ->Fill( mcTr.Pt(), mcD.IsReconstructed()*100 );
409  GetHisto("recosEffVsMCPhiSec") ->Fill( PhiMC, mcD.IsReconstructed()*100 );
410  }
411  }
412  }
413 } // void PndCATrackPerformanceBase::FillHistos()
414 #endif //DO_TPCCATRACKER_EFF_PERFORMANCE
415 
Int_t i
Definition: run_full.C:25
int Set() const
Definition: PndCAMCTrack.h:57
int low
Definition: anaMvdDigi.C:51
float P() const
Definition: PndCAMCTrack.h:46
float Py() const
Definition: PndCAMCTrack.h:44
TString outFile
Definition: hit_dirc.C:17
int NHits() const
Definition: PndCAMCTrack.h:53
int MotherId() const
Definition: PndCAMCTrack.h:35
Information about reconstruction of MCTrack.
static T ATan2(const T &y, const T &x)
float Pt() const
Definition: PndCAMCTrack.h:47
TString name
float Px() const
Definition: PndCAMCTrack.h:43