CMS 3D CMS Logo

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