CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MTVHistoProducerAlgoForTracker.cc
Go to the documentation of this file.
5 
10 
12 
13 #include "TMath.h"
14 #include <TF1.h>
15 
16 using namespace std;
17 
19  //parameters for _vs_eta plots
20  minEta = pset.getParameter<double>("minEta");
21  maxEta = pset.getParameter<double>("maxEta");
22  nintEta = pset.getParameter<int>("nintEta");
23  useFabsEta = pset.getParameter<bool>("useFabsEta");
24 
25  //parameters for _vs_pt plots
26  minPt = pset.getParameter<double>("minPt");
27  maxPt = pset.getParameter<double>("maxPt");
28  nintPt = pset.getParameter<int>("nintPt");
29  useInvPt = pset.getParameter<bool>("useInvPt");
30  useLogPt = pset.getUntrackedParameter<bool>("useLogPt",false);
31 
32  //parameters for _vs_Hit plots
33  minHit = pset.getParameter<double>("minHit");
34  maxHit = pset.getParameter<double>("maxHit");
35  nintHit = pset.getParameter<int>("nintHit");
36 
37  //parameters for _vs_phi plots
38  minPhi = pset.getParameter<double>("minPhi");
39  maxPhi = pset.getParameter<double>("maxPhi");
40  nintPhi = pset.getParameter<int>("nintPhi");
41 
42  //parameters for _vs_Dxy plots
43  minDxy = pset.getParameter<double>("minDxy");
44  maxDxy = pset.getParameter<double>("maxDxy");
45  nintDxy = pset.getParameter<int>("nintDxy");
46 
47  //parameters for _vs_Dz plots
48  minDz = pset.getParameter<double>("minDz");
49  maxDz = pset.getParameter<double>("maxDz");
50  nintDz = pset.getParameter<int>("nintDz");
51 
52  //parameters for _vs_ProductionVertexTransvPosition plots
53  minVertpos = pset.getParameter<double>("minVertpos");
54  maxVertpos = pset.getParameter<double>("maxVertpos");
55  nintVertpos = pset.getParameter<int>("nintVertpos");
56 
57  //parameters for _vs_ProductionVertexZPosition plots
58  minZpos = pset.getParameter<double>("minZpos");
59  maxZpos = pset.getParameter<double>("maxZpos");
60  nintZpos = pset.getParameter<int>("nintZpos");
61 
62  //parameters for dE/dx plots
63  minDeDx = pset.getParameter<double>("minDeDx");
64  maxDeDx = pset.getParameter<double>("maxDeDx");
65  nintDeDx = pset.getParameter<int>("nintDeDx");
66 
67  //parameters for resolution plots
68  ptRes_rangeMin = pset.getParameter<double>("ptRes_rangeMin");
69  ptRes_rangeMax = pset.getParameter<double>("ptRes_rangeMax");
70  ptRes_nbin = pset.getParameter<int>("ptRes_nbin");
71 
72  phiRes_rangeMin = pset.getParameter<double>("phiRes_rangeMin");
73  phiRes_rangeMax = pset.getParameter<double>("phiRes_rangeMax");
74  phiRes_nbin = pset.getParameter<int>("phiRes_nbin");
75 
76  cotThetaRes_rangeMin = pset.getParameter<double>("cotThetaRes_rangeMin");
77  cotThetaRes_rangeMax = pset.getParameter<double>("cotThetaRes_rangeMax");
78  cotThetaRes_nbin = pset.getParameter<int>("cotThetaRes_nbin");
79 
80  dxyRes_rangeMin = pset.getParameter<double>("dxyRes_rangeMin");
81  dxyRes_rangeMax = pset.getParameter<double>("dxyRes_rangeMax");
82  dxyRes_nbin = pset.getParameter<int>("dxyRes_nbin");
83 
84  dzRes_rangeMin = pset.getParameter<double>("dzRes_rangeMin");
85  dzRes_rangeMax = pset.getParameter<double>("dzRes_rangeMax");
86  dzRes_nbin = pset.getParameter<int>("dzRes_nbin");
87 
88 
89  //--- tracking particle selectors for efficiency measurements
90  using namespace edm;
91 
92  ParameterSet generalTpSelectorPSet = pset.getParameter<ParameterSet>("generalTpSelector");
93  ParameterSet TpSelectorForEfficiencyVsEtaPSet = pset.getParameter<ParameterSet>("TpSelectorForEfficiencyVsEta");
94  ParameterSet TpSelectorForEfficiencyVsPhiPSet = pset.getParameter<ParameterSet>("TpSelectorForEfficiencyVsPhi");
95  ParameterSet TpSelectorForEfficiencyVsPtPSet = pset.getParameter<ParameterSet>("TpSelectorForEfficiencyVsPt");
96  ParameterSet TpSelectorForEfficiencyVsVTXRPSet = pset.getParameter<ParameterSet>("TpSelectorForEfficiencyVsVTXR");
97  ParameterSet TpSelectorForEfficiencyVsVTXZPSet = pset.getParameter<ParameterSet>("TpSelectorForEfficiencyVsVTXZ");
98 
99  using namespace reco::modules;
106 
107  // fix for the LogScale by Ryan
108  if(useLogPt){
109  maxPt=log10(maxPt);
110  if(minPt > 0){
111  minPt=log10(minPt);
112  }
113  else{
114  edm::LogWarning("MultiTrackValidator")
115  << "minPt = "
116  << minPt << " <= 0 out of range while requesting log scale. Using minPt = 0.1.";
117  minPt=log10(0.1);
118  }
119  }
120 
121 }
122 
124  delete generalTpSelector;
130 }
131 
132 
134  std::vector<double> etaintervalsv;
135  std::vector<double> phiintervalsv;
136  std::vector<double> pTintervalsv;
137  std::vector<double> dxyintervalsv;
138  std::vector<double> dzintervalsv;
139  std::vector<double> vertposintervalsv;
140  std::vector<double> zposintervalsv;
141  std::vector<int> totSIMveta,totASSveta,totASS2veta,totRECveta;
142  std::vector<int> totSIMvpT,totASSvpT,totASS2vpT,totRECvpT;
143  std::vector<int> totSIMv_hit,totASSv_hit,totASS2v_hit,totRECv_hit;
144  std::vector<int> totSIMv_phi,totASSv_phi,totASS2v_phi,totRECv_phi;
145  std::vector<int> totSIMv_dxy,totASSv_dxy,totASS2v_dxy,totRECv_dxy;
146  std::vector<int> totSIMv_dz,totASSv_dz,totASS2v_dz,totRECv_dz;
147  std::vector<int> totSIMv_vertpos,totASSv_vertpos,totSIMv_zpos,totASSv_zpos;
148 
149  double step=(maxEta-minEta)/nintEta;
150  //std::ostringstream title,name; ///BM, what is this?
151  etaintervalsv.push_back(minEta);
152  for (int k=1;k<nintEta+1;k++) {
153  double d=minEta+k*step;
154  etaintervalsv.push_back(d);
155  totSIMveta.push_back(0);
156  totASSveta.push_back(0);
157  totASS2veta.push_back(0);
158  totRECveta.push_back(0);
159  }
160  etaintervals.push_back(etaintervalsv);
161  totSIMeta.push_back(totSIMveta);
162  totASSeta.push_back(totASSveta);
163  totASS2eta.push_back(totASS2veta);
164  totRECeta.push_back(totRECveta);
165 
166  double stepPt = (maxPt-minPt)/nintPt;
167  pTintervalsv.push_back(minPt);
168  for (int k=1;k<nintPt+1;k++) {
169  double d=0;
170  if(useLogPt)d=pow(10,minPt+k*stepPt);
171  else d=minPt+k*stepPt;
172  pTintervalsv.push_back(d);
173  totSIMvpT.push_back(0);
174  totASSvpT.push_back(0);
175  totASS2vpT.push_back(0);
176  totRECvpT.push_back(0);
177  }
178  pTintervals.push_back(pTintervalsv);
179  totSIMpT.push_back(totSIMvpT);
180  totASSpT.push_back(totASSvpT);
181  totASS2pT.push_back(totASS2vpT);
182  totRECpT.push_back(totRECvpT);
183 
184  for (int k=1;k<nintHit+1;k++) {
185  totSIMv_hit.push_back(0);
186  totASSv_hit.push_back(0);
187  totASS2v_hit.push_back(0);
188  totRECv_hit.push_back(0);
189  }
190  totSIM_hit.push_back(totSIMv_hit);
191  totASS_hit.push_back(totASSv_hit);
192  totASS2_hit.push_back(totASS2v_hit);
193  totREC_hit.push_back(totRECv_hit);
194 
195  double stepPhi = (maxPhi-minPhi)/nintPhi;
196  phiintervalsv.push_back(minPhi);
197  for (int k=1;k<nintPhi+1;k++) {
198  double d=minPhi+k*stepPhi;
199  phiintervalsv.push_back(d);
200  totSIMv_phi.push_back(0);
201  totASSv_phi.push_back(0);
202  totASS2v_phi.push_back(0);
203  totRECv_phi.push_back(0);
204  }
205  phiintervals.push_back(phiintervalsv);
206  totSIM_phi.push_back(totSIMv_phi);
207  totASS_phi.push_back(totASSv_phi);
208  totASS2_phi.push_back(totASS2v_phi);
209  totREC_phi.push_back(totRECv_phi);
210 
211  double stepDxy = (maxDxy-minDxy)/nintDxy;
212  dxyintervalsv.push_back(minDxy);
213  for (int k=1;k<nintDxy+1;k++) {
214  double d=minDxy+k*stepDxy;
215  dxyintervalsv.push_back(d);
216  totSIMv_dxy.push_back(0);
217  totASSv_dxy.push_back(0);
218  totASS2v_dxy.push_back(0);
219  totRECv_dxy.push_back(0);
220  }
221  dxyintervals.push_back(dxyintervalsv);
222  totSIM_dxy.push_back(totSIMv_dxy);
223  totASS_dxy.push_back(totASSv_dxy);
224  totASS2_dxy.push_back(totASS2v_dxy);
225  totREC_dxy.push_back(totRECv_dxy);
226 
227 
228  double stepDz = (maxDz-minDz)/nintDz;
229  dzintervalsv.push_back(minDz);
230  for (int k=1;k<nintDz+1;k++) {
231  double d=minDz+k*stepDz;
232  dzintervalsv.push_back(d);
233  totSIMv_dz.push_back(0);
234  totASSv_dz.push_back(0);
235  totASS2v_dz.push_back(0);
236  totRECv_dz.push_back(0);
237  }
238  dzintervals.push_back(dzintervalsv);
239  totSIM_dz.push_back(totSIMv_dz);
240  totASS_dz.push_back(totASSv_dz);
241  totASS2_dz.push_back(totASS2v_dz);
242  totREC_dz.push_back(totRECv_dz);
243 
244  double stepVertpos = (maxVertpos-minVertpos)/nintVertpos;
245  vertposintervalsv.push_back(minVertpos);
246  for (int k=1;k<nintVertpos+1;k++) {
247  double d=minVertpos+k*stepVertpos;
248  vertposintervalsv.push_back(d);
249  totSIMv_vertpos.push_back(0);
250  totASSv_vertpos.push_back(0);
251  }
252  vertposintervals.push_back(vertposintervalsv);
253  totSIM_vertpos.push_back(totSIMv_vertpos);
254  totASS_vertpos.push_back(totASSv_vertpos);
255 
256  double stepZpos = (maxZpos-minZpos)/nintZpos;
257  zposintervalsv.push_back(minZpos);
258  for (int k=1;k<nintZpos+1;k++) {
259  double d=minZpos+k*stepZpos;
260  zposintervalsv.push_back(d);
261  totSIMv_zpos.push_back(0);
262  totASSv_zpos.push_back(0);
263  }
264  zposintervals.push_back(zposintervalsv);
265  totSIM_zpos.push_back(totSIMv_zpos);
266  totASS_zpos.push_back(totASSv_zpos);
267 }
268 
270  h_ptSIM.push_back( dbe_->book1D("ptSIM", "generated p_{t}", 5500, 0, 110 ) );
271  h_etaSIM.push_back( dbe_->book1D("etaSIM", "generated pseudorapidity", 500, -2.5, 2.5 ) );
272  h_tracksSIM.push_back( dbe_->book1D("tracksSIM","number of simulated tracks",200,-0.5,99.5) );
273  h_vertposSIM.push_back( dbe_->book1D("vertposSIM","Transverse position of sim vertices",100,0.,120.) );
274 }
275 
276 
278  h_tracks.push_back( dbe_->book1D("tracks","number of reconstructed tracks",200,-0.5,19.5) );
279  h_fakes.push_back( dbe_->book1D("fakes","number of fake reco tracks",20,-0.5,19.5) );
280  h_charge.push_back( dbe_->book1D("charge","charge",3,-1.5,1.5) );
281 
282  h_hits.push_back( dbe_->book1D("hits", "number of hits per track", nintHit,minHit,maxHit ) );
283  h_losthits.push_back( dbe_->book1D("losthits", "number of lost hits per track", nintHit,minHit,maxHit) );
284  h_nchi2.push_back( dbe_->book1D("chi2", "normalized #chi^{2}", 200, 0, 20 ) );
285  h_nchi2_prob.push_back( dbe_->book1D("chi2_prob", "normalized #chi^{2} probability",100,0,1));
286 
288  h_recoeta.push_back( dbe_->book1D("num_reco_eta","N of reco track vs eta",nintEta,minEta,maxEta) );
289  h_assoceta.push_back( dbe_->book1D("num_assoc(simToReco)_eta","N of associated tracks (simToReco) vs eta",nintEta,minEta,maxEta) );
290  h_assoc2eta.push_back( dbe_->book1D("num_assoc(recoToSim)_eta","N of associated (recoToSim) tracks vs eta",nintEta,minEta,maxEta) );
291  h_simuleta.push_back( dbe_->book1D("num_simul_eta","N of simulated tracks vs eta",nintEta,minEta,maxEta) );
292  h_recopT.push_back( dbe_->book1D("num_reco_pT","N of reco track vs pT",nintPt,minPt,maxPt) );
293  h_assocpT.push_back( dbe_->book1D("num_assoc(simToReco)_pT","N of associated tracks (simToReco) vs pT",nintPt,minPt,maxPt) );
294  h_assoc2pT.push_back( dbe_->book1D("num_assoc(recoToSim)_pT","N of associated (recoToSim) tracks vs pT",nintPt,minPt,maxPt) );
295  h_simulpT.push_back( dbe_->book1D("num_simul_pT","N of simulated tracks vs pT",nintPt,minPt,maxPt) );
296  //
297  h_recohit.push_back( dbe_->book1D("num_reco_hit","N of reco track vs hit",nintHit,minHit,maxHit) );
298  h_assochit.push_back( dbe_->book1D("num_assoc(simToReco)_hit","N of associated tracks (simToReco) vs hit",nintHit,minHit,maxHit) );
299  h_assoc2hit.push_back( dbe_->book1D("num_assoc(recoToSim)_hit","N of associated (recoToSim) tracks vs hit",nintHit,minHit,maxHit) );
300  h_simulhit.push_back( dbe_->book1D("num_simul_hit","N of simulated tracks vs hit",nintHit,minHit,maxHit) );
301  //
302  h_recophi.push_back( dbe_->book1D("num_reco_phi","N of reco track vs phi",nintPhi,minPhi,maxPhi) );
303  h_assocphi.push_back( dbe_->book1D("num_assoc(simToReco)_phi","N of associated tracks (simToReco) vs phi",nintPhi,minPhi,maxPhi) );
304  h_assoc2phi.push_back( dbe_->book1D("num_assoc(recoToSim)_phi","N of associated (recoToSim) tracks vs phi",nintPhi,minPhi,maxPhi) );
305  h_simulphi.push_back( dbe_->book1D("num_simul_phi","N of simulated tracks vs phi",nintPhi,minPhi,maxPhi) );
306 
307  h_recodxy.push_back( dbe_->book1D("num_reco_dxy","N of reco track vs dxy",nintDxy,minDxy,maxDxy) );
308  h_assocdxy.push_back( dbe_->book1D("num_assoc(simToReco)_dxy","N of associated tracks (simToReco) vs dxy",nintDxy,minDxy,maxDxy) );
309  h_assoc2dxy.push_back( dbe_->book1D("num_assoc(recoToSim)_dxy","N of associated (recoToSim) tracks vs dxy",nintDxy,minDxy,maxDxy) );
310  h_simuldxy.push_back( dbe_->book1D("num_simul_dxy","N of simulated tracks vs dxy",nintDxy,minDxy,maxDxy) );
311 
312  h_recodz.push_back( dbe_->book1D("num_reco_dz","N of reco track vs dz",nintDz,minDz,maxDz) );
313  h_assocdz.push_back( dbe_->book1D("num_assoc(simToReco)_dz","N of associated tracks (simToReco) vs dz",nintDz,minDz,maxDz) );
314  h_assoc2dz.push_back( dbe_->book1D("num_assoc(recoToSim)_dz","N of associated (recoToSim) tracks vs dz",nintDz,minDz,maxDz) );
315  h_simuldz.push_back( dbe_->book1D("num_simul_dz","N of simulated tracks vs dz",nintDz,minDz,maxDz) );
316 
317  h_assocvertpos.push_back( dbe_->book1D("num_assoc(simToReco)_vertpos",
318  "N of associated tracks (simToReco) vs transverse vert position",
320  h_simulvertpos.push_back( dbe_->book1D("num_simul_vertpos","N of simulated tracks vs transverse vert position",
322 
323  h_assoczpos.push_back( dbe_->book1D("num_assoc(simToReco)_zpos","N of associated tracks (simToReco) vs z vert position",
325  h_simulzpos.push_back( dbe_->book1D("num_simul_zpos","N of simulated tracks vs z vert position",nintZpos,minZpos,maxZpos) );
326 
327 
329 
330  h_eta.push_back( dbe_->book1D("eta", "pseudorapidity residue", 1000, -0.1, 0.1 ) );
331  h_pt.push_back( dbe_->book1D("pullPt", "pull of p_{t}", 100, -10, 10 ) );
332  h_pullTheta.push_back( dbe_->book1D("pullTheta","pull of #theta parameter",250,-25,25) );
333  h_pullPhi.push_back( dbe_->book1D("pullPhi","pull of #phi parameter",250,-25,25) );
334  h_pullDxy.push_back( dbe_->book1D("pullDxy","pull of dxy parameter",250,-25,25) );
335  h_pullDz.push_back( dbe_->book1D("pullDz","pull of dz parameter",250,-25,25) );
336  h_pullQoverp.push_back( dbe_->book1D("pullQoverp","pull of qoverp parameter",250,-25,25) );
337 
338  /* TO BE FIXED -----------
339  if (associators[ww]=="TrackAssociatorByChi2"){
340  h_assochi2.push_back( dbe_->book1D("assocChi2","track association #chi^{2}",1000000,0,100000) );
341  h_assochi2_prob.push_back(dbe_->book1D("assocChi2_prob","probability of association #chi^{2}",100,0,1));
342  } else if (associators[ww]=="TrackAssociatorByHits"){
343  h_assocFraction.push_back( dbe_->book1D("assocFraction","fraction of shared hits",200,0,2) );
344  h_assocSharedHit.push_back(dbe_->book1D("assocSharedHit","number of shared hits",20,0,20));
345  }
346  */
347  h_assocFraction.push_back( dbe_->book1D("assocFraction","fraction of shared hits",200,0,2) );
348  h_assocSharedHit.push_back(dbe_->book1D("assocSharedHit","number of shared hits",20,0,20));
349  // ----------------------
350 
351  chi2_vs_nhits.push_back( dbe_->book2D("chi2_vs_nhits","#chi^{2} vs nhits",25,0,25,100,0,10) );
352 
353  etares_vs_eta.push_back( dbe_->book2D("etares_vs_eta","etaresidue vs eta",nintEta,minEta,maxEta,200,-0.1,0.1) );
354  nrec_vs_nsim.push_back( dbe_->book2D("nrec_vs_nsim","nrec vs nsim",20,-0.5,19.5,20,-0.5,19.5) );
355 
356  chi2_vs_eta.push_back( dbe_->book2D("chi2_vs_eta","chi2_vs_eta",nintEta,minEta,maxEta, 200, 0, 20 ));
357  chi2_vs_phi.push_back( dbe_->book2D("chi2_vs_phi","#chi^{2} vs #phi",nintPhi,minPhi,maxPhi, 200, 0, 20 ) );
358 
359  nhits_vs_eta.push_back( dbe_->book2D("nhits_vs_eta","nhits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
360  nPXBhits_vs_eta.push_back( dbe_->book2D("nPXBhits_vs_eta","# PXB its vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
361  nPXFhits_vs_eta.push_back( dbe_->book2D("nPXFhits_vs_eta","# PXF hits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
362  nTIBhits_vs_eta.push_back( dbe_->book2D("nTIBhits_vs_eta","# TIB hits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
363  nTIDhits_vs_eta.push_back( dbe_->book2D("nTIDhits_vs_eta","# TID hits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
364  nTOBhits_vs_eta.push_back( dbe_->book2D("nTOBhits_vs_eta","# TOB hits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
365  nTEChits_vs_eta.push_back( dbe_->book2D("nTEChits_vs_eta","# TEC hits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
366 
367  nLayersWithMeas_vs_eta.push_back( dbe_->book2D("nLayersWithMeas_vs_eta","# Layers with measurement vs eta",
369  nPXLlayersWithMeas_vs_eta.push_back( dbe_->book2D("nPXLlayersWithMeas_vs_eta","# PXL Layers with measurement vs eta",
371  nSTRIPlayersWithMeas_vs_eta.push_back( dbe_->book2D("nSTRIPlayersWithMeas_vs_eta","# STRIP Layers with measurement vs eta",
373  nSTRIPlayersWith1dMeas_vs_eta.push_back( dbe_->book2D("nSTRIPlayersWith1dMeas_vs_eta","# STRIP Layers with 1D measurement vs eta",
375  nSTRIPlayersWith2dMeas_vs_eta.push_back( dbe_->book2D("nSTRIPlayersWith2dMeas_vs_eta","# STRIP Layers with 2D measurement vs eta",
377 
378  nhits_vs_phi.push_back( dbe_->book2D("nhits_vs_phi","#hits vs #phi",nintPhi,minPhi,maxPhi,nintHit,minHit,maxHit) );
379 
380  nlosthits_vs_eta.push_back( dbe_->book2D("nlosthits_vs_eta","nlosthits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
381 
382  //resolution of track parameters
383  // dPt/Pt cotTheta Phi TIP LIP
384  // log10(pt)<0.5 100,0.1 240,0.08 100,0.015 100,0.1000 150,0.3000
385  // 0.5<log10(pt)<1.5 100,0.1 120,0.01 100,0.003 100,0.0100 150,0.0500
386  // >1.5 100,0.3 100,0.005 100,0.0008 100,0.0060 120,0.0300
387 
388  ptres_vs_eta.push_back(dbe_->book2D("ptres_vs_eta","ptres_vs_eta",
390 
391  ptres_vs_phi.push_back( dbe_->book2D("ptres_vs_phi","p_{t} res vs #phi",
393 
394  ptres_vs_pt.push_back(dbe_->book2D("ptres_vs_pt","ptres_vs_pt",nintPt,minPt,maxPt, ptRes_nbin, ptRes_rangeMin, ptRes_rangeMax));
395 
396  cotThetares_vs_eta.push_back(dbe_->book2D("cotThetares_vs_eta","cotThetares_vs_eta",
398 
399 
400  cotThetares_vs_pt.push_back(dbe_->book2D("cotThetares_vs_pt","cotThetares_vs_pt",
402 
403 
404  phires_vs_eta.push_back(dbe_->book2D("phires_vs_eta","phires_vs_eta",
406 
407  phires_vs_pt.push_back(dbe_->book2D("phires_vs_pt","phires_vs_pt",
409 
410  phires_vs_phi.push_back(dbe_->book2D("phires_vs_phi","#phi res vs #phi",
412 
413  dxyres_vs_eta.push_back(dbe_->book2D("dxyres_vs_eta","dxyres_vs_eta",
415 
416  dxyres_vs_pt.push_back( dbe_->book2D("dxyres_vs_pt","dxyres_vs_pt",
418 
419  dzres_vs_eta.push_back(dbe_->book2D("dzres_vs_eta","dzres_vs_eta",
421 
422  dzres_vs_pt.push_back(dbe_->book2D("dzres_vs_pt","dzres_vs_pt",nintPt,minPt,maxPt,dzRes_nbin, dzRes_rangeMin, dzRes_rangeMax));
423 
424  ptmean_vs_eta_phi.push_back(dbe_->bookProfile2D("ptmean_vs_eta_phi","mean p_{t} vs #eta and #phi",
425  nintPhi,minPhi,maxPhi,nintEta,minEta,maxEta,1000,0,1000));
426  phimean_vs_eta_phi.push_back(dbe_->bookProfile2D("phimean_vs_eta_phi","mean #phi vs #eta and #phi",
428 
429  //pulls of track params vs eta: to be used with fitslicesytool
430  dxypull_vs_eta.push_back(dbe_->book2D("dxypull_vs_eta","dxypull_vs_eta",nintEta,minEta,maxEta,100,-10,10));
431  ptpull_vs_eta.push_back(dbe_->book2D("ptpull_vs_eta","ptpull_vs_eta",nintEta,minEta,maxEta,100,-10,10));
432  dzpull_vs_eta.push_back(dbe_->book2D("dzpull_vs_eta","dzpull_vs_eta",nintEta,minEta,maxEta,100,-10,10));
433  phipull_vs_eta.push_back(dbe_->book2D("phipull_vs_eta","phipull_vs_eta",nintEta,minEta,maxEta,100,-10,10));
434  thetapull_vs_eta.push_back(dbe_->book2D("thetapull_vs_eta","thetapull_vs_eta",nintEta,minEta,maxEta,100,-10,10));
435 
436  // h_ptshiftetamean.push_back( dbe_->book1D("h_ptshifteta_Mean","<#deltapT/pT>[%] vs #eta",nintEta,minEta,maxEta) );
437 
438 
439  //pulls of track params vs phi
440  ptpull_vs_phi.push_back(dbe_->book2D("ptpull_vs_phi","p_{t} pull vs #phi",nintPhi,minPhi,maxPhi,100,-10,10));
441  phipull_vs_phi.push_back(dbe_->book2D("phipull_vs_phi","#phi pull vs #phi",nintPhi,minPhi,maxPhi,100,-10,10));
442  thetapull_vs_phi.push_back(dbe_->book2D("thetapull_vs_phi","#theta pull vs #phi",nintPhi,minPhi,maxPhi,100,-10,10));
443 
444 
445  nrecHit_vs_nsimHit_sim2rec.push_back( dbe_->book2D("nrecHit_vs_nsimHit_sim2rec","nrecHit vs nsimHit (Sim2RecAssoc)",
447  nrecHit_vs_nsimHit_rec2sim.push_back( dbe_->book2D("nrecHit_vs_nsimHit_rec2sim","nrecHit vs nsimHit (Rec2simAssoc)",
449 
450  // dE/dx stuff
451  // FIXME: it would be nice to have an array
452  h_dedx_estim1.push_back( dbe_->book1D("h_dedx_estim1","dE/dx estimator 1",nintDeDx,minDeDx,maxDeDx) );
453  h_dedx_estim2.push_back( dbe_->book1D("h_dedx_estim2","dE/dx estimator 2",nintDeDx,minDeDx,maxDeDx) );
454  h_dedx_nom1.push_back( dbe_->book1D("h_dedx_nom1","dE/dx number of measurements",nintHit,minHit,maxHit) );
455  h_dedx_nom2.push_back( dbe_->book1D("h_dedx_nom2","dE/dx number of measurements",nintHit,minHit,maxHit) );
456  h_dedx_sat1.push_back( dbe_->book1D("h_dedx_sat1","dE/dx number of measurements with saturation",nintHit,minHit,maxHit) );
457  h_dedx_sat2.push_back( dbe_->book1D("h_dedx_sat2","dE/dx number of measurements with saturation",nintHit,minHit,maxHit) );
458 
459 
460  if(useLogPt){
461  BinLogX(dzres_vs_pt.back()->getTH2F());
462  BinLogX(dxyres_vs_pt.back()->getTH2F());
463  BinLogX(phires_vs_pt.back()->getTH2F());
464  BinLogX(cotThetares_vs_pt.back()->getTH2F());
465  BinLogX(ptres_vs_pt.back()->getTH2F());
466  BinLogX(h_recopT.back()->getTH1F());
467  BinLogX(h_assocpT.back()->getTH1F());
468  BinLogX(h_assoc2pT.back()->getTH1F());
469  BinLogX(h_simulpT.back()->getTH1F());
470  }
471 }
472 
474  h_effic.push_back( dbe_->book1D("effic","efficiency vs #eta",nintEta,minEta,maxEta) );
475  h_efficPt.push_back( dbe_->book1D("efficPt","efficiency vs pT",nintPt,minPt,maxPt) );
476  h_effic_vs_hit.push_back( dbe_->book1D("effic_vs_hit","effic vs hit",nintHit,minHit,maxHit) );
477  h_effic_vs_phi.push_back( dbe_->book1D("effic_vs_phi","effic vs phi",nintPhi,minPhi,maxPhi) );
478  h_effic_vs_dxy.push_back( dbe_->book1D("effic_vs_dxy","effic vs dxy",nintDxy,minDxy,maxDxy) );
479  h_effic_vs_dz.push_back( dbe_->book1D("effic_vs_dz","effic vs dz",nintDz,minDz,maxDz) );
480  h_effic_vs_vertpos.push_back( dbe_->book1D("effic_vs_vertpos","effic vs vertpos",nintVertpos,minVertpos,maxVertpos) );
481  h_effic_vs_zpos.push_back( dbe_->book1D("effic_vs_zpos","effic vs zpos",nintZpos,minZpos,maxZpos) );
482 
483  h_fakerate.push_back( dbe_->book1D("fakerate","fake rate vs #eta",nintEta,minEta,maxEta) );
484  h_fakeratePt.push_back( dbe_->book1D("fakeratePt","fake rate vs pT",nintPt,minPt,maxPt) );
485  h_fake_vs_hit.push_back( dbe_->book1D("fakerate_vs_hit","fake rate vs hit",nintHit,minHit,maxHit) );
486  h_fake_vs_phi.push_back( dbe_->book1D("fakerate_vs_phi","fake vs phi",nintPhi,minPhi,maxPhi) );
487  h_fake_vs_dxy.push_back( dbe_->book1D("fakerate_vs_dxy","fake rate vs dxy",nintDxy,minDxy,maxDxy) );
488  h_fake_vs_dz.push_back( dbe_->book1D("fakerate_vs_dz","fake vs dz",nintDz,minDz,maxDz) );
489 
490  h_chi2meanhitsh.push_back( dbe_->bookProfile("chi2mean_vs_nhits","mean #chi^{2} vs nhits",25,0,25,100,0,10) );
491  h_chi2meanh.push_back( dbe_->bookProfile("chi2mean","mean #chi^{2} vs #eta",nintEta,minEta,maxEta, 200, 0, 20) );
492  h_chi2mean_vs_phi.push_back( dbe_->bookProfile("chi2mean_vs_phi","mean of #chi^{2} vs #phi",nintPhi,minPhi,maxPhi, 200, 0, 20) );
493 
494  h_hits_eta.push_back( dbe_->bookProfile("hits_eta","mean #hits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
495  h_PXBhits_eta.push_back( dbe_->bookProfile("PXBhits_eta","mean # PXB hits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
496  h_PXFhits_eta.push_back( dbe_->bookProfile("PXFhits_eta","mean # PXF hits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
497  h_TIBhits_eta.push_back( dbe_->bookProfile("TIBhits_eta","mean # TIB hits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
498  h_TIDhits_eta.push_back( dbe_->bookProfile("TIDhits_eta","mean # TID hits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
499  h_TOBhits_eta.push_back( dbe_->bookProfile("TOBhits_eta","mean # TOB hits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
500  h_TEChits_eta.push_back( dbe_->bookProfile("TEChits_eta","mean # TEC hits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
501 
502  h_LayersWithMeas_eta.push_back(dbe_->bookProfile("LayersWithMeas_eta","mean # LayersWithMeas vs eta",
504  h_PXLlayersWithMeas_eta.push_back(dbe_->bookProfile("PXLlayersWith2dMeas_eta","mean # PXLlayersWithMeas vs eta",
506  h_STRIPlayersWithMeas_eta.push_back(dbe_->bookProfile("STRIPlayersWithMeas_eta","mean # STRIPlayersWithMeas vs eta",
508  h_STRIPlayersWith1dMeas_eta.push_back(dbe_->bookProfile("STRIPlayersWith1dMeas_eta","mean # STRIPlayersWith1dMeas vs eta",
510  h_STRIPlayersWith2dMeas_eta.push_back(dbe_->bookProfile("STRIPlayersWith2dMeas_eta","mean # STRIPlayersWith2dMeas vs eta",
512  h_hits_phi.push_back( dbe_->bookProfile("hits_phi","mean #hits vs #phi",nintPhi,minPhi,maxPhi, nintHit,minHit,maxHit) );
513  h_losthits_eta.push_back( dbe_->bookProfile("losthits_eta","losthits_eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit) );
514 
515  h_ptrmsh.push_back( dbe_->book1D("ptres_vs_eta_Sigma","#sigma(#deltap_{t}/p_{t}) vs #eta",nintEta,minEta,maxEta) );
516  h_ptmeanhPhi.push_back( dbe_->book1D("ptres_vs_phi_Mean","mean of p_{t} resolution vs #phi",nintPhi,minPhi,maxPhi));
517  h_ptrmshPhi.push_back( dbe_->book1D("ptres_vs_phi_Sigma","#sigma(#deltap_{t}/p_{t}) vs #phi",nintPhi,minPhi,maxPhi) );
518  h_ptmeanhPt.push_back( dbe_->book1D("ptres_vs_pt_Mean","mean of p_{t} resolution vs p_{t}",nintPt,minPt,maxPt));
519  h_ptrmshPt.push_back( dbe_->book1D("ptres_vs_pt_Sigma","#sigma(#deltap_{t}/p_{t}) vs pT",nintPt,minPt,maxPt) );
520  h_cotThetameanh.push_back( dbe_->book1D("cotThetares_vs_eta_Mean","#sigma(cot(#theta)) vs #eta Mean",nintEta,minEta,maxEta) );
521  h_cotThetarmsh.push_back( dbe_->book1D("cotThetares_vs_eta_Sigma","#sigma(cot(#theta)) vs #eta Sigma",nintEta,minEta,maxEta) );
522  h_cotThetameanhPt.push_back( dbe_->book1D("cotThetares_vs_pt_Mean","#sigma(cot(#theta)) vs pT Mean",nintPt,minPt,maxPt) );
523  h_cotThetarmshPt.push_back( dbe_->book1D("cotThetares_vs_pt_Sigma","#sigma(cot(#theta)) vs pT Sigma",nintPt,minPt,maxPt) );
524  h_phimeanh.push_back(dbe_->book1D("phires_vs_eta_Mean","mean of #phi res vs #eta",nintEta,minEta,maxEta));
525  h_phirmsh.push_back( dbe_->book1D("phires_vs_eta_Sigma","#sigma(#delta#phi) vs #eta",nintEta,minEta,maxEta) );
526  h_phimeanhPt.push_back(dbe_->book1D("phires_vs_pt_Mean","mean of #phi res vs pT",nintPt,minPt,maxPt));
527  h_phirmshPt.push_back( dbe_->book1D("phires_vs_pt_Sigma","#sigma(#delta#phi) vs pT",nintPt,minPt,maxPt) );
528  h_phimeanhPhi.push_back(dbe_->book1D("phires_vs_phi_Mean","mean of #phi res vs #phi",nintPhi,minPhi,maxPhi));
529  h_phirmshPhi.push_back( dbe_->book1D("phires_vs_phi_Sigma","#sigma(#delta#phi) vs #phi",nintPhi,minPhi,maxPhi) );
530  h_dxymeanh.push_back( dbe_->book1D("dxyres_vs_eta_Mean","mean of dxyres vs #eta",nintEta,minEta,maxEta) );
531  h_dxyrmsh.push_back( dbe_->book1D("dxyres_vs_eta_Sigma","#sigma(#deltadxy) vs #eta",nintEta,minEta,maxEta) );
532  h_dxymeanhPt.push_back( dbe_->book1D("dxyres_vs_pt_Mean","mean of dxyres vs pT",nintPt,minPt,maxPt) );
533  h_dxyrmshPt.push_back( dbe_->book1D("dxyres_vs_pt_Sigma","#sigmadxy vs pT",nintPt,minPt,maxPt) );
534  h_dzmeanh.push_back( dbe_->book1D("dzres_vs_eta_Mean","mean of dzres vs #eta",nintEta,minEta,maxEta) );
535  h_dzrmsh.push_back( dbe_->book1D("dzres_vs_eta_Sigma","#sigma(#deltadz) vs #eta",nintEta,minEta,maxEta) );
536  h_dzmeanhPt.push_back( dbe_->book1D("dzres_vs_pt_Mean","mean of dzres vs pT",nintPt,minPt,maxPt) );
537  h_dzrmshPt.push_back( dbe_->book1D("dzres_vs_pt_Sigma","#sigma(#deltadz vs pT",nintPt,minPt,maxPt) );
538  h_dxypulletamean.push_back( dbe_->book1D("h_dxypulleta_Mean","mean of dxy pull vs #eta",nintEta,minEta,maxEta) );
539  h_ptpulletamean.push_back( dbe_->book1D("h_ptpulleta_Mean","mean of p_{t} pull vs #eta",nintEta,minEta,maxEta) );
540  h_dzpulletamean.push_back( dbe_->book1D("h_dzpulleta_Mean","mean of dz pull vs #eta",nintEta,minEta,maxEta) );
541  h_phipulletamean.push_back( dbe_->book1D("h_phipulleta_Mean","mean of #phi pull vs #eta",nintEta,minEta,maxEta) );
542  h_thetapulletamean.push_back( dbe_->book1D("h_thetapulleta_Mean","mean of #theta pull vs #eta",nintEta,minEta,maxEta) );
543  h_dxypulleta.push_back( dbe_->book1D("h_dxypulleta_Sigma","#sigma of dxy pull vs #eta",nintEta,minEta,maxEta) );
544  h_ptpulleta.push_back( dbe_->book1D("h_ptpulleta_Sigma","#sigma of p_{t} pull vs #eta",nintEta,minEta,maxEta) );
545  h_dzpulleta.push_back( dbe_->book1D("h_dzpulleta_Sigma","#sigma of dz pull vs #eta",nintEta,minEta,maxEta) );
546  h_phipulleta.push_back( dbe_->book1D("h_phipulleta_Sigma","#sigma of #phi pull vs #eta",nintEta,minEta,maxEta) );
547  h_thetapulleta.push_back( dbe_->book1D("h_thetapulleta_Sigma","#sigma of #theta pull vs #eta",nintEta,minEta,maxEta) );
548  h_ptshifteta.push_back( dbe_->book1D("ptres_vs_eta_Mean","<#deltapT/pT>[%] vs #eta",nintEta,minEta,maxEta) );
549  h_ptpullphimean.push_back( dbe_->book1D("h_ptpullphi_Mean","mean of p_{t} pull vs #phi",nintPhi,minPhi,maxPhi) );
550  h_phipullphimean.push_back( dbe_->book1D("h_phipullphi_Mean","mean of #phi pull vs #phi",nintPhi,minPhi,maxPhi) );
551  h_thetapullphimean.push_back( dbe_->book1D("h_thetapullphi_Mean","mean of #theta pull vs #phi",nintPhi,minPhi,maxPhi) );
552  h_ptpullphi.push_back( dbe_->book1D("h_ptpullphi_Sigma","#sigma of p_{t} pull vs #phi",nintPhi,minPhi,maxPhi) );
553  h_phipullphi.push_back( dbe_->book1D("h_phipullphi_Sigma","#sigma of #phi pull vs #phi",nintPhi,minPhi,maxPhi) );
554  h_thetapullphi.push_back( dbe_->book1D("h_thetapullphi_Sigma","#sigma of #theta pull vs #phi",nintPhi,minPhi,maxPhi) );
555 
556  if(useLogPt){
557  BinLogX(h_dzmeanhPt.back()->getTH1F());
558  BinLogX(h_dzrmshPt.back()->getTH1F());
559  BinLogX(h_dxymeanhPt.back()->getTH1F());
560  BinLogX(h_dxyrmshPt.back()->getTH1F());
561  BinLogX(h_phimeanhPt.back()->getTH1F());
562  BinLogX(h_phirmshPt.back()->getTH1F());
563  BinLogX(h_cotThetameanhPt.back()->getTH1F());
564  BinLogX(h_cotThetarmshPt.back()->getTH1F());
565  BinLogX(h_ptmeanhPt.back()->getTH1F());
566  BinLogX(h_ptrmshPt.back()->getTH1F());
567  BinLogX(h_efficPt.back()->getTH1F());
568  BinLogX(h_fakeratePt.back()->getTH1F());
569  }
570 }
571 
573  ParticleBase::Vector momentumTP,
574  ParticleBase::Point vertexTP){
575  h_ptSIM[count]->Fill(sqrt(momentumTP.perp2()));
576  h_etaSIM[count]->Fill(momentumTP.eta());
577  h_vertposSIM[count]->Fill(sqrt(vertexTP.perp2()));
578 }
579 
580 
581 
582 // TO BE FIXED USING PLAIN HISTOGRAMS INSTEAD OF RE-IMPLEMENTATION OF HISTOGRAMS (i.d. vectors<int/double>)
584  const TrackingParticle& tp,
585  ParticleBase::Vector momentumTP,
586  ParticleBase::Point vertexTP,
587  double dxySim, double dzSim, int nSimHits,
588  const reco::Track* track){
589  bool isMatched = track;
590 
591  if((*TpSelectorForEfficiencyVsEta)(tp)){
592  //effic vs hits
593  int nSimHitsInBounds = std::min((int)nSimHits,int(maxHit-1));
594  totSIM_hit[count][nSimHitsInBounds]++;
595  if(isMatched) {
596  totASS_hit[count][nSimHitsInBounds]++;
597  nrecHit_vs_nsimHit_sim2rec[count]->Fill( track->numberOfValidHits(),nSimHits);
598  }
599 
600  //effic vs eta
601  for (unsigned int f=0; f<etaintervals[count].size()-1; f++){
602  if (getEta(momentumTP.eta())>etaintervals[count][f]&&
603  getEta(momentumTP.eta())<etaintervals[count][f+1]) {
604  totSIMeta[count][f]++;
605  if (isMatched) {
606  totASSeta[count][f]++;
607  }
608  }
609  } // END for (unsigned int f=0; f<etaintervals[w].size()-1; f++){
610  }
611 
612  if((*TpSelectorForEfficiencyVsPhi)(tp)){
613  for (unsigned int f=0; f<phiintervals[count].size()-1; f++){
614  if (momentumTP.phi() > phiintervals[count][f]&&
615  momentumTP.phi() <phiintervals[count][f+1]) {
616  totSIM_phi[count][f]++;
617  if (isMatched) {
618  totASS_phi[count][f]++;
619  }
620  }
621  } // END for (unsigned int f=0; f<phiintervals[count].size()-1; f++){
622  }
623 
624  if((*TpSelectorForEfficiencyVsPt)(tp)){
625  for (unsigned int f=0; f<pTintervals[count].size()-1; f++){
626  if (getPt(sqrt(momentumTP.perp2()))>pTintervals[count][f]&&
627  getPt(sqrt(momentumTP.perp2()))<pTintervals[count][f+1]) {
628  totSIMpT[count][f]++;
629  if (isMatched) {
630  totASSpT[count][f]++;
631  }
632  }
633  } // END for (unsigned int f=0; f<pTintervals[count].size()-1; f++){
634  }
635 
637  for (unsigned int f=0; f<dxyintervals[count].size()-1; f++){
638  if (dxySim>dxyintervals[count][f]&&
639  dxySim<dxyintervals[count][f+1]) {
640  totSIM_dxy[count][f]++;
641  if (isMatched) {
642  totASS_dxy[count][f]++;
643  }
644  }
645  } // END for (unsigned int f=0; f<dxyintervals[count].size()-1; f++){
646 
647  for (unsigned int f=0; f<vertposintervals[count].size()-1; f++){
648  if (sqrt(vertexTP.perp2())>vertposintervals[count][f]&&
649  sqrt(vertexTP.perp2())<vertposintervals[count][f+1]) {
650  totSIM_vertpos[count][f]++;
651  if (isMatched) {
652  totASS_vertpos[count][f]++;
653  }
654  }
655  } // END for (unsigned int f=0; f<vertposintervals[count].size()-1; f++){
656  }
657 
659  for (unsigned int f=0; f<dzintervals[count].size()-1; f++){
660  if (dzSim>dzintervals[count][f]&&
661  dzSim<dzintervals[count][f+1]) {
662  totSIM_dz[count][f]++;
663  if (isMatched) {
664  totASS_dz[count][f]++;
665  }
666  }
667  } // END for (unsigned int f=0; f<dzintervals[count].size()-1; f++){
668 
669 
670  for (unsigned int f=0; f<zposintervals[count].size()-1; f++){
671  if (vertexTP.z()>zposintervals[count][f]&&
672  vertexTP.z()<zposintervals[count][f+1]) {
673  totSIM_zpos[count][f]++;
674  if (isMatched) {
675  totASS_zpos[count][f]++;
676  }
677  }
678  } // END for (unsigned int f=0; f<zposintervals[count].size()-1; f++){
679  }
680 
681 }
682 
683 // dE/dx
685 //void MTVHistoProducerAlgoForTracker::fill_dedx_recoTrack_histos(reco::TrackRef trackref, std::vector< edm::ValueMap<reco::DeDxData> > v_dEdx) {
686  double dedx;
687  int nom;
688  int sat;
690  for (unsigned int i=0; i<v_dEdx.size(); i++) {
691  dEdxTrack = v_dEdx.at(i);
692  dedx = dEdxTrack[trackref].dEdx();
693  nom = dEdxTrack[trackref].numberOfMeasurements();
694  sat = dEdxTrack[trackref].numberOfSaturatedMeasurements();
695  if (i==0) {
696  h_dedx_estim1[count]->Fill(dedx);
697  h_dedx_nom1[count]->Fill(nom);
698  h_dedx_sat1[count]->Fill(sat);
699  } else if (i==1) {
700  h_dedx_estim2[count]->Fill(dedx);
701  h_dedx_nom2[count]->Fill(nom);
702  h_dedx_sat2[count]->Fill(sat);
703  }
704  }
705 }
706 
707 
708 // TO BE FIXED USING PLAIN HISTOGRAMS INSTEAD OF RE-IMPLEMENTATION OF HISTOGRAMS (i.d. vectors<int/double>)
710  const reco::Track& track,
711  math::XYZPoint bsPosition,
712  bool isMatched){
713 
714  //Compute fake rate vs eta
715  for (unsigned int f=0; f<etaintervals[count].size()-1; f++){
716  if (getEta(track.momentum().eta())>etaintervals[count][f]&&
717  getEta(track.momentum().eta())<etaintervals[count][f+1]) {
718  totRECeta[count][f]++;
719  if (isMatched) {
720  totASS2eta[count][f]++;
721  }
722  }
723  } // End for (unsigned int f=0; f<etaintervals[count].size()-1; f++){
724 
725  for (unsigned int f=0; f<phiintervals[count].size()-1; f++){
726  if (track.momentum().phi()>phiintervals[count][f]&&
727  track.momentum().phi()<phiintervals[count][f+1]) {
728  totREC_phi[count][f]++;
729  if (isMatched) {
730  totASS2_phi[count][f]++;
731  }
732  }
733  } // End for (unsigned int f=0; f<phiintervals[count].size()-1; f++){
734 
735 
736  for (unsigned int f=0; f<pTintervals[count].size()-1; f++){
737  if (getPt(sqrt(track.momentum().perp2()))>pTintervals[count][f]&&
738  getPt(sqrt(track.momentum().perp2()))<pTintervals[count][f+1]) {
739  totRECpT[count][f]++;
740  if (isMatched) {
741  totASS2pT[count][f]++;
742  }
743  }
744  } // End for (unsigned int f=0; f<pTintervals[count].size()-1; f++){
745 
746  for (unsigned int f=0; f<dxyintervals[count].size()-1; f++){
747  if (track.dxy(bsPosition)>dxyintervals[count][f]&&
748  track.dxy(bsPosition)<dxyintervals[count][f+1]) {
749  totREC_dxy[count][f]++;
750  if (isMatched) {
751  totASS2_dxy[count][f]++;
752  }
753  }
754  } // End for (unsigned int f=0; f<dxyintervals[count].size()-1; f++){
755 
756  for (unsigned int f=0; f<dzintervals[count].size()-1; f++){
757  if (track.dz(bsPosition)>dzintervals[count][f]&&
758  track.dz(bsPosition)<dzintervals[count][f+1]) {
759  totREC_dz[count][f]++;
760  if (isMatched) {
761  totASS2_dz[count][f]++;
762  }
763  }
764  } // End for (unsigned int f=0; f<dzintervals[count].size()-1; f++){
765 
766  int tmp = std::min((int)track.found(),int(maxHit-1));
767  totREC_hit[count][tmp]++;
768  if (isMatched) totASS2_hit[count][tmp]++;
769 
770 }
771 
772 
774  const reco::Track& track){
775  //nchi2 and hits global distributions
776  h_nchi2[count]->Fill(track.normalizedChi2());
777  h_nchi2_prob[count]->Fill(TMath::Prob(track.chi2(),(int)track.ndof()));
778  h_hits[count]->Fill(track.numberOfValidHits());
779  h_losthits[count]->Fill(track.numberOfLostHits());
780  chi2_vs_nhits[count]->Fill(track.numberOfValidHits(),track.normalizedChi2());
781  h_charge[count]->Fill( track.charge() );
782 
783  //chi2 and #hit vs eta: fill 2D histos
784  chi2_vs_eta[count]->Fill(getEta(track.eta()),track.normalizedChi2());
785  nhits_vs_eta[count]->Fill(getEta(track.eta()),track.numberOfValidHits());
794  int LayersAll = track.hitPattern().stripLayersWithMeasurement();
795  int Layers2D = track.hitPattern().numberOfValidStripLayersWithMonoAndStereo();
796  int Layers1D = LayersAll - Layers2D;
797  nSTRIPlayersWithMeas_vs_eta[count]->Fill(getEta(track.eta()),LayersAll);
798  nSTRIPlayersWith1dMeas_vs_eta[count]->Fill(getEta(track.eta()),Layers1D);
799  nSTRIPlayersWith2dMeas_vs_eta[count]->Fill(getEta(track.eta()),Layers2D);
800 
801  nlosthits_vs_eta[count]->Fill(getEta(track.eta()),track.numberOfLostHits());
802 }
803 
804 
805 
807  ParticleBase::Vector momentumTP,
808  ParticleBase::Point vertexTP,
809  int chargeTP,
810  const reco::Track& track,
811  math::XYZPoint bsPosition){
812 
813  // evaluation of TP parameters
814  double qoverpSim = chargeTP/sqrt(momentumTP.x()*momentumTP.x()+momentumTP.y()*momentumTP.y()+momentumTP.z()*momentumTP.z());
815  double lambdaSim = M_PI/2-momentumTP.theta();
816  double phiSim = momentumTP.phi();
817  double dxySim = (-vertexTP.x()*sin(momentumTP.phi())+vertexTP.y()*cos(momentumTP.phi()));
818  double dzSim = vertexTP.z() - (vertexTP.x()*momentumTP.x()+vertexTP.y()*momentumTP.y())/sqrt(momentumTP.perp2())
819  * momentumTP.z()/sqrt(momentumTP.perp2());
820 
821 
822  reco::Track::ParameterVector rParameters = track.parameters();
823 
824  double qoverpRec(0);
825  double qoverpErrorRec(0);
826  double ptRec(0);
827  double ptErrorRec(0);
828  double lambdaRec(0);
829  double lambdaErrorRec(0);
830  double phiRec(0);
831  double phiErrorRec(0);
832 
833  /* TO BE FIXED LATER -----------
834  //loop to decide whether to take gsfTrack (utilisation of mode-function) or common track
835  const GsfTrack* gsfTrack(0);
836  if(useGsf){
837  gsfTrack = dynamic_cast<const GsfTrack*>(&(*track));
838  if (gsfTrack==0) edm::LogInfo("TrackValidator") << "Trying to access mode for a non-GsfTrack";
839  }
840 
841  if (gsfTrack) {
842  // get values from mode
843  getRecoMomentum(*gsfTrack, ptRec, ptErrorRec, qoverpRec, qoverpErrorRec,
844  lambdaRec,lambdaErrorRec, phiRec, phiErrorRec);
845  }
846 
847  else {
848  // get values from track (without mode)
849  getRecoMomentum(*track, ptRec, ptErrorRec, qoverpRec, qoverpErrorRec,
850  lambdaRec,lambdaErrorRec, phiRec, phiErrorRec);
851  }
852  */
853  getRecoMomentum(track, ptRec, ptErrorRec, qoverpRec, qoverpErrorRec,
854  lambdaRec,lambdaErrorRec, phiRec, phiErrorRec);
855  // -------------
856 
857  double ptError = ptErrorRec;
858  double ptres=ptRec-sqrt(momentumTP.perp2());
859  double etares=track.eta()-momentumTP.Eta();
860 
861 
862  double dxyRec = track.dxy(bsPosition);
863  double dzRec = track.dz(bsPosition);
864 
865  // eta residue; pt, k, theta, phi, dxy, dz pulls
866  double qoverpPull=(qoverpRec-qoverpSim)/qoverpErrorRec;
867  double thetaPull=(lambdaRec-lambdaSim)/lambdaErrorRec;
868  double phiPull=(phiRec-phiSim)/phiErrorRec;
869  double dxyPull=(dxyRec-dxySim)/track.dxyError();
870  double dzPull=(dzRec-dzSim)/track.dzError();
871 
872  double contrib_Qoverp = ((qoverpRec-qoverpSim)/qoverpErrorRec)*
873  ((qoverpRec-qoverpSim)/qoverpErrorRec)/5;
874  double contrib_dxy = ((dxyRec-dxySim)/track.dxyError())*((dxyRec-dxySim)/track.dxyError())/5;
875  double contrib_dz = ((dzRec-dzSim)/track.dzError())*((dzRec-dzSim)/track.dzError())/5;
876  double contrib_theta = ((lambdaRec-lambdaSim)/lambdaErrorRec)*
877  ((lambdaRec-lambdaSim)/lambdaErrorRec)/5;
878  double contrib_phi = ((phiRec-phiSim)/phiErrorRec)*
879  ((phiRec-phiSim)/phiErrorRec)/5;
880 
881  LogTrace("TrackValidatorTEST")
882  //<< "assocChi2=" << tp.begin()->second << "\n"
883  << "" << "\n"
884  << "ptREC=" << ptRec << "\n" << "etaREC=" << track.eta() << "\n" << "qoverpREC=" << qoverpRec << "\n"
885  << "dxyREC=" << dxyRec << "\n" << "dzREC=" << dzRec << "\n"
886  << "thetaREC=" << track.theta() << "\n" << "phiREC=" << phiRec << "\n"
887  << "" << "\n"
888  << "qoverpError()=" << qoverpErrorRec << "\n" << "dxyError()=" << track.dxyError() << "\n"<< "dzError()="
889  << track.dzError() << "\n"
890  << "thetaError()=" << lambdaErrorRec << "\n" << "phiError()=" << phiErrorRec << "\n"
891  << "" << "\n"
892  << "ptSIM=" << sqrt(momentumTP.perp2()) << "\n"<< "etaSIM=" << momentumTP.Eta() << "\n"<< "qoverpSIM=" << qoverpSim << "\n"
893  << "dxySIM=" << dxySim << "\n"<< "dzSIM=" << dzSim << "\n" << "thetaSIM=" << M_PI/2-lambdaSim << "\n"
894  << "phiSIM=" << phiSim << "\n"
895  << "" << "\n"
896  << "contrib_Qoverp=" << contrib_Qoverp << "\n"<< "contrib_dxy=" << contrib_dxy << "\n"<< "contrib_dz=" << contrib_dz << "\n"
897  << "contrib_theta=" << contrib_theta << "\n"<< "contrib_phi=" << contrib_phi << "\n"
898  << "" << "\n"
899  <<"chi2PULL="<<contrib_Qoverp+contrib_dxy+contrib_dz+contrib_theta+contrib_phi<<"\n";
900 
901  h_pullQoverp[count]->Fill(qoverpPull);
902  h_pullTheta[count]->Fill(thetaPull);
903  h_pullPhi[count]->Fill(phiPull);
904  h_pullDxy[count]->Fill(dxyPull);
905  h_pullDz[count]->Fill(dzPull);
906 
907 
908  h_pt[count]->Fill(ptres/ptError);
909  h_eta[count]->Fill(etares);
910  etares_vs_eta[count]->Fill(getEta(track.eta()),etares);
911 
912 
913 
914  //resolution of track params: fill 2D histos
915  dxyres_vs_eta[count]->Fill(getEta(track.eta()),dxyRec-dxySim);
916  ptres_vs_eta[count]->Fill(getEta(track.eta()),(ptRec-sqrt(momentumTP.perp2()))/ptRec);
917  dzres_vs_eta[count]->Fill(getEta(track.eta()),dzRec-dzSim);
918  phires_vs_eta[count]->Fill(getEta(track.eta()),phiRec-phiSim);
919  cotThetares_vs_eta[count]->Fill(getEta(track.eta()),1/tan(M_PI*0.5-lambdaRec)-1/tan(M_PI*0.5-lambdaSim));
920 
921  //same as before but vs pT
922  dxyres_vs_pt[count]->Fill(getPt(ptRec),dxyRec-dxySim);
923  ptres_vs_pt[count]->Fill(getPt(ptRec),(ptRec-sqrt(momentumTP.perp2()))/ptRec);
924  dzres_vs_pt[count]->Fill(getPt(ptRec),dzRec-dzSim);
925  phires_vs_pt[count]->Fill(getPt(ptRec),phiRec-phiSim);
926  cotThetares_vs_pt[count]->Fill(getPt(ptRec),1/tan(M_PI*0.5-lambdaRec)-1/tan(M_PI*0.5-lambdaSim));
927 
928  //pulls of track params vs eta: fill 2D histos
929  dxypull_vs_eta[count]->Fill(getEta(track.eta()),dxyPull);
930  ptpull_vs_eta[count]->Fill(getEta(track.eta()),ptres/ptError);
931  dzpull_vs_eta[count]->Fill(getEta(track.eta()),dzPull);
932  phipull_vs_eta[count]->Fill(getEta(track.eta()),phiPull);
933  thetapull_vs_eta[count]->Fill(getEta(track.eta()),thetaPull);
934 
935  //plots vs phi
936  nhits_vs_phi[count]->Fill(phiRec,track.numberOfValidHits());
937  chi2_vs_phi[count]->Fill(phiRec,track.normalizedChi2());
938  ptmean_vs_eta_phi[count]->Fill(phiRec,getEta(track.eta()),ptRec);
939  phimean_vs_eta_phi[count]->Fill(phiRec,getEta(track.eta()),phiRec);
940  ptres_vs_phi[count]->Fill(phiRec,(ptRec-sqrt(momentumTP.perp2()))/ptRec);
941  phires_vs_phi[count]->Fill(phiRec,phiRec-phiSim);
942  ptpull_vs_phi[count]->Fill(phiRec,ptres/ptError);
943  phipull_vs_phi[count]->Fill(phiRec,phiPull);
944  thetapull_vs_phi[count]->Fill(phiRec,thetaPull);
945 
946 
947 }
948 
949 
950 
951 void
952 MTVHistoProducerAlgoForTracker::getRecoMomentum (const reco::Track& track, double& pt, double& ptError,
953  double& qoverp, double& qoverpError, double& lambda,double& lambdaError,
954  double& phi, double& phiError ) const {
955  pt = track.pt();
956  ptError = track.ptError();
957  qoverp = track.qoverp();
958  qoverpError = track.qoverpError();
959  lambda = track.lambda();
960  lambdaError = track.lambdaError();
961  phi = track.phi();
962  phiError = track.phiError();
963  // cout <<"test1" << endl;
964 
965 
966 
967 }
968 
969 void
970 MTVHistoProducerAlgoForTracker::getRecoMomentum (const reco::GsfTrack& gsfTrack, double& pt, double& ptError,
971  double& qoverp, double& qoverpError, double& lambda,double& lambdaError,
972  double& phi, double& phiError ) const {
973 
974  pt = gsfTrack.ptMode();
975  ptError = gsfTrack.ptModeError();
976  qoverp = gsfTrack.qoverpMode();
977  qoverpError = gsfTrack.qoverpModeError();
978  lambda = gsfTrack.lambdaMode();
979  lambdaError = gsfTrack.lambdaModeError();
980  phi = gsfTrack.phiMode();
981  phiError = gsfTrack.phiModeError();
982  // cout <<"test2" << endl;
983 
984 }
985 
986 double
988  if (useFabsEta) return fabs(eta);
989  else return eta;
990 }
991 
992 double
994  if (useInvPt && pt!=0) return 1/pt;
995  else return pt;
996 }
997 
998 
1000  //resolution of track params: get sigma from 2D histos
1001  FitSlicesYTool fsyt_dxy(dxyres_vs_eta[counter]);
1002  fsyt_dxy.getFittedSigmaWithError(h_dxyrmsh[counter]);
1003  fsyt_dxy.getFittedMeanWithError(h_dxymeanh[counter]);
1004  FitSlicesYTool fsyt_dxyPt(dxyres_vs_pt[counter]);
1005  fsyt_dxyPt.getFittedSigmaWithError(h_dxyrmshPt[counter]);
1006  fsyt_dxyPt.getFittedMeanWithError(h_dxymeanhPt[counter]);
1007  FitSlicesYTool fsyt_pt(ptres_vs_eta[counter]);
1008  fsyt_pt.getFittedSigmaWithError(h_ptrmsh[counter]);
1009  fsyt_pt.getFittedMeanWithError(h_ptshifteta[counter]);
1010  FitSlicesYTool fsyt_ptPt(ptres_vs_pt[counter]);
1011  fsyt_ptPt.getFittedSigmaWithError(h_ptrmshPt[counter]);
1012  fsyt_ptPt.getFittedMeanWithError(h_ptmeanhPt[counter]);
1013  FitSlicesYTool fsyt_ptPhi(ptres_vs_phi[counter]);
1014  fsyt_ptPhi.getFittedSigmaWithError(h_ptrmshPhi[counter]);
1015  fsyt_ptPhi.getFittedMeanWithError(h_ptmeanhPhi[counter]);
1016  FitSlicesYTool fsyt_dz(dzres_vs_eta[counter]);
1017  fsyt_dz.getFittedSigmaWithError(h_dzrmsh[counter]);
1018  fsyt_dz.getFittedMeanWithError(h_dzmeanh[counter]);
1019  FitSlicesYTool fsyt_dzPt(dzres_vs_pt[counter]);
1020  fsyt_dzPt.getFittedSigmaWithError(h_dzrmshPt[counter]);
1021  fsyt_dzPt.getFittedMeanWithError(h_dzmeanhPt[counter]);
1022  FitSlicesYTool fsyt_phi(phires_vs_eta[counter]);
1023  fsyt_phi.getFittedSigmaWithError(h_phirmsh[counter]);
1024  fsyt_phi.getFittedMeanWithError(h_phimeanh[counter]);
1025  FitSlicesYTool fsyt_phiPt(phires_vs_pt[counter]);
1026  fsyt_phiPt.getFittedSigmaWithError(h_phirmshPt[counter]);
1027  fsyt_phiPt.getFittedMeanWithError(h_phimeanhPt[counter]);
1028  FitSlicesYTool fsyt_phiPhi(phires_vs_phi[counter]);
1029  fsyt_phiPhi.getFittedSigmaWithError(h_phirmshPhi[counter]);
1030  fsyt_phiPhi.getFittedMeanWithError(h_phimeanhPhi[counter]);
1031  FitSlicesYTool fsyt_cotTheta(cotThetares_vs_eta[counter]);
1032  fsyt_cotTheta.getFittedSigmaWithError(h_cotThetarmsh[counter]);
1033  fsyt_cotTheta.getFittedMeanWithError(h_cotThetameanh[counter]);
1034  FitSlicesYTool fsyt_cotThetaPt(cotThetares_vs_pt[counter]);
1035  fsyt_cotThetaPt.getFittedSigmaWithError(h_cotThetarmshPt[counter]);
1036  fsyt_cotThetaPt.getFittedMeanWithError(h_cotThetameanhPt[counter]);
1037 
1038  //pulls of track params vs eta: get sigma from 2D histos
1039  FitSlicesYTool fsyt_dxyp(dxypull_vs_eta[counter]);
1040  fsyt_dxyp.getFittedSigmaWithError(h_dxypulleta[counter]);
1041  fsyt_dxyp.getFittedMeanWithError(h_dxypulletamean[counter]);
1042  FitSlicesYTool fsyt_ptp(ptpull_vs_eta[counter]);
1043  fsyt_ptp.getFittedSigmaWithError(h_ptpulleta[counter]);
1044  fsyt_ptp.getFittedMeanWithError(h_ptpulletamean[counter]);
1045  FitSlicesYTool fsyt_dzp(dzpull_vs_eta[counter]);
1046  fsyt_dzp.getFittedSigmaWithError(h_dzpulleta[counter]);
1047  fsyt_dzp.getFittedMeanWithError(h_dzpulletamean[counter]);
1048  FitSlicesYTool fsyt_phip(phipull_vs_eta[counter]);
1049  fsyt_phip.getFittedSigmaWithError(h_phipulleta[counter]);
1050  fsyt_phip.getFittedMeanWithError(h_phipulletamean[counter]);
1051  FitSlicesYTool fsyt_thetap(thetapull_vs_eta[counter]);
1052  fsyt_thetap.getFittedSigmaWithError(h_thetapulleta[counter]);
1053  fsyt_thetap.getFittedMeanWithError(h_thetapulletamean[counter]);
1054  //vs phi
1055  FitSlicesYTool fsyt_ptpPhi(ptpull_vs_phi[counter]);
1056  fsyt_ptpPhi.getFittedSigmaWithError(h_ptpullphi[counter]);
1057  fsyt_ptpPhi.getFittedMeanWithError(h_ptpullphimean[counter]);
1058  FitSlicesYTool fsyt_phipPhi(phipull_vs_phi[counter]);
1059  fsyt_phipPhi.getFittedSigmaWithError(h_phipullphi[counter]);
1060  fsyt_phipPhi.getFittedMeanWithError(h_phipullphimean[counter]);
1061  FitSlicesYTool fsyt_thetapPhi(thetapull_vs_phi[counter]);
1062  fsyt_thetapPhi.getFittedSigmaWithError(h_thetapullphi[counter]);
1063  fsyt_thetapPhi.getFittedMeanWithError(h_thetapullphimean[counter]);
1064 
1065  //effic&fake
1066  fillPlotFromVectors(h_effic[counter],totASSeta[counter],totSIMeta[counter],"effic");
1067  fillPlotFromVectors(h_fakerate[counter],totASS2eta[counter],totRECeta[counter],"fakerate");
1068  fillPlotFromVectors(h_efficPt[counter],totASSpT[counter],totSIMpT[counter],"effic");
1069  fillPlotFromVectors(h_fakeratePt[counter],totASS2pT[counter],totRECpT[counter],"fakerate");
1070  fillPlotFromVectors(h_effic_vs_hit[counter],totASS_hit[counter],totSIM_hit[counter],"effic");
1071  fillPlotFromVectors(h_fake_vs_hit[counter],totASS2_hit[counter],totREC_hit[counter],"fakerate");
1072  fillPlotFromVectors(h_effic_vs_phi[counter],totASS_phi[counter],totSIM_phi[counter],"effic");
1073  fillPlotFromVectors(h_fake_vs_phi[counter],totASS2_phi[counter],totREC_phi[counter],"fakerate");
1074  fillPlotFromVectors(h_effic_vs_dxy[counter],totASS_dxy[counter],totSIM_dxy[counter],"effic");
1075  fillPlotFromVectors(h_fake_vs_dxy[counter],totASS2_dxy[counter],totREC_dxy[counter],"fakerate");
1076  fillPlotFromVectors(h_effic_vs_dz[counter],totASS_dz[counter],totSIM_dz[counter],"effic");
1077  fillPlotFromVectors(h_fake_vs_dz[counter],totASS2_dz[counter],totREC_dz[counter],"fakerate");
1078  fillPlotFromVectors(h_effic_vs_vertpos[counter],totASS_vertpos[counter],totSIM_vertpos[counter],"effic");
1079  fillPlotFromVectors(h_effic_vs_zpos[counter],totASS_zpos[counter],totSIM_zpos[counter],"effic");
1080 
1081 }
1082 
1083 
1085  //chi2 and #hit vs eta: get mean from 2D histos
1086  doProfileX(chi2_vs_eta[counter],h_chi2meanh[counter]);
1087  doProfileX(nhits_vs_eta[counter],h_hits_eta[counter]);
1088  doProfileX(nPXBhits_vs_eta[counter],h_PXBhits_eta[counter]);
1089  doProfileX(nPXFhits_vs_eta[counter],h_PXFhits_eta[counter]);
1090  doProfileX(nTIBhits_vs_eta[counter],h_TIBhits_eta[counter]);
1091  doProfileX(nTIDhits_vs_eta[counter],h_TIDhits_eta[counter]);
1092  doProfileX(nTOBhits_vs_eta[counter],h_TOBhits_eta[counter]);
1093  doProfileX(nTEChits_vs_eta[counter],h_TEChits_eta[counter]);
1094 
1100 
1101 
1102 
1103  doProfileX(nlosthits_vs_eta[counter],h_losthits_eta[counter]);
1104  //vs phi
1105  doProfileX(chi2_vs_nhits[counter],h_chi2meanhitsh[counter]);
1106  // doProfileX(ptres_vs_eta[counter],h_ptresmean_vs_eta[counter]);
1107  // doProfileX(phires_vs_eta[counter],h_phiresmean_vs_eta[counter]);
1108  doProfileX(chi2_vs_phi[counter],h_chi2mean_vs_phi[counter]);
1109  doProfileX(nhits_vs_phi[counter],h_hits_phi[counter]);
1110  // doProfileX(ptres_vs_phi[counter],h_ptresmean_vs_phi[counter]);
1111  // doProfileX(phires_vs_phi[counter],h_phiresmean_vs_phi[counter]);
1112 }
1113 
1115  fillPlotFromVector(h_recoeta[counter],totRECeta[counter]);
1116  fillPlotFromVector(h_simuleta[counter],totSIMeta[counter]);
1117  fillPlotFromVector(h_assoceta[counter],totASSeta[counter]);
1118  fillPlotFromVector(h_assoc2eta[counter],totASS2eta[counter]);
1119 
1120  fillPlotFromVector(h_recopT[counter],totRECpT[counter]);
1121  fillPlotFromVector(h_simulpT[counter],totSIMpT[counter]);
1122  fillPlotFromVector(h_assocpT[counter],totASSpT[counter]);
1123  fillPlotFromVector(h_assoc2pT[counter],totASS2pT[counter]);
1124 
1125  fillPlotFromVector(h_recohit[counter],totREC_hit[counter]);
1126  fillPlotFromVector(h_simulhit[counter],totSIM_hit[counter]);
1127  fillPlotFromVector(h_assochit[counter],totASS_hit[counter]);
1128  fillPlotFromVector(h_assoc2hit[counter],totASS2_hit[counter]);
1129 
1130  fillPlotFromVector(h_recophi[counter],totREC_phi[counter]);
1131  fillPlotFromVector(h_simulphi[counter],totSIM_phi[counter]);
1132  fillPlotFromVector(h_assocphi[counter],totASS_phi[counter]);
1133  fillPlotFromVector(h_assoc2phi[counter],totASS2_phi[counter]);
1134 
1135  fillPlotFromVector(h_recodxy[counter],totREC_dxy[counter]);
1136  fillPlotFromVector(h_simuldxy[counter],totSIM_dxy[counter]);
1137  fillPlotFromVector(h_assocdxy[counter],totASS_dxy[counter]);
1138  fillPlotFromVector(h_assoc2dxy[counter],totASS2_dxy[counter]);
1139 
1140  fillPlotFromVector(h_recodz[counter],totREC_dz[counter]);
1141  fillPlotFromVector(h_simuldz[counter],totSIM_dz[counter]);
1142  fillPlotFromVector(h_assocdz[counter],totASS_dz[counter]);
1143  fillPlotFromVector(h_assoc2dz[counter],totASS2_dz[counter]);
1144 
1147 
1148  fillPlotFromVector(h_simulzpos[counter],totSIM_zpos[counter]);
1149  fillPlotFromVector(h_assoczpos[counter],totASS_zpos[counter]);
1150 }
double qoverp() const
q/p
Definition: TrackBase.h:115
double phiModeError() const
error on phi from mode
Definition: GsfTrack.h:93
T getParameter(std::string const &) const
TrackingParticleSelector * generalTpSelector
std::vector< MonitorElement * > h_assoc2hit
T getUntrackedParameter(std::string const &, T const &) const
std::vector< MonitorElement * > h_dedx_estim2
int i
Definition: DBlmapReader.cc:9
std::vector< MonitorElement * > h_dzpulletamean
std::vector< MonitorElement * > h_recodxy
std::vector< MonitorElement * > h_assochit
std::vector< MonitorElement * > h_efficPt
std::vector< MonitorElement * > h_fakes
std::vector< std::vector< double > > zposintervals
std::vector< MonitorElement * > h_PXFhits_eta
std::vector< MonitorElement * > h_nchi2_prob
std::vector< MonitorElement * > h_pullDz
void getFittedSigmaWithError(MonitorElement *)
Fill the ME with the sigma value (with error) of the gaussian fit in each slice.
TrackingParticleSelector * TpSelectorForEfficiencyVsPhi
void fillPlotFromVectors(MonitorElement *h, std::vector< int > &numerator, std::vector< int > &denominator, std::string type)
std::vector< MonitorElement * > ptpull_vs_phi
std::vector< MonitorElement * > h_assoczpos
std::vector< std::vector< int > > totASS_phi
std::vector< MonitorElement * > nPXFhits_vs_eta
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:150
std::vector< MonitorElement * > h_fake_vs_hit
std::vector< MonitorElement * > h_dzmeanh
std::vector< std::vector< int > > totRECeta
void doProfileX(TH2 *th2, MonitorElement *me)
std::vector< MonitorElement * > h_simulzpos
std::vector< std::vector< int > > totASSeta
std::vector< MonitorElement * > nrecHit_vs_nsimHit_rec2sim
std::vector< std::vector< double > > vertposintervals
std::vector< MonitorElement * > h_assoc2pT
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:514
double lambdaMode() const
Lambda angle from mode.
Definition: GsfTrack.h:44
std::vector< MonitorElement * > h_simulpT
void fillPlotFromVector(MonitorElement *h, std::vector< int > &vec)
std::vector< MonitorElement * > h_ptshifteta
list step
Definition: launcher.py:15
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
Definition: TrackBase.h:111
void getRecoMomentum(const reco::Track &track, double &pt, double &ptError, double &qoverp, double &qoverpError, double &lambda, double &lambdaError, double &phi, double &phiError) const
retrieval of reconstructed momentum components from reco::Track (== mean values for GSF) ...
std::vector< MonitorElement * > nTEChits_vs_eta
std::vector< MonitorElement * > h_fake_vs_dz
std::vector< MonitorElement * > h_hits
std::vector< MonitorElement * > h_effic_vs_vertpos
std::vector< std::vector< double > > dxyintervals
double theta() const
polar angle
Definition: TrackBase.h:117
double dxyError() const
error on dxy
Definition: TrackBase.h:209
std::vector< MonitorElement * > nLayersWithMeas_vs_eta
std::vector< MonitorElement * > h_pullPhi
std::vector< MonitorElement * > h_fake_vs_dxy
std::vector< MonitorElement * > phipull_vs_phi
std::vector< MonitorElement * > h_dedx_sat1
std::vector< MonitorElement * > h_hits_eta
std::vector< MonitorElement * > h_thetapullphi
void fill_dedx_recoTrack_histos(int count, edm::RefToBase< reco::Track > &trackref, std::vector< edm::ValueMap< reco::DeDxData > > v_dEdx)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
std::vector< MonitorElement * > nrec_vs_nsim
std::vector< MonitorElement * > h_ptrmshPt
std::vector< MonitorElement * > h_assocdz
std::vector< std::vector< int > > totREC_dz
std::vector< std::vector< int > > totASS2_phi
std::vector< MonitorElement * > nTIDhits_vs_eta
std::vector< MonitorElement * > h_ptSIM
std::vector< MonitorElement * > h_dxypulletamean
std::vector< MonitorElement * > phires_vs_eta
std::vector< MonitorElement * > h_pullDxy
std::vector< MonitorElement * > h_assoc2phi
std::vector< std::vector< int > > totASS_dxy
std::vector< MonitorElement * > h_phipullphi
std::vector< MonitorElement * > h_nchi2
std::vector< MonitorElement * > h_fakeratePt
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:139
unsigned short numberOfLostHits() const
number of cases where track crossed a layer without getting a hit.
Definition: TrackBase.h:234
TrackingParticleSelector * TpSelectorForEfficiencyVsVTXZ
std::vector< MonitorElement * > h_dxyrmsh
#define min(a, b)
Definition: mlp_lapack.h:161
math::XYZVectorD Vector
point in the space
Definition: ParticleBase.h:31
std::vector< MonitorElement * > h_dzrmshPt
std::vector< MonitorElement * > h_vertposSIM
std::vector< MonitorElement * > h_simuleta
std::vector< std::vector< int > > totSIM_dz
std::vector< MonitorElement * > h_ptpulleta
math::Vector< dimension >::type ParameterVector
parameter vector
Definition: TrackBase.h:70
int pixelLayersWithMeasurement() const
Definition: HitPattern.cc:888
T eta() const
int numberOfValidStripLayersWithMonoAndStereo() const
Definition: HitPattern.cc:768
std::vector< MonitorElement * > h_TIBhits_eta
std::vector< MonitorElement * > h_thetapullphimean
std::vector< MonitorElement * > h_cotThetameanhPt
std::vector< MonitorElement * > h_phimeanhPhi
std::vector< MonitorElement * > h_assoc2dz
int trackerLayersWithMeasurement() const
Definition: HitPattern.cc:883
std::vector< MonitorElement * > chi2_vs_phi
int numberOfValidStripTIDHits() const
Definition: HitPattern.cc:424
std::vector< MonitorElement * > h_LayersWithMeas_eta
std::vector< std::vector< int > > totASS_zpos
std::vector< MonitorElement * > h_chi2mean_vs_phi
std::vector< MonitorElement * > h_assocphi
std::vector< MonitorElement * > h_cotThetarmsh
std::vector< MonitorElement * > phires_vs_phi
std::vector< MonitorElement * > dzres_vs_eta
std::vector< MonitorElement * > h_losthits_eta
double qoverpMode() const
q/p from mode
Definition: GsfTrack.h:40
std::vector< MonitorElement * > h_ptmeanhPhi
std::vector< std::vector< int > > totSIM_hit
std::vector< MonitorElement * > nlosthits_vs_eta
std::vector< MonitorElement * > nSTRIPlayersWith1dMeas_vs_eta
std::vector< MonitorElement * > h_phimeanh
double ptModeError() const
error on Pt (set to 1000 TeV if charge==0 for safety) from mode
Definition: GsfTrack.h:80
std::vector< MonitorElement * > h_recohit
std::vector< MonitorElement * > h_thetapulleta
void fill_ResoAndPull_recoTrack_histos(int count, ParticleBase::Vector momentumTP, ParticleBase::Point vertexTP, int chargeTP, const reco::Track &track, math::XYZPoint bsPosition)
std::vector< std::vector< int > > totSIM_zpos
std::vector< std::vector< int > > totASSpT
std::vector< MonitorElement * > h_phipullphimean
std::vector< MonitorElement * > h_dedx_estim1
std::vector< MonitorElement * > h_hits_phi
std::vector< MonitorElement * > phires_vs_pt
SingleObjectSelector< TrackingParticleCollection,::TrackingParticleSelector > TrackingParticleSelector
math::XYZPointD Point
point in the space
Definition: ParticleBase.h:29
std::vector< MonitorElement * > h_STRIPlayersWithMeas_eta
std::vector< std::vector< int > > totASS2eta
std::vector< MonitorElement * > nPXBhits_vs_eta
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:141
std::vector< std::vector< int > > totASS_hit
std::vector< MonitorElement * > h_assoc2dxy
std::vector< MonitorElement * > h_dxyrmshPt
std::vector< MonitorElement * > h_STRIPlayersWith1dMeas_eta
std::vector< MonitorElement * > h_pullQoverp
int numberOfValidPixelEndcapHits() const
Definition: HitPattern.cc:385
std::vector< std::vector< int > > totSIM_phi
std::vector< std::vector< int > > totASS2pT
std::vector< MonitorElement * > h_fake_vs_phi
void fill_recoAssociated_simTrack_histos(int count, const TrackingParticle &tp, ParticleBase::Vector momentumTP, ParticleBase::Point vertexTP, double dxy, double dz, int nSimHits, const reco::Track *track)
std::vector< MonitorElement * > h_ptpulletamean
double chi2() const
chi-squared of the fit
Definition: TrackBase.h:107
ParameterVector parameters() const
Track parameters with one-to-one correspondence to the covariance matrix.
Definition: TrackBase.h:178
std::vector< MonitorElement * > nSTRIPlayersWithMeas_vs_eta
std::vector< MonitorElement * > nTOBhits_vs_eta
std::vector< std::vector< int > > totASS_dz
double ndof() const
number of degrees of freedom of the fit
Definition: TrackBase.h:109
T sqrt(T t)
Definition: SSEVec.h:28
std::vector< MonitorElement * > ptpull_vs_eta
std::vector< MonitorElement * > etares_vs_eta
double pt() const
track transverse momentum
Definition: TrackBase.h:131
std::vector< MonitorElement * > h_recophi
std::vector< MonitorElement * > h_assocpT
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
std::vector< MonitorElement * > h_ptpullphimean
double ptError() const
error on Pt (set to 1000 TeV if charge==0 for safety)
Definition: TrackBase.h:194
std::vector< MonitorElement * > nSTRIPlayersWith2dMeas_vs_eta
std::vector< MonitorElement * > h_tracks
std::vector< MonitorElement * > h_chi2meanh
double phiError() const
error on phi
Definition: TrackBase.h:207
std::vector< MonitorElement * > h_TIDhits_eta
std::vector< MonitorElement * > h_tracksSIM
std::vector< MonitorElement * > h_effic
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
std::vector< MonitorElement * > nhits_vs_phi
std::vector< std::vector< int > > totASS2_dz
double lambda() const
Lambda angle.
Definition: TrackBase.h:119
std::vector< std::vector< int > > totSIM_vertpos
std::vector< MonitorElement * > h_ptmeanhPt
std::vector< MonitorElement * > h_phirmsh
double f[11][100]
std::vector< MonitorElement * > nrecHit_vs_nsimHit_sim2rec
int numberOfValidStripTECHits() const
Definition: HitPattern.cc:450
std::vector< std::vector< int > > totRECpT
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:232
void fill_simAssociated_recoTrack_histos(int count, const reco::Track &track)
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:828
std::vector< MonitorElement * > h_phirmshPt
std::vector< MonitorElement * > phimean_vs_eta_phi
std::vector< MonitorElement * > h_charge
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:223
std::vector< std::vector< int > > totASS2_hit
std::vector< std::vector< int > > totREC_dxy
#define LogTrace(id)
std::vector< std::vector< double > > phiintervals
std::vector< MonitorElement * > chi2_vs_nhits
int numberOfValidStripTIBHits() const
Definition: HitPattern.cc:411
std::vector< MonitorElement * > dzpull_vs_eta
std::vector< MonitorElement * > h_simuldz
int k[5][pyjets_maxn]
std::vector< MonitorElement * > h_fakerate
double qoverpError() const
error on signed transverse curvature
Definition: TrackBase.h:192
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
Definition: TrackBase.h:127
double dzError() const
error on dz
Definition: TrackBase.h:215
std::vector< MonitorElement * > h_ptpullphi
std::vector< MonitorElement * > thetapull_vs_phi
TrackingParticleSelector * TpSelectorForEfficiencyVsPt
std::vector< MonitorElement * > h_simulvertpos
std::vector< MonitorElement * > h_STRIPlayersWith2dMeas_eta
std::vector< MonitorElement * > dxyres_vs_eta
std::vector< MonitorElement * > h_effic_vs_phi
std::vector< MonitorElement * > h_ptrmsh
std::vector< std::vector< int > > totASS_vertpos
std::vector< MonitorElement * > h_chi2meanhitsh
std::vector< MonitorElement * > h_dxymeanhPt
std::vector< MonitorElement * > h_dzpulleta
#define M_PI
Definition: BFit3D.cc:3
std::vector< MonitorElement * > nPXLlayersWithMeas_vs_eta
std::vector< std::vector< int > > totSIMpT
std::vector< MonitorElement * > nTIBhits_vs_eta
std::vector< MonitorElement * > h_dxypulleta
std::vector< std::vector< double > > etaintervals
std::vector< MonitorElement * > h_effic_vs_dz
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
std::vector< MonitorElement * > h_phirmshPhi
double qoverpModeError() const
error on signed transverse curvature from mode
Definition: GsfTrack.h:78
std::vector< MonitorElement * > h_eta
void getFittedMeanWithError(MonitorElement *)
Fill the ME with the mean value (with error) of the gaussian fit in each slice.
std::vector< MonitorElement * > h_pt
std::vector< MonitorElement * > h_PXBhits_eta
std::vector< MonitorElement * > h_phimeanhPt
std::vector< MonitorElement * > h_dedx_nom2
std::vector< MonitorElement * > cotThetares_vs_pt
std::vector< MonitorElement * > h_effic_vs_zpos
std::vector< MonitorElement * > h_etaSIM
std::vector< MonitorElement * > h_simulphi
int stripLayersWithMeasurement() const
Definition: HitPattern.cc:893
std::vector< MonitorElement * > h_pullTheta
int numberOfValidStripTOBHits() const
Definition: HitPattern.cc:437
std::vector< std::vector< int > > totREC_hit
std::vector< MonitorElement * > ptmean_vs_eta_phi
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
double lambdaError() const
error on lambda
Definition: TrackBase.h:203
std::vector< std::vector< int > > totSIMeta
std::vector< MonitorElement * > dxypull_vs_eta
std::vector< MonitorElement * > ptres_vs_eta
std::vector< MonitorElement * > h_cotThetameanh
std::vector< MonitorElement * > h_dzrmsh
std::vector< MonitorElement * > h_effic_vs_dxy
std::vector< MonitorElement * > phipull_vs_eta
unsigned short found() const
Number of valid hits on track.
Definition: Track.h:100
std::vector< MonitorElement * > h_TOBhits_eta
std::vector< MonitorElement * > h_TEChits_eta
std::vector< MonitorElement * > h_simulhit
void fill_generic_simTrack_histos(int counter, ParticleBase::Vector, ParticleBase::Point vertex)
std::vector< MonitorElement * > h_dzmeanhPt
std::vector< MonitorElement * > h_recopT
std::vector< std::vector< double > > pTintervals
std::vector< MonitorElement * > h_assocdxy
double phiMode() const
azimuthal angle of momentum vector from mode
Definition: GsfTrack.h:56
int numberOfValidPixelBarrelHits() const
Definition: HitPattern.cc:372
int charge() const
track electric charge
Definition: TrackBase.h:113
std::vector< MonitorElement * > cotThetares_vs_eta
std::vector< MonitorElement * > h_assocFraction
std::vector< MonitorElement * > h_cotThetarmshPt
std::vector< std::vector< int > > totREC_phi
double lambdaModeError() const
error on lambda from mode
Definition: GsfTrack.h:89
std::vector< MonitorElement * > h_recodz
std::vector< MonitorElement * > ptres_vs_pt
std::vector< MonitorElement * > h_dedx_sat2
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:642
std::vector< MonitorElement * > h_phipulleta
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:121
std::vector< MonitorElement * > h_assoceta
std::vector< MonitorElement * > ptres_vs_phi
TrackingParticleSelector * TpSelectorForEfficiencyVsVTXR
std::vector< MonitorElement * > h_assocSharedHit
std::vector< MonitorElement * > h_dxymeanh
std::vector< MonitorElement * > nhits_vs_eta
std::vector< MonitorElement * > h_ptrmshPhi
double ptMode() const
track transverse momentum from mode
Definition: GsfTrack.h:48
std::vector< MonitorElement * > h_effic_vs_hit
std::vector< MonitorElement * > h_simuldxy
std::vector< MonitorElement * > h_assocvertpos
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
void fill_generic_recoTrack_histos(int count, const reco::Track &track, math::XYZPoint bsPosition, bool isMatched)
MTVHistoProducerAlgoForTracker(const edm::ParameterSet &pset)
std::vector< MonitorElement * > h_recoeta
std::vector< MonitorElement * > thetapull_vs_eta
std::vector< std::vector< int > > totSIM_dxy
std::vector< MonitorElement * > chi2_vs_eta
std::vector< MonitorElement * > h_phipulletamean
std::vector< MonitorElement * > h_PXLlayersWithMeas_eta
std::vector< std::vector< double > > dzintervals
std::vector< MonitorElement * > dxyres_vs_pt
std::vector< MonitorElement * > h_dedx_nom1
std::vector< std::vector< int > > totASS2_dxy
std::vector< MonitorElement * > h_losthits
TrackingParticleSelector * TpSelectorForEfficiencyVsEta
std::vector< MonitorElement * > h_assoc2eta
std::vector< MonitorElement * > h_thetapulletamean
Definition: DDAxes.h:10
MonitorElement * bookProfile2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, const char *option="s")
Definition: DQMStore.cc:972
std::vector< MonitorElement * > dzres_vs_pt