CMS 3D CMS Logo

MTVHistoProducerAlgoForTracker.cc
Go to the documentation of this file.
4 
9 
11 
12 
13 #include "TMath.h"
14 #include <TF1.h>
15 
16 using namespace std;
17 
18 namespace {
19  void BinLogX(TH1 *h) {
20  TAxis *axis = h->GetXaxis();
21  int bins = axis->GetNbins();
22 
23  float from = axis->GetXmin();
24  float to = axis->GetXmax();
25  float width = (to - from) / bins;
26  std::vector<float> new_bins(bins+1, 0);
27 
28  for (int i = 0; i <= bins; i++) {
29  new_bins[i] = TMath::Power(10, from + i * width);
30  }
31  axis->Set(bins, new_bins.data());
32  }
33 
34  template <typename... Args>
35  ConcurrentMonitorElement make1DIfLogX(DQMStore::ConcurrentBooker& ibook, bool logx, Args&& ...args) {
36  auto h = std::make_unique<TH1F>(std::forward<Args>(args)...);
37  if(logx) BinLogX(h.get());
38  const auto& name = h->GetName();
39  return ibook.book1D(name, h.release());
40  }
41 
42  template <typename... Args>
43  ConcurrentMonitorElement makeProfileIfLogX(DQMStore::ConcurrentBooker& ibook, bool logx, Args&& ...args) {
44  auto h = std::make_unique<TProfile>(std::forward<Args>(args)...);
45  if(logx) BinLogX(h.get());
46  const auto& name = h->GetName();
47  return ibook.bookProfile(name, h.release());
48  }
49 
50  template <typename... Args>
51  ConcurrentMonitorElement make2DIfLogX(DQMStore::ConcurrentBooker& ibook, bool logx, Args&& ...args) {
52  auto h = std::make_unique<TH2F>(std::forward<Args>(args)...);
53  if(logx) BinLogX(h.get());
54  const auto& name = h->GetName();
55  return ibook.book2D(name, h.release());
56  }
57 
58  void setBinLabels(ConcurrentMonitorElement& h, const std::vector<std::string>& labels) {
59  for(size_t i=0; i<labels.size(); ++i) {
60  h.setBinLabel(i+1, labels[i]);
61  }
63  }
64 
65  void setBinLabelsAlgo(ConcurrentMonitorElement& h, int axis=1) {
66  for(size_t i=0; i<reco::TrackBase::algoSize; ++i) {
67  h.setBinLabel(i+1, reco::TrackBase::algoName(static_cast<reco::TrackBase::TrackAlgorithm>(i)), axis);
68  }
70  }
71 
72  void fillMVAHistos(const std::vector<ConcurrentMonitorElement>& h_mva,
73  const std::vector<ConcurrentMonitorElement>& h_mvacut,
74  const std::vector<ConcurrentMonitorElement>& h_mva_hp,
75  const std::vector<ConcurrentMonitorElement>& h_mvacut_hp,
76  const std::vector<float>& mvas,
77  unsigned int selectsLoose, unsigned int selectsHP) {
78  // Fill MVA1 histos with all tracks, MVA2 histos only with tracks
79  // not selected by MVA1, etc.
80  for(size_t i=0; i<mvas.size(); ++i) {
81  if(i<=selectsLoose) {
82  h_mva[i].fill(mvas[i]);
83  h_mvacut[i].fill(mvas[i]);
84  }
85  if(i>=1 && i<=selectsHP) {
86  h_mva_hp[i].fill(mvas[i]);
87  h_mvacut_hp[i].fill(mvas[i]);
88  }
89  }
90  }
91 
92  void fillMVAHistos(double xval,
93  const std::vector<ConcurrentMonitorElement>& h_mva,
94  const std::vector<ConcurrentMonitorElement>& h_mva_hp,
95  const std::vector<float>& mvas,
96  unsigned int selectsLoose, unsigned int selectsHP) {
97  // Fill MVA1 histos with all tracks, MVA2 histos only with tracks
98  // not selected by MVA1, etc.
99  for(size_t i=0; i<mvas.size(); ++i) {
100  if(i<=selectsLoose) {
101  h_mva[i].fill(xval, mvas[i]);
102  }
103  if(i>=1 && i<=selectsHP) {
104  h_mva_hp[i].fill(xval, mvas[i]);
105  }
106  }
107  }
108 }
109 
111  doSeedPlots_(doSeedPlots)
112 {
113  //parameters for _vs_eta plots
114  minEta = pset.getParameter<double>("minEta");
115  maxEta = pset.getParameter<double>("maxEta");
116  nintEta = pset.getParameter<int>("nintEta");
117  useFabsEta = pset.getParameter<bool>("useFabsEta");
118 
119  //parameters for _vs_pt plots
120  minPt = pset.getParameter<double>("minPt");
121  maxPt = pset.getParameter<double>("maxPt");
122  nintPt = pset.getParameter<int>("nintPt");
123  useInvPt = pset.getParameter<bool>("useInvPt");
124  useLogPt = pset.getUntrackedParameter<bool>("useLogPt",false);
125 
126  //parameters for _vs_Hit plots
127  minHit = pset.getParameter<double>("minHit");
128  maxHit = pset.getParameter<double>("maxHit");
129  nintHit = pset.getParameter<int>("nintHit");
130 
131  //parameters for _vs_Pu plots
132  minPu = pset.getParameter<double>("minPu");
133  maxPu = pset.getParameter<double>("maxPu");
134  nintPu = pset.getParameter<int>("nintPu");
135 
136  //parameters for _vs_Layer plots
137  minLayers = pset.getParameter<double>("minLayers");
138  maxLayers = pset.getParameter<double>("maxLayers");
139  nintLayers = pset.getParameter<int>("nintLayers");
140 
141  //parameters for _vs_phi plots
142  minPhi = pset.getParameter<double>("minPhi");
143  maxPhi = pset.getParameter<double>("maxPhi");
144  nintPhi = pset.getParameter<int>("nintPhi");
145 
146  //parameters for _vs_Dxy plots
147  minDxy = pset.getParameter<double>("minDxy");
148  maxDxy = pset.getParameter<double>("maxDxy");
149  nintDxy = pset.getParameter<int>("nintDxy");
150 
151  //parameters for _vs_Dz plots
152  minDz = pset.getParameter<double>("minDz");
153  maxDz = pset.getParameter<double>("maxDz");
154  nintDz = pset.getParameter<int>("nintDz");
155 
156  dxyDzZoom = pset.getParameter<double>("dxyDzZoom");
157 
158  //parameters for _vs_ProductionVertexTransvPosition plots
159  minVertpos = pset.getParameter<double>("minVertpos");
160  maxVertpos = pset.getParameter<double>("maxVertpos");
161  nintVertpos = pset.getParameter<int>("nintVertpos");
162  useLogVertpos = pset.getUntrackedParameter<bool>("useLogVertpos");
163 
164  //parameters for _vs_ProductionVertexZPosition plots
165  minZpos = pset.getParameter<double>("minZpos");
166  maxZpos = pset.getParameter<double>("maxZpos");
167  nintZpos = pset.getParameter<int>("nintZpos");
168 
169  //parameters for _vs_dR plots
170  mindr = pset.getParameter<double>("mindr");
171  maxdr = pset.getParameter<double>("maxdr");
172  nintdr = pset.getParameter<int>("nintdr");
173 
174  // paramers for _vs_chi2 plots
175  minChi2 = pset.getParameter<double>("minChi2");
176  maxChi2 = pset.getParameter<double>("maxChi2");
177  nintChi2 = pset.getParameter<int>("nintChi2");
178 
179  //parameters for dE/dx plots
180  minDeDx = pset.getParameter<double>("minDeDx");
181  maxDeDx = pset.getParameter<double>("maxDeDx");
182  nintDeDx = pset.getParameter<int>("nintDeDx");
183 
184  //parameters for Pileup plots
185  minVertcount = pset.getParameter<double>("minVertcount");
186  maxVertcount = pset.getParameter<double>("maxVertcount");
187  nintVertcount = pset.getParameter<int>("nintVertcount");
188 
189  //parameters for number of tracks plots
190  minTracks = pset.getParameter<double>("minTracks");
191  maxTracks = pset.getParameter<double>("maxTracks");
192  nintTracks = pset.getParameter<int>("nintTracks");
193 
194  //parameters for vs. PV z plots
195  minPVz = pset.getParameter<double>("minPVz");
196  maxPVz = pset.getParameter<double>("maxPVz");
197  nintPVz = pset.getParameter<int>("nintPVz");
198 
199  //parameters for vs. MVA plots
200  minMVA = pset.getParameter<double>("minMVA");
201  maxMVA = pset.getParameter<double>("maxMVA");
202  nintMVA = pset.getParameter<int>("nintMVA");
203 
204  //parameters for resolution plots
205  ptRes_rangeMin = pset.getParameter<double>("ptRes_rangeMin");
206  ptRes_rangeMax = pset.getParameter<double>("ptRes_rangeMax");
207  ptRes_nbin = pset.getParameter<int>("ptRes_nbin");
208 
209  phiRes_rangeMin = pset.getParameter<double>("phiRes_rangeMin");
210  phiRes_rangeMax = pset.getParameter<double>("phiRes_rangeMax");
211  phiRes_nbin = pset.getParameter<int>("phiRes_nbin");
212 
213  cotThetaRes_rangeMin = pset.getParameter<double>("cotThetaRes_rangeMin");
214  cotThetaRes_rangeMax = pset.getParameter<double>("cotThetaRes_rangeMax");
215  cotThetaRes_nbin = pset.getParameter<int>("cotThetaRes_nbin");
216 
217  dxyRes_rangeMin = pset.getParameter<double>("dxyRes_rangeMin");
218  dxyRes_rangeMax = pset.getParameter<double>("dxyRes_rangeMax");
219  dxyRes_nbin = pset.getParameter<int>("dxyRes_nbin");
220 
221  dzRes_rangeMin = pset.getParameter<double>("dzRes_rangeMin");
222  dzRes_rangeMax = pset.getParameter<double>("dzRes_rangeMax");
223  dzRes_nbin = pset.getParameter<int>("dzRes_nbin");
224 
225 
226  maxDzpvCum = pset.getParameter<double>("maxDzpvCumulative");
227  nintDzpvCum = pset.getParameter<int>("nintDzpvCumulative");
228 
229  maxDzpvsigCum = pset.getParameter<double>("maxDzpvsigCumulative");
230  nintDzpvsigCum = pset.getParameter<int>("nintDzpvsigCumulative");
231 
232  //--- tracking particle selectors for efficiency measurements
233  using namespace edm;
234  using namespace reco::modules;
235  auto initTPselector = [&](auto& sel, auto& name) {
236  sel = std::make_unique<TrackingParticleSelector>(ParameterAdapter<TrackingParticleSelector>::make(pset.getParameter<ParameterSet>(name)));
237  };
238  auto initTrackSelector = [&](auto& sel, auto& name) {
240  };
241  auto initGPselector = [&](auto& sel, auto& name) {
242  sel = std::make_unique<GenParticleCustomSelector>(ParameterAdapter<GenParticleCustomSelector>::make(pset.getParameter<ParameterSet>(name)));
243  };
244 
245  initTPselector(generalTpSelector, "generalTpSelector");
246  initTPselector(TpSelectorForEfficiencyVsEta, "TpSelectorForEfficiencyVsEta");
247  initTPselector(TpSelectorForEfficiencyVsPhi, "TpSelectorForEfficiencyVsPhi");
248  initTPselector(TpSelectorForEfficiencyVsPt, "TpSelectorForEfficiencyVsPt");
249  initTPselector(TpSelectorForEfficiencyVsVTXR, "TpSelectorForEfficiencyVsVTXR");
250  initTPselector(TpSelectorForEfficiencyVsVTXZ, "TpSelectorForEfficiencyVsVTXZ");
251 
252  initTrackSelector(trackSelectorVsEta, "TpSelectorForEfficiencyVsEta");
253  initTrackSelector(trackSelectorVsPhi, "TpSelectorForEfficiencyVsPhi");
254  initTrackSelector(trackSelectorVsPt, "TpSelectorForEfficiencyVsPt");
255 
256  initGPselector(generalGpSelector, "generalGpSelector");
257  initGPselector(GpSelectorForEfficiencyVsEta, "GpSelectorForEfficiencyVsEta");
258  initGPselector(GpSelectorForEfficiencyVsPhi, "GpSelectorForEfficiencyVsPhi");
259  initGPselector(GpSelectorForEfficiencyVsPt, "GpSelectorForEfficiencyVsPt");
260  initGPselector(GpSelectorForEfficiencyVsVTXR, "GpSelectorForEfficiencyVsVTXR");
261  initGPselector(GpSelectorForEfficiencyVsVTXZ, "GpSelectorForEfficiencyVsVTXZ");
262 
263  // SeedingLayerSets
264  // If enabled, use last bin to denote other or unknown cases
265  seedingLayerSetNames = pset.getParameter<std::vector<std::string> >("seedingLayerSets");
266  std::vector<std::pair<SeedingLayerSetId, std::string> > stripPairSets;
267  if(!seedingLayerSetNames.empty()) {
268  std::vector<std::vector<std::string>> layerSets = SeedingLayerSetsBuilder::layerNamesInSets(seedingLayerSetNames);
269  for(size_t i=0; i<layerSets.size(); ++i) {
270  const auto& layerSet = layerSets[i];
271  if(layerSet.size() > std::tuple_size<SeedingLayerSetId>::value) {
272  throw cms::Exception("Configuration") << "Got seedingLayerSet " << seedingLayerSetNames[i] << " with " << layerSet.size() << " elements, but I have a hard-coded maximum of " << std::tuple_size<SeedingLayerSetId>::value << ". Please increase the maximum in MTVHistoProducerAlgoForTracker.h";
273  }
274  SeedingLayerSetId setId;
275  for(size_t j=0; j<layerSet.size(); ++j) {
276  // SeedingLayerSetsBuilder::fillDescriptions() kind-of
277  // suggests that the 'M' prefix stands for strip mono hits
278  // (maybe it should force), so making the assumption here is
279  // (still) a bit ugly. But, this is the easiest way.
280  bool isStripMono = !layerSet[j].empty() && layerSet[j][0] == 'M';
281  setId[j] = std::make_tuple(SeedingLayerSetsBuilder::nameToEnumId(layerSet[j]), isStripMono);
282  }
283  // Account for the fact that strip triplet seeding may give pairs
284  if(layerSet.size() == 3 && isTrackerStrip(std::get<GeomDetEnumerators::SubDetector>(std::get<0>(setId[0])))) {
285  SeedingLayerSetId pairId;
286  pairId[0] = setId[0];
287  pairId[1] = setId[1];
288  stripPairSets.emplace_back(pairId, layerSet[0]+"+"+layerSet[1]);
289  }
290 
291  auto inserted = seedingLayerSetToBin.insert(std::make_pair(setId, i));
292  if(!inserted.second)
293  throw cms::Exception("Configuration") << "SeedingLayerSet " << seedingLayerSetNames[i] << " is specified twice, while the set list should be unique.";
294  }
295 
296  // Add the "strip pairs from strip triplets" if they don't otherwise exist
297  for(const auto& setIdName: stripPairSets) {
298  auto inserted = seedingLayerSetToBin.insert(std::make_pair(setIdName.first, seedingLayerSetNames.size()));
299  if(inserted.second)
300  seedingLayerSetNames.push_back(setIdName.second);
301  }
302 
303  seedingLayerSetNames.emplace_back("Other/Unknown");
304  }
305 
306  // fix for the LogScale by Ryan
307  if(useLogPt){
308  maxPt=log10(maxPt);
309  if(minPt > 0){
310  minPt=log10(minPt);
311  }
312  else{
313  edm::LogWarning("MultiTrackValidator")
314  << "minPt = "
315  << minPt << " <= 0 out of range while requesting log scale. Using minPt = 0.1.";
316  minPt=log10(0.1);
317  }
318  }
319  if(useLogVertpos) {
320  maxVertpos = std::log10(maxVertpos);
321  if(minVertpos > 0) {
322  minVertpos = std::log10(minVertpos);
323  }
324  else {
325  edm::LogWarning("MultiTrackValidator")
326  << "minVertpos = " << minVertpos << " <= 0 out of range while requesting log scale. Using minVertpos = 0.1.";
327  minVertpos = -1;
328  }
329  }
330 
331 }
332 
334 
336  edm::ParameterSet psetTrack;
337  psetTrack.copyForModify(pset);
338  psetTrack.eraseSimpleParameter("minHit");
339  psetTrack.eraseSimpleParameter("signalOnly");
340  psetTrack.eraseSimpleParameter("intimeOnly");
341  psetTrack.eraseSimpleParameter("chargedOnly");
342  psetTrack.eraseSimpleParameter("stableOnly");
343  psetTrack.addParameter("maxChi2", 1e10);
344  psetTrack.addParameter("minHit", 0);
345  psetTrack.addParameter("minPixelHit", 0);
346  psetTrack.addParameter("minLayer", 0);
347  psetTrack.addParameter("min3DLayer", 0);
348  psetTrack.addParameter("quality", std::vector<std::string>{});
349  psetTrack.addParameter("algorithm", std::vector<std::string>{});
350  psetTrack.addParameter("originalAlgorithm", std::vector<std::string>{});
351  psetTrack.addParameter("algorithmMaskContains", std::vector<std::string>{});
352 
353  return std::make_unique<RecoTrackSelectorBase>(psetTrack);
354 }
355 
357  histograms.h_ptSIM = make1DIfLogX(ibook, useLogPt, "ptSIM", "generated p_{t}", nintPt, minPt, maxPt);
358  histograms.h_etaSIM = ibook.book1D("etaSIM", "generated pseudorapidity", nintEta, minEta, maxEta);
359  histograms.h_tracksSIM = ibook.book1D("tracksSIM","number of simulated tracks", nintTracks, minTracks, maxTracks*10);
360  histograms.h_vertposSIM = ibook.book1D("vertposSIM","Transverse position of sim vertices", nintVertpos, minVertpos, maxVertpos);
361  histograms.h_bunchxSIM = ibook.book1D("bunchxSIM", "bunch crossing", 21, -15.5, 5.5 );
362 }
363 
365  histograms.h_assoceta.push_back( ibook.book1D("num_assoc(simToReco)_eta","N of associated tracks (simToReco) vs eta",nintEta,minEta,maxEta) );
366  histograms.h_simuleta.push_back( ibook.book1D("num_simul_eta","N of simulated tracks vs eta",nintEta,minEta,maxEta) );
367 
368  histograms.h_assocpT.push_back( make1DIfLogX(ibook, useLogPt, "num_assoc(simToReco)_pT","N of associated tracks (simToReco) vs pT",nintPt,minPt,maxPt) );
369  histograms.h_simulpT.push_back( make1DIfLogX(ibook, useLogPt, "num_simul_pT","N of simulated tracks vs pT",nintPt,minPt,maxPt) );
370 
371  histograms.h_assochit.push_back( ibook.book1D("num_assoc(simToReco)_hit","N of associated tracks (simToReco) vs hit",nintHit,minHit,maxHit) );
372  histograms.h_simulhit.push_back( ibook.book1D("num_simul_hit","N of simulated tracks vs hit",nintHit,minHit,maxHit) );
373 
374  histograms.h_assoclayer.push_back( ibook.book1D("num_assoc(simToReco)_layer","N of associated tracks (simToReco) vs layer",nintLayers,minLayers,maxLayers) );
375  histograms.h_simullayer.push_back( ibook.book1D("num_simul_layer","N of simulated tracks vs layer",nintLayers,minLayers,maxLayers) );
376 
377  histograms.h_assocpixellayer.push_back( ibook.book1D("num_assoc(simToReco)_pixellayer","N of associated tracks (simToReco) vs pixel layer",nintLayers,minLayers,maxLayers) );
378  histograms.h_simulpixellayer.push_back( ibook.book1D("num_simul_pixellayer","N of simulated tracks vs pixel layer",nintLayers,minLayers,maxLayers) );
379 
380  histograms.h_assoc3Dlayer.push_back( ibook.book1D("num_assoc(simToReco)_3Dlayer","N of associated tracks (simToReco) vs 3D layer",nintLayers,minLayers,maxLayers) );
381  histograms.h_simul3Dlayer.push_back( ibook.book1D("num_simul_3Dlayer","N of simulated tracks vs 3D layer",nintLayers,minLayers,maxLayers) );
382 
383  histograms.h_assocpu.push_back( ibook.book1D("num_assoc(simToReco)_pu","N of associated tracks (simToReco) vs pu",nintPu,minPu,maxPu) );
384  histograms.h_simulpu.push_back( ibook.book1D("num_simul_pu","N of simulated tracks vs pu",nintPu,minPu,maxPu) );
385 
386  histograms.h_assocphi.push_back( ibook.book1D("num_assoc(simToReco)_phi","N of associated tracks (simToReco) vs phi",nintPhi,minPhi,maxPhi) );
387  histograms.h_simulphi.push_back( ibook.book1D("num_simul_phi","N of simulated tracks vs phi",nintPhi,minPhi,maxPhi) );
388 
389  histograms.h_assocdxy.push_back( ibook.book1D("num_assoc(simToReco)_dxy","N of associated tracks (simToReco) vs dxy",nintDxy,minDxy,maxDxy) );
390  histograms.h_simuldxy.push_back( ibook.book1D("num_simul_dxy","N of simulated tracks vs dxy",nintDxy,minDxy,maxDxy) );
391 
392  histograms.h_assocdz.push_back( ibook.book1D("num_assoc(simToReco)_dz","N of associated tracks (simToReco) vs dz",nintDz,minDz,maxDz) );
393  histograms.h_simuldz.push_back( ibook.book1D("num_simul_dz","N of simulated tracks vs dz",nintDz,minDz,maxDz) );
394 
395  histograms.h_assocvertpos.push_back( make1DIfLogX(ibook, useLogVertpos, "num_assoc(simToReco)_vertpos",
396  "N of associated tracks (simToReco) vs transverse vert position",
398  histograms.h_simulvertpos.push_back( make1DIfLogX(ibook, useLogVertpos, "num_simul_vertpos","N of simulated tracks vs transverse vert position",
400 
401  histograms.h_assoczpos.push_back( ibook.book1D("num_assoc(simToReco)_zpos","N of associated tracks (simToReco) vs z vert position",
403  histograms.h_simulzpos.push_back( ibook.book1D("num_simul_zpos","N of simulated tracks vs z vert position",nintZpos,minZpos,maxZpos) );
404 
405  histograms.h_assocdr.push_back( make1DIfLogX(ibook, true, "num_assoc(simToReco)_dr","N of associated tracks (simToReco) vs dR",nintdr,log10(mindr),log10(maxdr)) );
406  histograms.h_simuldr.push_back( make1DIfLogX(ibook, true, "num_simul_dr","N of simulated tracks vs dR",nintdr,log10(mindr),log10(maxdr)) );
407 
408  histograms.h_simul_simpvz.push_back( ibook.book1D("num_simul_simpvz", "N of simulated tracks vs. sim PV z", nintPVz, minPVz, maxPVz) );
409  histograms.h_assoc_simpvz.push_back( ibook.book1D("num_assoc(simToReco)_simpvz", "N of associated tracks (simToReco) vs. sim PV z", nintPVz, minPVz, maxPVz) );
410 
411  histograms.nrecHit_vs_nsimHit_sim2rec.push_back( doResolutionPlots ? ibook.book2D("nrecHit_vs_nsimHit_sim2rec","nrecHit vs nsimHit (Sim2RecAssoc)",
414 
415  // TODO: use the dynamic track algo priority order also here
416  constexpr auto nalgos = reco::TrackBase::algoSize;
417  histograms.h_duplicates_oriAlgo_vs_oriAlgo.push_back( ibook.book2D("duplicates_oriAlgo_vs_oriAlgo", "Duplicate tracks: originalAlgo vs originalAlgo",
418  nalgos,0,nalgos, nalgos,0,nalgos) );
419  setBinLabelsAlgo(histograms.h_duplicates_oriAlgo_vs_oriAlgo.back(), 1);
420  setBinLabelsAlgo(histograms.h_duplicates_oriAlgo_vs_oriAlgo.back(), 2);
421 }
422 
424  histograms.h_assocdxypv.push_back( ibook.book1D("num_assoc(simToReco)_dxypv","N of associated tracks (simToReco) vs dxy(PV)",nintDxy,minDxy,maxDxy) );
425  histograms.h_simuldxypv.push_back( ibook.book1D("num_simul_dxypv","N of simulated tracks vs dxy(PV)",nintDxy,minDxy,maxDxy) );
426 
427  histograms.h_assocdzpv.push_back( ibook.book1D("num_assoc(simToReco)_dzpv","N of associated tracks (simToReco) vs dz(PV)",nintDz,minDz,maxDz) );
428  histograms.h_simuldzpv.push_back( ibook.book1D("num_simul_dzpv","N of simulated tracks vs dz(PV)",nintDz,minDz,maxDz) );
429 
430  histograms.h_assocdxypvzoomed.push_back( ibook.book1D("num_assoc(simToReco)_dxypv_zoomed","N of associated tracks (simToReco) vs dxy(PV)",nintDxy,minDxy/dxyDzZoom,maxDxy/dxyDzZoom) );
431  histograms.h_simuldxypvzoomed.push_back( ibook.book1D("num_simul_dxypv_zoomed","N of simulated tracks vs dxy(PV)",nintDxy,minDxy/dxyDzZoom,maxDxy/dxyDzZoom) );
432 
433  histograms.h_assocdzpvzoomed.push_back( ibook.book1D("num_assoc(simToReco)_dzpv_zoomed","N of associated tracks (simToReco) vs dz(PV)",nintDz,minDz/dxyDzZoom,maxDz/dxyDzZoom) );
434  histograms.h_simuldzpvzoomed.push_back( ibook.book1D("num_simul_dzpv_zoomed","N of simulated tracks vs dz(PV)",nintDz,minDz/dxyDzZoom,maxDz/dxyDzZoom) );
435 
436  histograms.h_assoc_dzpvcut.push_back( ibook.book1D("num_assoc(simToReco)_dzpvcut","N of associated tracks (simToReco) vs dz(PV)",nintDzpvCum,0,maxDzpvCum) );
437  histograms.h_simul_dzpvcut.push_back( ibook.book1D("num_simul_dzpvcut","N of simulated tracks from sim PV",nintDzpvCum,0,maxDzpvCum) );
438  histograms.h_simul2_dzpvcut.push_back( ibook.book1D("num_simul2_dzpvcut","N of simulated tracks (associated to any track) from sim PV",nintDzpvCum,0,maxDzpvCum) );
439 
440  histograms.h_assoc_dzpvcut_pt.push_back( ibook.book1D("num_assoc(simToReco)_dzpvcut_pt","#sump_{T} of associated tracks (simToReco) vs dz(PV)",nintDzpvCum,0,maxDzpvCum) );
441  histograms.h_simul_dzpvcut_pt.push_back( ibook.book1D("num_simul_dzpvcut_pt","#sump_{T} of simulated tracks from sim PV",nintDzpvCum,0,maxDzpvCum) );
442  histograms.h_simul2_dzpvcut_pt.push_back( ibook.book1D("num_simul2_dzpvcut_pt","#sump_{T} of simulated tracks (associated to any track) from sim PV",nintDzpvCum,0,maxDzpvCum) );
443  histograms.h_assoc_dzpvcut_pt.back().enableSumw2();
444  histograms.h_simul_dzpvcut_pt.back().enableSumw2();
445  histograms.h_simul2_dzpvcut_pt.back().enableSumw2();
446 
447  histograms.h_assoc_dzpvsigcut.push_back( ibook.book1D("num_assoc(simToReco)_dzpvsigcut","N of associated tracks (simToReco) vs dz(PV)/dzError",nintDzpvsigCum,0,maxDzpvsigCum) );
448  histograms.h_simul_dzpvsigcut.push_back( ibook.book1D("num_simul_dzpvsigcut","N of simulated tracks from sim PV/dzError",nintDzpvsigCum,0,maxDzpvsigCum) );
449  histograms.h_simul2_dzpvsigcut.push_back( ibook.book1D("num_simul2_dzpvsigcut","N of simulated tracks (associated to any track) from sim PV/dzError",nintDzpvsigCum,0,maxDzpvsigCum) );
450 
451  histograms.h_assoc_dzpvsigcut_pt.push_back( ibook.book1D("num_assoc(simToReco)_dzpvsigcut_pt","#sump_{T} of associated tracks (simToReco) vs dz(PV)/dzError",nintDzpvsigCum,0,maxDzpvsigCum) );
452  histograms.h_simul_dzpvsigcut_pt.push_back( ibook.book1D("num_simul_dzpvsigcut_pt","#sump_{T} of simulated tracks from sim PV/dzError",nintDzpvsigCum,0,maxDzpvsigCum) );
453  histograms.h_simul2_dzpvsigcut_pt.push_back( ibook.book1D("num_simul2_dzpvsigcut_pt","#sump_{T} of simulated tracks (associated to any track) from sim PV/dzError",nintDzpvsigCum,0,maxDzpvsigCum) );
454  histograms.h_assoc_dzpvsigcut_pt.back().enableSumw2();
455  histograms.h_simul_dzpvsigcut_pt.back().enableSumw2();
456  histograms.h_simul2_dzpvsigcut_pt.back().enableSumw2();
457 }
458 
460  histograms.h_tracks.push_back( ibook.book1D("tracks","number of reconstructed tracks", nintTracks, minTracks, maxTracks) );
461  histograms.h_fakes.push_back( ibook.book1D("fakes","number of fake reco tracks", nintTracks, minTracks, maxTracks) );
462  histograms.h_charge.push_back( ibook.book1D("charge","charge",3,-1.5,1.5) );
463 
464  histograms.h_hits.push_back( ibook.book1D("hits", "number of hits per track", nintHit,minHit,maxHit ) );
465  histograms.h_losthits.push_back( ibook.book1D("losthits", "number of lost hits per track", nintHit,minHit,maxHit) );
466  histograms.h_nchi2.push_back( ibook.book1D("chi2", "normalized #chi^{2}", 200, 0, 20 ) );
467  histograms.h_nchi2_prob.push_back( ibook.book1D("chi2_prob", "normalized #chi^{2} probability",100,0,1));
468 
469  histograms.h_nmisslayers_inner.push_back( ibook.book1D("missing_inner_layers", "number of missing inner layers", nintLayers,minLayers,maxLayers ) );
470  histograms.h_nmisslayers_outer.push_back( ibook.book1D("missing_outer_layers", "number of missing outer layers", nintLayers,minLayers,maxLayers ) );
471 
472  histograms.h_algo.push_back( ibook.book1D("h_algo","Tracks by algo",reco::TrackBase::algoSize, 0., double(reco::TrackBase::algoSize) ) );
473  for (size_t ibin=0; ibin<reco::TrackBase::algoSize-1; ibin++)
474  histograms.h_algo.back().setBinLabel(ibin+1,reco::TrackBase::algoNames[ibin]);
475  histograms.h_algo.back().disableAlphanumeric();
476 
478  histograms.h_recoeta.push_back( ibook.book1D("num_reco_eta","N of reco track vs eta",nintEta,minEta,maxEta) );
479  histograms.h_reco2eta.push_back( ibook.book1D("num_reco2_eta","N of selected reco track vs eta",nintEta,minEta,maxEta) );
480  histograms.h_assoc2eta.push_back( ibook.book1D("num_assoc(recoToSim)_eta","N of associated (recoToSim) tracks vs eta",nintEta,minEta,maxEta) );
481  histograms.h_loopereta.push_back( ibook.book1D("num_duplicate_eta","N of associated (recoToSim) duplicate tracks vs eta",nintEta,minEta,maxEta) );
482  if(!doSeedPlots_) histograms.h_misideta.push_back( ibook.book1D("num_chargemisid_eta","N of associated (recoToSim) charge misIDed tracks vs eta",nintEta,minEta,maxEta) );
483  histograms.h_pileupeta.push_back( ibook.book1D("num_pileup_eta","N of associated (recoToSim) pileup tracks vs eta",nintEta,minEta,maxEta) );
484  //
485  histograms.h_recopT.push_back( make1DIfLogX(ibook, useLogPt, "num_reco_pT","N of reco track vs pT",nintPt,minPt,maxPt) );
486  histograms.h_reco2pT.push_back( make1DIfLogX(ibook, useLogPt, "num_reco2_pT","N of selected reco track vs pT",nintPt,minPt,maxPt) );
487  histograms.h_assoc2pT.push_back( make1DIfLogX(ibook, useLogPt, "num_assoc(recoToSim)_pT","N of associated (recoToSim) tracks vs pT",nintPt,minPt,maxPt) );
488  histograms.h_looperpT.push_back( make1DIfLogX(ibook, useLogPt, "num_duplicate_pT","N of associated (recoToSim) duplicate tracks vs pT",nintPt,minPt,maxPt) );
489  if(!doSeedPlots_) histograms.h_misidpT.push_back( make1DIfLogX(ibook, useLogPt, "num_chargemisid_pT","N of associated (recoToSim) charge misIDed tracks vs pT",nintPt,minPt,maxPt) );
490  histograms.h_pileuppT.push_back( make1DIfLogX(ibook, useLogPt, "num_pileup_pT","N of associated (recoToSim) pileup tracks vs pT",nintPt,minPt,maxPt) );
491  //
492  histograms.h_recohit.push_back( ibook.book1D("num_reco_hit","N of reco track vs hit",nintHit,minHit,maxHit) );
493  histograms.h_assoc2hit.push_back( ibook.book1D("num_assoc(recoToSim)_hit","N of associated (recoToSim) tracks vs hit",nintHit,minHit,maxHit) );
494  histograms.h_looperhit.push_back( ibook.book1D("num_duplicate_hit","N of associated (recoToSim) duplicate tracks vs hit",nintHit,minHit,maxHit) );
495  if(!doSeedPlots_) histograms.h_misidhit.push_back( ibook.book1D("num_chargemisid_hit","N of associated (recoToSim) charge misIDed tracks vs hit",nintHit,minHit,maxHit) );
496  histograms.h_pileuphit.push_back( ibook.book1D("num_pileup_hit","N of associated (recoToSim) pileup tracks vs hit",nintHit,minHit,maxHit) );
497  //
498  histograms.h_recolayer.push_back( ibook.book1D("num_reco_layer","N of reco track vs layer",nintLayers,minLayers,maxLayers) );
499  histograms.h_assoc2layer.push_back( ibook.book1D("num_assoc(recoToSim)_layer","N of associated (recoToSim) tracks vs layer",nintLayers,minLayers,maxLayers) );
500  histograms.h_looperlayer.push_back( ibook.book1D("num_duplicate_layer","N of associated (recoToSim) duplicate tracks vs layer",nintLayers,minLayers,maxLayers) );
501  if(!doSeedPlots_) histograms.h_misidlayer.push_back( ibook.book1D("num_chargemisid_layer","N of associated (recoToSim) charge misIDed tracks vs layer",nintLayers,minLayers,maxLayers) );
502  histograms.h_pileuplayer.push_back( ibook.book1D("num_pileup_layer","N of associated (recoToSim) pileup tracks vs layer",nintLayers,minLayers,maxLayers) );
503  //
504  histograms.h_recopixellayer.push_back( ibook.book1D("num_reco_pixellayer","N of reco track vs pixellayer",nintLayers,minLayers,maxLayers) );
505  histograms.h_assoc2pixellayer.push_back( ibook.book1D("num_assoc(recoToSim)_pixellayer","N of associated (recoToSim) tracks vs pixellayer",nintLayers,minLayers,maxLayers) );
506  histograms.h_looperpixellayer.push_back( ibook.book1D("num_duplicate_pixellayer","N of associated (recoToSim) duplicate tracks vs pixellayer",nintLayers,minLayers,maxLayers) );
507  if(!doSeedPlots_) histograms.h_misidpixellayer.push_back( ibook.book1D("num_chargemisid_pixellayer","N of associated (recoToSim) charge misIDed tracks vs pixellayer",nintLayers,minLayers,maxLayers) );
508  histograms.h_pileuppixellayer.push_back( ibook.book1D("num_pileup_pixellayer","N of associated (recoToSim) pileup tracks vs pixellayer",nintLayers,minLayers,maxLayers) );
509  //
510  histograms.h_reco3Dlayer.push_back( ibook.book1D("num_reco_3Dlayer","N of reco track vs 3D layer",nintLayers,minLayers,maxLayers) );
511  histograms.h_assoc23Dlayer.push_back( ibook.book1D("num_assoc(recoToSim)_3Dlayer","N of associated (recoToSim) tracks vs 3D layer",nintLayers,minLayers,maxLayers) );
512  histograms.h_looper3Dlayer.push_back( ibook.book1D("num_duplicate_3Dlayer","N of associated (recoToSim) duplicate tracks vs 3D layer",nintLayers,minLayers,maxLayers) );
513  if(!doSeedPlots_) histograms.h_misid3Dlayer.push_back( ibook.book1D("num_chargemisid_3Dlayer","N of associated (recoToSim) charge misIDed tracks vs 3D layer",nintLayers,minLayers,maxLayers) );
514  histograms.h_pileup3Dlayer.push_back( ibook.book1D("num_pileup_3Dlayer","N of associated (recoToSim) pileup tracks vs 3D layer",nintLayers,minLayers,maxLayers) );
515  //
516  histograms.h_recopu.push_back( ibook.book1D("num_reco_pu","N of reco track vs pu",nintPu,minPu,maxPu) );
517  histograms.h_reco2pu.push_back( ibook.book1D("num_reco2_pu","N of selected reco track vs pu",nintPu,minPu,maxPu) );
518  histograms.h_assoc2pu.push_back( ibook.book1D("num_assoc(recoToSim)_pu","N of associated (recoToSim) tracks vs pu",nintPu,minPu,maxPu) );
519  histograms.h_looperpu.push_back( ibook.book1D("num_duplicate_pu","N of associated (recoToSim) duplicate tracks vs pu",nintPu,minPu,maxPu) );
520  if(!doSeedPlots_) histograms.h_misidpu.push_back( ibook.book1D("num_chargemisid_pu","N of associated (recoToSim) charge misIDed tracks vs pu",nintPu,minPu,maxPu) );
521  histograms.h_pileuppu.push_back( ibook.book1D("num_pileup_pu","N of associated (recoToSim) pileup tracks vs pu",nintPu,minPu,maxPu) );
522  //
523  histograms.h_recophi.push_back( ibook.book1D("num_reco_phi","N of reco track vs phi",nintPhi,minPhi,maxPhi) );
524  histograms.h_assoc2phi.push_back( ibook.book1D("num_assoc(recoToSim)_phi","N of associated (recoToSim) tracks vs phi",nintPhi,minPhi,maxPhi) );
525  histograms.h_looperphi.push_back( ibook.book1D("num_duplicate_phi","N of associated (recoToSim) duplicate tracks vs phi",nintPhi,minPhi,maxPhi) );
526  if(!doSeedPlots_) histograms.h_misidphi.push_back( ibook.book1D("num_chargemisid_phi","N of associated (recoToSim) charge misIDed tracks vs phi",nintPhi,minPhi,maxPhi) );
527  histograms.h_pileupphi.push_back( ibook.book1D("num_pileup_phi","N of associated (recoToSim) pileup tracks vs phi",nintPhi,minPhi,maxPhi) );
528 
529  histograms.h_recodxy.push_back( ibook.book1D("num_reco_dxy","N of reco track vs dxy",nintDxy,minDxy,maxDxy) );
530  histograms.h_assoc2dxy.push_back( ibook.book1D("num_assoc(recoToSim)_dxy","N of associated (recoToSim) tracks vs dxy",nintDxy,minDxy,maxDxy) );
531  histograms.h_looperdxy.push_back( ibook.book1D("num_duplicate_dxy","N of associated (recoToSim) looper tracks vs dxy",nintDxy,minDxy,maxDxy) );
532  if(!doSeedPlots_) histograms.h_misiddxy.push_back( ibook.book1D("num_chargemisid_dxy","N of associated (recoToSim) charge misIDed tracks vs dxy",nintDxy,minDxy,maxDxy) );
533  histograms.h_pileupdxy.push_back( ibook.book1D("num_pileup_dxy","N of associated (recoToSim) pileup tracks vs dxy",nintDxy,minDxy,maxDxy) );
534 
535  histograms.h_recodz.push_back( ibook.book1D("num_reco_dz","N of reco track vs dz",nintDz,minDz,maxDz) );
536  histograms.h_assoc2dz.push_back( ibook.book1D("num_assoc(recoToSim)_dz","N of associated (recoToSim) tracks vs dz",nintDz,minDz,maxDz) );
537  histograms.h_looperdz.push_back( ibook.book1D("num_duplicate_dz","N of associated (recoToSim) looper tracks vs dz",nintDz,minDz,maxDz) );
538  if(!doSeedPlots_) histograms.h_misiddz.push_back( ibook.book1D("num_chargemisid_versus_dz","N of associated (recoToSim) charge misIDed tracks vs dz",nintDz,minDz,maxDz) );
539  histograms.h_pileupdz.push_back( ibook.book1D("num_pileup_dz","N of associated (recoToSim) pileup tracks vs dz",nintDz,minDz,maxDz) );
540 
541  histograms.h_recovertpos.push_back( make1DIfLogX(ibook, useLogVertpos, "num_reco_vertpos","N of reconstructed tracks vs transverse ref point position",nintVertpos,minVertpos,maxVertpos) );
542  histograms.h_assoc2vertpos.push_back( make1DIfLogX(ibook, useLogVertpos, "num_assoc(recoToSim)_vertpos","N of associated (recoToSim) tracks vs transverse ref point position",nintVertpos,minVertpos,maxVertpos) );
543  histograms.h_loopervertpos.push_back( make1DIfLogX(ibook, useLogVertpos, "num_duplicate_vertpos","N of associated (recoToSim) looper tracks vs transverse ref point position",nintVertpos,minVertpos,maxVertpos) );
544  histograms.h_pileupvertpos.push_back( make1DIfLogX(ibook, useLogVertpos, "num_pileup_vertpos","N of associated (recoToSim) pileup tracks vs transverse ref point position",nintVertpos,minVertpos,maxVertpos) );
545 
546  histograms.h_recozpos.push_back( ibook.book1D("num_reco_zpos","N of reconstructed tracks vs transverse ref point position",nintZpos,minZpos,maxZpos) );
547  histograms.h_assoc2zpos.push_back( ibook.book1D("num_assoc(recoToSim)_zpos","N of associated (recoToSim) tracks vs transverse ref point position",nintZpos,minZpos,maxZpos) );
548  histograms.h_looperzpos.push_back( ibook.book1D("num_duplicate_zpos","N of associated (recoToSim) looper tracks vs transverse ref point position",nintZpos,minZpos,maxZpos) );
549  histograms.h_pileupzpos.push_back( ibook.book1D("num_pileup_zpos","N of associated (recoToSim) pileup tracks vs transverse ref point position",nintZpos,minZpos,maxZpos) );
550 
551  histograms.h_recodr.push_back( make1DIfLogX(ibook, true, "num_reco_dr","N of reconstructed tracks vs dR",nintdr,log10(mindr),log10(maxdr)) );
552  histograms.h_assoc2dr.push_back( make1DIfLogX(ibook, true, "num_assoc(recoToSim)_dr","N of associated tracks (recoToSim) vs dR",nintdr,log10(mindr),log10(maxdr)) );
553  histograms.h_looperdr.push_back( make1DIfLogX(ibook, true, "num_duplicate_dr","N of associated (recoToSim) looper tracks vs dR",nintdr,log10(mindr),log10(maxdr)) );
554  histograms.h_pileupdr.push_back( make1DIfLogX(ibook, true, "num_pileup_dr","N of associated (recoToSim) pileup tracks vs dR",nintdr,log10(mindr),log10(maxdr)) );
555 
556  histograms.h_reco_simpvz.push_back( ibook.book1D("num_reco_simpvz", "N of reco track vs. sim PV z", nintPVz, minPVz, maxPVz) );
557  histograms.h_assoc2_simpvz.push_back( ibook.book1D("num_assoc(recoToSim)_simpvz", "N of associated tracks (recoToSim) vs. sim PV z", nintPVz, minPVz, maxPVz) );
558  histograms.h_looper_simpvz.push_back( ibook.book1D("num_duplicate_simpvz", "N of associated (recoToSim) looper tracks vs. sim PV z", nintPVz, minPVz, maxPVz) );
559  histograms.h_pileup_simpvz.push_back( ibook.book1D("num_pileup_simpvz", "N of associated (recoToSim) pileup tracks vs. sim PV z", nintPVz, minPVz, maxPVz) );
560 
561  histograms.h_recochi2.push_back( ibook.book1D("num_reco_chi2","N of reco track vs normalized #chi^{2}",nintChi2,minChi2,maxChi2) );
562  histograms.h_assoc2chi2.push_back( ibook.book1D("num_assoc(recoToSim)_chi2","N of associated (recoToSim) tracks vs normalized #chi^{2}",nintChi2,minChi2,maxChi2) );
563  histograms.h_looperchi2.push_back( ibook.book1D("num_duplicate_chi2","N of associated (recoToSim) looper tracks vs normalized #chi^{2}",nintChi2,minChi2,maxChi2) );
564  if(!doSeedPlots_) histograms.h_misidchi2.push_back( ibook.book1D("num_chargemisid_chi2","N of associated (recoToSim) charge misIDed tracks vs normalized #chi^{2}",nintChi2,minChi2,maxChi2) );
565  histograms.h_pileupchi2.push_back( ibook.book1D("num_pileup_chi2","N of associated (recoToSim) pileup tracks vs normalized #chi^{2}",nintChi2,minChi2,maxChi2) );
566 
567 
568  if(!seedingLayerSetNames.empty()) {
569  const auto size = seedingLayerSetNames.size();
570  histograms.h_reco_seedingLayerSet.push_back(ibook.book1D("num_reco_seedingLayerSet", "N of reco track vs. seedingLayerSet", size,0,size));
571  histograms.h_assoc2_seedingLayerSet.push_back(ibook.book1D("num_assoc(recoToSim)_seedingLayerSet", "N of associated track (recoToSim) tracks vs. seedingLayerSet", size,0,size));
572  histograms.h_looper_seedingLayerSet.push_back(ibook.book1D("num_duplicate_seedingLayerSet", "N of reco associated (recoToSim) looper vs. seedingLayerSet", size,0,size));
573  histograms.h_pileup_seedingLayerSet.push_back(ibook.book1D("num_pileup_seedingLayerSet", "N of reco associated (recoToSim) pileup vs. seedingLayerSet", size,0,size));
574 
579  }
580 
582 
583  auto bookResolutionPlots1D = [&](std::vector<ConcurrentMonitorElement>& vec, auto&&... params) {
584  vec.push_back( doResolutionPlots ? ibook.book1D(std::forward<decltype(params)>(params)...) : ConcurrentMonitorElement{} );
585  };
586  auto bookResolutionPlots2D = [&](std::vector<ConcurrentMonitorElement>& vec, bool logx, auto&&... params) {
587  vec.push_back( doResolutionPlots ? make2DIfLogX(ibook, logx, std::forward<decltype(params)>(params)...) : ConcurrentMonitorElement{} );
588  };
589  auto bookResolutionPlotsProfile2D = [&](std::vector<ConcurrentMonitorElement>& vec, auto&&... params) {
590  vec.push_back( doResolutionPlots ? ibook.bookProfile2D(std::forward<decltype(params)>(params)...) : ConcurrentMonitorElement{} );
591  };
592 
593  bookResolutionPlots1D(histograms.h_eta, "eta", "pseudorapidity residue", 1000, -0.1, 0.1);
594  bookResolutionPlots1D(histograms.h_pt, "pullPt", "pull of p_{t}", 100, -10, 10 );
595  bookResolutionPlots1D(histograms.h_pullTheta, "pullTheta","pull of #theta parameter",250,-25,25);
596  bookResolutionPlots1D(histograms.h_pullPhi, "pullPhi","pull of #phi parameter",250,-25,25);
597  bookResolutionPlots1D(histograms.h_pullDxy, "pullDxy","pull of dxy parameter",250,-25,25);
598  bookResolutionPlots1D(histograms.h_pullDz, "pullDz","pull of dz parameter",250,-25,25);
599  bookResolutionPlots1D(histograms.h_pullQoverp, "pullQoverp","pull of qoverp parameter",250,-25,25);
600 
601  /* TO BE FIXED -----------
602  if (associators[ww]=="TrackAssociatorByChi2"){
603  histograms.h_assochi2.push_back( ibook.book1D("assocChi2","track association #chi^{2}",1000000,0,100000) );
604  histograms.h_assochi2_prob.push_back(ibook.book1D("assocChi2_prob","probability of association #chi^{2}",100,0,1));
605  } else if (associators[ww]=="quickTrackAssociatorByHits"){
606  histograms.h_assocFraction.push_back( ibook.book1D("assocFraction","fraction of shared hits",200,0,2) );
607  histograms.h_assocSharedHit.push_back(ibook.book1D("assocSharedHit","number of shared hits",20,0,20));
608  }
609  */
610  histograms.h_assocFraction.push_back( ibook.book1D("assocFraction","fraction of shared hits",200,0,2) );
611  histograms.h_assocSharedHit.push_back(ibook.book1D("assocSharedHit","number of shared hits",41,-0.5,40.5));
612  // ----------------------
613 
614  // use the standard error of the mean as the errors in the profile
615  histograms.chi2_vs_nhits.push_back( ibook.bookProfile("chi2mean_vs_nhits","mean #chi^{2} vs nhits",nintHit,minHit,maxHit, 100,0,10, " ") );
616 
617  bookResolutionPlots2D(histograms.etares_vs_eta, false, "etares_vs_eta","etaresidue vs eta",nintEta,minEta,maxEta,200,-0.1,0.1);
618  bookResolutionPlots2D(histograms.nrec_vs_nsim, false, "nrec_vs_nsim","Number of selected reco tracks vs. number of selected sim tracks;TrackingParticles;Reco tracks", nintTracks,minTracks,maxTracks, nintTracks,minTracks,maxTracks);
619 
620  histograms.chi2_vs_eta.push_back( ibook.bookProfile("chi2mean","mean #chi^{2} vs #eta",nintEta,minEta,maxEta, 200, 0, 20, " " ));
621  histograms.chi2_vs_phi.push_back( ibook.bookProfile("chi2mean_vs_phi","mean #chi^{2} vs #phi",nintPhi,minPhi,maxPhi, 200, 0, 20, " " ) );
622 
623  histograms.nhits_vs_eta.push_back( ibook.bookProfile("hits_eta","mean hits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit, " ") );
624  histograms.nPXBhits_vs_eta.push_back( ibook.bookProfile("PXBhits_vs_eta","mean # PXB its vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit, " ") );
625  histograms.nPXFhits_vs_eta.push_back( ibook.bookProfile("PXFhits_vs_eta","mean # PXF hits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit, " ") );
626  histograms.nPXLhits_vs_eta.push_back( ibook.bookProfile("PXLhits_vs_eta","mean # PXL hits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit, " ") );
627  histograms.nTIBhits_vs_eta.push_back( ibook.bookProfile("TIBhits_vs_eta","mean # TIB hits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit, " ") );
628  histograms.nTIDhits_vs_eta.push_back( ibook.bookProfile("TIDhits_vs_eta","mean # TID hits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit, " ") );
629  histograms.nTOBhits_vs_eta.push_back( ibook.bookProfile("TOBhits_vs_eta","mean # TOB hits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit, " ") );
630  histograms.nTEChits_vs_eta.push_back( ibook.bookProfile("TEChits_vs_eta","mean # TEC hits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit, " ") );
631  histograms.nSTRIPhits_vs_eta.push_back( ibook.bookProfile("STRIPhits_vs_eta","mean # STRIP hits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit, " ") );
632 
633  histograms.nLayersWithMeas_vs_eta.push_back( ibook.bookProfile("LayersWithMeas_eta","mean # Layers with measurement vs eta",
635  histograms.nPXLlayersWithMeas_vs_eta.push_back( ibook.bookProfile("PXLlayersWithMeas_vs_eta","mean # PXL Layers with measurement vs eta",
637  histograms.nSTRIPlayersWithMeas_vs_eta.push_back( ibook.bookProfile("STRIPlayersWithMeas_vs_eta","mean # STRIP Layers with measurement vs eta",
639  histograms.nSTRIPlayersWith1dMeas_vs_eta.push_back( ibook.bookProfile("STRIPlayersWith1dMeas_vs_eta","mean # STRIP Layers with 1D measurement vs eta",
641  histograms.nSTRIPlayersWith2dMeas_vs_eta.push_back( ibook.bookProfile("STRIPlayersWith2dMeas_vs_eta","mean # STRIP Layers with 2D measurement vs eta",
643 
644  histograms.nhits_vs_phi.push_back( ibook.bookProfile("hits_phi","mean # hits vs #phi",nintPhi,minPhi,maxPhi,nintHit,minHit,maxHit, " ") );
645 
646  histograms.nlosthits_vs_eta.push_back( ibook.bookProfile("losthits_vs_eta","mean # lost hits vs eta",nintEta,minEta,maxEta,nintHit,minHit,maxHit, " ") );
647 
648  //resolution of track parameters
649  // dPt/Pt cotTheta Phi TIP LIP
650  // log10(pt)<0.5 100,0.1 240,0.08 100,0.015 100,0.1000 150,0.3000
651  // 0.5<log10(pt)<1.5 100,0.1 120,0.01 100,0.003 100,0.0100 150,0.0500
652  // >1.5 100,0.3 100,0.005 100,0.0008 100,0.0060 120,0.0300
653 
654  bookResolutionPlots2D(histograms.ptres_vs_eta, false, "ptres_vs_eta","ptres_vs_eta",
656 
657  bookResolutionPlots2D(histograms.ptres_vs_phi, false, "ptres_vs_phi","p_{t} res vs #phi",
659 
660  bookResolutionPlots2D(histograms.ptres_vs_pt, useLogPt, "ptres_vs_pt","ptres_vs_pt",nintPt,minPt,maxPt, ptRes_nbin, ptRes_rangeMin, ptRes_rangeMax);
661 
662  bookResolutionPlots2D(histograms.cotThetares_vs_eta, false, "cotThetares_vs_eta","cotThetares_vs_eta",
664 
665  bookResolutionPlots2D(histograms.cotThetares_vs_pt, useLogPt, "cotThetares_vs_pt","cotThetares_vs_pt",
667 
668 
669  bookResolutionPlots2D(histograms.phires_vs_eta, false, "phires_vs_eta","phires_vs_eta",
671 
672  bookResolutionPlots2D(histograms.phires_vs_pt, useLogPt, "phires_vs_pt","phires_vs_pt",
674 
675  bookResolutionPlots2D(histograms.phires_vs_phi, false, "phires_vs_phi","#phi res vs #phi",
677 
678  bookResolutionPlots2D(histograms.dxyres_vs_eta, false, "dxyres_vs_eta","dxyres_vs_eta",
680 
681  bookResolutionPlots2D(histograms.dxyres_vs_pt, useLogPt, "dxyres_vs_pt","dxyres_vs_pt",
683 
684  bookResolutionPlots2D(histograms.dzres_vs_eta, false, "dzres_vs_eta","dzres_vs_eta",
686 
687  bookResolutionPlots2D(histograms.dzres_vs_pt, useLogPt, "dzres_vs_pt","dzres_vs_pt",nintPt,minPt,maxPt,dzRes_nbin, dzRes_rangeMin, dzRes_rangeMax);
688 
689  bookResolutionPlotsProfile2D(histograms.ptmean_vs_eta_phi, "ptmean_vs_eta_phi","mean p_{t} vs #eta and #phi",
690  nintPhi,minPhi,maxPhi,nintEta,minEta,maxEta,1000,0,1000);
691  bookResolutionPlotsProfile2D(histograms.phimean_vs_eta_phi, "phimean_vs_eta_phi","mean #phi vs #eta and #phi",
693 
694  //pulls of track params vs eta: to be used with fitslicesytool
695  bookResolutionPlots2D(histograms.dxypull_vs_eta, false, "dxypull_vs_eta","dxypull_vs_eta",nintEta,minEta,maxEta,100,-10,10);
696  bookResolutionPlots2D(histograms.ptpull_vs_eta, false, "ptpull_vs_eta","ptpull_vs_eta",nintEta,minEta,maxEta,100,-10,10);
697  bookResolutionPlots2D(histograms.dzpull_vs_eta, false, "dzpull_vs_eta","dzpull_vs_eta",nintEta,minEta,maxEta,100,-10,10);
698  bookResolutionPlots2D(histograms.phipull_vs_eta, false, "phipull_vs_eta","phipull_vs_eta",nintEta,minEta,maxEta,100,-10,10);
699  bookResolutionPlots2D(histograms.thetapull_vs_eta, false, "thetapull_vs_eta","thetapull_vs_eta",nintEta,minEta,maxEta,100,-10,10);
700 
701  // histograms.h_ptshiftetamean.push_back( ibook.book1D("h_ptshifteta_Mean","<#deltapT/pT>[%] vs #eta",nintEta,minEta,maxEta) );
702 
703 
704  //pulls of track params vs phi
705  bookResolutionPlots2D(histograms.ptpull_vs_phi, false, "ptpull_vs_phi","p_{t} pull vs #phi",nintPhi,minPhi,maxPhi,100,-10,10);
706  bookResolutionPlots2D(histograms.phipull_vs_phi, false, "phipull_vs_phi","#phi pull vs #phi",nintPhi,minPhi,maxPhi,100,-10,10);
707  bookResolutionPlots2D(histograms.thetapull_vs_phi, false, "thetapull_vs_phi","#theta pull vs #phi",nintPhi,minPhi,maxPhi,100,-10,10);
708 
709 
710  bookResolutionPlots2D(histograms.nrecHit_vs_nsimHit_rec2sim, false, "nrecHit_vs_nsimHit_rec2sim","nrecHit vs nsimHit (Rec2simAssoc)", nintHit,minHit,maxHit, nintHit,minHit,maxHit);
711 }
712 
714  histograms.h_recodxypv.push_back( ibook.book1D("num_reco_dxypv","N of reco track vs dxy(PV)",nintDxy,minDxy,maxDxy) );
715  histograms.h_assoc2dxypv.push_back( ibook.book1D("num_assoc(recoToSim)_dxypv","N of associated (recoToSim) tracks vs dxy(PV)",nintDxy,minDxy,maxDxy) );
716  histograms.h_looperdxypv.push_back( ibook.book1D("num_duplicate_dxypv","N of associated (recoToSim) looper tracks vs dxy(PV)",nintDxy,minDxy,maxDxy) );
717  if(!doSeedPlots_) histograms.h_misiddxypv.push_back( ibook.book1D("num_chargemisid_dxypv","N of associated (recoToSim) charge misIDed tracks vs dxy(PV)",nintDxy,minDxy,maxDxy) );
718  histograms.h_pileupdxypv.push_back( ibook.book1D("num_pileup_dxypv","N of associated (recoToSim) pileup tracks vs dxy(PV)",nintDxy,minDxy,maxDxy) );
719 
720  histograms.h_recodzpv.push_back( ibook.book1D("num_reco_dzpv","N of reco track vs dz(PV)",nintDz,minDz,maxDz) );
721  histograms.h_assoc2dzpv.push_back( ibook.book1D("num_assoc(recoToSim)_dzpv","N of associated (recoToSim) tracks vs dz(PV)",nintDz,minDz,maxDz) );
722  histograms.h_looperdzpv.push_back( ibook.book1D("num_duplicate_dzpv","N of associated (recoToSim) looper tracks vs dz(PV)",nintDz,minDz,maxDz) );
723  if(!doSeedPlots_) histograms.h_misiddzpv.push_back( ibook.book1D("num_chargemisid_versus_dzpv","N of associated (recoToSim) charge misIDed tracks vs dz(PV)",nintDz,minDz,maxDz) );
724  histograms.h_pileupdzpv.push_back( ibook.book1D("num_pileup_dzpv","N of associated (recoToSim) pileup tracks vs dz(PV)",nintDz,minDz,maxDz) );
725 
726  histograms.h_recodxypvzoomed.push_back( ibook.book1D("num_reco_dxypv_zoomed","N of reco track vs dxy(PV)",nintDxy,minDxy/dxyDzZoom,maxDxy/dxyDzZoom) );
727  histograms.h_assoc2dxypvzoomed.push_back( ibook.book1D("num_assoc(recoToSim)_dxypv_zoomed","N of associated (recoToSim) tracks vs dxy(PV)",nintDxy,minDxy/dxyDzZoom,maxDxy/dxyDzZoom) );
728  histograms.h_looperdxypvzoomed.push_back( ibook.book1D("num_duplicate_dxypv_zoomed","N of associated (recoToSim) looper tracks vs dxy(PV)",nintDxy,minDxy/dxyDzZoom,maxDxy/dxyDzZoom) );
729  if(!doSeedPlots_) histograms.h_misiddxypvzoomed.push_back( ibook.book1D("num_chargemisid_dxypv_zoomed","N of associated (recoToSim) charge misIDed tracks vs dxy(PV)",nintDxy,minDxy/dxyDzZoom,maxDxy/dxyDzZoom) );
730  histograms.h_pileupdxypvzoomed.push_back( ibook.book1D("num_pileup_dxypv_zoomed","N of associated (recoToSim) pileup tracks vs dxy(PV)",nintDxy,minDxy/dxyDzZoom,maxDxy/dxyDzZoom) );
731 
732  histograms.h_recodzpvzoomed.push_back( ibook.book1D("num_reco_dzpv_zoomed","N of reco track vs dz(PV)",nintDz,minDz/dxyDzZoom,maxDz/dxyDzZoom) );
733  histograms.h_assoc2dzpvzoomed.push_back( ibook.book1D("num_assoc(recoToSim)_dzpv_zoomed","N of associated (recoToSim) tracks vs dz(PV)",nintDz,minDz/dxyDzZoom,maxDz/dxyDzZoom) );
734  histograms.h_looperdzpvzoomed.push_back( ibook.book1D("num_duplicate_dzpv_zoomed","N of associated (recoToSim) looper tracks vs dz(PV)",nintDz,minDz/dxyDzZoom,maxDz/dxyDzZoom) );
735  if(!doSeedPlots_) histograms.h_misiddzpvzoomed.push_back( ibook.book1D("num_chargemisid_versus_dzpv_zoomed","N of associated (recoToSim) charge misIDed tracks vs dz(PV)",nintDz,minDz/dxyDzZoom,maxDz/dxyDzZoom) );
736  histograms.h_pileupdzpvzoomed.push_back( ibook.book1D("num_pileup_dzpv_zoomed","N of associated (recoToSim) pileup tracks vs dz(PV)",nintDz,minDz/dxyDzZoom,maxDz/dxyDzZoom) );
737 
738  histograms.h_reco_dzpvcut.push_back( ibook.book1D("num_reco_dzpvcut","N of reco track vs dz(PV)",nintDzpvCum,0,maxDzpvCum) );
739  histograms.h_assoc2_dzpvcut.push_back( ibook.book1D("num_assoc(recoToSim)_dzpvcut","N of associated (recoToSim) tracks vs dz(PV)",nintDzpvCum,0,maxDzpvCum) );
740  histograms.h_pileup_dzpvcut.push_back( ibook.book1D("num_pileup_dzpvcut", "N of associated (recoToSim) pileup tracks vs dz(PV)",nintDzpvCum,0,maxDzpvCum) );
741 
742  histograms.h_reco_dzpvcut_pt.push_back( ibook.book1D("num_reco_dzpvcut_pt","#sump_{T} of reco track vs dz(PV)",nintDzpvCum,0,maxDzpvCum) );
743  histograms.h_assoc2_dzpvcut_pt.push_back( ibook.book1D("num_assoc(recoToSim)_dzpvcut_pt","#sump_{T} of associated (recoToSim) tracks vs dz(PV)",nintDzpvCum,0,maxDzpvCum) );
744  histograms.h_pileup_dzpvcut_pt.push_back( ibook.book1D("num_pileup_dzpvcut_pt", "#sump_{T} of associated (recoToSim) pileup tracks vs dz(PV)",nintDzpvCum,0,maxDzpvCum) );
745  histograms.h_reco_dzpvcut_pt.back().enableSumw2();
746  histograms.h_assoc2_dzpvcut_pt.back().enableSumw2();
747  histograms.h_pileup_dzpvcut_pt.back().enableSumw2();
748 
749  histograms.h_reco_dzpvsigcut.push_back( ibook.book1D("num_reco_dzpvsigcut","N of reco track vs dz(PV)/dzError",nintDzpvsigCum,0,maxDzpvsigCum) );
750  histograms.h_assoc2_dzpvsigcut.push_back( ibook.book1D("num_assoc(recoToSim)_dzpvsigcut","N of associated (recoToSim) tracks vs dz(PV)/dzError",nintDzpvsigCum,0,maxDzpvsigCum) );
751  histograms.h_pileup_dzpvsigcut.push_back( ibook.book1D("num_pileup_dzpvsigcut","N of associated (recoToSim) pileup tracks vs dz(PV)/dzError",nintDzpvsigCum,0,maxDzpvsigCum) );
752 
753  histograms.h_reco_dzpvsigcut_pt.push_back( ibook.book1D("num_reco_dzpvsigcut_pt","#sump_{T} of reco track vs dz(PV)/dzError",nintDzpvsigCum,0,maxDzpvsigCum) );
754  histograms.h_assoc2_dzpvsigcut_pt.push_back( ibook.book1D("num_assoc(recoToSim)_dzpvsigcut_pt","#sump_{T} of associated (recoToSim) tracks vs dz(PV)/dzError",nintDzpvsigCum,0,maxDzpvsigCum) );
755  histograms.h_pileup_dzpvsigcut_pt.push_back( ibook.book1D("num_pileup_dzpvsigcut_pt","#sump_{T} of associated (recoToSim) pileup tracks vs dz(PV)/dzError",nintDzpvsigCum,0,maxDzpvsigCum) );
756  histograms.h_reco_dzpvsigcut_pt.back().enableSumw2();
757  histograms.h_assoc2_dzpvsigcut_pt.back().enableSumw2();
758  histograms.h_pileup_dzpvsigcut_pt.back().enableSumw2();
759 
760 }
761 
763  // dE/dx stuff
764  histograms.h_dedx_estim.emplace_back();
765  histograms.h_dedx_estim.back().push_back(ibook.book1D("h_dedx_estim1","dE/dx estimator 1",nintDeDx,minDeDx,maxDeDx));
766  histograms.h_dedx_estim.back().push_back(ibook.book1D("h_dedx_estim2","dE/dx estimator 2",nintDeDx,minDeDx,maxDeDx));
767 
768  histograms.h_dedx_nom.emplace_back();
769  histograms.h_dedx_nom.back().push_back(ibook.book1D("h_dedx_nom1","dE/dx number of measurements",nintHit,minHit,maxHit));
770  histograms.h_dedx_nom.back().push_back(ibook.book1D("h_dedx_nom2","dE/dx number of measurements",nintHit,minHit,maxHit));
771 
772  histograms.h_dedx_sat.emplace_back();
773  histograms.h_dedx_sat.back().push_back(ibook.book1D("h_dedx_sat1","dE/dx number of measurements with saturation",nintHit,minHit,maxHit));
774  histograms.h_dedx_sat.back().push_back(ibook.book1D("h_dedx_sat2","dE/dx number of measurements with saturation",nintHit,minHit,maxHit));
775 }
776 
778  histograms.h_seedsFitFailed.push_back(ibook.book1D("seeds_fitFailed", "Number of seeds for which the fit failed", nintTracks, minTracks, maxTracks));
779  histograms.h_seedsFitFailedFraction.push_back(ibook.book1D("seeds_fitFailedFraction", "Fraction of seeds for which the fit failed", 100, 0, 1));
780 }
781 
783  histograms.h_reco_mva.emplace_back();
784  histograms.h_assoc2_mva.emplace_back();
785 
786  histograms.h_reco_mvacut.emplace_back();
787  histograms.h_assoc_mvacut.emplace_back();
788  histograms.h_assoc2_mvacut.emplace_back();
789  histograms.h_simul2_mvacut.emplace_back();
790 
791  histograms.h_reco_mva_hp.emplace_back();
792  histograms.h_assoc2_mva_hp.emplace_back();
793 
794  histograms.h_reco_mvacut_hp.emplace_back();
795  histograms.h_assoc_mvacut_hp.emplace_back();
796  histograms.h_assoc2_mvacut_hp.emplace_back();
797  histograms.h_simul2_mvacut_hp.emplace_back();
798 
799  histograms.h_assoc2_mva_vs_pt.emplace_back();
800  histograms.h_fake_mva_vs_pt.emplace_back();
801  histograms.h_assoc2_mva_vs_pt_hp.emplace_back();
802  histograms.h_fake_mva_vs_pt_hp.emplace_back();
803  histograms.h_assoc2_mva_vs_eta.emplace_back();
804  histograms.h_fake_mva_vs_eta.emplace_back();
805  histograms.h_assoc2_mva_vs_eta_hp.emplace_back();
806  histograms.h_fake_mva_vs_eta_hp.emplace_back();
807 
808  for(size_t i=1; i <= nMVAs; ++i) {
809  auto istr = std::to_string(i);
810  std::string pfix;
811 
812  if(i==1) {
813  histograms.h_reco_mva_hp.back().emplace_back();
814  histograms.h_assoc2_mva_hp.back().emplace_back();
815 
816  histograms.h_reco_mvacut_hp.back().emplace_back();
817  histograms.h_assoc_mvacut_hp.back().emplace_back();
818  histograms.h_assoc2_mvacut_hp.back().emplace_back();
819  histograms.h_simul2_mvacut_hp.back().emplace_back();
820 
821  histograms.h_assoc2_mva_vs_pt_hp.back().emplace_back();
822  histograms.h_fake_mva_vs_pt_hp.back().emplace_back();
823  histograms.h_assoc2_mva_vs_eta_hp.back().emplace_back();
824  histograms.h_fake_mva_vs_eta_hp.back().emplace_back();
825  }
826  else {
827  pfix = " (not loose-selected)";
828  std::string pfix2 = " (not HP-selected)";
829 
830  histograms.h_reco_mva_hp.back().push_back(ibook.book1D("num_reco_mva"+istr+"_hp", "N of reco track after vs MVA"+istr+pfix2, nintMVA, minMVA, maxMVA) );
831  histograms.h_assoc2_mva_hp.back().push_back(ibook.book1D("num_assoc(recoToSim)_mva"+istr+"_hp", "N of associated tracks (recoToSim) vs MVA"+istr+pfix2, nintMVA, minMVA, maxMVA) );
832 
833  histograms.h_reco_mvacut_hp.back().push_back(ibook.book1D("num_reco_mva"+istr+"cut"+"_hp", "N of reco track vs cut on MVA"+istr+pfix2, nintMVA, minMVA, maxMVA) );
834  histograms.h_assoc_mvacut_hp.back().push_back(ibook.book1D("num_assoc(simToReco)_mva"+istr+"cut_hp", "N of associated tracks (simToReco) vs cut on MVA"+istr+pfix2, nintMVA, minMVA, maxMVA) );
835  histograms.h_assoc2_mvacut_hp.back().push_back(ibook.book1D("num_assoc(recoToSim)_mva"+istr+"cut_hp", "N of associated tracks (recoToSim) vs cut on MVA"+istr+pfix2, nintMVA, minMVA, maxMVA) );
836  histograms.h_simul2_mvacut_hp.back().push_back(ibook.book1D("num_simul2_mva"+istr+"cut_hp", "N of simulated tracks (associated to any track) vs cut on MVA"+istr+pfix2, nintMVA, minMVA, maxMVA) );
837 
838  histograms.h_assoc2_mva_vs_pt_hp.back().push_back(makeProfileIfLogX(ibook, useLogPt, ("mva_assoc(recoToSim)_mva"+istr+"_pT_hp").c_str(), ("MVA"+istr+" of associated tracks (recoToSim) vs. track p_{T}"+pfix2).c_str(), nintPt, minPt, maxPt, minMVA, maxMVA));
839  histograms.h_fake_mva_vs_pt_hp.back().push_back(makeProfileIfLogX(ibook, useLogPt, ("mva_fake_mva"+istr+"pT_hp").c_str(), ("MVA"+istr+" of non-associated tracks (recoToSim) vs. track p_{T}"+pfix2).c_str(), nintPt, minPt, maxPt, minMVA, maxMVA));
840  histograms.h_assoc2_mva_vs_eta_hp.back().push_back(ibook.bookProfile("mva_assoc(recoToSim)_mva"+istr+"_eta_hp", "MVA"+istr+" of associated tracks (recoToSim) vs. track #eta"+pfix2, nintEta, minEta, maxEta, nintMVA, minMVA, maxMVA));
841  histograms.h_fake_mva_vs_eta_hp.back().push_back(ibook.bookProfile("mva_fake_mva"+istr+"eta_hp", "MVA"+istr+" of non-associated tracks (recoToSim) vs. track #eta"+pfix2, nintEta, minEta, maxEta, nintMVA, minMVA, maxMVA));
842  }
843 
844  histograms.h_reco_mva.back().push_back(ibook.book1D("num_reco_mva"+istr, "N of reco track vs MVA"+istr+pfix, nintMVA, minMVA, maxMVA) );
845  histograms.h_assoc2_mva.back().push_back(ibook.book1D("num_assoc(recoToSim)_mva"+istr, "N of associated tracks (recoToSim) vs MVA"+istr+pfix, nintMVA, minMVA, maxMVA) );
846 
847  histograms.h_reco_mvacut.back().push_back(ibook.book1D("num_reco_mva"+istr+"cut", "N of reco track vs cut on MVA"+istr+pfix, nintMVA, minMVA, maxMVA) );
848  histograms.h_assoc_mvacut.back().push_back(ibook.book1D("num_assoc(simToReco)_mva"+istr+"cut", "N of associated tracks (simToReco) vs cut on MVA"+istr+pfix, nintMVA, minMVA, maxMVA) );
849  histograms.h_assoc2_mvacut.back().push_back(ibook.book1D("num_assoc(recoToSim)_mva"+istr+"cut", "N of associated tracks (recoToSim) vs cut on MVA"+istr+pfix, nintMVA, minMVA, maxMVA) );
850  histograms.h_simul2_mvacut.back().push_back(ibook.book1D("num_simul2_mva"+istr+"cut", "N of simulated tracks (associated to any track) vs cut on MVA"+istr+pfix, nintMVA, minMVA, maxMVA) );
851 
852  histograms.h_assoc2_mva_vs_pt.back().push_back(makeProfileIfLogX(ibook, useLogPt, ("mva_assoc(recoToSim)_mva"+istr+"_pT").c_str(), ("MVA"+istr+" of associated tracks (recoToSim) vs. track p_{T}"+pfix).c_str(), nintPt, minPt, maxPt, minMVA, maxMVA));
853  histograms.h_fake_mva_vs_pt.back().push_back(makeProfileIfLogX(ibook, useLogPt, ("mva_fake_mva"+istr+"_pT").c_str(), ("MVA"+istr+" of non-associated tracks (recoToSim) vs. track p_{T}"+pfix).c_str(), nintPt, minPt, maxPt, minMVA, maxMVA));
854  histograms.h_assoc2_mva_vs_eta.back().push_back(ibook.bookProfile("mva_assoc(recoToSim)_mva"+istr+"_eta", "MVA"+istr+" of associated tracks (recoToSim) vs. track #eta"+pfix, nintEta, minEta, maxEta, nintMVA, minMVA, maxMVA));
855  histograms.h_fake_mva_vs_eta.back().push_back(ibook.bookProfile("mva_fake_mva"+istr+"_eta", "MVA"+istr+" of non-associated tracks (recoToSim) vs. track #eta"+pfix, nintEta, minEta, maxEta, nintMVA, minMVA, maxMVA));
856  }
857 }
858 
860  const TrackingParticle::Vector& momentumTP,
861  const TrackingParticle::Point& vertexTP,
862  int bx) const {
863  if(bx == 0) {
864  histograms.h_ptSIM.fill(sqrt(momentumTP.perp2()));
865  histograms.h_etaSIM.fill(momentumTP.eta());
866  histograms.h_vertposSIM.fill(sqrt(vertexTP.perp2()));
867  }
868  histograms.h_bunchxSIM.fill(bx);
869 }
870 
871 
872 
874  int count,
875  const TrackingParticle& tp,
876  const TrackingParticle::Vector& momentumTP,
877  const TrackingParticle::Point& vertexTP,
878  double dxySim, double dzSim,
879  double dxyPVSim, double dzPVSim,
880  int nSimHits,
881  int nSimLayers, int nSimPixelLayers, int nSimStripMonoAndStereoLayers,
882  const reco::Track* track,
883  int numVertices,
884  double dR,
885  const math::XYZPoint *pvPosition,
886  const TrackingVertex::LorentzVector *simPVPosition,
887  const math::XYZPoint& bsPosition,
888  const std::vector<float>& mvas,
889  unsigned int selectsLoose, unsigned int selectsHP) const {
890  bool isMatched = track;
891  const auto eta = getEta(momentumTP.eta());
892  const auto phi = momentumTP.phi();
893  const auto pt = getPt(sqrt(momentumTP.perp2()));
894  const auto nSim3DLayers = nSimPixelLayers + nSimStripMonoAndStereoLayers;
895 
896  const auto vertexTPwrtBS = vertexTP - bsPosition;
897  const auto vertxy = std::sqrt(vertexTPwrtBS.perp2());
898  const auto vertz = vertexTPwrtBS.z();
899 
900  //efficiency vs. cut on MVA
901  //
902  // Note that this includes also pileup TPs, as "signalOnly"
903  // selection is applied only in the TpSelector*. Have to think if
904  // this is really what we want.
905  if(isMatched) {
906  for(size_t i=0; i<mvas.size(); ++i) {
907  if(i<=selectsLoose) {
908  histograms.h_simul2_mvacut[count][i].fill(maxMVA);
909  histograms.h_assoc_mvacut[count][i].fill(mvas[i]);
910  }
911  if(i>=1 && i<=selectsHP) {
912  histograms.h_simul2_mvacut_hp[count][i].fill(maxMVA);
913  histograms.h_assoc_mvacut_hp[count][i].fill(mvas[i]);
914  }
915  }
916  }
917 
918  if((*TpSelectorForEfficiencyVsEta)(tp)){
919  //effic vs eta
920  histograms.h_simuleta[count].fill(eta);
921  if (isMatched) histograms.h_assoceta[count].fill(eta);
922  }
923 
924  if((*TpSelectorForEfficiencyVsPhi)(tp)){
925  histograms.h_simulphi[count].fill(phi);
926  if (isMatched) histograms.h_assocphi[count].fill(phi);
927  //effic vs hits
928  histograms.h_simulhit[count].fill(nSimHits);
929  histograms.h_simullayer[count].fill(nSimLayers);
930  histograms.h_simulpixellayer[count].fill(nSimPixelLayers);
931  histograms.h_simul3Dlayer[count].fill(nSim3DLayers);
932  if(isMatched) {
933  histograms.h_assochit[count].fill(nSimHits);
934  histograms.h_assoclayer[count].fill(nSimLayers);
935  histograms.h_assocpixellayer[count].fill(nSimPixelLayers);
936  histograms.h_assoc3Dlayer[count].fill(nSim3DLayers);
937  if(histograms.nrecHit_vs_nsimHit_sim2rec[count]) histograms.nrecHit_vs_nsimHit_sim2rec[count].fill( track->numberOfValidHits(),nSimHits);
938  }
939  //effic vs pu
940  histograms.h_simulpu[count].fill(numVertices);
941  if(isMatched) histograms.h_assocpu[count].fill(numVertices);
942  //efficiency vs dR
943  histograms.h_simuldr[count].fill(dR);
944  if (isMatched) histograms.h_assocdr[count].fill(dR);
945  }
946 
947  if((*TpSelectorForEfficiencyVsPt)(tp)){
948  histograms.h_simulpT[count].fill(pt);
949  if (isMatched) histograms.h_assocpT[count].fill(pt);
950  }
951 
953  histograms.h_simuldxy[count].fill(dxySim);
954  if (isMatched) histograms.h_assocdxy[count].fill(dxySim);
955  if(pvPosition) {
956  histograms.h_simuldxypv[count].fill(dxyPVSim);
957  histograms.h_simuldxypvzoomed[count].fill(dxyPVSim);
958  if (isMatched) {
959  histograms.h_assocdxypv[count].fill(dxyPVSim);
960  histograms.h_assocdxypvzoomed[count].fill(dxyPVSim);
961  }
962  }
963 
964  histograms.h_simulvertpos[count].fill(vertxy);
965  if (isMatched) histograms.h_assocvertpos[count].fill(vertxy);
966  }
967 
968 
970  histograms.h_simuldz[count].fill(dzSim);
971  if (isMatched) histograms.h_assocdz[count].fill(dzSim);
972 
973  histograms.h_simulzpos[count].fill(vertz);
974  if (isMatched) histograms.h_assoczpos[count].fill(vertz);
975 
976  if(pvPosition) {
977  histograms.h_simuldzpv[count].fill(dzPVSim);
978  histograms.h_simuldzpvzoomed[count].fill(dzPVSim);
979 
980  histograms.h_simul_dzpvcut[count].fill(0);
981  histograms.h_simul_dzpvsigcut[count].fill(0);
982  histograms.h_simul_dzpvcut_pt[count].fill(0, pt);
983  histograms.h_simul_dzpvsigcut_pt[count].fill(0, pt);
984 
985  if(isMatched) {
986  histograms.h_assocdzpv[count].fill(dzPVSim);
987  histograms.h_assocdzpvzoomed[count].fill(dzPVSim);
988 
989  histograms.h_simul2_dzpvcut[count].fill(0);
990  histograms.h_simul2_dzpvsigcut[count].fill(0);
991  histograms.h_simul2_dzpvcut_pt[count].fill(0, pt);
992  histograms.h_simul2_dzpvsigcut_pt[count].fill(0, pt);
993  const double dzpvcut = std::abs(track->dz(*pvPosition));
994  const double dzpvsigcut = dzpvcut / track->dzError();
995  histograms.h_assoc_dzpvcut[count].fill(dzpvcut);
996  histograms.h_assoc_dzpvsigcut[count].fill(dzpvsigcut);
997  histograms.h_assoc_dzpvcut_pt[count].fill(dzpvcut, pt);
998  histograms.h_assoc_dzpvsigcut_pt[count].fill(dzpvsigcut, pt);
999  }
1000  }
1001  if(simPVPosition) {
1002  const auto simpvz = simPVPosition->z();
1003  histograms.h_simul_simpvz[count].fill(simpvz);
1004  if(isMatched) {
1005  histograms.h_assoc_simpvz[count].fill(simpvz);
1006  }
1007  }
1008  }
1009 
1010 }
1011 
1013  int count,
1014  const reco::Track& track1,
1015  const reco::Track& track2) const {
1016  histograms.h_duplicates_oriAlgo_vs_oriAlgo[count].fill(track1.originalAlgo(), track2.originalAlgo());
1017 }
1018 
1020  histograms.h_tracksSIM.fill(numSimTracks);
1021 }
1022 
1023 // dE/dx
1025  for (unsigned int i=0; i<v_dEdx.size(); i++) {
1026  const edm::ValueMap<reco::DeDxData>& dEdxTrack = *(v_dEdx[i]);
1027  const reco::DeDxData& dedx = dEdxTrack[trackref];
1028  histograms.h_dedx_estim[count][i].fill(dedx.dEdx());
1029  histograms.h_dedx_nom[count][i].fill(dedx.numberOfMeasurements());
1030  histograms.h_dedx_sat[count][i].fill(dedx.numberOfSaturatedMeasurements());
1031  }
1032 }
1033 
1034 
1036  int count,
1037  const reco::Track& track,
1038  const TrackerTopology& ttopo,
1039  const math::XYZPoint& bsPosition,
1040  const math::XYZPoint *pvPosition,
1041  const TrackingVertex::LorentzVector *simPVPosition,
1042  bool isMatched,
1043  bool isSigMatched,
1044  bool isChargeMatched,
1045  int numAssocRecoTracks,
1046  int numVertices,
1047  int nSimHits,
1048  double sharedFraction,
1049  double dR,
1050  const std::vector<float>& mvas,
1051  unsigned int selectsLoose, unsigned int selectsHP) const {
1052 
1053  //Fill track algo histogram
1054  histograms.h_algo[count].fill(track.algo());
1055  int sharedHits = sharedFraction * track.numberOfValidHits();
1056 
1057  //Compute fake rate vs eta
1058  const auto eta = getEta(track.momentum().eta());
1059  const auto phi = track.momentum().phi();
1060  const auto pt = getPt(sqrt(track.momentum().perp2()));
1061  const auto dxy = track.dxy(bsPosition);
1062  const auto dz = track.dz(bsPosition);
1063  const auto dxypv = pvPosition ? track.dxy(*pvPosition) : 0.0;
1064  const auto dzpv = pvPosition ? track.dz(*pvPosition) : 0.0;
1065  const auto dzpvsig = pvPosition ? dzpv / track.dzError() : 0.0;
1066  const auto nhits = track.found();
1067  const auto nlayers = track.hitPattern().trackerLayersWithMeasurement();
1068  const auto nPixelLayers = track.hitPattern().pixelLayersWithMeasurement();
1069  const auto n3DLayers = nPixelLayers + track.hitPattern().numberOfValidStripLayersWithMonoAndStereo();
1070  const auto refPointWrtBS = track.referencePoint() - bsPosition;
1071  const auto vertxy = std::sqrt(refPointWrtBS.perp2());
1072  const auto vertz = refPointWrtBS.z();
1073  const auto chi2 = track.normalizedChi2();
1074  const bool fillSeedingLayerSets = !seedingLayerSetNames.empty();
1075  const unsigned int seedingLayerSetBin = fillSeedingLayerSets ? getSeedingLayerSetBin(track, ttopo) : 0;
1076  const auto simpvz = simPVPosition ? simPVPosition->z() : 0.0;
1077 
1078  const bool paramsValid = !trackFromSeedFitFailed(track);
1079 
1080  if(paramsValid) {
1081  histograms.h_recoeta[count].fill(eta);
1082  histograms.h_recophi[count].fill(phi);
1083  histograms.h_recopT[count].fill(pt);
1084  histograms.h_recodxy[count].fill(dxy);
1085  histograms.h_recodz[count].fill(dz);
1086  histograms.h_recochi2[count].fill(chi2);
1087  histograms.h_recovertpos[count].fill(vertxy);
1088  histograms.h_recozpos[count].fill(vertz);
1089  histograms.h_recodr[count].fill(dR);
1090  if(fillSeedingLayerSets) histograms.h_reco_seedingLayerSet[count].fill(seedingLayerSetBin);
1091  if(pvPosition) {
1092  histograms.h_recodxypv[count].fill(dxypv);
1093  histograms.h_recodzpv[count].fill(dzpv);
1094  histograms.h_recodxypvzoomed[count].fill(dxypv);
1095  histograms.h_recodzpvzoomed[count].fill(dzpv);
1096 
1097  histograms.h_reco_dzpvcut[count].fill(std::abs(dzpv));
1098  histograms.h_reco_dzpvsigcut[count].fill(std::abs(dzpvsig));
1099  histograms.h_reco_dzpvcut_pt[count].fill(std::abs(dzpv), pt);
1100  histograms.h_reco_dzpvsigcut_pt[count].fill(std::abs(dzpvsig), pt);
1101  }
1102  if(simPVPosition) {
1103  histograms.h_reco_simpvz[count].fill(simpvz);
1104  }
1105  if((*trackSelectorVsEta)(track, bsPosition)) {
1106  histograms.h_reco2eta[count].fill(eta);
1107  }
1108  if((*trackSelectorVsPt)(track, bsPosition)) {
1109  histograms.h_reco2pT[count].fill(pt);
1110  }
1111  }
1112  histograms.h_recohit[count].fill(nhits);
1113  histograms.h_recolayer[count].fill(nlayers);
1114  histograms.h_recopixellayer[count].fill(nPixelLayers);
1115  histograms.h_reco3Dlayer[count].fill(n3DLayers);
1116  histograms.h_recopu[count].fill(numVertices);
1117  if((*trackSelectorVsPhi)(track, bsPosition)) {
1118  histograms.h_reco2pu[count].fill(numVertices);
1119  }
1120 
1121  fillMVAHistos(histograms.h_reco_mva[count], histograms.h_reco_mvacut[count], histograms.h_reco_mva_hp[count], histograms.h_reco_mvacut_hp[count], mvas, selectsLoose, selectsHP);
1122 
1123  if (isMatched) {
1124  if(paramsValid) {
1125  histograms.h_assoc2eta[count].fill(eta);
1126  histograms.h_assoc2phi[count].fill(phi);
1127  histograms.h_assoc2pT[count].fill(pt);
1128  histograms.h_assoc2dxy[count].fill(dxy);
1129  histograms.h_assoc2dz[count].fill(dz);
1130  histograms.h_assoc2hit[count].fill(nhits);
1131  histograms.h_assoc2chi2[count].fill(chi2);
1132  histograms.h_assoc2vertpos[count].fill(vertxy);
1133  histograms.h_assoc2zpos[count].fill(vertz);
1134  histograms.h_assoc2dr[count].fill(dR);
1135  if(fillSeedingLayerSets) histograms.h_assoc2_seedingLayerSet[count].fill(seedingLayerSetBin);
1136  if(pvPosition) {
1137  histograms.h_assoc2dxypv[count].fill(dxypv);
1138  histograms.h_assoc2dzpv[count].fill(dzpv);
1139  histograms.h_assoc2dxypvzoomed[count].fill(dxypv);
1140  histograms.h_assoc2dzpvzoomed[count].fill(dzpv);
1141 
1142  histograms.h_assoc2_dzpvcut[count].fill(std::abs(dzpv));
1143  histograms.h_assoc2_dzpvsigcut[count].fill(std::abs(dzpvsig));
1144  histograms.h_assoc2_dzpvcut_pt[count].fill(std::abs(dzpv), pt);
1145  histograms.h_assoc2_dzpvsigcut_pt[count].fill(std::abs(dzpvsig), pt);
1146  }
1147  if(simPVPosition) {
1148  histograms.h_assoc2_simpvz[count].fill(simpvz);
1149  }
1150  }
1151  histograms.h_assoc2layer[count].fill(nlayers);
1152  histograms.h_assoc2pixellayer[count].fill(nPixelLayers);
1153  histograms.h_assoc23Dlayer[count].fill(n3DLayers);
1154  histograms.h_assoc2pu[count].fill(numVertices);
1155 
1156  fillMVAHistos(histograms.h_assoc2_mva[count], histograms.h_assoc2_mvacut[count], histograms.h_assoc2_mva_hp[count], histograms.h_assoc2_mvacut_hp[count], mvas, selectsLoose, selectsHP);
1157  fillMVAHistos(pt, histograms.h_assoc2_mva_vs_pt[count], histograms.h_assoc2_mva_vs_pt_hp[count], mvas, selectsLoose, selectsHP);
1158  fillMVAHistos(eta, histograms.h_assoc2_mva_vs_eta[count], histograms.h_assoc2_mva_vs_eta_hp[count], mvas, selectsLoose, selectsHP);
1159 
1160  if(histograms.nrecHit_vs_nsimHit_rec2sim[count]) histograms.nrecHit_vs_nsimHit_rec2sim[count].fill( track.numberOfValidHits(),nSimHits);
1161  histograms.h_assocFraction[count].fill( sharedFraction);
1162  histograms.h_assocSharedHit[count].fill( sharedHits);
1163 
1164  if (!doSeedPlots_ && !isChargeMatched) {
1165  histograms.h_misideta[count].fill(eta);
1166  histograms.h_misidphi[count].fill(phi);
1167  histograms.h_misidpT[count].fill(pt);
1168  histograms.h_misiddxy[count].fill(dxy);
1169  histograms.h_misiddz[count].fill(dz);
1170  histograms.h_misidhit[count].fill(nhits);
1171  histograms.h_misidlayer[count].fill(nlayers);
1172  histograms.h_misidpixellayer[count].fill(nPixelLayers);
1173  histograms.h_misid3Dlayer[count].fill(n3DLayers);
1174  histograms.h_misidpu[count].fill(numVertices);
1175  histograms.h_misidchi2[count].fill(chi2);
1176  if(pvPosition) {
1177  histograms.h_misiddxypv[count].fill(dxypv);
1178  histograms.h_misiddzpv[count].fill(dzpv);
1179  histograms.h_misiddxypvzoomed[count].fill(dxypv);
1180  histograms.h_misiddzpvzoomed[count].fill(dzpv);
1181  }
1182  }
1183 
1184  if (numAssocRecoTracks>1) {
1185  if(paramsValid) {
1186  histograms.h_loopereta[count].fill(eta);
1187  histograms.h_looperphi[count].fill(phi);
1188  histograms.h_looperpT[count].fill(pt);
1189  histograms.h_looperdxy[count].fill(dxy);
1190  histograms.h_looperdz[count].fill(dz);
1191  histograms.h_looperchi2[count].fill(chi2);
1192  histograms.h_loopervertpos[count].fill(vertxy);
1193  histograms.h_looperzpos[count].fill(vertz);
1194  histograms.h_looperdr[count].fill(dR);
1195  if(fillSeedingLayerSets) histograms.h_looper_seedingLayerSet[count].fill(seedingLayerSetBin);
1196  if(pvPosition) {
1197  histograms.h_looperdxypv[count].fill(dxypv);
1198  histograms.h_looperdzpv[count].fill(dzpv);
1199  histograms.h_looperdxypvzoomed[count].fill(dxypv);
1200  histograms.h_looperdzpvzoomed[count].fill(dzpv);
1201  }
1202  if(simPVPosition) {
1203  histograms.h_looper_simpvz[count].fill(simpvz);
1204  }
1205  }
1206  histograms.h_looperhit[count].fill(nhits);
1207  histograms.h_looperlayer[count].fill(nlayers);
1208  histograms.h_looperpixellayer[count].fill(nPixelLayers);
1209  histograms.h_looper3Dlayer[count].fill(n3DLayers);
1210  histograms.h_looperpu[count].fill(numVertices);
1211  }
1212  if(!isSigMatched) {
1213  if(paramsValid) {
1214  histograms.h_pileupeta[count].fill(eta);
1215  histograms.h_pileupphi[count].fill(phi);
1216  histograms.h_pileuppT[count].fill(pt);
1217  histograms.h_pileupdxy[count].fill(dxy);
1218  histograms.h_pileupdz[count].fill(dz);
1219  histograms.h_pileupchi2[count].fill(chi2);
1220  histograms.h_pileupvertpos[count].fill(vertxy);
1221  histograms.h_pileupzpos[count].fill(vertz);
1222  histograms.h_pileupdr[count].fill(dR);
1223  if(fillSeedingLayerSets) histograms.h_pileup_seedingLayerSet[count].fill(seedingLayerSetBin);
1224  if(pvPosition) {
1225  histograms.h_pileupdxypv[count].fill(dxypv);
1226  histograms.h_pileupdzpv[count].fill(dzpv);
1227  histograms.h_pileupdxypvzoomed[count].fill(dxypv);
1228  histograms.h_pileupdzpvzoomed[count].fill(dzpv);
1229 
1230  histograms.h_pileup_dzpvcut[count].fill(std::abs(dzpv));
1231  histograms.h_pileup_dzpvsigcut[count].fill(std::abs(dzpvsig));
1232  histograms.h_pileup_dzpvcut_pt[count].fill(std::abs(dzpv), pt);
1233  histograms.h_pileup_dzpvsigcut_pt[count].fill(std::abs(dzpvsig), pt);
1234  }
1235  if(simPVPosition) {
1236  histograms.h_pileup_simpvz[count].fill(simpvz);
1237  }
1238  }
1239  histograms.h_pileuphit[count].fill(nhits);
1240  histograms.h_pileuplayer[count].fill(nlayers);
1241  histograms.h_pileuppixellayer[count].fill(nPixelLayers);
1242  histograms.h_pileup3Dlayer[count].fill(n3DLayers);
1243  histograms.h_pileuppu[count].fill(numVertices);
1244  }
1245  }
1246  else { // !isMatched
1247  fillMVAHistos(pt, histograms.h_fake_mva_vs_pt[count], histograms.h_fake_mva_vs_pt_hp[count], mvas, selectsLoose, selectsHP);
1248  fillMVAHistos(eta, histograms.h_fake_mva_vs_eta[count], histograms.h_fake_mva_vs_eta_hp[count], mvas, selectsLoose, selectsHP);
1249  }
1250 }
1251 
1252 
1254  int count,
1255  const reco::Track& track) const {
1256  //nchi2 and hits global distributions
1257  histograms.h_hits[count].fill(track.numberOfValidHits());
1258  histograms.h_losthits[count].fill(track.numberOfLostHits());
1261  if(trackFromSeedFitFailed(track))
1262  return;
1263 
1264  histograms.h_nchi2[count].fill(track.normalizedChi2());
1265  histograms.h_nchi2_prob[count].fill(TMath::Prob(track.chi2(),(int)track.ndof()));
1266  histograms.chi2_vs_nhits[count].fill(track.numberOfValidHits(),track.normalizedChi2());
1267  histograms.h_charge[count].fill( track.charge() );
1268 
1269  //chi2 and #hit vs eta: fill 2D histos
1270  const auto eta = getEta(track.eta());
1271  histograms.chi2_vs_eta[count].fill(eta, track.normalizedChi2());
1272  histograms.nhits_vs_eta[count].fill(eta, track.numberOfValidHits());
1273  const auto pxbHits = track.hitPattern().numberOfValidPixelBarrelHits();
1274  const auto pxfHits = track.hitPattern().numberOfValidPixelEndcapHits();
1275  const auto tibHits = track.hitPattern().numberOfValidStripTIBHits();
1276  const auto tidHits = track.hitPattern().numberOfValidStripTIDHits();
1277  const auto tobHits = track.hitPattern().numberOfValidStripTOBHits();
1278  const auto tecHits = track.hitPattern().numberOfValidStripTECHits();
1279  histograms.nPXBhits_vs_eta[count].fill(eta, pxbHits);
1280  histograms.nPXFhits_vs_eta[count].fill(eta, pxfHits);
1281  histograms.nPXLhits_vs_eta[count].fill(eta, pxbHits+pxfHits);
1282  histograms.nTIBhits_vs_eta[count].fill(eta, tibHits);
1283  histograms.nTIDhits_vs_eta[count].fill(eta, tidHits);
1284  histograms.nTOBhits_vs_eta[count].fill(eta, tobHits);
1285  histograms.nTEChits_vs_eta[count].fill(eta, tecHits);
1286  histograms.nSTRIPhits_vs_eta[count].fill(eta, tibHits+tidHits+tobHits+tecHits);
1289  int LayersAll = track.hitPattern().stripLayersWithMeasurement();
1290  int Layers2D = track.hitPattern().numberOfValidStripLayersWithMonoAndStereo();
1291  int Layers1D = LayersAll - Layers2D;
1292  histograms.nSTRIPlayersWithMeas_vs_eta[count].fill(eta, LayersAll);
1293  histograms.nSTRIPlayersWith1dMeas_vs_eta[count].fill(eta, Layers1D);
1294  histograms.nSTRIPlayersWith2dMeas_vs_eta[count].fill(eta, Layers2D);
1295 
1296  histograms.nlosthits_vs_eta[count].fill(eta, track.numberOfLostHits());
1297 }
1298 
1299 
1300 void MTVHistoProducerAlgoForTracker::fill_trackBased_histos(const Histograms& histograms, int count, int assTracks, int numRecoTracks, int numRecoTracksSelected, int numSimTracksSelected) const {
1301 
1302  histograms.h_tracks[count].fill(assTracks);
1303  histograms.h_fakes[count].fill(numRecoTracks-assTracks);
1304  if(histograms.nrec_vs_nsim[count]) histograms.nrec_vs_nsim[count].fill(numSimTracksSelected, numRecoTracksSelected);
1305 
1306 }
1307 
1308 
1309 
1311  int count,
1312  const TrackingParticle::Vector& momentumTP,
1313  const TrackingParticle::Point& vertexTP,
1314  int chargeTP,
1315  const reco::Track& track,
1316  const math::XYZPoint& bsPosition) const {
1317  if(trackFromSeedFitFailed(track))
1318  return;
1319 
1320  // evaluation of TP parameters
1321  double qoverpSim = chargeTP/sqrt(momentumTP.x()*momentumTP.x()+momentumTP.y()*momentumTP.y()+momentumTP.z()*momentumTP.z());
1322  double lambdaSim = M_PI/2-momentumTP.theta();
1323  double phiSim = momentumTP.phi();
1324  double dxySim = TrackingParticleIP::dxy(vertexTP, momentumTP, bsPosition);
1325  double dzSim = TrackingParticleIP::dz(vertexTP, momentumTP, bsPosition);
1326 
1327 
1328  // reco::Track::ParameterVector rParameters = track.parameters(); // UNUSED
1329 
1330  double qoverpRec(0);
1331  double qoverpErrorRec(0);
1332  double ptRec(0);
1333  double ptErrorRec(0);
1334  double lambdaRec(0);
1335  double lambdaErrorRec(0);
1336  double phiRec(0);
1337  double phiErrorRec(0);
1338 
1339  /* TO BE FIXED LATER -----------
1340  //loop to decide whether to take gsfTrack (utilisation of mode-function) or common track
1341  const GsfTrack* gsfTrack(0);
1342  if(useGsf){
1343  gsfTrack = dynamic_cast<const GsfTrack*>(&(*track));
1344  if (gsfTrack==0) edm::LogInfo("TrackValidator") << "Trying to access mode for a non-GsfTrack";
1345  }
1346 
1347  if (gsfTrack) {
1348  // get values from mode
1349  getRecoMomentum(*gsfTrack, ptRec, ptErrorRec, qoverpRec, qoverpErrorRec,
1350  lambdaRec,lambdaErrorRec, phiRec, phiErrorRec);
1351  }
1352 
1353  else {
1354  // get values from track (without mode)
1355  getRecoMomentum(*track, ptRec, ptErrorRec, qoverpRec, qoverpErrorRec,
1356  lambdaRec,lambdaErrorRec, phiRec, phiErrorRec);
1357  }
1358  */
1359  getRecoMomentum(track, ptRec, ptErrorRec, qoverpRec, qoverpErrorRec,
1360  lambdaRec,lambdaErrorRec, phiRec, phiErrorRec);
1361  // -------------
1362 
1363  double ptError = ptErrorRec;
1364  double ptres=ptRec-sqrt(momentumTP.perp2());
1365  double etares=track.eta()-momentumTP.Eta();
1366 
1367 
1368  double dxyRec = track.dxy(bsPosition);
1369  double dzRec = track.dz(bsPosition);
1370 
1371  const auto phiRes = phiRec-phiSim;
1372  const auto dxyRes = dxyRec-dxySim;
1373  const auto dzRes = dzRec-dzSim;
1374  const auto cotThetaRes = 1/tan(M_PI*0.5-lambdaRec)-1/tan(M_PI*0.5-lambdaSim);
1375 
1376  // eta residue; pt, k, theta, phi, dxy, dz pulls
1377  double qoverpPull=(qoverpRec-qoverpSim)/qoverpErrorRec;
1378  double thetaPull=(lambdaRec-lambdaSim)/lambdaErrorRec;
1379  double phiPull=phiRes/phiErrorRec;
1380  double dxyPull=dxyRes/track.dxyError();
1381  double dzPull=dzRes/track.dzError();
1382 
1383 #ifdef EDM_ML_DEBUG
1384  double contrib_Qoverp = ((qoverpRec-qoverpSim)/qoverpErrorRec)*
1385  ((qoverpRec-qoverpSim)/qoverpErrorRec)/5;
1386  double contrib_dxy = ((dxyRec-dxySim)/track.dxyError())*((dxyRec-dxySim)/track.dxyError())/5;
1387  double contrib_dz = ((dzRec-dzSim)/track.dzError())*((dzRec-dzSim)/track.dzError())/5;
1388  double contrib_theta = ((lambdaRec-lambdaSim)/lambdaErrorRec)*
1389  ((lambdaRec-lambdaSim)/lambdaErrorRec)/5;
1390  double contrib_phi = ((phiRec-phiSim)/phiErrorRec)*
1391  ((phiRec-phiSim)/phiErrorRec)/5;
1392 
1393  LogTrace("TrackValidatorTEST")
1394  //<< "assocChi2=" << tp.begin()->second << "\n"
1395  << "" << "\n"
1396  << "ptREC=" << ptRec << "\n" << "etaREC=" << track.eta() << "\n" << "qoverpREC=" << qoverpRec << "\n"
1397  << "dxyREC=" << dxyRec << "\n" << "dzREC=" << dzRec << "\n"
1398  << "thetaREC=" << track.theta() << "\n" << "phiREC=" << phiRec << "\n"
1399  << "" << "\n"
1400  << "qoverpError()=" << qoverpErrorRec << "\n" << "dxyError()=" << track.dxyError() << "\n"<< "dzError()="
1401  << track.dzError() << "\n"
1402  << "thetaError()=" << lambdaErrorRec << "\n" << "phiError()=" << phiErrorRec << "\n"
1403  << "" << "\n"
1404  << "ptSIM=" << sqrt(momentumTP.perp2()) << "\n"<< "etaSIM=" << momentumTP.Eta() << "\n"<< "qoverpSIM=" << qoverpSim << "\n"
1405  << "dxySIM=" << dxySim << "\n"<< "dzSIM=" << dzSim << "\n" << "thetaSIM=" << M_PI/2-lambdaSim << "\n"
1406  << "phiSIM=" << phiSim << "\n"
1407  << "" << "\n"
1408  << "contrib_Qoverp=" << contrib_Qoverp << "\n"<< "contrib_dxy=" << contrib_dxy << "\n"<< "contrib_dz=" << contrib_dz << "\n"
1409  << "contrib_theta=" << contrib_theta << "\n"<< "contrib_phi=" << contrib_phi << "\n"
1410  << "" << "\n"
1411  <<"chi2PULL="<<contrib_Qoverp+contrib_dxy+contrib_dz+contrib_theta+contrib_phi<<"\n";
1412 #endif
1413 
1414  histograms.h_pullQoverp[count].fill(qoverpPull);
1415  histograms.h_pullTheta[count].fill(thetaPull);
1416  histograms.h_pullPhi[count].fill(phiPull);
1417  histograms.h_pullDxy[count].fill(dxyPull);
1418  histograms.h_pullDz[count].fill(dzPull);
1419 
1420  const auto etaSim = getEta(momentumTP.eta());
1421  const auto ptSim = getPt(sqrt(momentumTP.perp2()));
1422 
1423  histograms.h_pt[count].fill(ptres/ptError);
1424  histograms.h_eta[count].fill(etares);
1425  //histograms.etares_vs_eta[count].fill(getEta(track.eta()),etares);
1426  histograms.etares_vs_eta[count].fill(etaSim, etares);
1427 
1428  //resolution of track params: fill 2D histos
1429  histograms.dxyres_vs_eta[count].fill(etaSim, dxyRes);
1430  histograms.ptres_vs_eta[count].fill(etaSim, ptres/ptRec);
1431  histograms.dzres_vs_eta[count].fill(etaSim, dzRes);
1432  histograms.phires_vs_eta[count].fill(etaSim, phiRes);
1433  histograms.cotThetares_vs_eta[count].fill(etaSim, cotThetaRes);
1434 
1435  //same as before but vs pT
1436  histograms.dxyres_vs_pt[count].fill(ptSim, dxyRes);
1437  histograms.ptres_vs_pt[count].fill(ptSim, ptres/ptRec);
1438  histograms.dzres_vs_pt[count].fill(ptSim, dzRes);
1439  histograms.phires_vs_pt[count].fill(ptSim, phiRes);
1440  histograms.cotThetares_vs_pt[count].fill(ptSim, cotThetaRes);
1441 
1442  //pulls of track params vs eta: fill 2D histos
1443  histograms.dxypull_vs_eta[count].fill(etaSim, dxyPull);
1444  histograms.ptpull_vs_eta[count].fill(etaSim, ptres/ptError);
1445  histograms.dzpull_vs_eta[count].fill(etaSim, dzPull);
1446  histograms.phipull_vs_eta[count].fill(etaSim, phiPull);
1447  histograms.thetapull_vs_eta[count].fill(etaSim, thetaPull);
1448 
1449  //plots vs phi
1450  histograms.nhits_vs_phi[count].fill(phiRec,track.numberOfValidHits());
1451  histograms.chi2_vs_phi[count].fill(phiRec,track.normalizedChi2());
1452  histograms.ptmean_vs_eta_phi[count].fill(phiRec,getEta(track.eta()),ptRec);
1453  histograms.phimean_vs_eta_phi[count].fill(phiRec,getEta(track.eta()),phiRec);
1454 
1455  histograms.ptres_vs_phi[count].fill(phiSim, ptres/ptRec);
1456  histograms.phires_vs_phi[count].fill(phiSim, phiRes);
1457  histograms.ptpull_vs_phi[count].fill(phiSim, ptres/ptError);
1458  histograms.phipull_vs_phi[count].fill(phiSim, phiPull);
1459  histograms.thetapull_vs_phi[count].fill(phiSim, thetaPull);
1460 
1461 
1462 }
1463 
1464 
1465 
1466 void
1468  double& qoverp, double& qoverpError, double& lambda,double& lambdaError,
1469  double& phi, double& phiError ) const {
1470  pt = track.pt();
1471  ptError = track.ptError();
1472  qoverp = track.qoverp();
1473  qoverpError = track.qoverpError();
1474  lambda = track.lambda();
1475  lambdaError = track.lambdaError();
1476  phi = track.phi();
1477  phiError = track.phiError();
1478  // cout <<"test1" << endl;
1479 
1480 
1481 
1482 }
1483 
1484 void
1485 MTVHistoProducerAlgoForTracker::getRecoMomentum (const reco::GsfTrack& gsfTrack, double& pt, double& ptError,
1486  double& qoverp, double& qoverpError, double& lambda,double& lambdaError,
1487  double& phi, double& phiError ) const {
1488 
1489  pt = gsfTrack.ptMode();
1490  ptError = gsfTrack.ptModeError();
1491  qoverp = gsfTrack.qoverpMode();
1492  qoverpError = gsfTrack.qoverpModeError();
1493  lambda = gsfTrack.lambdaMode();
1494  lambdaError = gsfTrack.lambdaModeError();
1495  phi = gsfTrack.phiMode();
1496  phiError = gsfTrack.phiModeError();
1497  // cout <<"test2" << endl;
1498 
1499 }
1500 
1501 double
1503  if (useFabsEta) return fabs(eta);
1504  else return eta;
1505 }
1506 
1507 double
1509  if (useInvPt && pt!=0) return 1/pt;
1510  else return pt;
1511 }
1512 
1514  if(track.seedRef().isNull() || !track.seedRef().isAvailable())
1515  return seedingLayerSetNames.size()-1;
1516 
1517  const TrajectorySeed& seed = *(track.seedRef());
1518  const auto hitRange = seed.recHits();
1519  SeedingLayerSetId searchId;
1520  const int nhits = std::distance(hitRange.first, hitRange.second);
1521  if(nhits > static_cast<int>(std::tuple_size<SeedingLayerSetId>::value)) {
1522  LogDebug("TrackValidator") << "Got seed with " << nhits << " hits, but I have a hard-coded maximum of " << std::tuple_size<SeedingLayerSetId>::value << ", classifying the seed as 'unknown'. Please increase the maximum in MTVHistoProducerAlgoForTracker.h if needed.";
1523  return seedingLayerSetNames.size()-1;
1524  }
1525  int i=0;
1526  for(auto iHit = hitRange.first; iHit != hitRange.second; ++iHit, ++i) {
1527  DetId detId = iHit->geographicalId();
1528 
1529  if(detId.det() != DetId::Tracker) {
1530  throw cms::Exception("LogicError") << "Encountered seed hit detId " << detId.rawId() << " not from Tracker, but " << detId.det();
1531  }
1532 
1534  bool subdetStrip = false;
1535  switch(detId.subdetId()) {
1538  case StripSubdetector::TIB: subdet = GeomDetEnumerators::TIB; subdetStrip = true; break;
1539  case StripSubdetector::TID: subdet = GeomDetEnumerators::TID; subdetStrip = true; break;
1540  case StripSubdetector::TOB: subdet = GeomDetEnumerators::TOB; subdetStrip = true; break;
1541  case StripSubdetector::TEC: subdet = GeomDetEnumerators::TEC; subdetStrip = true; break;
1542  default: throw cms::Exception("LogicError") << "Unknown subdetId " << detId.subdetId();
1543  };
1544 
1545  TrackerDetSide side = static_cast<TrackerDetSide>(ttopo.side(detId));
1546 
1547  // Even with the recent addition of
1548  // SeedingLayerSetsBuilder::fillDescription() this assumption is a
1549  // bit ugly.
1550  const bool isStripMono = subdetStrip && trackerHitRTTI::isSingle(*iHit);
1551  searchId[i] = SeedingLayerId(SeedingLayerSetsBuilder::SeedingLayerId(subdet, side, ttopo.layer(detId)), isStripMono);
1552  }
1553  auto found = seedingLayerSetToBin.find(searchId);
1554  if(found == seedingLayerSetToBin.end()) {
1555  return seedingLayerSetNames.size()-1;
1556  }
1557  return found->second;
1558 }
1559 
1561  int count,
1562  const reco::GenParticle& tp,
1563  const TrackingParticle::Vector& momentumTP,
1564  const TrackingParticle::Point& vertexTP,
1565  double dxySim, double dzSim, int nSimHits,
1566  const reco::Track* track,
1567  int numVertices) const {
1568 
1569  bool isMatched = track;
1570 
1571  if((*GpSelectorForEfficiencyVsEta)(tp)){
1572  //effic vs eta
1573  histograms.h_simuleta[count].fill(getEta(momentumTP.eta()));
1574  if (isMatched) histograms.h_assoceta[count].fill(getEta(momentumTP.eta()));
1575  }
1576 
1577  if((*GpSelectorForEfficiencyVsPhi)(tp)){
1578  histograms.h_simulphi[count].fill(momentumTP.phi());
1579  if (isMatched) histograms.h_assocphi[count].fill(momentumTP.phi());
1580  //effic vs hits
1581  histograms.h_simulhit[count].fill((int)nSimHits);
1582  if(isMatched) {
1583  histograms.h_assochit[count].fill((int)nSimHits);
1584  if(histograms.nrecHit_vs_nsimHit_sim2rec[count]) histograms.nrecHit_vs_nsimHit_sim2rec[count].fill(track->numberOfValidHits(),nSimHits);
1585  }
1586  //effic vs pu
1587  histograms.h_simulpu[count].fill(numVertices);
1588  if (isMatched) histograms.h_assocpu[count].fill(numVertices);
1589  //efficiency vs dR
1590  //not implemented for now
1591  }
1592 
1593  if((*GpSelectorForEfficiencyVsPt)(tp)){
1594  histograms.h_simulpT[count].fill(getPt(sqrt(momentumTP.perp2())));
1595  if (isMatched) histograms.h_assocpT[count].fill(getPt(sqrt(momentumTP.perp2())));
1596  }
1597 
1598  if((*GpSelectorForEfficiencyVsVTXR)(tp)){
1599  histograms.h_simuldxy[count].fill(dxySim);
1600  if (isMatched) histograms.h_assocdxy[count].fill(dxySim);
1601 
1602  histograms.h_simulvertpos[count].fill(sqrt(vertexTP.perp2()));
1603  if (isMatched) histograms.h_assocvertpos[count].fill(sqrt(vertexTP.perp2()));
1604  }
1605 
1606  if((*GpSelectorForEfficiencyVsVTXZ)(tp)){
1607  histograms.h_simuldz[count].fill(dzSim);
1608  if (isMatched) histograms.h_assocdz[count].fill(dzSim);
1609 
1610  histograms.h_simulzpos[count].fill(vertexTP.z());
1611  if (isMatched) histograms.h_assoczpos[count].fill(vertexTP.z());
1612  }
1613 
1614 }
1615 
1617  int count,
1618  int seedsFitFailed,
1619  int seedsTotal) const {
1620  histograms.h_seedsFitFailed[count].fill(seedsFitFailed);
1621  histograms.h_seedsFitFailedFraction[count].fill(static_cast<double>(seedsFitFailed)/seedsTotal);
1622 }
#define LogDebug(id)
std::vector< ConcurrentMonitorElement > h_assoc2pu
size
Write out results.
std::vector< ConcurrentMonitorElement > h_assoc2pixellayer
double qoverp() const
q / p
Definition: TrackBase.h:573
double phiModeError() const
error on phi from mode
Definition: GsfTrack.h:94
std::vector< ConcurrentMonitorElement > h_pileupdxy
std::vector< ConcurrentMonitorElement > h_misidphi
std::vector< ConcurrentMonitorElement > h_fakes
const edm::RefToBase< TrajectorySeed > & seedRef() const
Definition: Track.h:213
std::vector< ConcurrentMonitorElement > h_looperdxy
T getParameter(std::string const &) const
std::vector< ConcurrentMonitorElement > h_looper_seedingLayerSet
void fill_trackBased_histos(const Histograms &histograms, int count, int assTracks, int numRecoTracks, int numRecoTracksSelected, int numSimTracksSelected) const
ConcurrentMonitorElement bookProfile(Args &&...args)
Definition: DQMStore.h:272
T getUntrackedParameter(std::string const &, T const &) const
void fill_generic_simTrack_histos(const Histograms &histograms, const TrackingParticle::Vector &, const TrackingParticle::Point &vertex, int bx) const
std::vector< ConcurrentMonitorElement > h_looperlayer
std::vector< ConcurrentMonitorElement > h_assoc2dzpvzoomed
const Point & referencePoint() const
Reference point on the track.
Definition: TrackBase.h:681
std::vector< ConcurrentMonitorElement > h_assoczpos
std::vector< ConcurrentMonitorElement > chi2_vs_eta
std::vector< std::vector< ConcurrentMonitorElement > > h_assoc_mvacut_hp
std::unique_ptr< TrackingParticleSelector > TpSelectorForEfficiencyVsPt
std::vector< ConcurrentMonitorElement > h_pileuphit
std::vector< ConcurrentMonitorElement > h_pullQoverp
std::vector< ConcurrentMonitorElement > h_pileup_seedingLayerSet
std::vector< ConcurrentMonitorElement > h_misiddzpv
std::unique_ptr< TrackingParticleSelector > TpSelectorForEfficiencyVsEta
void fill_seed_histos(const Histograms &histograms, int count, int seedsFitFailed, int seedsTotal) const
std::vector< ConcurrentMonitorElement > h_assoc_dzpvsigcut_pt
std::vector< ConcurrentMonitorElement > h_pileupphi
std::vector< ConcurrentMonitorElement > nSTRIPhits_vs_eta
std::vector< ConcurrentMonitorElement > dxyres_vs_eta
std::vector< ConcurrentMonitorElement > h_pullTheta
std::vector< ConcurrentMonitorElement > h_misidpixellayer
bool trackFromSeedFitFailed(const reco::Track &track)
std::vector< std::vector< ConcurrentMonitorElement > > h_reco_mva
std::vector< ConcurrentMonitorElement > h_assoc3Dlayer
std::vector< ConcurrentMonitorElement > h_simul_dzpvcut_pt
std::vector< ConcurrentMonitorElement > h_assocFraction
std::vector< ConcurrentMonitorElement > h_pullPhi
std::unique_ptr< GenParticleCustomSelector > GpSelectorForEfficiencyVsVTXR
std::vector< ConcurrentMonitorElement > h_seedsFitFailed
std::vector< ConcurrentMonitorElement > h_assoc2eta
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
std::vector< ConcurrentMonitorElement > h_misidhit
std::vector< ConcurrentMonitorElement > h_assoclayer
double lambdaMode() const
Lambda angle from mode.
Definition: GsfTrack.h:45
std::vector< ConcurrentMonitorElement > h_recodr
std::vector< ConcurrentMonitorElement > h_misiddxy
std::vector< ConcurrentMonitorElement > h_pileupdr
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:561
std::vector< ConcurrentMonitorElement > h_assoc2zpos
bool isAvailable() const
Definition: RefToBase.h:114
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) ...
ConcurrentMonitorElement bookProfile2D(Args &&...args)
Definition: DQMStore.h:279
std::vector< ConcurrentMonitorElement > phires_vs_eta
std::vector< ConcurrentMonitorElement > h_looperpu
std::unique_ptr< TrackingParticleSelector > TpSelectorForEfficiencyVsVTXR
std::map< SeedingLayerSetId, unsigned int > seedingLayerSetToBin
std::vector< std::vector< ConcurrentMonitorElement > > h_assoc2_mvacut
double theta() const
polar angle
Definition: TrackBase.h:579
double dxyError() const
error on dxy
Definition: TrackBase.h:796
std::vector< ConcurrentMonitorElement > h_nmisslayers_inner
void bookMVAHistos(DQMStore::ConcurrentBooker &ibook, Histograms &histograms, size_t nMVAs)
std::vector< ConcurrentMonitorElement > h_looperpT
TrackerDetSide
Definition: TrackerDetSide.h:4
void bookSimTrackPVAssociationHistos(DQMStore::ConcurrentBooker &ibook, Histograms &histograms)
std::vector< ConcurrentMonitorElement > nPXLhits_vs_eta
std::vector< ConcurrentMonitorElement > h_pileupdzpv
void fill_ResoAndPull_recoTrack_histos(const Histograms &histograms, int count, const TrackingParticle::Vector &momentumTP, const TrackingParticle::Point &vertexTP, int chargeTP, const reco::Track &track, const math::XYZPoint &bsPosition) const
S make(const edm::ParameterSet &cfg)
std::vector< ConcurrentMonitorElement > h_simuldxy
std::vector< ConcurrentMonitorElement > h_assocdzpv
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
unsigned int side(const DetId &id) const
void fill_recoAssociated_simTrack_histos(const Histograms &histograms, int count, const TrackingParticle &tp, const TrackingParticle::Vector &momentumTP, const TrackingParticle::Point &vertexTP, double dxy, double dz, double dxyPV, double dzPV, int nSimHits, int nSimLayers, int nSimPixelLayers, int nSimStripMonoAndStereoLayers, const reco::Track *track, int numVertices, double dR, const math::XYZPoint *pvPosition, const TrackingVertex::LorentzVector *simPVPosition, const math::XYZPoint &bsPosition, const std::vector< float > &mvas, unsigned int selectsLoose, unsigned int selectsHP) const
std::vector< ConcurrentMonitorElement > nSTRIPlayersWithMeas_vs_eta
std::vector< ConcurrentMonitorElement > nlosthits_vs_eta
std::vector< ConcurrentMonitorElement > h_charge
std::vector< ConcurrentMonitorElement > nrec_vs_nsim
std::unique_ptr< GenParticleCustomSelector > GpSelectorForEfficiencyVsVTXZ
std::vector< ConcurrentMonitorElement > h_simulphi
std::vector< ConcurrentMonitorElement > h_simulpT
std::vector< ConcurrentMonitorElement > h_algo
std::vector< ConcurrentMonitorElement > h_simul2_dzpvsigcut_pt
std::vector< ConcurrentMonitorElement > h_eta
std::vector< std::vector< ConcurrentMonitorElement > > h_fake_mva_vs_pt
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:645
unsigned short numberOfLostHits() const
number of cases where track crossed a layer without getting a hit.
Definition: TrackBase.h:826
std::vector< ConcurrentMonitorElement > h_looperdz
std::vector< ConcurrentMonitorElement > h_misiddz
std::vector< ConcurrentMonitorElement > h_assoc2chi2
std::vector< ConcurrentMonitorElement > h_assoc2_dzpvsigcut
std::vector< ConcurrentMonitorElement > h_pileupdxypv
std::vector< ConcurrentMonitorElement > h_pileupeta
std::vector< ConcurrentMonitorElement > h_assoc2phi
std::unique_ptr< GenParticleCustomSelector > GpSelectorForEfficiencyVsPt
std::vector< ConcurrentMonitorElement > nPXFhits_vs_eta
std::vector< ConcurrentMonitorElement > h_looperdzpv
std::vector< ConcurrentMonitorElement > h_pileupchi2
std::unique_ptr< RecoTrackSelectorBase > trackSelectorVsPhi
std::vector< ConcurrentMonitorElement > h_pileuppT
int pixelLayersWithMeasurement() const
Definition: HitPattern.cc:501
std::vector< ConcurrentMonitorElement > h_assoc2dzpv
std::vector< ConcurrentMonitorElement > h_simuleta
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:675
std::vector< std::vector< ConcurrentMonitorElement > > h_assoc2_mva_hp
std::vector< ConcurrentMonitorElement > h_simuldzpvzoomed
std::vector< ConcurrentMonitorElement > h_looperphi
std::vector< ConcurrentMonitorElement > h_simulhit
unsigned int getSeedingLayerSetBin(const reco::Track &track, const TrackerTopology &ttopo) const
void fill_simTrackBased_histos(const Histograms &histograms, int numSimTracks) const
std::vector< ConcurrentMonitorElement > h_misiddxypvzoomed
std::vector< ConcurrentMonitorElement > h_assoc2dxypvzoomed
std::vector< ConcurrentMonitorElement > h_pileuplayer
int trackerLayersWithMeasurement() const
Definition: HitPattern.cc:520
std::vector< ConcurrentMonitorElement > h_reco_dzpvsigcut_pt
std::vector< ConcurrentMonitorElement > h_assoc2pT
std::vector< ConcurrentMonitorElement > h_pullDz
int numberOfValidStripTOBHits() const
Definition: HitPattern.h:869
#define constexpr
std::vector< ConcurrentMonitorElement > etares_vs_eta
std::vector< ConcurrentMonitorElement > ptres_vs_phi
std::vector< ConcurrentMonitorElement > h_simuldzpv
std::vector< ConcurrentMonitorElement > h_pileupdzpvzoomed
std::vector< ConcurrentMonitorElement > h_pileupvertpos
std::vector< std::vector< ConcurrentMonitorElement > > h_simul2_mvacut_hp
std::unique_ptr< GenParticleCustomSelector > GpSelectorForEfficiencyVsPhi
std::vector< ConcurrentMonitorElement > h_pileupdxypvzoomed
std::vector< ConcurrentMonitorElement > h_loopereta
std::vector< ConcurrentMonitorElement > h_hits
double qoverpMode() const
q/p from mode
Definition: GsfTrack.h:41
float dEdx() const
Definition: DeDxData.cc:26
double ptModeError() const
error on Pt (set to 1000 TeV if charge==0 for safety) from mode
Definition: GsfTrack.h:81
TrackAlgorithm algo() const
Definition: TrackBase.h:497
math::XYZPointD Point
point in the space
std::vector< ConcurrentMonitorElement > h_assoc2_dzpvcut
std::vector< ConcurrentMonitorElement > h_misiddxypv
std::vector< ConcurrentMonitorElement > nPXBhits_vs_eta
math::XYZTLorentzVectorD LorentzVector
std::vector< std::vector< ConcurrentMonitorElement > > h_fake_mva_vs_pt_hp
std::vector< ConcurrentMonitorElement > h_recodxypv
std::vector< ConcurrentMonitorElement > nrecHit_vs_nsimHit_rec2sim
std::vector< ConcurrentMonitorElement > h_simulpixellayer
std::vector< ConcurrentMonitorElement > nSTRIPlayersWith2dMeas_vs_eta
std::vector< ConcurrentMonitorElement > dxyres_vs_pt
void bookRecoHistos(DQMStore::ConcurrentBooker &ibook, Histograms &histograms, bool doResolutionPlots)
std::vector< ConcurrentMonitorElement > h_nchi2
std::tuple< GeomDetEnumerators::SubDetector, TrackerDetSide, int > SeedingLayerId
std::vector< ConcurrentMonitorElement > h_simul2_dzpvcut_pt
std::vector< ConcurrentMonitorElement > h_recozpos
unsigned int numberOfMeasurements() const
Definition: DeDxData.cc:37
std::vector< ConcurrentMonitorElement > h_looperpixellayer
std::vector< ConcurrentMonitorElement > h_recopixellayer
std::vector< ConcurrentMonitorElement > h_assocdxypv
std::vector< ConcurrentMonitorElement > h_assocdz
std::vector< ConcurrentMonitorElement > phires_vs_phi
void bookSeedHistos(DQMStore::ConcurrentBooker &ibook, Histograms &histograms)
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:651
std::vector< ConcurrentMonitorElement > h_simul_simpvz
int numberOfValidStripLayersWithMonoAndStereo(uint16_t stripdet, uint16_t layer) const
Definition: HitPattern.cc:343
std::vector< ConcurrentMonitorElement > h_pileup_dzpvcut
std::vector< ConcurrentMonitorElement > h_looperdr
std::vector< ConcurrentMonitorElement > nTOBhits_vs_eta
std::vector< std::vector< ConcurrentMonitorElement > > h_simul2_mvacut
int numberOfValidPixelBarrelHits() const
Definition: HitPattern.h:844
std::vector< ConcurrentMonitorElement > ptres_vs_eta
std::vector< std::vector< ConcurrentMonitorElement > > h_fake_mva_vs_eta
std::vector< ConcurrentMonitorElement > h_assoceta
std::vector< ConcurrentMonitorElement > h_reco2eta
std::vector< ConcurrentMonitorElement > h_misidpT
std::vector< ConcurrentMonitorElement > h_reco3Dlayer
std::vector< ConcurrentMonitorElement > h_assoc_dzpvcut_pt
std::vector< ConcurrentMonitorElement > dzres_vs_eta
std::vector< ConcurrentMonitorElement > h_assocdzpvzoomed
std::vector< ConcurrentMonitorElement > h_pileupdz
std::tuple< SeedingLayerSetsBuilder::SeedingLayerId, bool > SeedingLayerId
std::vector< std::vector< ConcurrentMonitorElement > > h_assoc2_mva_vs_eta
double chi2() const
chi-squared of the fit
Definition: TrackBase.h:549
std::vector< ConcurrentMonitorElement > h_assoc2layer
std::vector< ConcurrentMonitorElement > h_recodzpv
std::vector< ConcurrentMonitorElement > nLayersWithMeas_vs_eta
std::vector< ConcurrentMonitorElement > h_pileup3Dlayer
auto dz(const T_Vertex &vertex, const T_Momentum &momentum, const T_Point &point)
ConcurrentMonitorElement book2D(Args &&...args)
Definition: DQMStore.h:244
std::vector< ConcurrentMonitorElement > h_assoc_simpvz
std::vector< ConcurrentMonitorElement > h_reco2pu
std::vector< ConcurrentMonitorElement > h_reco_dzpvcut_pt
double ndof() const
number of degrees of freedom of the fit
Definition: TrackBase.h:555
T sqrt(T t)
Definition: SSEVec.h:18
std::vector< ConcurrentMonitorElement > h_simul3Dlayer
std::vector< ConcurrentMonitorElement > h_simul_dzpvcut
std::vector< ConcurrentMonitorElement > h_misiddzpvzoomed
std::unique_ptr< GenParticleCustomSelector > GpSelectorForEfficiencyVsEta
double pt() const
track transverse momentum
Definition: TrackBase.h:621
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:144
std::vector< ConcurrentMonitorElement > h_misidlayer
std::vector< ConcurrentMonitorElement > ptres_vs_pt
std::unique_ptr< TrackingParticleSelector > generalTpSelector
std::vector< ConcurrentMonitorElement > h_recolayer
std::vector< ConcurrentMonitorElement > nTIDhits_vs_eta
double ptError() const
error on Pt (set to 1000 TeV if charge==0 for safety)
Definition: TrackBase.h:763
std::vector< ConcurrentMonitorElement > h_pileupzpos
std::vector< ConcurrentMonitorElement > h_simul2_dzpvcut
double phiError() const
error on phi
Definition: TrackBase.h:790
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
std::vector< ConcurrentMonitorElement > h_simulvertpos
std::vector< ConcurrentMonitorElement > h_simulzpos
void fill_simAssociated_recoTrack_histos(const Histograms &histograms, int count, const reco::Track &track) const
std::unique_ptr< RecoTrackSelectorBase > trackSelectorVsPt
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
std::vector< ConcurrentMonitorElement > h_assoc2hit
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
void bookSimHistos(DQMStore::ConcurrentBooker &ibook, Histograms &histograms)
ConcurrentMonitorElement book1D(Args &&...args)
Definition: DQMStore.h:223
int numberOfValidStripTIDHits() const
Definition: HitPattern.h:864
double lambda() const
Lambda angle.
Definition: TrackBase.h:585
bool isMatched(TrackingRecHit const &hit)
std::vector< ConcurrentMonitorElement > h_recodxy
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:820
std::vector< ConcurrentMonitorElement > h_pileup_dzpvsigcut_pt
int numberOfValidStripTECHits() const
Definition: HitPattern.h:874
std::vector< ConcurrentMonitorElement > h_recopT
std::vector< ConcurrentMonitorElement > cotThetares_vs_pt
std::vector< ConcurrentMonitorElement > h_assoc_dzpvcut
std::vector< ConcurrentMonitorElement > h_assocvertpos
void bookSimTrackHistos(DQMStore::ConcurrentBooker &ibook, Histograms &histograms, bool doResolutionPlots)
std::vector< ConcurrentMonitorElement > h_recovertpos
std::vector< ConcurrentMonitorElement > h_assoc_dzpvsigcut
std::vector< ConcurrentMonitorElement > h_assoc2dxypv
std::vector< ConcurrentMonitorElement > dzres_vs_pt
std::vector< ConcurrentMonitorElement > phires_vs_pt
std::vector< ConcurrentMonitorElement > nhits_vs_phi
void eraseSimpleParameter(std::string const &name)
std::vector< ConcurrentMonitorElement > h_assoc2_seedingLayerSet
void copyForModify(ParameterSet const &other)
std::vector< ConcurrentMonitorElement > h_assocpixellayer
std::vector< ConcurrentMonitorElement > ptmean_vs_eta_phi
std::vector< ConcurrentMonitorElement > h_simulpu
std::vector< ConcurrentMonitorElement > h_simuldxypv
std::vector< ConcurrentMonitorElement > h_looperchi2
std::vector< std::vector< ConcurrentMonitorElement > > h_dedx_estim
std::vector< ConcurrentMonitorElement > h_duplicates_oriAlgo_vs_oriAlgo
std::vector< ConcurrentMonitorElement > h_assoc2dxy
std::vector< ConcurrentMonitorElement > phipull_vs_phi
#define LogTrace(id)
std::vector< ConcurrentMonitorElement > h_recophi
std::vector< ConcurrentMonitorElement > h_loopervertpos
bool isTrackerStrip(GeomDetEnumerators::SubDetector m)
std::vector< ConcurrentMonitorElement > h_simullayer
#define M_PI
std::vector< ConcurrentMonitorElement > h_recodzpvzoomed
double qoverpError() const
error on signed transverse curvature
Definition: TrackBase.h:757
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:609
void fill_dedx_recoTrack_histos(const Histograms &histograms, int count, const edm::RefToBase< reco::Track > &trackref, const std::vector< const edm::ValueMap< reco::DeDxData > * > &v_dEdx) const
std::vector< ConcurrentMonitorElement > h_nmisslayers_outer
double dzError() const
error on dz
Definition: TrackBase.h:814
std::vector< ConcurrentMonitorElement > h_looper3Dlayer
static SeedingLayerId nameToEnumId(const std::string &name)
std::vector< std::vector< ConcurrentMonitorElement > > h_fake_mva_vs_eta_hp
MTVHistoProducerAlgoForTracker(const edm::ParameterSet &pset, const bool doSeedPlots)
std::vector< std::vector< ConcurrentMonitorElement > > h_dedx_sat
std::vector< ConcurrentMonitorElement > h_nchi2_prob
void fill_generic_recoTrack_histos(const Histograms &histograms, int count, const reco::Track &track, const TrackerTopology &ttopo, const math::XYZPoint &bsPosition, const math::XYZPoint *pvPosition, const TrackingVertex::LorentzVector *simPVPosition, bool isMatched, bool isSigMatched, bool isChargeMatched, int numAssocRecoTracks, int numVertices, int nSimHits, double sharedFraction, double dR, const std::vector< float > &mvas, unsigned int selectsLoose, unsigned int selectsHP) const
std::vector< ConcurrentMonitorElement > nhits_vs_eta
std::array< SeedingLayerId, 4 > SeedingLayerSetId
Definition: DetId.h:18
std::vector< ConcurrentMonitorElement > h_assoc2_dzpvsigcut_pt
TrackAlgorithm originalAlgo() const
Definition: TrackBase.h:501
void bookRecoPVAssociationHistos(DQMStore::ConcurrentBooker &ibook, Histograms &histograms)
std::vector< ConcurrentMonitorElement > h_reco_seedingLayerSet
std::vector< ConcurrentMonitorElement > h_assoc2vertpos
std::vector< ConcurrentMonitorElement > h_recohit
void fill_duplicate_histos(const Histograms &histograms, int count, const reco::Track &track1, const reco::Track &track2) const
std::vector< std::vector< ConcurrentMonitorElement > > h_assoc_mvacut
std::unique_ptr< TrackingParticleSelector > TpSelectorForEfficiencyVsPhi
std::vector< std::vector< ConcurrentMonitorElement > > h_assoc2_mva_vs_eta_hp
std::vector< std::vector< ConcurrentMonitorElement > > h_reco_mvacut
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:446
std::vector< ConcurrentMonitorElement > h_assocdr
bool isSingle(TrackingRecHit const &hit)
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
void setBinLabel(int bin, std::string const &label, int axis=1)
std::vector< ConcurrentMonitorElement > h_assocpu
std::vector< ConcurrentMonitorElement > chi2_vs_phi
std::vector< ConcurrentMonitorElement > dxypull_vs_eta
std::vector< ConcurrentMonitorElement > h_reco_dzpvcut
std::vector< ConcurrentMonitorElement > h_recochi2
double qoverpModeError() const
error on signed transverse curvature from mode
Definition: GsfTrack.h:79
bool isNull() const
Checks for null.
Definition: RefToBase.h:328
std::string algoName() const
Definition: TrackBase.h:508
int stripLayersWithMeasurement() const
Definition: HitPattern.h:1036
range recHits() const
std::vector< std::vector< ConcurrentMonitorElement > > h_reco_mvacut_hp
std::vector< ConcurrentMonitorElement > h_pileup_simpvz
std::vector< ConcurrentMonitorElement > h_simul2_dzpvsigcut
int numberOfValidStripTIBHits() const
Definition: HitPattern.h:859
std::vector< std::vector< ConcurrentMonitorElement > > h_reco_mva_hp
std::vector< ConcurrentMonitorElement > h_assoc2dr
static const std::string algoNames[]
Definition: TrackBase.h:148
std::vector< ConcurrentMonitorElement > h_assoc2_dzpvcut_pt
int numberOfLostHits(HitCategory category) const
Definition: HitPattern.h:903
unsigned int layer(const DetId &id) const
int numberOfValidPixelEndcapHits() const
Definition: HitPattern.h:849
std::vector< std::vector< ConcurrentMonitorElement > > h_dedx_nom
std::vector< ConcurrentMonitorElement > dzpull_vs_eta
std::unique_ptr< TrackingParticleSelector > TpSelectorForEfficiencyVsVTXZ
double lambdaError() const
error on lambda
Definition: TrackBase.h:778
std::vector< ConcurrentMonitorElement > h_misid3Dlayer
std::vector< std::string > seedingLayerSetNames
std::vector< std::vector< ConcurrentMonitorElement > > h_assoc2_mva_vs_pt_hp
std::vector< ConcurrentMonitorElement > phimean_vs_eta_phi
HLT enums.
std::vector< ConcurrentMonitorElement > h_assocdxypvzoomed
void fill(Args &&...args) const
auto dxy(const T_Vertex &vertex, const T_Momentum &momentum, const T_Point &point)
std::vector< ConcurrentMonitorElement > h_looperdzpvzoomed
std::vector< ConcurrentMonitorElement > ptpull_vs_phi
std::vector< ConcurrentMonitorElement > h_assocphi
std::vector< ConcurrentMonitorElement > h_pileup_dzpvsigcut
unsigned short found() const
Number of valid hits on track.
Definition: Track.h:194
std::vector< ConcurrentMonitorElement > h_simul_dzpvsigcut
std::vector< ConcurrentMonitorElement > chi2_vs_nhits
std::vector< ConcurrentMonitorElement > h_pt
std::vector< ConcurrentMonitorElement > nrecHit_vs_nsimHit_sim2rec
std::vector< ConcurrentMonitorElement > h_recopu
std::vector< ConcurrentMonitorElement > phipull_vs_eta
std::vector< ConcurrentMonitorElement > h_misideta
std::vector< ConcurrentMonitorElement > h_reco_simpvz
std::vector< ConcurrentMonitorElement > h_assoc23Dlayer
std::vector< ConcurrentMonitorElement > h_assoc2_simpvz
std::vector< std::vector< ConcurrentMonitorElement > > h_assoc2_mvacut_hp
std::vector< ConcurrentMonitorElement > h_looperzpos
std::vector< ConcurrentMonitorElement > nPXLlayersWithMeas_vs_eta
double phiMode() const
azimuthal angle of momentum vector from mode
Definition: GsfTrack.h:57
std::vector< ConcurrentMonitorElement > nTEChits_vs_eta
std::vector< ConcurrentMonitorElement > h_recodxypvzoomed
Monte Carlo truth information used for tracking validation.
std::vector< ConcurrentMonitorElement > h_recodz
std::vector< ConcurrentMonitorElement > h_simuldxypvzoomed
std::vector< ConcurrentMonitorElement > h_seedsFitFailedFraction
int charge() const
track electric charge
Definition: TrackBase.h:567
std::vector< ConcurrentMonitorElement > h_misidchi2
std::vector< ConcurrentMonitorElement > h_losthits
std::vector< ConcurrentMonitorElement > cotThetares_vs_eta
std::vector< ConcurrentMonitorElement > thetapull_vs_eta
std::vector< ConcurrentMonitorElement > h_simuldz
void bookRecodEdxHistos(DQMStore::ConcurrentBooker &ibook, Histograms &histograms)
std::vector< ConcurrentMonitorElement > ptpull_vs_eta
double lambdaModeError() const
error on lambda from mode
Definition: GsfTrack.h:90
std::unique_ptr< GenParticleCustomSelector > generalGpSelector
std::vector< ConcurrentMonitorElement > h_reco2pT
std::vector< ConcurrentMonitorElement > h_looperdxypvzoomed
std::vector< ConcurrentMonitorElement > h_reco_dzpvsigcut
void setBinLabels(std::vector< TH2F > &depth)
std::vector< ConcurrentMonitorElement > h_simul_dzpvsigcut_pt
math::XYZVectorD Vector
point in the space
std::unique_ptr< RecoTrackSelectorBase > trackSelectorVsEta
std::vector< ConcurrentMonitorElement > h_looperhit
std::vector< ConcurrentMonitorElement > h_misidpu
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:591
static std::unique_ptr< RecoTrackSelectorBase > makeRecoTrackSelectorFromTPSelectorParameters(const edm::ParameterSet &pset)
std::vector< ConcurrentMonitorElement > h_simuldr
std::vector< ConcurrentMonitorElement > h_assochit
std::vector< ConcurrentMonitorElement > h_assocSharedHit
double ptMode() const
track transverse momentum from mode
Definition: GsfTrack.h:49
int numberOfSaturatedMeasurements() const
Definition: DeDxData.cc:42
std::vector< ConcurrentMonitorElement > h_assocdxy
std::vector< ConcurrentMonitorElement > h_assocpT
std::vector< ConcurrentMonitorElement > h_looperdxypv
std::vector< ConcurrentMonitorElement > h_looper_simpvz
std::vector< ConcurrentMonitorElement > h_pileuppu
std::vector< std::vector< ConcurrentMonitorElement > > h_assoc2_mva_vs_pt
std::vector< ConcurrentMonitorElement > h_recoeta
std::vector< std::vector< ConcurrentMonitorElement > > h_assoc2_mva
std::vector< ConcurrentMonitorElement > h_pileup_dzpvcut_pt
std::vector< ConcurrentMonitorElement > h_pileuppixellayer
std::vector< ConcurrentMonitorElement > nSTRIPlayersWith1dMeas_vs_eta
std::vector< ConcurrentMonitorElement > h_pullDxy
std::vector< ConcurrentMonitorElement > h_assoc2dz
std::vector< ConcurrentMonitorElement > nTIBhits_vs_eta
static std::vector< std::vector< std::string > > layerNamesInSets(const std::vector< std::string > &namesPSet)
std::vector< ConcurrentMonitorElement > h_tracks
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:39
std::vector< ConcurrentMonitorElement > thetapull_vs_phi