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