CMS 3D CMS Logo

MultiTrackValidator.cc
Go to the documentation of this file.
3 
7 
26 
32 #include <type_traits>
33 
34 #include "TMath.h"
35 #include <TF1.h>
38 //#include <iostream>
39 
40 using namespace std;
41 using namespace edm;
42 
44 namespace {
45  bool trackSelected(unsigned char mask, unsigned char qual) { return mask & 1 << qual; }
46 
47 } // namespace
48 
50  : tTopoEsToken(esConsumes()),
51  parametersDefiner(pset.getParameter<std::string>("parametersDefiner")),
52  tpDefinerEsToken(esConsumes(edm::ESInputTag("", parametersDefiner))),
53  parametersDefinerIsCosmic_(parametersDefiner == "CosmicParametersDefinerForTP"),
54  associators(pset.getUntrackedParameter<std::vector<edm::InputTag>>("associators")),
55  label(pset.getParameter<std::vector<edm::InputTag>>("label")),
56  ignoremissingtkcollection_(pset.getUntrackedParameter<bool>("ignoremissingtrackcollection", false)),
57  useAssociators_(pset.getParameter<bool>("UseAssociators")),
58  calculateDrSingleCollection_(pset.getUntrackedParameter<bool>("calculateDrSingleCollection")),
59  doPlotsOnlyForTruePV_(pset.getUntrackedParameter<bool>("doPlotsOnlyForTruePV")),
60  doSummaryPlots_(pset.getUntrackedParameter<bool>("doSummaryPlots")),
61  doSimPlots_(pset.getUntrackedParameter<bool>("doSimPlots")),
62  doSimTrackPlots_(pset.getUntrackedParameter<bool>("doSimTrackPlots")),
63  doRecoTrackPlots_(pset.getUntrackedParameter<bool>("doRecoTrackPlots")),
64  dodEdxPlots_(pset.getUntrackedParameter<bool>("dodEdxPlots")),
65  doPVAssociationPlots_(pset.getUntrackedParameter<bool>("doPVAssociationPlots")),
66  doSeedPlots_(pset.getUntrackedParameter<bool>("doSeedPlots")),
67  doMVAPlots_(pset.getUntrackedParameter<bool>("doMVAPlots")),
68  simPVMaxZ_(pset.getUntrackedParameter<double>("simPVMaxZ")) {
69  if (not(pset.getParameter<edm::InputTag>("cores").label().empty())) {
70  cores_ = consumes<edm::View<reco::Candidate>>(pset.getParameter<edm::InputTag>("cores"));
71  }
72  if (label.empty()) {
73  // Disable prefetching of everything if there are no track collections
74  return;
75  }
76 
77  const edm::InputTag& label_tp_effic_tag = pset.getParameter<edm::InputTag>("label_tp_effic");
78  const edm::InputTag& label_tp_fake_tag = pset.getParameter<edm::InputTag>("label_tp_fake");
79 
80  if (pset.getParameter<bool>("label_tp_effic_refvector")) {
81  label_tp_effic_refvector = consumes<TrackingParticleRefVector>(label_tp_effic_tag);
82  } else {
83  label_tp_effic = consumes<TrackingParticleCollection>(label_tp_effic_tag);
84  }
85  if (pset.getParameter<bool>("label_tp_fake_refvector")) {
86  label_tp_fake_refvector = consumes<TrackingParticleRefVector>(label_tp_fake_tag);
87  } else {
88  label_tp_fake = consumes<TrackingParticleCollection>(label_tp_fake_tag);
89  }
90  label_pileupinfo = consumes<std::vector<PileupSummaryInfo>>(pset.getParameter<edm::InputTag>("label_pileupinfo"));
91  for (const auto& tag : pset.getParameter<std::vector<edm::InputTag>>("sim")) {
92  simHitTokens_.push_back(consumes<std::vector<PSimHit>>(tag));
93  }
94 
95  std::vector<edm::InputTag> doResolutionPlotsForLabels =
96  pset.getParameter<std::vector<edm::InputTag>>("doResolutionPlotsForLabels");
97  doResolutionPlots_.reserve(label.size());
98  for (auto& itag : label) {
99  labelToken.push_back(consumes<edm::View<reco::Track>>(itag));
100  const bool doResol = doResolutionPlotsForLabels.empty() ||
103  doResolutionPlots_.push_back(doResol);
104  }
105  { // check for duplicates
106  auto labelTmp = edm::vector_transform(label, [&](const edm::InputTag& tag) { return tag.label(); });
107  std::sort(begin(labelTmp), end(labelTmp));
109  const std::string* prev = &empty;
110  for (const std::string& l : labelTmp) {
111  if (l == *prev) {
112  throw cms::Exception("Configuration") << "Duplicate InputTag in labels: " << l;
113  }
114  prev = &l;
115  }
116  }
117 
118  edm::InputTag beamSpotTag = pset.getParameter<edm::InputTag>("beamSpot");
119  bsSrc = consumes<reco::BeamSpot>(beamSpotTag);
120 
121  ParameterSet psetForHistoProducerAlgo = pset.getParameter<ParameterSet>("histoProducerAlgoBlock");
122  histoProducerAlgo_ = std::make_unique<MTVHistoProducerAlgoForTracker>(psetForHistoProducerAlgo, doSeedPlots_);
123 
124  dirName_ = pset.getParameter<std::string>("dirName");
125 
126  tpNLayersToken_ = consumes<edm::ValueMap<unsigned int>>(pset.getParameter<edm::InputTag>("label_tp_nlayers"));
128  consumes<edm::ValueMap<unsigned int>>(pset.getParameter<edm::InputTag>("label_tp_npixellayers"));
130  consumes<edm::ValueMap<unsigned int>>(pset.getParameter<edm::InputTag>("label_tp_nstripstereolayers"));
131 
132  if (dodEdxPlots_) {
133  m_dEdx1Tag = consumes<edm::ValueMap<reco::DeDxData>>(pset.getParameter<edm::InputTag>("dEdx1Tag"));
134  m_dEdx2Tag = consumes<edm::ValueMap<reco::DeDxData>>(pset.getParameter<edm::InputTag>("dEdx2Tag"));
135  }
136 
137  label_tv = consumes<TrackingVertexCollection>(pset.getParameter<edm::InputTag>("label_tv"));
139  recoVertexToken_ = consumes<edm::View<reco::Vertex>>(pset.getUntrackedParameter<edm::InputTag>("label_vertex"));
141  consumes<reco::VertexToTrackingVertexAssociator>(pset.getUntrackedParameter<edm::InputTag>("vertexAssociator"));
142  }
143 
144  if (doMVAPlots_) {
146  auto mvaPSet = pset.getUntrackedParameter<edm::ParameterSet>("mvaLabels");
147  for (size_t iIter = 0; iIter < labelToken.size(); ++iIter) {
150  if (mvaPSet.exists(labels.module)) {
152  mvaPSet.getUntrackedParameter<std::vector<std::string>>(labels.module), [&](const std::string& tag) {
153  return std::make_tuple(consumes<MVACollection>(edm::InputTag(tag, "MVAValues")),
154  consumes<QualityMaskCollection>(edm::InputTag(tag, "QualityMasks")));
155  });
156  }
157  }
158  }
159 
160  tpSelector = TrackingParticleSelector(pset.getParameter<double>("ptMinTP"),
161  pset.getParameter<double>("ptMaxTP"),
162  pset.getParameter<double>("minRapidityTP"),
163  pset.getParameter<double>("maxRapidityTP"),
164  pset.getParameter<double>("tipTP"),
165  pset.getParameter<double>("lipTP"),
166  pset.getParameter<int>("minHitTP"),
167  pset.getParameter<bool>("signalOnlyTP"),
168  pset.getParameter<bool>("intimeOnlyTP"),
169  pset.getParameter<bool>("chargedOnlyTP"),
170  pset.getParameter<bool>("stableOnlyTP"),
171  pset.getParameter<std::vector<int>>("pdgIdTP"),
172  pset.getParameter<bool>("invertRapidityCutTP"));
173 
174  cosmictpSelector = CosmicTrackingParticleSelector(pset.getParameter<double>("ptMinTP"),
175  pset.getParameter<double>("minRapidityTP"),
176  pset.getParameter<double>("maxRapidityTP"),
177  pset.getParameter<double>("tipTP"),
178  pset.getParameter<double>("lipTP"),
179  pset.getParameter<int>("minHitTP"),
180  pset.getParameter<bool>("chargedOnlyTP"),
181  pset.getParameter<std::vector<int>>("pdgIdTP"));
182 
183  ParameterSet psetVsPhi = psetForHistoProducerAlgo.getParameter<ParameterSet>("TpSelectorForEfficiencyVsPhi");
184  dRtpSelector = TrackingParticleSelector(psetVsPhi.getParameter<double>("ptMin"),
185  psetVsPhi.getParameter<double>("ptMax"),
186  psetVsPhi.getParameter<double>("minRapidity"),
187  psetVsPhi.getParameter<double>("maxRapidity"),
188  psetVsPhi.getParameter<double>("tip"),
189  psetVsPhi.getParameter<double>("lip"),
190  psetVsPhi.getParameter<int>("minHit"),
191  psetVsPhi.getParameter<bool>("signalOnly"),
192  psetVsPhi.getParameter<bool>("intimeOnly"),
193  psetVsPhi.getParameter<bool>("chargedOnly"),
194  psetVsPhi.getParameter<bool>("stableOnly"),
195  psetVsPhi.getParameter<std::vector<int>>("pdgId"),
196  psetVsPhi.getParameter<bool>("invertRapidityCut"));
197 
199 
200  useGsf = pset.getParameter<bool>("useGsf");
201 
202  _simHitTpMapTag = mayConsume<SimHitTPAssociationProducer::SimHitTPAssociationList>(
203  pset.getParameter<edm::InputTag>("simHitTpMapTag"));
204 
207  consumes<edm::View<reco::Track>>(pset.getParameter<edm::InputTag>("trackCollectionForDrCalculation"));
208  }
209 
210  if (useAssociators_) {
211  for (auto const& src : associators) {
212  associatorTokens.push_back(consumes<reco::TrackToTrackingParticleAssociator>(src));
213  }
214  } else {
215  for (auto const& src : associators) {
216  associatormapStRs.push_back(consumes<reco::SimToRecoCollection>(src));
217  associatormapRtSs.push_back(consumes<reco::RecoToSimCollection>(src));
218  }
219  }
220 }
221 
223 
225  edm::Run const&,
226  edm::EventSetup const& setup,
227  Histograms& histograms) const {
228  if (label.empty()) {
229  // Disable histogram booking if there are no track collections
230  return;
231  }
232 
233  const auto minColl = -0.5;
234  const auto maxColl = label.size() - 0.5;
235  const auto nintColl = label.size();
236 
237  auto binLabels = [&](dqm::reco::MonitorElement* me) {
238  for (size_t i = 0; i < label.size(); ++i) {
239  me->setBinLabel(i + 1, label[i].label());
240  }
241  me->disableAlphanumeric();
242  return me;
243  };
244 
245  //Booking histograms concerning with simulated tracks
246  if (doSimPlots_) {
247  ibook.cd();
248  ibook.setCurrentFolder(dirName_ + "simulation");
249 
250  histoProducerAlgo_->bookSimHistos(ibook, histograms.histoProducerAlgo);
251 
252  ibook.cd();
253  ibook.setCurrentFolder(dirName_);
254  }
255 
256  for (unsigned int ww = 0; ww < associators.size(); ww++) {
257  ibook.cd();
258  // FIXME: these need to be moved to a subdirectory whose name depends on the associator
259  ibook.setCurrentFolder(dirName_);
260 
261  if (doSummaryPlots_) {
262  if (doSimTrackPlots_) {
263  histograms.h_assoc_coll.push_back(
264  binLabels(ibook.book1D("num_assoc(simToReco)_coll",
265  "N of associated (simToReco) tracks vs track collection",
266  nintColl,
267  minColl,
268  maxColl)));
269  histograms.h_simul_coll.push_back(binLabels(
270  ibook.book1D("num_simul_coll", "N of simulated tracks vs track collection", nintColl, minColl, maxColl)));
271  }
272  if (doRecoTrackPlots_) {
273  histograms.h_reco_coll.push_back(binLabels(
274  ibook.book1D("num_reco_coll", "N of reco track vs track collection", nintColl, minColl, maxColl)));
275  histograms.h_assoc2_coll.push_back(
276  binLabels(ibook.book1D("num_assoc(recoToSim)_coll",
277  "N of associated (recoToSim) tracks vs track collection",
278  nintColl,
279  minColl,
280  maxColl)));
281  histograms.h_looper_coll.push_back(
282  binLabels(ibook.book1D("num_duplicate_coll",
283  "N of associated (recoToSim) looper tracks vs track collection",
284  nintColl,
285  minColl,
286  maxColl)));
287  histograms.h_pileup_coll.push_back(
288  binLabels(ibook.book1D("num_pileup_coll",
289  "N of associated (recoToSim) pileup tracks vs track collection",
290  nintColl,
291  minColl,
292  maxColl)));
293  }
294  }
295 
296  for (unsigned int www = 0; www < label.size(); www++) {
297  ibook.cd();
298  InputTag algo = label[www];
299  string dirName = dirName_;
300  if (!algo.process().empty())
301  dirName += algo.process() + "_";
302  if (!algo.label().empty())
303  dirName += algo.label() + "_";
304  if (!algo.instance().empty())
305  dirName += algo.instance() + "_";
306  if (dirName.find("Tracks") < dirName.length()) {
307  dirName.replace(dirName.find("Tracks"), 6, "");
308  }
309  string assoc = associators[ww].label();
310  if (assoc.find("Track") < assoc.length()) {
311  assoc.replace(assoc.find("Track"), 5, "");
312  }
313  dirName += assoc;
314  std::replace(dirName.begin(), dirName.end(), ':', '_');
315 
316  ibook.setCurrentFolder(dirName);
317 
318  const bool doResolutionPlots = doResolutionPlots_[www];
319 
320  if (doSimTrackPlots_) {
321  histoProducerAlgo_->bookSimTrackHistos(ibook, histograms.histoProducerAlgo, doResolutionPlots);
323  histoProducerAlgo_->bookSimTrackPVAssociationHistos(ibook, histograms.histoProducerAlgo);
324  }
325 
326  //Booking histograms concerning with reconstructed tracks
327  if (doRecoTrackPlots_) {
328  histoProducerAlgo_->bookRecoHistos(ibook, histograms.histoProducerAlgo, doResolutionPlots);
329  if (dodEdxPlots_)
330  histoProducerAlgo_->bookRecodEdxHistos(ibook, histograms.histoProducerAlgo);
332  histoProducerAlgo_->bookRecoPVAssociationHistos(ibook, histograms.histoProducerAlgo);
333  if (doMVAPlots_)
334  histoProducerAlgo_->bookMVAHistos(
335  ibook, histograms.histoProducerAlgo, mvaQualityCollectionTokens_[www].size());
336  }
337 
338  if (doSeedPlots_) {
339  histoProducerAlgo_->bookSeedHistos(ibook, histograms.histoProducerAlgo);
340  }
341  } //end loop www
342  } // end loop ww
343 }
344 
345 namespace {
346  void ensureEffIsSubsetOfFake(const TrackingParticleRefVector& eff, const TrackingParticleRefVector& fake) {
347  // If efficiency RefVector is empty, don't check the product ids
348  // as it will be 0:0 for empty. This covers also the case where
349  // both are empty. The case of fake being empty and eff not is an
350  // error.
351  if (eff.empty())
352  return;
353 
354  // First ensure product ids
355  if (eff.id() != fake.id()) {
356  throw cms::Exception("Configuration")
357  << "Efficiency and fake TrackingParticle (refs) point to different collections (eff " << eff.id() << " fake "
358  << fake.id()
359  << "). This is not supported. Efficiency TP set must be the same or a subset of the fake TP set.";
360  }
361 
362  // Same technique as in associationMapFilterValues
363  edm::IndexSet fakeKeys;
364  fakeKeys.reserve(fake.size());
365  for (const auto& ref : fake) {
366  fakeKeys.insert(ref.key());
367  }
368 
369  for (const auto& ref : eff) {
370  if (!fakeKeys.has(ref.key())) {
371  throw cms::Exception("Configuration") << "Efficiency TrackingParticle " << ref.key()
372  << " is not found from the set of fake TPs. This is not supported. The "
373  "efficiency TP set must be the same or a subset of the fake TP set.";
374  }
375  }
376  }
377 } // namespace
378 
380  const edm::Handle<TrackingVertexCollection>& htv) const {
381  for (const auto& simV : *htv) {
382  if (simV.eventId().bunchCrossing() != 0)
383  continue; // remove OOTPU
384  if (simV.eventId().event() != 0)
385  continue; // pick the PV of hard scatter
386  return &(simV.position());
387  }
388  return nullptr;
389 }
390 
392  const edm::Event& event, const edm::Handle<TrackingVertexCollection>& htv) const {
394  event.getByToken(recoVertexToken_, hvertex);
395 
397  event.getByToken(vertexAssociatorToken_, hvassociator);
398 
399  auto v_r2s = hvassociator->associateRecoToSim(hvertex, htv);
400  auto pvPtr = hvertex->refAt(0);
401  if (pvPtr->isFake() || pvPtr->ndof() < 0) // skip junk vertices
402  return nullptr;
403 
404  auto pvFound = v_r2s.find(pvPtr);
405  if (pvFound == v_r2s.end())
406  return nullptr;
407 
408  for (const auto& vertexRefQuality : pvFound->val) {
409  const TrackingVertex& tv = *(vertexRefQuality.first);
410  if (tv.eventId().event() == 0 && tv.eventId().bunchCrossing() == 0) {
411  return &(pvPtr->position());
412  }
413  }
414 
415  return nullptr;
416 }
417 
419  const Histograms& histograms,
420  const TrackingParticleRefVector& tPCeff,
421  const ParametersDefinerForTP& parametersDefinerTP,
422  const edm::Event& event,
423  const edm::EventSetup& setup,
424  const reco::BeamSpot& bs,
425  std::vector<std::tuple<TrackingParticle::Vector, TrackingParticle::Point>>& momVert_tPCeff,
426  std::vector<size_t>& selected_tPCeff) const {
427  selected_tPCeff.reserve(tPCeff.size());
428  momVert_tPCeff.reserve(tPCeff.size());
429  int nIntimeTPs = 0;
431  for (size_t j = 0; j < tPCeff.size(); ++j) {
432  const TrackingParticleRef& tpr = tPCeff[j];
433 
434  TrackingParticle::Vector momentum = parametersDefinerTP.momentum(event, setup, tpr);
435  TrackingParticle::Point vertex = parametersDefinerTP.vertex(event, setup, tpr);
436  if (doSimPlots_) {
437  histoProducerAlgo_->fill_generic_simTrack_histos(
438  histograms.histoProducerAlgo, momentum, vertex, tpr->eventId().bunchCrossing());
439  }
440  if (tpr->eventId().bunchCrossing() == 0)
441  ++nIntimeTPs;
442 
443  if (cosmictpSelector(tpr, &bs, event, setup)) {
444  selected_tPCeff.push_back(j);
445  momVert_tPCeff.emplace_back(momentum, vertex);
446  }
447  }
448  } else {
449  size_t j = 0;
450  for (auto const& tpr : tPCeff) {
451  const TrackingParticle& tp = *tpr;
452 
453  // TODO: do we want to fill these from all TPs that include IT
454  // and OOT (as below), or limit to IT+OOT TPs passing tpSelector
455  // (as it was before)? The latter would require another instance
456  // of tpSelector with intimeOnly=False.
457  if (doSimPlots_) {
458  histoProducerAlgo_->fill_generic_simTrack_histos(
459  histograms.histoProducerAlgo, tp.momentum(), tp.vertex(), tp.eventId().bunchCrossing());
460  }
461  if (tp.eventId().bunchCrossing() == 0)
462  ++nIntimeTPs;
463 
464  if (tpSelector(tp)) {
465  selected_tPCeff.push_back(j);
466  TrackingParticle::Vector momentum = parametersDefinerTP.momentum(event, setup, tpr);
467  TrackingParticle::Point vertex = parametersDefinerTP.vertex(event, setup, tpr);
468  momVert_tPCeff.emplace_back(momentum, vertex);
469  }
470  ++j;
471  }
472  }
473  if (doSimPlots_) {
474  histoProducerAlgo_->fill_simTrackBased_histos(histograms.histoProducerAlgo, nIntimeTPs);
475  }
476 }
477 
479  const std::vector<size_t>& selected_tPCeff,
480  DynArray<float>& dR_tPCeff,
481  DynArray<float>& dR_tPCeff_jet,
482  const edm::View<reco::Candidate>* cores) const {
483  float etaL[tPCeff.size()], phiL[tPCeff.size()];
484  size_t n_selTP_dr = 0;
485  for (size_t iTP : selected_tPCeff) {
486  //calculare dR wrt inclusive collection (also with PU, low pT, displaced)
487  auto const& tp2 = *(tPCeff[iTP]);
488  auto&& p = tp2.momentum();
489  etaL[iTP] = etaFromXYZ(p.x(), p.y(), p.z());
490  phiL[iTP] = atan2f(p.y(), p.x());
491  }
492  for (size_t iTP1 : selected_tPCeff) {
493  auto const& tp = *(tPCeff[iTP1]);
495  double dR_jet = std::numeric_limits<double>::max();
496  if (dRtpSelector(tp)) { //only for those needed for efficiency!
497  ++n_selTP_dr;
498  float eta = etaL[iTP1];
499  float phi = phiL[iTP1];
500  for (size_t iTP2 : selected_tPCeff) {
501  //calculare dR wrt inclusive collection (also with PU, low pT, displaced)
502  if (iTP1 == iTP2) {
503  continue;
504  }
505  auto dR_tmp = reco::deltaR2(eta, phi, etaL[iTP2], phiL[iTP2]);
506  if (dR_tmp < dR)
507  dR = dR_tmp;
508  } // ttp2 (iTP)
509  if (cores != nullptr) {
510  for (unsigned int ji = 0; ji < cores->size(); ji++) { //jet loop
511  const reco::Candidate& jet = (*cores)[ji];
512  double jet_eta = jet.eta();
513  double jet_phi = jet.phi();
514  auto dR_jet_tmp = reco::deltaR2(eta, phi, jet_eta, jet_phi);
515  if (dR_jet_tmp < dR_jet)
516  dR_jet = dR_jet_tmp;
517  }
518  }
519  }
520  dR_tPCeff[iTP1] = std::sqrt(dR);
521  dR_tPCeff_jet[iTP1] = std::sqrt(dR_jet);
522 
523  } // tp
524  return n_selTP_dr;
525 }
526 
528  const edm::View<reco::Track>& trackCollectionDr,
529  DynArray<float>& dR_trk,
530  DynArray<float>& dR_trk_jet,
531  const edm::View<reco::Candidate>* cores) const {
532  int i = 0;
533  float etaL[trackCollectionDr.size()];
534  float phiL[trackCollectionDr.size()];
535  bool validL[trackCollectionDr.size()];
536  for (auto const& track2 : trackCollectionDr) {
537  auto&& p = track2.momentum();
538  etaL[i] = etaFromXYZ(p.x(), p.y(), p.z());
539  phiL[i] = atan2f(p.y(), p.x());
540  validL[i] = !trackFromSeedFitFailed(track2);
541  ++i;
542  }
543  for (View<reco::Track>::size_type i = 0; i < trackCollection.size(); ++i) {
544  auto const& track = trackCollection[i];
546  auto dR_jet = std::numeric_limits<float>::max();
548  auto&& p = track.momentum();
549  float eta = etaFromXYZ(p.x(), p.y(), p.z());
550  float phi = atan2f(p.y(), p.x());
551  for (View<reco::Track>::size_type j = 0; j < trackCollectionDr.size(); ++j) {
552  if (!validL[j])
553  continue;
554  auto dR_tmp = reco::deltaR2(eta, phi, etaL[j], phiL[j]);
555  if ((dR_tmp < dR) & (dR_tmp > std::numeric_limits<float>::min()))
556  dR = dR_tmp;
557  }
558  if (cores != nullptr) {
559  for (unsigned int ji = 0; ji < cores->size(); ji++) { //jet loop
560  const reco::Candidate& jet = (*cores)[ji];
561  double jet_eta = jet.eta();
562  double jet_phi = jet.phi();
563  auto dR_jet_tmp = reco::deltaR2(eta, phi, jet_eta, jet_phi);
564  if (dR_jet_tmp < dR_jet)
565  dR_jet = dR_jet_tmp;
566  }
567  }
568  }
569  dR_trk[i] = std::sqrt(dR);
570  dR_trk_jet[i] = std::sqrt(dR_jet);
571  }
572 }
573 
575  const edm::EventSetup& setup,
576  const Histograms& histograms) const {
577  if (label.empty()) {
578  // Disable if there are no track collections
579  return;
580  }
581 
582  using namespace reco;
583 
584  LogDebug("TrackValidator") << "\n===================================================="
585  << "\n"
586  << "Analyzing new event"
587  << "\n"
588  << "====================================================\n"
589  << "\n";
590 
591  const auto& parametersDefinerTPHandle = setup.getHandle(tpDefinerEsToken);
592  //Since we modify the object, we must clone it
593  auto parametersDefinerTP = parametersDefinerTPHandle->clone();
594 
595  const TrackerTopology& ttopo = setup.getData(tTopoEsToken);
596 
597  // FIXME: we really need to move to edm::View for reading the
598  // TrackingParticles... Unfortunately it has non-trivial
599  // consequences on the associator/association interfaces etc.
600  TrackingParticleRefVector tmpTPeff;
601  TrackingParticleRefVector tmpTPfake;
602  const TrackingParticleRefVector* tmpTPeffPtr = nullptr;
603  const TrackingParticleRefVector* tmpTPfakePtr = nullptr;
604 
606  edm::Handle<TrackingParticleRefVector> TPCollectionHeffRefVector;
607 
608  const bool tp_effic_refvector = label_tp_effic.isUninitialized();
609  if (!tp_effic_refvector) {
610  event.getByToken(label_tp_effic, TPCollectionHeff);
611  for (size_t i = 0, size = TPCollectionHeff->size(); i < size; ++i) {
612  tmpTPeff.push_back(TrackingParticleRef(TPCollectionHeff, i));
613  }
614  tmpTPeffPtr = &tmpTPeff;
615  } else {
616  event.getByToken(label_tp_effic_refvector, TPCollectionHeffRefVector);
617  tmpTPeffPtr = TPCollectionHeffRefVector.product();
618  }
620  edm::Handle<TrackingParticleCollection> TPCollectionHfake;
621  event.getByToken(label_tp_fake, TPCollectionHfake);
622  for (size_t i = 0, size = TPCollectionHfake->size(); i < size; ++i) {
623  tmpTPfake.push_back(TrackingParticleRef(TPCollectionHfake, i));
624  }
625  tmpTPfakePtr = &tmpTPfake;
626  } else {
627  edm::Handle<TrackingParticleRefVector> TPCollectionHfakeRefVector;
628  event.getByToken(label_tp_fake_refvector, TPCollectionHfakeRefVector);
629  tmpTPfakePtr = TPCollectionHfakeRefVector.product();
630  }
631 
632  TrackingParticleRefVector const& tPCeff = *tmpTPeffPtr;
633  TrackingParticleRefVector const& tPCfake = *tmpTPfakePtr;
634 
635  ensureEffIsSubsetOfFake(tPCeff, tPCfake);
636 
639  //warning: make sure the TP collection used in the map is the same used in the MTV!
640  event.getByToken(_simHitTpMapTag, simHitsTPAssoc);
641  parametersDefinerTP->initEvent(simHitsTPAssoc);
642  cosmictpSelector.initEvent(simHitsTPAssoc);
643  }
644 
645  // Find the sim PV and tak its position
647  event.getByToken(label_tv, htv);
648  const TrackingVertex::LorentzVector* theSimPVPosition = getSimPVPosition(htv);
649  if (simPVMaxZ_ >= 0) {
650  if (!theSimPVPosition)
651  return;
652  if (std::abs(theSimPVPosition->z()) > simPVMaxZ_)
653  return;
654  }
655 
656  // Check, when necessary, if reco PV matches to sim PV
657  const reco::Vertex::Point* thePVposition = nullptr;
659  thePVposition = getRecoPVPosition(event, htv);
660  if (doPlotsOnlyForTruePV_ && !thePVposition)
661  return;
662 
663  // Rest of the code assumes that if thePVposition is non-null, the
664  // PV-association histograms get filled. In above, the "nullness"
665  // is used to deliver the information if the reco PV is matched to
666  // the sim PV.
668  thePVposition = nullptr;
669  }
670 
671  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
672  event.getByToken(bsSrc, recoBeamSpotHandle);
673  reco::BeamSpot const& bs = *recoBeamSpotHandle;
674 
676  event.getByToken(label_pileupinfo, puinfoH);
677  PileupSummaryInfo puinfo;
678 
679  for (unsigned int puinfo_ite = 0; puinfo_ite < (*puinfoH).size(); ++puinfo_ite) {
680  if ((*puinfoH)[puinfo_ite].getBunchCrossing() == 0) {
681  puinfo = (*puinfoH)[puinfo_ite];
682  break;
683  }
684  }
685 
686  // Number of 3D layers for TPs
688  event.getByToken(tpNLayersToken_, tpNLayersH);
689  const auto& nLayers_tPCeff = *tpNLayersH;
690 
691  event.getByToken(tpNPixelLayersToken_, tpNLayersH);
692  const auto& nPixelLayers_tPCeff = *tpNLayersH;
693 
694  event.getByToken(tpNStripStereoLayersToken_, tpNLayersH);
695  const auto& nStripMonoAndStereoLayers_tPCeff = *tpNLayersH;
696 
697  // Precalculate TP selection (for efficiency), and momentum and vertex wrt PCA
698  //
699  // TODO: ParametersDefinerForTP ESProduct needs to be changed to
700  // EDProduct because of consumes.
701  //
702  // In principle, we could just precalculate the momentum and vertex
703  // wrt PCA for all TPs for once and put that to the event. To avoid
704  // repetitive calculations those should be calculated only once for
705  // each TP. That would imply that we should access TPs via Refs
706  // (i.e. View) in here, since, in general, the eff and fake TP
707  // collections can be different (and at least HI seems to use that
708  // feature). This would further imply that the
709  // RecoToSimCollection/SimToRecoCollection should be changed to use
710  // View<TP> instead of vector<TP>, and migrate everything.
711  //
712  // Or we could take only one input TP collection, and do another
713  // TP-selection to obtain the "fake" collection like we already do
714  // for "efficiency" TPs.
715  std::vector<size_t> selected_tPCeff;
716  std::vector<std::tuple<TrackingParticle::Vector, TrackingParticle::Point>> momVert_tPCeff;
717  tpParametersAndSelection(histograms, tPCeff, *parametersDefinerTP, event, setup, bs, momVert_tPCeff, selected_tPCeff);
718 
719  //calculate dR for TPs
720  declareDynArray(float, tPCeff.size(), dR_tPCeff);
721 
722  //calculate dR_jet for TPs
723  const edm::View<reco::Candidate>* coresVector = nullptr;
724  if (not cores_.isUninitialized()) {
726  event.getByToken(cores_, cores);
727  if (cores.isValid()) {
728  coresVector = cores.product();
729  }
730  }
731  declareDynArray(float, tPCeff.size(), dR_tPCeff_jet);
732 
733  size_t n_selTP_dr = tpDR(tPCeff, selected_tPCeff, dR_tPCeff, dR_tPCeff_jet, coresVector);
734 
738  }
739 
740  // dE/dx
741  // at some point this could be generalized, with a vector of tags and a corresponding vector of Handles
742  // I'm writing the interface such to take vectors of ValueMaps
743  std::vector<const edm::ValueMap<reco::DeDxData>*> v_dEdx;
744  if (dodEdxPlots_) {
747  event.getByToken(m_dEdx1Tag, dEdx1Handle);
748  event.getByToken(m_dEdx2Tag, dEdx2Handle);
749  v_dEdx.push_back(dEdx1Handle.product());
750  v_dEdx.push_back(dEdx2Handle.product());
751  }
752 
753  std::vector<const MVACollection*> mvaCollections;
754  std::vector<const QualityMaskCollection*> qualityMaskCollections;
755  std::vector<float> mvaValues;
756 
757  int w = 0; //counter counting the number of sets of histograms
758  for (unsigned int ww = 0; ww < associators.size(); ww++) {
759  // run value filtering of recoToSim map already here as it depends only on the association, not track collection
760  reco::SimToRecoCollection const* simRecCollPFull = nullptr;
761  reco::RecoToSimCollection const* recSimCollP = nullptr;
762  reco::RecoToSimCollection recSimCollL;
763  if (!useAssociators_) {
764  Handle<reco::SimToRecoCollection> simtorecoCollectionH;
765  event.getByToken(associatormapStRs[ww], simtorecoCollectionH);
766  simRecCollPFull = simtorecoCollectionH.product();
767 
768  Handle<reco::RecoToSimCollection> recotosimCollectionH;
769  event.getByToken(associatormapRtSs[ww], recotosimCollectionH);
770  recSimCollP = recotosimCollectionH.product();
771 
772  // We need to filter the associations of the fake-TrackingParticle
773  // collection only from RecoToSim collection, otherwise the
774  // RecoToSim histograms get false entries
775  recSimCollL = associationMapFilterValues(*recSimCollP, tPCfake);
776  recSimCollP = &recSimCollL;
777  }
778 
779  for (unsigned int www = 0; www < label.size();
780  www++, w++) { // need to increment w here, since there are many continues in the loop body
781  //
782  //get collections from the event
783  //
784  edm::Handle<View<Track>> trackCollectionHandle;
785  if (!event.getByToken(labelToken[www], trackCollectionHandle) && ignoremissingtkcollection_)
786  continue;
787  const edm::View<Track>& trackCollection = *trackCollectionHandle;
788 
789  reco::SimToRecoCollection const* simRecCollP = nullptr;
790  reco::SimToRecoCollection simRecCollL;
791 
792  //associate tracks
793  LogTrace("TrackValidator") << "Analyzing " << label[www] << " with " << associators[ww] << "\n";
794  if (useAssociators_) {
796  event.getByToken(associatorTokens[ww], theAssociator);
797 
798  // The associator interfaces really need to be fixed...
800  for (edm::View<Track>::size_type i = 0; i < trackCollection.size(); ++i) {
801  trackRefs.push_back(trackCollection.refAt(i));
802  }
803 
804  LogTrace("TrackValidator") << "Calling associateRecoToSim method"
805  << "\n";
806  recSimCollL = theAssociator->associateRecoToSim(trackRefs, tPCfake);
807  recSimCollP = &recSimCollL;
808  LogTrace("TrackValidator") << "Calling associateSimToReco method"
809  << "\n";
810  // It is necessary to do the association wrt. fake TPs,
811  // because this SimToReco association is used also for
812  // duplicates. Since the set of efficiency TPs are required to
813  // be a subset of the set of fake TPs, for efficiency
814  // histograms it doesn't matter if the association contains
815  // associations of TPs not in the set of efficiency TPs.
816  simRecCollL = theAssociator->associateSimToReco(trackRefs, tPCfake);
817  simRecCollP = &simRecCollL;
818  } else {
819  // We need to filter the associations of the current track
820  // collection only from SimToReco collection, otherwise the
821  // SimToReco histograms get false entries. The filtering must
822  // be done separately for each track collection.
823  simRecCollL = associationMapFilterValues(*simRecCollPFull, trackCollection);
824  simRecCollP = &simRecCollL;
825  }
826 
827  reco::RecoToSimCollection const& recSimColl = *recSimCollP;
828  reco::SimToRecoCollection const& simRecColl = *simRecCollP;
829 
830  // read MVA collections
834  for (const auto& tokenTpl : mvaQualityCollectionTokens_[www]) {
835  event.getByToken(std::get<0>(tokenTpl), hmva);
836  event.getByToken(std::get<1>(tokenTpl), hqual);
837 
838  mvaCollections.push_back(hmva.product());
839  qualityMaskCollections.push_back(hqual.product());
840  if (mvaCollections.back()->size() != trackCollection.size()) {
841  throw cms::Exception("Configuration")
842  << "Inconsistency in track collection and MVA sizes. Track collection " << www << " has "
843  << trackCollection.size() << " tracks, whereas the MVA " << (mvaCollections.size() - 1)
844  << " for it has " << mvaCollections.back()->size() << " entries. Double-check your configuration.";
845  }
846  if (qualityMaskCollections.back()->size() != trackCollection.size()) {
847  throw cms::Exception("Configuration")
848  << "Inconsistency in track collection and quality mask sizes. Track collection " << www << " has "
849  << trackCollection.size() << " tracks, whereas the quality mask " << (qualityMaskCollections.size() - 1)
850  << " for it has " << qualityMaskCollections.back()->size()
851  << " entries. Double-check your configuration.";
852  }
853  }
854  }
855 
856  // ########################################################
857  // fill simulation histograms (LOOP OVER TRACKINGPARTICLES)
858  // ########################################################
859 
860  //compute number of tracks per eta interval
861  //
862  LogTrace("TrackValidator") << "\n# of TrackingParticles: " << tPCeff.size() << "\n";
863  int ats(0); //This counter counts the number of simTracks that are "associated" to recoTracks
864  int st(0); //This counter counts the number of simulated tracks passing the MTV selection (i.e. tpSelector(tp) )
865 
866  //loop over already-selected TPs for tracking efficiency
867  for (size_t i = 0; i < selected_tPCeff.size(); ++i) {
868  size_t iTP = selected_tPCeff[i];
869  const TrackingParticleRef& tpr = tPCeff[iTP];
870  const TrackingParticle& tp = *tpr;
871 
872  auto const& momVert = momVert_tPCeff[i];
873  TrackingParticle::Vector momentumTP;
874  TrackingParticle::Point vertexTP;
875 
876  double dxySim(0);
877  double dzSim(0);
878  double dxyPVSim = 0;
879  double dzPVSim = 0;
880  double dR = dR_tPCeff[iTP];
881  double dR_jet = dR_tPCeff_jet[iTP];
882 
883  //---------- THIS PART HAS TO BE CLEANED UP. THE PARAMETER DEFINER WAS NOT MEANT TO BE USED IN THIS WAY ----------
884  //If the TrackingParticle is collison like, get the momentum and vertex at production state
886  momentumTP = tp.momentum();
887  vertexTP = tp.vertex();
888  //Calcualte the impact parameters w.r.t. PCA
889  const TrackingParticle::Vector& momentum = std::get<TrackingParticle::Vector>(momVert);
890  const TrackingParticle::Point& vertex = std::get<TrackingParticle::Point>(momVert);
891  dxySim = TrackingParticleIP::dxy(vertex, momentum, bs.position());
892  dzSim = TrackingParticleIP::dz(vertex, momentum, bs.position());
893 
894  if (theSimPVPosition) {
895  dxyPVSim = TrackingParticleIP::dxy(vertex, momentum, *theSimPVPosition);
896  dzPVSim = TrackingParticleIP::dz(vertex, momentum, *theSimPVPosition);
897  }
898  }
899  //If the TrackingParticle is comics, get the momentum and vertex at PCA
900  else {
901  momentumTP = std::get<TrackingParticle::Vector>(momVert);
902  vertexTP = std::get<TrackingParticle::Point>(momVert);
903  dxySim = TrackingParticleIP::dxy(vertexTP, momentumTP, bs.position());
904  dzSim = TrackingParticleIP::dz(vertexTP, momentumTP, bs.position());
905 
906  // Do dxy and dz vs. PV make any sense for cosmics? I guess not
907  }
908  //---------- THE PART ABOVE HAS TO BE CLEANED UP. THE PARAMETER DEFINER WAS NOT MEANT TO BE USED IN THIS WAY ----------
909 
910  // in the coming lines, histos are filled using as input
911  // - momentumTP
912  // - vertexTP
913  // - dxySim
914  // - dzSim
915  if (!doSimTrackPlots_)
916  continue;
917 
918  // ##############################################
919  // fill RecoAssociated SimTracks' histograms
920  // ##############################################
921  const reco::Track* matchedTrackPointer = nullptr;
922  const reco::Track* matchedSecondTrackPointer = nullptr;
923  unsigned int selectsLoose = mvaCollections.size();
924  unsigned int selectsHP = mvaCollections.size();
925  if (simRecColl.find(tpr) != simRecColl.end()) {
926  auto const& rt = simRecColl[tpr];
927  if (!rt.empty()) {
928  ats++; //This counter counts the number of simTracks that have a recoTrack associated
929  // isRecoMatched = true; // UNUSED
930  matchedTrackPointer = rt.begin()->first.get();
931  if (rt.size() >= 2) {
932  matchedSecondTrackPointer = (rt.begin() + 1)->first.get();
933  }
934  LogTrace("TrackValidator") << "TrackingParticle #" << st << " with pt=" << sqrt(momentumTP.perp2())
935  << " associated with quality:" << rt.begin()->second << "\n";
936 
937  if (doMVAPlots_) {
938  // for each MVA we need to take the value of the track
939  // with largest MVA value (for the cumulative histograms)
940  //
941  // also identify the first MVA that possibly selects any
942  // track matched to this TrackingParticle, separately
943  // for loose and highPurity qualities
944  for (size_t imva = 0; imva < mvaCollections.size(); ++imva) {
945  const auto& mva = *(mvaCollections[imva]);
946  const auto& qual = *(qualityMaskCollections[imva]);
947 
948  auto iMatch = rt.begin();
949  float maxMva = mva[iMatch->first.key()];
950  for (; iMatch != rt.end(); ++iMatch) {
951  auto itrk = iMatch->first.key();
952  maxMva = std::max(maxMva, mva[itrk]);
953 
954  if (selectsLoose >= imva && trackSelected(qual[itrk], reco::TrackBase::loose))
955  selectsLoose = imva;
956  if (selectsHP >= imva && trackSelected(qual[itrk], reco::TrackBase::highPurity))
957  selectsHP = imva;
958  }
959  mvaValues.push_back(maxMva);
960  }
961  }
962  }
963  } else {
964  LogTrace("TrackValidator") << "TrackingParticle #" << st << " with pt,eta,phi: " << sqrt(momentumTP.perp2())
965  << " , " << momentumTP.eta() << " , " << momentumTP.phi() << " , "
966  << " NOT associated to any reco::Track"
967  << "\n";
968  }
969 
970  int nSimHits = tp.numberOfTrackerHits();
971  int nSimLayers = nLayers_tPCeff[tpr];
972  int nSimPixelLayers = nPixelLayers_tPCeff[tpr];
973  int nSimStripMonoAndStereoLayers = nStripMonoAndStereoLayers_tPCeff[tpr];
974  histoProducerAlgo_->fill_recoAssociated_simTrack_histos(histograms.histoProducerAlgo,
975  w,
976  tp,
977  momentumTP,
978  vertexTP,
979  dxySim,
980  dzSim,
981  dxyPVSim,
982  dzPVSim,
983  nSimHits,
984  nSimLayers,
985  nSimPixelLayers,
986  nSimStripMonoAndStereoLayers,
987  matchedTrackPointer,
988  puinfo.getPU_NumInteractions(),
989  dR,
990  dR_jet,
991  thePVposition,
992  theSimPVPosition,
993  bs.position(),
994  mvaValues,
995  selectsLoose,
996  selectsHP);
997  mvaValues.clear();
998 
999  if (matchedTrackPointer && matchedSecondTrackPointer) {
1000  histoProducerAlgo_->fill_duplicate_histos(
1001  histograms.histoProducerAlgo, w, *matchedTrackPointer, *matchedSecondTrackPointer);
1002  }
1003 
1004  if (doSummaryPlots_) {
1005  if (dRtpSelector(tp)) {
1006  histograms.h_simul_coll[ww]->Fill(www);
1007  if (matchedTrackPointer) {
1008  histograms.h_assoc_coll[ww]->Fill(www);
1009  }
1010  }
1011  }
1012 
1013  } // End for (TrackingParticleCollection::size_type i=0; i<tPCeff.size(); i++){
1014 
1015  // ##############################################
1016  // fill recoTracks histograms (LOOP OVER TRACKS)
1017  // ##############################################
1018  if (!doRecoTrackPlots_)
1019  continue;
1020  LogTrace("TrackValidator") << "\n# of reco::Tracks with " << label[www].process() << ":" << label[www].label()
1021  << ":" << label[www].instance() << ": " << trackCollection.size() << "\n";
1022 
1023  int sat(0); //This counter counts the number of recoTracks that are associated to SimTracks from Signal only
1024  int at(0); //This counter counts the number of recoTracks that are associated to SimTracks
1025  int rT(0); //This counter counts the number of recoTracks in general
1026  int seed_fit_failed = 0;
1027  size_t n_selTrack_dr = 0;
1028 
1029  //calculate dR for tracks
1030  const edm::View<Track>* trackCollectionDr = &trackCollection;
1032  trackCollectionDr = trackCollectionForDrCalculation.product();
1033  }
1034  declareDynArray(float, trackCollection.size(), dR_trk);
1035  declareDynArray(float, trackCollection.size(), dR_trk_jet);
1036  trackDR(trackCollection, *trackCollectionDr, dR_trk, dR_trk_jet, coresVector);
1037 
1038  for (View<Track>::size_type i = 0; i < trackCollection.size(); ++i) {
1039  auto track = trackCollection.refAt(i);
1040  rT++;
1042  ++seed_fit_failed;
1043  if ((*dRTrackSelector)(*track, bs.position()))
1044  ++n_selTrack_dr;
1045 
1046  bool isSigSimMatched(false);
1047  bool isSimMatched(false);
1048  bool isChargeMatched(true);
1049  int numAssocRecoTracks = 0;
1050  int nSimHits = 0;
1051  double sharedFraction = 0.;
1052 
1053  auto tpFound = recSimColl.find(track);
1054  isSimMatched = tpFound != recSimColl.end();
1055  if (isSimMatched) {
1056  const auto& tp = tpFound->val;
1057  nSimHits = tp[0].first->numberOfTrackerHits();
1058  sharedFraction = tp[0].second;
1059  if (tp[0].first->charge() != track->charge())
1060  isChargeMatched = false;
1061  if (simRecColl.find(tp[0].first) != simRecColl.end())
1062  numAssocRecoTracks = simRecColl[tp[0].first].size();
1063  at++;
1064  for (unsigned int tp_ite = 0; tp_ite < tp.size(); ++tp_ite) {
1065  TrackingParticle trackpart = *(tp[tp_ite].first);
1066  if ((trackpart.eventId().event() == 0) && (trackpart.eventId().bunchCrossing() == 0)) {
1067  isSigSimMatched = true;
1068  sat++;
1069  break;
1070  }
1071  }
1072  LogTrace("TrackValidator") << "reco::Track #" << rT << " with pt=" << track->pt()
1073  << " associated with quality:" << tp.begin()->second << "\n";
1074  } else {
1075  LogTrace("TrackValidator") << "reco::Track #" << rT << " with pt=" << track->pt()
1076  << " NOT associated to any TrackingParticle"
1077  << "\n";
1078  }
1079 
1080  // set MVA values for this track
1081  // take also the indices of first MVAs to select by loose and
1082  // HP quality
1083  unsigned int selectsLoose = mvaCollections.size();
1084  unsigned int selectsHP = mvaCollections.size();
1085  if (doMVAPlots_) {
1086  for (size_t imva = 0; imva < mvaCollections.size(); ++imva) {
1087  const auto& mva = *(mvaCollections[imva]);
1088  const auto& qual = *(qualityMaskCollections[imva]);
1089  mvaValues.push_back(mva[i]);
1090 
1091  if (selectsLoose >= imva && trackSelected(qual[i], reco::TrackBase::loose))
1092  selectsLoose = imva;
1093  if (selectsHP >= imva && trackSelected(qual[i], reco::TrackBase::highPurity))
1094  selectsHP = imva;
1095  }
1096  }
1097 
1098  double dR = dR_trk[i];
1099  double dR_jet = dR_trk_jet[i];
1100  histoProducerAlgo_->fill_generic_recoTrack_histos(histograms.histoProducerAlgo,
1101  w,
1102  *track,
1103  ttopo,
1104  bs.position(),
1105  thePVposition,
1106  theSimPVPosition,
1107  isSimMatched,
1108  isSigSimMatched,
1109  isChargeMatched,
1110  numAssocRecoTracks,
1111  puinfo.getPU_NumInteractions(),
1112  nSimHits,
1113  sharedFraction,
1114  dR,
1115  dR_jet,
1116  mvaValues,
1117  selectsLoose,
1118  selectsHP);
1119  mvaValues.clear();
1120 
1121  if (doSummaryPlots_) {
1122  histograms.h_reco_coll[ww]->Fill(www);
1123  if (isSimMatched) {
1124  histograms.h_assoc2_coll[ww]->Fill(www);
1125  if (numAssocRecoTracks > 1) {
1126  histograms.h_looper_coll[ww]->Fill(www);
1127  }
1128  if (!isSigSimMatched) {
1129  histograms.h_pileup_coll[ww]->Fill(www);
1130  }
1131  }
1132  }
1133 
1134  // dE/dx
1135  if (dodEdxPlots_)
1136  histoProducerAlgo_->fill_dedx_recoTrack_histos(histograms.histoProducerAlgo, w, track, v_dEdx);
1137 
1138  //Fill other histos
1139  if (!isSimMatched)
1140  continue;
1141 
1142  histoProducerAlgo_->fill_simAssociated_recoTrack_histos(histograms.histoProducerAlgo, w, *track);
1143 
1144  /* TO BE FIXED LATER
1145  if (associators[ww]=="trackAssociatorByChi2"){
1146  //association chi2
1147  double assocChi2 = -tp.begin()->second;//in association map is stored -chi2
1148  h_assochi2[www]->Fill(assocChi2);
1149  h_assochi2_prob[www]->Fill(TMath::Prob((assocChi2)*5,5));
1150  }
1151  else if (associators[ww]=="quickTrackAssociatorByHits"){
1152  double fraction = tp.begin()->second;
1153  h_assocFraction[www]->Fill(fraction);
1154  h_assocSharedHit[www]->Fill(fraction*track->numberOfValidHits());
1155  }
1156  */
1157 
1158  if (doResolutionPlots_[www]) {
1159  //Get tracking particle parameters at point of closest approach to the beamline
1160  TrackingParticleRef tpr = tpFound->val.begin()->first;
1161  TrackingParticle::Vector momentumTP = parametersDefinerTP->momentum(event, setup, tpr);
1162  TrackingParticle::Point vertexTP = parametersDefinerTP->vertex(event, setup, tpr);
1163  int chargeTP = tpr->charge();
1164 
1165  histoProducerAlgo_->fill_ResoAndPull_recoTrack_histos(
1166  histograms.histoProducerAlgo, w, momentumTP, vertexTP, chargeTP, *track, bs.position());
1167  }
1168 
1169  //TO BE FIXED
1170  //std::vector<PSimHit> simhits=tpr.get()->trackPSimHit(DetId::Tracker);
1171  //nrecHit_vs_nsimHit_rec2sim[w]->Fill(track->numberOfValidHits(), (int)(simhits.end()-simhits.begin() ));
1172 
1173  } // End of for(View<Track>::size_type i=0; i<trackCollection.size(); ++i){
1174  mvaCollections.clear();
1175  qualityMaskCollections.clear();
1176 
1177  histoProducerAlgo_->fill_trackBased_histos(histograms.histoProducerAlgo, w, at, rT, n_selTrack_dr, n_selTP_dr);
1178  // Fill seed-specific histograms
1179  if (doSeedPlots_) {
1180  histoProducerAlgo_->fill_seed_histos(
1181  histograms.histoProducerAlgo, www, seed_fit_failed, trackCollection.size());
1182  }
1183 
1184  LogTrace("TrackValidator") << "Collection " << www << "\n"
1185  << "Total Simulated (selected): " << n_selTP_dr << "\n"
1186  << "Total Reconstructed (selected): " << n_selTrack_dr << "\n"
1187  << "Total Reconstructed: " << rT << "\n"
1188  << "Total Associated (recoToSim): " << at << "\n"
1189  << "Total Fakes: " << rT - at << "\n";
1190  } // End of for (unsigned int www=0;www<label.size();www++){
1191  } //END of for (unsigned int ww=0;ww<associators.size();ww++){
1192 }
SummaryClient_cfi.labels
labels
Definition: SummaryClient_cfi.py:61
TSCBLBuilderNoMaterial.h
MultiTrackValidator::dRtpSelector
TrackingParticleSelector dRtpSelector
Definition: MultiTrackValidator.h:148
MultiTrackValidator::simPVMaxZ_
const double simPVMaxZ_
Definition: MultiTrackValidator.h:140
dqm::impl::MonitorElement
Definition: MonitorElement.h:98
MultiTrackValidator::associatorTokens
std::vector< edm::EDGetTokenT< reco::TrackToTrackingParticleAssociator > > associatorTokens
Definition: MultiTrackValidator.h:124
PileupSummaryInfo.h
electrons_cff.bool
bool
Definition: electrons_cff.py:366
edm::AssociationMap::find
const_iterator find(const key_type &k) const
find element with specified reference key
Definition: AssociationMap.h:173
mps_fire.i
i
Definition: mps_fire.py:428
edm::ESInputTag
Definition: ESInputTag.h:87
FreeTrajectoryState.h
MultiTrackValidator::tpNLayersToken_
edm::EDGetTokenT< edm::ValueMap< unsigned int > > tpNLayersToken_
Definition: MultiTrackValidator.h:128
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11713
MessageLogger.h
MultiTrackValidator::labelToken
std::vector< edm::EDGetTokenT< edm::View< reco::Track > > > labelToken
Definition: MultiTrackValidator.h:76
funct::false
false
Definition: Factorize.h:29
reco::TrackBase::loose
Definition: TrackBase.h:152
MultiTrackValidator::dqmAnalyze
void dqmAnalyze(const edm::Event &, const edm::EventSetup &, const Histograms &) const override
Method called once per event.
Definition: MultiTrackValidator.cc:574
MultiTrackValidator::cores_
edm::EDGetTokenT< edm::View< reco::Candidate > > cores_
Definition: MultiTrackValidator.h:142
edm::Handle::product
T const * product() const
Definition: Handle.h:70
MultiTrackValidator::label_tp_effic_refvector
edm::EDGetTokenT< TrackingParticleRefVector > label_tp_effic_refvector
Definition: MultiTrackValidator.h:68
DeDxData.h
MultiTrackValidator::useGsf
bool useGsf
Definition: MultiTrackValidator.h:139
CosmicParametersDefinerForTPESProducer.h
MultiTrackValidator::label
std::vector< edm::InputTag > label
Definition: MultiTrackValidator.h:75
MultiTrackValidator::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, Histograms &) const override
Method called to book the DQM histograms.
Definition: MultiTrackValidator.cc:224
edm::Run
Definition: Run.h:45
min
T min(T a, T b)
Definition: MathUtil.h:58
edm::RefVector::id
ProductID id() const
Accessor for product ID.
Definition: RefVector.h:117
edm
HLT enums.
Definition: AlignableModifier.h:19
TrackerTopology
Definition: TrackerTopology.h:16
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
reco::TrackToTrackingParticleAssociator::associateRecoToSim
reco::RecoToSimCollection associateRecoToSim(const edm::Handle< edm::View< reco::Track >> &tCH, const edm::Handle< TrackingParticleCollection > &tPCH) const
Definition: TrackToTrackingParticleAssociator.h:64
hcal_runs.rt
rt
Definition: hcal_runs.py:76
MultiTrackValidator::dRTrackSelector
std::unique_ptr< RecoTrackSelectorBase > dRTrackSelector
Definition: MultiTrackValidator.h:149
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
GenParticleRef
edm::Ref< edm::HepMCProduct, HepMC::GenParticle > GenParticleRef
Definition: MultiTrackValidator.cc:43
edm::EDGetTokenT::isUninitialized
constexpr bool isUninitialized() const noexcept
Definition: EDGetToken.h:99
TrackingVertex.h
MultiTrackValidator::tpNPixelLayersToken_
edm::EDGetTokenT< edm::ValueMap< unsigned int > > tpNPixelLayersToken_
Definition: MultiTrackValidator.h:129
TrackerHitAssociator.h
edm::IndexSet::reserve
void reserve(unsigned int size)
Reserve memory for the set.
Definition: IndexSet.h:34
TrackingParticle::Vector
math::XYZVectorD Vector
point in the space
Definition: TrackingParticle.h:37
edm::RefVector< TrackingParticleCollection >
ParametersDefinerForTP::momentum
virtual TrackingParticle::Vector momentum(const edm::Event &iEvent, const edm::EventSetup &iSetup, const Charge ch, const Point &vtx, const LorentzVector &lv) const
Definition: ParametersDefinerForTP.cc:17
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
beam_dqm_sourceclient-live_cfg.mva
mva
Definition: beam_dqm_sourceclient-live_cfg.py:124
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
associationMapFilterValues.h
edm::Handle
Definition: AssociativeIterator.h:50
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
edm::Ref
Definition: AssociativeIterator.h:58
trackingPlots.assoc
assoc
Definition: trackingPlots.py:184
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
cmsdt::algo
algo
Definition: constants.h:165
edm::AssociationMap::end
const_iterator end() const
last iterator over the map (read only)
Definition: AssociationMap.h:171
MultiTrackValidator::label_tp_fake_refvector
edm::EDGetTokenT< TrackingParticleRefVector > label_tp_fake_refvector
Definition: MultiTrackValidator.h:69
reco::VertexToTrackingVertexAssociator::associateRecoToSim
reco::VertexRecoToSimCollection associateRecoToSim(const edm::Handle< edm::View< reco::Vertex >> &vCH, const edm::Handle< TrackingVertexCollection > &tVCH) const
Definition: VertexToTrackingVertexAssociator.h:22
MultiTrackValidator.h
MakerMacros.h
MultiTrackValidator::tpNStripStereoLayersToken_
edm::EDGetTokenT< edm::ValueMap< unsigned int > > tpNStripStereoLayersToken_
Definition: MultiTrackValidator.h:130
cms::cuda::bs
bs
Definition: HistoContainer.h:127
edm::IndexSet::has
bool has(unsigned int index) const
Check if an element (=index) is in the set.
Definition: IndexSet.h:54
TrackingParticleIP::dxy
auto dxy(const T_Vertex &vertex, const T_Momentum &momentum, const T_Point &point)
Definition: TrackingParticleIP.h:11
Track.h
TrackFwd.h
TrackingVertexContainer.h
TrackValidationHeavyIons_cff.trackCollectionForDrCalculation
trackCollectionForDrCalculation
Definition: TrackValidationHeavyIons_cff.py:32
edm::RefVector::empty
bool empty() const
Is the RefVector empty.
Definition: RefVector.h:99
MultiTrackValidator::associators
std::vector< edm::InputTag > associators
Definition: MultiTrackValidator.h:65
edm::RefToBaseVector::push_back
void push_back(const RefToBase< T > &)
Definition: RefToBaseVector.h:217
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
MultiTrackValidator::doMVAPlots_
const bool doMVAPlots_
Definition: MultiTrackValidator.h:94
PVValHelper::eta
Definition: PVValidationHelpers.h:70
w
const double w
Definition: UKUtility.cc:23
DynArray
Definition: DynArray.h:5
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
TrackingParticle
Monte Carlo truth information used for tracking validation.
Definition: TrackingParticle.h:29
mps_fire.end
end
Definition: mps_fire.py:242
reco::BeamSpot
Definition: BeamSpot.h:21
MultiTrackValidator::tpDR
size_t tpDR(const TrackingParticleRefVector &tPCeff, const std::vector< size_t > &selected_tPCeff, DynArray< float > &dR_tPCeff, DynArray< float > &dR_tPCeff_jet, const edm::View< reco::Candidate > *cores) const
Definition: MultiTrackValidator.cc:478
reco::modules::TrackingParticleSelector
SingleObjectSelector< TrackingParticleCollection, ::TrackingParticleSelector > TrackingParticleSelector
Definition: TrackingParticleSelector.cc:17
reco::Track
Definition: Track.h:27
MultiTrackValidator::doRecoTrackPlots_
const bool doRecoTrackPlots_
Definition: MultiTrackValidator.h:90
dqm::implementation::NavigatorBase::cd
virtual void cd()
Definition: DQMStore.cc:29
declareDynArray
#define declareDynArray(T, n, x)
Definition: DynArray.h:91
MultiTrackValidator::_simHitTpMapTag
edm::EDGetTokenT< SimHitTPAssociationProducer::SimHitTPAssociationList > _simHitTpMapTag
Definition: MultiTrackValidator.h:151
TrackingVertex::eventId
const EncodedEventId & eventId() const
Definition: TrackingVertex.h:72
IndexSet.h
MultiTrackValidator::tTopoEsToken
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoEsToken
Definition: MultiTrackValidator.h:57
MultiTrackValidator::getRecoPVPosition
const reco::Vertex::Point * getRecoPVPosition(const edm::Event &event, const edm::Handle< TrackingVertexCollection > &htv) const
Definition: MultiTrackValidator.cc:391
AlignmentProducer_cff.beamSpotTag
beamSpotTag
Definition: AlignmentProducer_cff.py:50
MultiTrackValidator::ignoremissingtkcollection_
const bool ignoremissingtkcollection_
Definition: MultiTrackValidator.h:83
trackTimeValueMapProducer_cfi.associators
associators
Definition: trackTimeValueMapProducer_cfi.py:9
cmsswSequenceInfo.tp
tp
Definition: cmsswSequenceInfo.py:17
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:112
MultiTrackValidator::doSimPlots_
const bool doSimPlots_
Definition: MultiTrackValidator.h:88
MultiTrackValidator::associatormapRtSs
std::vector< edm::EDGetTokenT< reco::RecoToSimCollection > > associatormapRtSs
Definition: MultiTrackValidator.h:126
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::vector_transform
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
Definition: transform.h:11
edm::View::size
size_type size() const
ParametersDefinerForTPESProducer.h
trackFromSeedFitFailed
bool trackFromSeedFitFailed(const reco::Track &track)
Definition: trackFromSeedFitFailed.h:6
MultiTrackValidator::dodEdxPlots_
const bool dodEdxPlots_
Definition: MultiTrackValidator.h:91
edm::View
Definition: CaloClusterFwd.h:14
reco::CosmicTrackingParticleSelector
ObjectSelector< CosmicTrackingParticleSelector > CosmicTrackingParticleSelector
Definition: CosmicTrackingParticleSelector.cc:16
TrackToTrackingParticleAssociator.h
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
trackFromSeedFitFailed.h
edm::ParameterSet
Definition: ParameterSet.h:47
MultiTrackValidator::doSimTrackPlots_
const bool doSimTrackPlots_
Definition: MultiTrackValidator.h:89
TrackRefitter_38T_cff.src
src
Definition: TrackRefitter_38T_cff.py:24
MultiTrackValidator::tpParametersAndSelection
void tpParametersAndSelection(const Histograms &histograms, const TrackingParticleRefVector &tPCeff, const ParametersDefinerForTP &parametersDefinerTP, const edm::Event &event, const edm::EventSetup &setup, const reco::BeamSpot &bs, std::vector< std::tuple< TrackingParticle::Vector, TrackingParticle::Point >> &momVert_tPCeff, std::vector< size_t > &selected_tPCeff) const
Definition: MultiTrackValidator.cc:418
duplicaterechits_cfi.trackCollection
trackCollection
Definition: duplicaterechits_cfi.py:4
deltaR.h
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
MultiTrackValidator::vertexAssociatorToken_
edm::EDGetTokenT< reco::VertexToTrackingVertexAssociator > vertexAssociatorToken_
Definition: MultiTrackValidator.h:154
edm::AssociationMap< edm::OneToManyWithQualityGeneric< TrackingParticleCollection, edm::View< reco::Track >, double > >
MultiTrackValidator::calculateDrSingleCollection_
const bool calculateDrSingleCollection_
Definition: MultiTrackValidator.h:85
TrackingVertex
Definition: TrackingVertex.h:22
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
MultiTrackValidator::doPVAssociationPlots_
const bool doPVAssociationPlots_
Definition: MultiTrackValidator.h:92
reco::deltaR2
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
MultiTrackValidator::m_dEdx1Tag
edm::EDGetTokenT< edm::ValueMap< reco::DeDxData > > m_dEdx1Tag
Definition: MultiTrackValidator.h:80
EncodedEventId::event
int event() const
get the contents of the subdetector field (should be protected?)
Definition: EncodedEventId.h:30
edm::IndexSet
Definition: IndexSet.h:22
MultiTrackValidator::doResolutionPlots_
std::vector< bool > doResolutionPlots_
Definition: MultiTrackValidator.h:96
GsfTrack.h
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
MultiTrackValidator::~MultiTrackValidator
~MultiTrackValidator() override
Destructor.
Definition: MultiTrackValidator.cc:222
RunInfoPI::fake
Definition: RunInfoPayloadInspectoHelper.h:16
MuonTrackValidator_cfi.parametersDefiner
parametersDefiner
Definition: MuonTrackValidator_cfi.py:26
MultiTrackValidator::doSummaryPlots_
const bool doSummaryPlots_
Definition: MultiTrackValidator.h:87
edm::IndexSet::insert
void insert(unsigned int index)
Insert an element (=index) to the set.
Definition: IndexSet.h:47
MultiTrackValidator::MultiTrackValidator
MultiTrackValidator(const edm::ParameterSet &pset)
Constructor.
Definition: MultiTrackValidator.cc:49
edm::EventSetup
Definition: EventSetup.h:58
histograms
Definition: histograms.py:1
edm::RefVector::push_back
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:67
edm::RefToBaseVector< reco::Track >
MultiTrackValidator::recoVertexToken_
edm::EDGetTokenT< edm::View< reco::Vertex > > recoVertexToken_
Definition: MultiTrackValidator.h:153
MultiTrackValidator::useAssociators_
const bool useAssociators_
Definition: MultiTrackValidator.h:84
TrackingParticle::eventId
EncodedEventId eventId() const
Signal source, crossing number.
Definition: TrackingParticle.h:72
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
MultiTrackValidator::doSeedPlots_
const bool doSeedPlots_
Definition: MultiTrackValidator.h:93
reco::Candidate
Definition: Candidate.h:27
ValueMap.h
edm::EDConsumerBase::labelsForToken
void labelsForToken(EDGetToken iToken, Labels &oLabels) const
Definition: EDConsumerBase.cc:338
DDAxes::phi
MultiTrackValidator::parametersDefinerIsCosmic_
const bool parametersDefinerIsCosmic_
Definition: MultiTrackValidator.h:61
TrackingParticle.h
MultiTrackValidator::histoProducerAlgo_
std::unique_ptr< MTVHistoProducerAlgoForTracker > histoProducerAlgo_
Definition: MultiTrackValidator.h:98
PtEtaPhiMass.h
reco::Vertex::Point
math::XYZPoint Point
point in the space
Definition: Vertex.h:40
std
Definition: JetResolutionObject.h:76
Ref.h
MultiTrackValidator::tpDefinerEsToken
const edm::ESGetToken< ParametersDefinerForTP, TrackAssociatorRecord > tpDefinerEsToken
Definition: MultiTrackValidator.h:60
GsfTrackFwd.h
MultiTrackValidator::label_tp_fake
edm::EDGetTokenT< TrackingParticleCollection > label_tp_fake
Definition: MultiTrackValidator.h:67
MultiTrackValidator::tpSelector
TrackingParticleSelector tpSelector
Definition: MultiTrackValidator.h:146
MultiTrackValidator::label_tv
edm::EDGetTokenT< TrackingVertexCollection > label_tv
Definition: MultiTrackValidator.h:70
metsig::jet
Definition: SignAlgoResolutions.h:47
transform.h
PileupSummaryInfo::getPU_NumInteractions
const int getPU_NumInteractions() const
Definition: PileupSummaryInfo.h:62
MultiTrackValidator::label_pileupinfo
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > label_pileupinfo
Definition: MultiTrackValidator.h:71
MultiTrackValidator::associatormapStRs
std::vector< edm::EDGetTokenT< reco::SimToRecoCollection > > associatormapStRs
Definition: MultiTrackValidator.h:125
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
Exception
Definition: hltDiff.cc:245
HLT_FULL_cff.cores
cores
Definition: HLT_FULL_cff.py:104293
associationMapFilterValues
T_AssociationMap associationMapFilterValues(const T_AssociationMap &map, const T_RefVector &valueRefs)
Definition: associationMapFilterValues.h:125
TrackerOfflineValidation_Dqm_cff.dirName
dirName
Definition: TrackerOfflineValidation_Dqm_cff.py:55
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
MultiTrackValidator::cosmictpSelector
CosmicTrackingParticleSelector cosmictpSelector
Definition: MultiTrackValidator.h:147
reco::TrackToTrackingParticleAssociator::associateSimToReco
reco::SimToRecoCollection associateSimToReco(const edm::Handle< edm::View< reco::Track >> &tCH, const edm::Handle< TrackingParticleCollection > &tPCH) const
Definition: TrackToTrackingParticleAssociator.h:71
dqm::implementation::IBooker
Definition: DQMStore.h:43
MultiTrackValidator_cfi.doResolutionPlotsForLabels
doResolutionPlotsForLabels
do resolution plots only for these labels (or all if empty)
Definition: MultiTrackValidator_cfi.py:101
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
MultiTrackValidator::dirName_
std::string dirName_
Definition: MultiTrackValidator.h:137
HGC3DClusterGenMatchSelector_cfi.dR
dR
Definition: HGC3DClusterGenMatchSelector_cfi.py:7
TrackingParticleRef
edm::Ref< TrackingParticleCollection > TrackingParticleRef
Definition: TrackingParticleFwd.h:12
edm::EDConsumerBase::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: EDConsumerBase.h:155
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
MultiTrackValidator::bsSrc
edm::EDGetTokenT< reco::BeamSpot > bsSrc
Definition: MultiTrackValidator.h:78
event
Definition: event.py:1
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
edm::Event
Definition: Event.h:73
MultiTrackValidator::getSimPVPosition
const TrackingVertex::LorentzVector * getSimPVPosition(const edm::Handle< TrackingVertexCollection > &htv) const
Definition: MultiTrackValidator.cc:379
MultiTrackValidator::m_dEdx2Tag
edm::EDGetTokenT< edm::ValueMap< reco::DeDxData > > m_dEdx2Tag
Definition: MultiTrackValidator.h:81
TrackingParticle::Point
math::XYZPointD Point
point in the space
Definition: TrackingParticle.h:36
TrackingParticleIP.h
edm::RefVector::size
size_type size() const
Size of the RefVector.
Definition: RefVector.h:102
MultiTrackValidator::trackDR
void trackDR(const edm::View< reco::Track > &trackCollection, const edm::View< reco::Track > &trackCollectionDr, DynArray< float > &dR_trk, DynArray< float > &dR_trk_jet, const edm::View< reco::Candidate > *cores) const
Definition: MultiTrackValidator.cc:527
MultiTrackValidator::label_tp_effic
edm::EDGetTokenT< TrackingParticleCollection > label_tp_effic
Definition: MultiTrackValidator.h:66
MultiTrackValidator::doPlotsOnlyForTruePV_
const bool doPlotsOnlyForTruePV_
Definition: MultiTrackValidator.h:86
MTVHistoProducerAlgoForTracker::makeRecoTrackSelectorFromTPSelectorParameters
static std::unique_ptr< RecoTrackSelectorBase > makeRecoTrackSelectorFromTPSelectorParameters(const edm::ParameterSet &pset)
Definition: MTVHistoProducerAlgoForTracker.cc:371
SimTrackContainer.h
edm::InputTag
Definition: InputTag.h:15
label
const char * label
Definition: PFTauDecayModeTools.cc:11
SimVertexContainer.h
EncodedEventId::bunchCrossing
int bunchCrossing() const
get the detector field from this detid
Definition: EncodedEventId.h:25
PileupSummaryInfo
Definition: PileupSummaryInfo.h:22
MultiTrackValidator::labelTokenForDrCalculation
edm::EDGetTokenT< edm::View< reco::Track > > labelTokenForDrCalculation
Definition: MultiTrackValidator.h:152
MultiTrackValidator::mvaQualityCollectionTokens_
std::vector< std::vector< std::tuple< edm::EDGetTokenT< MVACollection >, edm::EDGetTokenT< QualityMaskCollection > > > > mvaQualityCollectionTokens_
Definition: MultiTrackValidator.h:135
edm::View::size_type
unsigned int size_type
Definition: View.h:90
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
MultiTrackValidatorHistograms
Definition: MultiTrackValidator.h:34
edm::ProductLabels
Definition: ProductLabels.h:4
MultiTrackValidator::simHitTokens_
std::vector< edm::EDGetTokenT< std::vector< PSimHit > > > simHitTokens_
Definition: MultiTrackValidator.h:73
ParametersDefinerForTP::vertex
virtual TrackingParticle::Point vertex(const edm::Event &iEvent, const edm::EventSetup &iSetup, const Charge ch, const Point &vtx, const LorentzVector &lv) const
Definition: ParametersDefinerForTP.cc:50
TrackingVertex::LorentzVector
math::XYZTLorentzVectorD LorentzVector
Definition: TrackingVertex.h:28
ParametersDefinerForTP
Definition: ParametersDefinerForTP.h:19
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
TrackingParticleIP::dz
auto dz(const T_Vertex &vertex, const T_Momentum &momentum, const T_Point &point)
Definition: TrackingParticleIP.h:16
python.rootplot.root2matplotlib.replace
def replace(string, replacements)
Definition: root2matplotlib.py:444
EncodedEventId.h
reco::TrackBase::highPurity
Definition: TrackBase.h:154