CMS 3D CMS Logo

MtdTracksValidation.cc
Go to the documentation of this file.
1 #include <string>
2 
8 
11 
18 
24 
27 
35 
46 
57 
60 
67 
68 #include "CLHEP/Units/PhysicalConstants.h"
69 #include "MTDHit.h"
70 
72 public:
73  explicit MtdTracksValidation(const edm::ParameterSet&);
74  ~MtdTracksValidation() override;
75 
76  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
77 
78 private:
79  void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
80 
81  void analyze(const edm::Event&, const edm::EventSetup&) override;
82 
83  const std::pair<bool, bool> checkAcceptance(
84  const reco::Track&, const edm::Event&, const edm::EventSetup&, size_t&, float&, float&, float&, float&);
85 
86  const bool trkTPSelLV(const TrackingParticle&);
87  const bool trkTPSelAll(const TrackingParticle&);
88  const bool trkRecSel(const reco::TrackBase&);
89  const bool trkRecSelLowPt(const reco::TrackBase&);
91 
92  const unsigned long int uniqueId(const uint32_t x, const EncodedEventId& y) {
93  const uint64_t a = static_cast<uint64_t>(x);
94  const uint64_t b = static_cast<uint64_t>(y.rawId());
95 
96  if (x < y.rawId())
97  return (b << 32) | a;
98  else
99  return (a << 32) | b;
100  }
101 
102  bool isETL(const double eta) const { return (std::abs(eta) > trackMinEtlEta_) && (std::abs(eta) < trackMaxEtlEta_); }
103 
104  // ------------ member data ------------
105 
107  const float trackMaxPt_;
108  const float trackMaxBtlEta_;
109  const float trackMinEtlEta_;
110  const float trackMaxEtlEta_;
111 
112  static constexpr double simUnit_ = 1e9; // sim time in s while reco time in ns
113  static constexpr double etacutGEN_ = 4.; // |eta| < 4;
114  static constexpr double etacutREC_ = 3.; // |eta| < 3;
115  static constexpr double pTcutBTL_ = 0.7; // PT > 0.7 GeV
116  static constexpr double pTcutETL_ = 0.2; // PT > 0.2 GeV
117  static constexpr double depositBTLthreshold_ = 1; // threshold for energy deposit in BTL cell [MeV]
118  static constexpr double depositETLthreshold_ = 0.001; // threshold for energy deposit in ETL cell [MeV]
119  static constexpr double rBTL_ = 110.0;
120  static constexpr double zETL_ = 290.0;
121  static constexpr double etaMatchCut_ = 0.05;
122  static constexpr double cluDRradius_ = 0.05; // to cluster rechits around extrapolated track
123 
126 
129 
136 
139 
153 
159 
168 
183 
197 
200 
204 
223 
243 
249 };
250 
251 // ------------ constructor and destructor --------------
253  : folder_(iConfig.getParameter<std::string>("folder")),
254  trackMaxPt_(iConfig.getParameter<double>("trackMaximumPt")),
255  trackMaxBtlEta_(iConfig.getParameter<double>("trackMaximumBtlEta")),
256  trackMinEtlEta_(iConfig.getParameter<double>("trackMinimumEtlEta")),
257  trackMaxEtlEta_(iConfig.getParameter<double>("trackMaximumEtlEta")) {
258  GenRecTrackToken_ = consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("inputTagG"));
259  RecTrackToken_ = consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("inputTagT"));
261  consumes<TrackingParticleCollection>(iConfig.getParameter<edm::InputTag>("SimTag"));
263  consumes<reco::SimToRecoCollection>(iConfig.getParameter<edm::InputTag>("TPtoRecoTrackAssoc"));
265  consumes<reco::RecoToSimCollection>(iConfig.getParameter<edm::InputTag>("TPtoRecoTrackAssoc"));
267  consumes<reco::TPToSimCollectionMtd>(iConfig.getParameter<edm::InputTag>("tp2SimAssociationMapTag"));
268  btlRecHitsToken_ = consumes<FTLRecHitCollection>(iConfig.getParameter<edm::InputTag>("btlRecHits"));
269  etlRecHitsToken_ = consumes<FTLRecHitCollection>(iConfig.getParameter<edm::InputTag>("etlRecHits"));
270  trackAssocToken_ = consumes<edm::ValueMap<int>>(iConfig.getParameter<edm::InputTag>("trackAssocSrc"));
271  pathLengthToken_ = consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("pathLengthSrc"));
272  tmtdToken_ = consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("tmtd"));
273  SigmatmtdToken_ = consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("sigmatmtd"));
274  t0SrcToken_ = consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("t0Src"));
275  Sigmat0SrcToken_ = consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("sigmat0Src"));
276  t0PidToken_ = consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("t0PID"));
277  Sigmat0PidToken_ = consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("sigmat0PID"));
278  t0SafePidToken_ = consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("t0SafePID"));
279  Sigmat0SafePidToken_ = consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("sigmat0SafePID"));
280  SigmaTofPiToken_ = consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("sigmaTofPi"));
281  SigmaTofKToken_ = consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("sigmaTofK"));
282  SigmaTofPToken_ = consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("sigmaTofP"));
283  trackMVAQualToken_ = consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("trackMVAQual"));
285  consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("outermostHitPositionSrc"));
286  mtdgeoToken_ = esConsumes<MTDGeometry, MTDDigiGeometryRecord>();
287  mtdtopoToken_ = esConsumes<MTDTopology, MTDTopologyRcd>();
288  mtdlayerToken_ = esConsumes<MTDDetLayerGeometry, MTDRecoGeometryRecord>();
289  magfieldToken_ = esConsumes<MagneticField, IdealMagneticFieldRecord>();
290  builderToken_ = esConsumes<TransientTrackBuilder, TransientTrackRecord>(edm::ESInputTag("", "TransientTrackBuilder"));
291 }
292 
294 
295 // ------------ method called for each event ------------
297  using namespace edm;
298  using namespace geant_units::operators;
299  using namespace std;
300 
301  auto GenRecTrackHandle = makeValid(iEvent.getHandle(GenRecTrackToken_));
302 
303  std::unordered_map<uint32_t, MTDHit> m_btlHits;
304  std::unordered_map<uint32_t, MTDHit> m_etlHits;
305  std::unordered_map<uint32_t, std::set<unsigned long int>> m_btlTrkPerCell;
306  std::unordered_map<uint32_t, std::set<unsigned long int>> m_etlTrkPerCell;
307  const auto& tp2SimAssociationMap = iEvent.get(tp2SimAssociationMapToken_);
308 
309  const auto& tMtd = iEvent.get(tmtdToken_);
310  const auto& SigmatMtd = iEvent.get(SigmatmtdToken_);
311  const auto& t0Src = iEvent.get(t0SrcToken_);
312  const auto& Sigmat0Src = iEvent.get(Sigmat0SrcToken_);
313  const auto& t0Pid = iEvent.get(t0PidToken_);
314  const auto& Sigmat0Pid = iEvent.get(Sigmat0PidToken_);
315  const auto& t0Safe = iEvent.get(t0SafePidToken_);
316  const auto& Sigmat0Safe = iEvent.get(Sigmat0SafePidToken_);
317  const auto& SigmaTofPi = iEvent.get(SigmaTofPiToken_);
318  const auto& SigmaTofK = iEvent.get(SigmaTofKToken_);
319  const auto& SigmaTofP = iEvent.get(SigmaTofPToken_);
320  const auto& mtdQualMVA = iEvent.get(trackMVAQualToken_);
321  const auto& trackAssoc = iEvent.get(trackAssocToken_);
322  const auto& pathLength = iEvent.get(pathLengthToken_);
323  const auto& outermostHitPosition = iEvent.get(outermostHitPositionToken_);
324 
325  auto simToRecoH = makeValid(iEvent.getHandle(simToRecoAssociationToken_));
326  s2r_ = simToRecoH.product();
327 
328  auto recoToSimH = makeValid(iEvent.getHandle(recoToSimAssociationToken_));
329  r2s_ = recoToSimH.product();
330 
331  unsigned int index = 0;
332 
333  // --- Loop over all RECO tracks ---
334  for (const auto& trackGen : *GenRecTrackHandle) {
335  const reco::TrackRef trackref(iEvent.getHandle(GenRecTrackToken_), index);
336  index++;
337 
338  if (trackAssoc[trackref] == -1) {
339  LogWarning("mtdTracks") << "Extended track not associated";
340  continue;
341  }
342 
343  const reco::TrackRef mtdTrackref = reco::TrackRef(iEvent.getHandle(RecTrackToken_), trackAssoc[trackref]);
344  const reco::Track& track = *mtdTrackref;
345 
346  bool isBTL = false;
347  bool isETL = false;
348  bool twoETLdiscs = false;
349  bool noCrack = std::abs(trackGen.eta()) < trackMaxBtlEta_ || std::abs(trackGen.eta()) > trackMinEtlEta_;
350 
351  if (trkRecSel(trackGen)) {
352  meTracktmtd_->Fill(tMtd[trackref]);
353  if (std::round(SigmatMtd[trackref] - Sigmat0Pid[trackref]) != 0) {
354  LogWarning("mtdTracks")
355  << "TimeError associated to refitted track is different from TimeError stored in tofPID "
356  "sigmat0 ValueMap: this should not happen";
357  }
358 
359  meTrackt0Src_->Fill(t0Src[trackref]);
360  meTrackSigmat0Src_->Fill(Sigmat0Src[trackref]);
361 
362  meTrackt0Pid_->Fill(t0Pid[trackref]);
363  meTrackSigmat0Pid_->Fill(Sigmat0Pid[trackref]);
364  meTrackt0SafePid_->Fill(t0Safe[trackref]);
365  meTrackSigmat0SafePid_->Fill(std::log10(std::max(Sigmat0Safe[trackref], 0.001f)));
366  meTrackMVAQual_->Fill(mtdQualMVA[trackref]);
367 
368  meTrackSigmaTof_[0]->Fill(SigmaTofPi[trackref] * 1e3); //save as ps
369  meTrackSigmaTof_[1]->Fill(SigmaTofK[trackref] * 1e3);
370  meTrackSigmaTof_[2]->Fill(SigmaTofP[trackref] * 1e3);
371  meTrackSigmaTofvsP_[0]->Fill(trackGen.p(), SigmaTofPi[trackref] * 1e3);
372  meTrackSigmaTofvsP_[1]->Fill(trackGen.p(), SigmaTofK[trackref] * 1e3);
373  meTrackSigmaTofvsP_[2]->Fill(trackGen.p(), SigmaTofP[trackref] * 1e3);
374 
375  meTrackPathLenghtvsEta_->Fill(std::abs(trackGen.eta()), pathLength[trackref]);
376 
377  if (std::abs(trackGen.eta()) < trackMaxBtlEta_) {
378  // --- all BTL tracks (with and without hit in MTD) ---
379  meBTLTrackEffEtaTot_->Fill(trackGen.eta());
380  meBTLTrackEffPhiTot_->Fill(trackGen.phi());
381  meBTLTrackEffPtTot_->Fill(trackGen.pt());
382 
383  bool MTDBtl = false;
384  int numMTDBtlvalidhits = 0;
385  for (const auto hit : track.recHits()) {
386  if (hit->isValid() == false)
387  continue;
388  MTDDetId Hit = hit->geographicalId();
389  if ((Hit.det() == 6) && (Hit.subdetId() == 1) && (Hit.mtdSubDetector() == 1)) {
390  MTDBtl = true;
391  numMTDBtlvalidhits++;
392  }
393  }
394  meTrackNumHits_->Fill(numMTDBtlvalidhits);
395 
396  // --- keeping only tracks with last hit in MTD ---
397  if (MTDBtl == true) {
398  isBTL = true;
399  meBTLTrackEffEtaMtd_->Fill(trackGen.eta());
400  meBTLTrackEffPhiMtd_->Fill(trackGen.phi());
401  meBTLTrackEffPtMtd_->Fill(trackGen.pt());
403  meBTLTrackPtRes_->Fill((trackGen.pt() - track.pt()) / trackGen.pt());
404  }
405  if (isBTL && Sigmat0Safe[trackref] < 0.) {
406  meTrackNumHitsNT_->Fill(numMTDBtlvalidhits);
407  }
408  } //loop over (geometrical) BTL tracks
409 
410  else {
411  // --- all ETL tracks (with and without hit in MTD) ---
412  if ((trackGen.eta() < -trackMinEtlEta_) && (trackGen.eta() > -trackMaxEtlEta_)) {
413  meETLTrackEffEtaTot_[0]->Fill(trackGen.eta());
414  meETLTrackEffPhiTot_[0]->Fill(trackGen.phi());
415  meETLTrackEffPtTot_[0]->Fill(trackGen.pt());
416  }
417 
418  if ((trackGen.eta() > trackMinEtlEta_) && (trackGen.eta() < trackMaxEtlEta_)) {
419  meETLTrackEffEtaTot_[1]->Fill(trackGen.eta());
420  meETLTrackEffPhiTot_[1]->Fill(trackGen.phi());
421  meETLTrackEffPtTot_[1]->Fill(trackGen.pt());
422  }
423 
424  bool MTDEtlZnegD1 = false;
425  bool MTDEtlZnegD2 = false;
426  bool MTDEtlZposD1 = false;
427  bool MTDEtlZposD2 = false;
428  int numMTDEtlvalidhits = 0;
429  for (const auto hit : track.recHits()) {
430  if (hit->isValid() == false)
431  continue;
432  MTDDetId Hit = hit->geographicalId();
433  if ((Hit.det() == 6) && (Hit.subdetId() == 1) && (Hit.mtdSubDetector() == 2)) {
434  isETL = true;
435  ETLDetId ETLHit = hit->geographicalId();
436 
437  if ((ETLHit.zside() == -1) && (ETLHit.nDisc() == 1)) {
438  MTDEtlZnegD1 = true;
440  meETLTrackPtRes_->Fill((trackGen.pt() - track.pt()) / trackGen.pt());
441  numMTDEtlvalidhits++;
442  }
443  if ((ETLHit.zside() == -1) && (ETLHit.nDisc() == 2)) {
444  MTDEtlZnegD2 = true;
446  meETLTrackPtRes_->Fill((trackGen.pt() - track.pt()) / trackGen.pt());
447  numMTDEtlvalidhits++;
448  }
449  if ((ETLHit.zside() == 1) && (ETLHit.nDisc() == 1)) {
450  MTDEtlZposD1 = true;
452  meETLTrackPtRes_->Fill((trackGen.pt() - track.pt()) / trackGen.pt());
453  numMTDEtlvalidhits++;
454  }
455  if ((ETLHit.zside() == 1) && (ETLHit.nDisc() == 2)) {
456  MTDEtlZposD2 = true;
458  meETLTrackPtRes_->Fill((trackGen.pt() - track.pt()) / trackGen.pt());
459  numMTDEtlvalidhits++;
460  }
461  }
462  }
463  meTrackNumHits_->Fill(-numMTDEtlvalidhits);
464  if (isETL && Sigmat0Safe[trackref] < 0.) {
465  meTrackNumHitsNT_->Fill(-numMTDEtlvalidhits);
466  }
467 
468  // --- keeping only tracks with last hit in MTD ---
469  if ((trackGen.eta() < -trackMinEtlEta_) && (trackGen.eta() > -trackMaxEtlEta_)) {
470  twoETLdiscs = (MTDEtlZnegD1 == true) && (MTDEtlZnegD2 == true);
471  if ((MTDEtlZnegD1 == true) || (MTDEtlZnegD2 == true)) {
472  meETLTrackEffEtaMtd_[0]->Fill(trackGen.eta());
473  meETLTrackEffPhiMtd_[0]->Fill(trackGen.phi());
474  meETLTrackEffPtMtd_[0]->Fill(trackGen.pt());
475  if (twoETLdiscs) {
476  meETLTrackEffEta2Mtd_[0]->Fill(trackGen.eta());
477  meETLTrackEffPhi2Mtd_[0]->Fill(trackGen.phi());
478  meETLTrackEffPt2Mtd_[0]->Fill(trackGen.pt());
479  }
480  }
481  }
482  if ((trackGen.eta() > trackMinEtlEta_) && (trackGen.eta() < trackMaxEtlEta_)) {
483  twoETLdiscs = (MTDEtlZposD1 == true) && (MTDEtlZposD2 == true);
484  if ((MTDEtlZposD1 == true) || (MTDEtlZposD2 == true)) {
485  meETLTrackEffEtaMtd_[1]->Fill(trackGen.eta());
486  meETLTrackEffPhiMtd_[1]->Fill(trackGen.phi());
487  meETLTrackEffPtMtd_[1]->Fill(trackGen.pt());
488  if (twoETLdiscs) {
489  meETLTrackEffEta2Mtd_[1]->Fill(trackGen.eta());
490  meETLTrackEffPhi2Mtd_[1]->Fill(trackGen.phi());
491  meETLTrackEffPt2Mtd_[1]->Fill(trackGen.pt());
492  }
493  }
494  }
495  }
496 
497  if (isBTL)
498  meTrackOutermostHitR_->Fill(outermostHitPosition[trackref]);
499  if (isETL)
500  meTrackOutermostHitZ_->Fill(std::abs(outermostHitPosition[trackref]));
501 
502  LogDebug("MtdTracksValidation") << "Track p/pt = " << trackGen.p() << " " << trackGen.pt() << " eta "
503  << trackGen.eta() << " BTL " << isBTL << " ETL " << isETL << " 2disks "
504  << twoETLdiscs;
505 
506  // TrackingParticle based matching
507 
508  const reco::TrackBaseRef trkrefb(trackref);
509  auto tp_info = getMatchedTP(trkrefb);
510 
511  meTrackPtTot_->Fill(trackGen.pt());
512  meTrackEtaTot_->Fill(std::abs(trackGen.eta()));
513  if (tp_info != nullptr && trkTPSelAll(**tp_info)) {
514  if (trackGen.pt() < trackMaxPt_) {
515  if (isBTL) {
516  meBTLTrackMatchedTPPtResMtd_->Fill(std::abs(track.pt() - (*tp_info)->pt()) /
517  std::abs(trackGen.pt() - (*tp_info)->pt()));
518  meBTLTrackMatchedTPPtRatioGen_->Fill(trackGen.pt() / (*tp_info)->pt());
519  meBTLTrackMatchedTPPtRatioMtd_->Fill(track.pt() / (*tp_info)->pt());
521  (*tp_info)->pt(), std::abs(track.pt() - (*tp_info)->pt()) / std::abs(trackGen.pt() - (*tp_info)->pt()));
522  meBTLTrackMatchedTPDPtvsPtGen_->Fill((*tp_info)->pt(),
523  (trackGen.pt() - (*tp_info)->pt()) / (*tp_info)->pt());
524  meBTLTrackMatchedTPDPtvsPtMtd_->Fill((*tp_info)->pt(), (track.pt() - (*tp_info)->pt()) / (*tp_info)->pt());
525  }
526  if (isETL && !twoETLdiscs && (std::abs(trackGen.eta()) > trackMinEtlEta_) &&
527  (std::abs(trackGen.eta()) < trackMaxEtlEta_)) {
528  meETLTrackMatchedTPPtResMtd_->Fill(std::abs(track.pt() - (*tp_info)->pt()) /
529  std::abs(trackGen.pt() - (*tp_info)->pt()));
530  meETLTrackMatchedTPPtRatioGen_->Fill(trackGen.pt() / (*tp_info)->pt());
531  meETLTrackMatchedTPPtRatioMtd_->Fill(track.pt() / (*tp_info)->pt());
533  (*tp_info)->pt(), std::abs(track.pt() - (*tp_info)->pt()) / std::abs(trackGen.pt() - (*tp_info)->pt()));
534  meETLTrackMatchedTPDPtvsPtGen_->Fill((*tp_info)->pt(),
535  (trackGen.pt() - (*tp_info)->pt()) / ((*tp_info)->pt()));
536  meETLTrackMatchedTPDPtvsPtMtd_->Fill((*tp_info)->pt(),
537  (track.pt() - (*tp_info)->pt()) / ((*tp_info)->pt()));
538  }
539  if (isETL && twoETLdiscs) {
540  meETLTrackMatchedTP2PtResMtd_->Fill(std::abs(track.pt() - (*tp_info)->pt()) /
541  std::abs(trackGen.pt() - (*tp_info)->pt()));
542  meETLTrackMatchedTP2PtRatioGen_->Fill(trackGen.pt() / (*tp_info)->pt());
543  meETLTrackMatchedTP2PtRatioMtd_->Fill(track.pt() / (*tp_info)->pt());
545  (*tp_info)->pt(), std::abs(track.pt() - (*tp_info)->pt()) / std::abs(trackGen.pt() - (*tp_info)->pt()));
546  meETLTrackMatchedTP2DPtvsPtGen_->Fill((*tp_info)->pt(),
547  (trackGen.pt() - (*tp_info)->pt()) / ((*tp_info)->pt()));
548  meETLTrackMatchedTP2DPtvsPtMtd_->Fill((*tp_info)->pt(),
549  (track.pt() - (*tp_info)->pt()) / ((*tp_info)->pt()));
550  }
551  }
552  auto simClustersRefs = tp2SimAssociationMap.find(*tp_info);
553  const bool withMTD = (simClustersRefs != tp2SimAssociationMap.end());
554  if (noCrack) {
555  meTrackMatchedTPEffPtTot_->Fill(trackGen.pt());
556  if (trkTPSelLV(**tp_info)) {
557  meTrackMatchedTPEffPtTotLV_->Fill(trackGen.pt());
558  }
559  if (withMTD) {
560  meTrackMatchedTPmtdEffPtTot_->Fill(trackGen.pt());
561  }
562  }
563  meTrackMatchedTPEffEtaTot_->Fill(std::abs(trackGen.eta()));
564  if (trkTPSelLV(**tp_info)) {
565  meTrackMatchedTPEffEtaTotLV_->Fill(std::abs(trackGen.eta()));
566  }
567  if (withMTD) {
568  meTrackMatchedTPmtdEffEtaTot_->Fill(std::abs(trackGen.eta()));
569  }
570  if (isBTL || isETL) {
571  if (noCrack) {
572  meTrackMatchedTPEffPtMtd_->Fill(trackGen.pt());
573  if (isBTL || twoETLdiscs) {
574  meTrackMatchedTPEffPtEtl2Mtd_->Fill(trackGen.pt());
575  }
576  if (withMTD) {
577  meTrackMatchedTPmtdEffPtMtd_->Fill(trackGen.pt());
578  }
579  }
580  meTrackMatchedTPEffEtaMtd_->Fill(std::abs(trackGen.eta()));
581  if (isBTL || twoETLdiscs) {
582  meTrackMatchedTPEffEtaEtl2Mtd_->Fill(std::abs(trackGen.eta()));
583  }
584  if (withMTD) {
585  meTrackMatchedTPmtdEffEtaMtd_->Fill(std::abs(trackGen.eta()));
586  }
587  }
588 
589  // time pull and detailed extrapolation check only on tracks associated to TP from signal event
590  if (!trkTPSelLV(**tp_info)) {
591  continue;
592  }
593  size_t nlayers(0);
594  float extrho(0.);
595  float exteta(0.);
596  float extphi(0.);
597  float selvar(0.);
598  auto accept = checkAcceptance(trackGen, iEvent, iSetup, nlayers, extrho, exteta, extphi, selvar);
599  if (accept.first && std::abs(exteta) < trackMaxBtlEta_) {
601  meExtraBTLeneInCone_->Fill(selvar);
602  }
603  if (accept.second) {
604  if (std::abs(exteta) < trackMaxBtlEta_) {
606  }
607  if (noCrack) {
608  meExtraPtMtd_->Fill(trackGen.pt());
609  if (nlayers == 2) {
610  meExtraPtEtl2Mtd_->Fill(trackGen.pt());
611  }
612  }
613  meExtraEtaMtd_->Fill(std::abs(trackGen.eta()));
614  if (nlayers == 2) {
615  meExtraEtaEtl2Mtd_->Fill(std::abs(trackGen.eta()));
616  }
617  if (accept.first && accept.second && !(isBTL || isETL)) {
618  edm::LogInfo("MtdTracksValidation")
619  << "MtdTracksValidation: extender fail in " << iEvent.id().run() << " " << iEvent.id().event()
620  << " pt= " << trackGen.pt() << " eta= " << trackGen.eta();
621  meExtraMTDfailExtenderEta_->Fill(std::abs(trackGen.eta()));
622  if (noCrack) {
623  meExtraMTDfailExtenderPt_->Fill(trackGen.pt());
624  }
625  }
626  } // detailed extrapolation check
627 
628  // time res and time pull
629  double tsim = (*tp_info)->parentVertex()->position().t() * simUnit_;
630  double dT(-9999.);
631  double pullT(-9999.);
632  if (Sigmat0Safe[trackref] != -1.) {
633  dT = t0Safe[trackref] - tsim;
634  pullT = dT / Sigmat0Safe[trackref];
635  if (isBTL || isETL) {
636  meTrackResTot_->Fill(dT);
637  meTrackPullTot_->Fill(pullT);
638  meTrackResTotvsMVAQual_->Fill(mtdQualMVA[trackref], dT);
639  meTrackPullTotvsMVAQual_->Fill(mtdQualMVA[trackref], pullT);
640  }
641  } // time res and time pull
642 
643  } // TP matching
644  } // trkRecSel
645 
646  // ETL tracks with low pt (0.2 < Pt [GeV] < 0.7)
647  if (trkRecSelLowPt(trackGen)) {
648  if ((std::abs(trackGen.eta()) > trackMinEtlEta_) && (std::abs(trackGen.eta()) < trackMaxEtlEta_)) {
649  if (trackGen.pt() < 0.45) {
650  meETLTrackEffEtaTotLowPt_[0]->Fill(std::abs(trackGen.eta()));
651  } else {
652  meETLTrackEffEtaTotLowPt_[1]->Fill(std::abs(trackGen.eta()));
653  }
654  }
655  bool MTDEtlZnegD1 = false;
656  bool MTDEtlZnegD2 = false;
657  bool MTDEtlZposD1 = false;
658  bool MTDEtlZposD2 = false;
659  for (const auto hit : track.recHits()) {
660  if (hit->isValid() == false)
661  continue;
662  MTDDetId Hit = hit->geographicalId();
663  if ((Hit.det() == 6) && (Hit.subdetId() == 1) && (Hit.mtdSubDetector() == 2)) {
664  isETL = true;
665  ETLDetId ETLHit = hit->geographicalId();
666  if ((ETLHit.zside() == -1) && (ETLHit.nDisc() == 1)) {
667  MTDEtlZnegD1 = true;
668  }
669  if ((ETLHit.zside() == -1) && (ETLHit.nDisc() == 2)) {
670  MTDEtlZnegD2 = true;
671  }
672  if ((ETLHit.zside() == 1) && (ETLHit.nDisc() == 1)) {
673  MTDEtlZposD1 = true;
674  }
675  if ((ETLHit.zside() == 1) && (ETLHit.nDisc() == 2)) {
676  MTDEtlZposD2 = true;
677  }
678  }
679  }
680  if ((trackGen.eta() < -trackMinEtlEta_) && (trackGen.eta() > -trackMaxEtlEta_)) {
681  twoETLdiscs = (MTDEtlZnegD1 == true) && (MTDEtlZnegD2 == true);
682  }
683  if ((trackGen.eta() > trackMinEtlEta_) && (trackGen.eta() < trackMaxEtlEta_)) {
684  twoETLdiscs = (MTDEtlZposD1 == true) && (MTDEtlZposD2 == true);
685  }
686  if (isETL && (std::abs(trackGen.eta()) > trackMinEtlEta_) && (std::abs(trackGen.eta()) < trackMaxEtlEta_)) {
687  if (trackGen.pt() < 0.45) {
688  meETLTrackEffEtaMtdLowPt_[0]->Fill(std::abs(trackGen.eta()));
689  } else {
690  meETLTrackEffEtaMtdLowPt_[1]->Fill(std::abs(trackGen.eta()));
691  }
692  }
693  if (isETL && twoETLdiscs) {
694  if (trackGen.pt() < 0.45) {
695  meETLTrackEffEta2MtdLowPt_[0]->Fill(std::abs(trackGen.eta()));
696  } else {
697  meETLTrackEffEta2MtdLowPt_[1]->Fill(std::abs(trackGen.eta()));
698  }
699  }
700  } // trkRecSelLowPt
701 
702  } // RECO tracks loop
703 }
704 
705 const std::pair<bool, bool> MtdTracksValidation::checkAcceptance(const reco::Track& track,
706  const edm::Event& iEvent,
707  edm::EventSetup const& iSetup,
708  size_t& nlayers,
709  float& extrho,
710  float& exteta,
711  float& extphi,
712  float& selvar) {
713  bool isMatched(false);
714  nlayers = 0;
715  extrho = 0.;
716  exteta = -999.;
717  extphi = -999.;
718  selvar = 0.;
719 
720  auto geometryHandle = iSetup.getTransientHandle(mtdgeoToken_);
721  const MTDGeometry* geom = geometryHandle.product();
722  auto topologyHandle = iSetup.getTransientHandle(mtdtopoToken_);
723  const MTDTopology* topology = topologyHandle.product();
724 
725  auto layerHandle = iSetup.getTransientHandle(mtdlayerToken_);
726  const MTDDetLayerGeometry* layerGeo = layerHandle.product();
727 
728  auto magfieldHandle = iSetup.getTransientHandle(magfieldToken_);
729  const MagneticField* mfield = magfieldHandle.product();
730 
731  auto ttrackBuilder = iSetup.getTransientHandle(builderToken_);
732 
733  auto tTrack = ttrackBuilder->build(track);
734  TrajectoryStateOnSurface tsos = tTrack.outermostMeasurementState();
735  float theMaxChi2 = 500.;
736  float theNSigma = 10.;
737  std::unique_ptr<MeasurementEstimator> theEstimator =
738  std::make_unique<Chi2MeasurementEstimator>(theMaxChi2, theNSigma);
740 
741  auto btlRecHitsHandle = makeValid(iEvent.getHandle(btlRecHitsToken_));
742  auto etlRecHitsHandle = makeValid(iEvent.getHandle(etlRecHitsToken_));
743 
744  edm::LogVerbatim("MtdTracksValidation")
745  << "MtdTracksValidation: extrapolating track, pt= " << track.pt() << " eta= " << track.eta();
746 
747  //try BTL
748  bool inBTL = false;
749  float eneSum(0.);
750  const std::vector<const DetLayer*>& layersBTL = layerGeo->allBTLLayers();
751  for (const DetLayer* ilay : layersBTL) {
752  std::pair<bool, TrajectoryStateOnSurface> comp = ilay->compatible(tsos, prop, *theEstimator);
753  if (!comp.first)
754  continue;
755  if (!inBTL) {
756  inBTL = true;
757  extrho = comp.second.globalPosition().perp();
758  exteta = comp.second.globalPosition().eta();
759  extphi = comp.second.globalPosition().phi();
760  edm::LogVerbatim("MtdTracksValidation") << "MtdTracksValidation: extrapolation at BTL surface, rho= " << extrho
761  << " eta= " << exteta << " phi= " << extphi;
762  }
763  std::vector<DetLayer::DetWithState> compDets = ilay->compatibleDets(tsos, prop, *theEstimator);
764  for (const auto& detWithState : compDets) {
765  const auto& det = detWithState.first;
766 
767  // loop on compatible rechits and check energy in a fixed size cone around the extrapolation point
768 
769  edm::LogVerbatim("MtdTracksValidation")
770  << "MtdTracksValidation: DetId= " << det->geographicalId().rawId()
771  << " gp= " << detWithState.second.globalPosition().x() << " " << detWithState.second.globalPosition().y()
772  << " " << detWithState.second.globalPosition().z() << " rho= " << detWithState.second.globalPosition().perp()
773  << " eta= " << detWithState.second.globalPosition().eta()
774  << " phi= " << detWithState.second.globalPosition().phi();
775 
776  for (const auto& recHit : *btlRecHitsHandle) {
777  BTLDetId detId = recHit.id();
778  DetId geoId = detId.geographicalId(MTDTopologyMode::crysLayoutFromTopoMode(topology->getMTDTopologyMode()));
779  const MTDGeomDet* thedet = geom->idToDet(geoId);
780  if (thedet == nullptr)
781  throw cms::Exception("MtdTracksValidation") << "GeographicalID: " << std::hex << geoId.rawId() << " ("
782  << detId.rawId() << ") is invalid!" << std::dec << std::endl;
783  if (geoId == det->geographicalId()) {
784  const ProxyMTDTopology& topoproxy = static_cast<const ProxyMTDTopology&>(thedet->topology());
785  const RectangularMTDTopology& topo = static_cast<const RectangularMTDTopology&>(topoproxy.specificTopology());
786 
787  Local3DPoint local_point(0., 0., 0.);
788  local_point = topo.pixelToModuleLocalPoint(local_point, detId.row(topo.nrows()), detId.column(topo.nrows()));
789  const auto& global_point = thedet->toGlobal(local_point);
790  edm::LogVerbatim("MtdTracksValidation")
791  << "MtdTracksValidation: Hit id= " << detId.rawId() << " ene= " << recHit.energy()
792  << " dr= " << reco::deltaR(global_point, detWithState.second.globalPosition());
793  if (reco::deltaR(global_point, detWithState.second.globalPosition()) < cluDRradius_) {
794  eneSum += recHit.energy();
795  //extrho = detWithState.second.globalPosition().perp();
796  //exteta = detWithState.second.globalPosition().eta();
797  //extphi = detWithState.second.globalPosition().phi();
798  }
799  }
800  }
801  }
802  if (eneSum > depositBTLthreshold_) {
803  nlayers++;
804  selvar = eneSum;
805  isMatched = true;
806  edm::LogVerbatim("MtdTracksValidation")
807  << "MtdTracksValidation: BTL matched, energy= " << eneSum << " #layers= " << nlayers;
808  }
809  }
810  if (inBTL) {
811  return std::make_pair(inBTL, isMatched);
812  }
813 
814  //try ETL
815  bool inETL = false;
816  const std::vector<const DetLayer*>& layersETL = layerGeo->allETLLayers();
817  for (const DetLayer* ilay : layersETL) {
818  size_t hcount(0);
819  const BoundDisk& disk = static_cast<const MTDSectorForwardDoubleLayer*>(ilay)->specificSurface();
820  const double diskZ = disk.position().z();
821  if (tsos.globalPosition().z() * diskZ < 0)
822  continue; // only propagate to the disk that's on the same side
823  std::pair<bool, TrajectoryStateOnSurface> comp = ilay->compatible(tsos, prop, *theEstimator);
824  if (!comp.first)
825  continue;
826  if (!inETL) {
827  inETL = true;
828  extrho = comp.second.globalPosition().perp();
829  exteta = comp.second.globalPosition().eta();
830  extphi = comp.second.globalPosition().phi();
831  }
832  edm::LogVerbatim("MtdTracksValidation") << "MtdTracksValidation: extrapolation at ETL surface, rho= " << extrho
833  << " eta= " << exteta << " phi= " << extphi;
834  std::vector<DetLayer::DetWithState> compDets = ilay->compatibleDets(tsos, prop, *theEstimator);
835  for (const auto& detWithState : compDets) {
836  const auto& det = detWithState.first;
837 
838  // loop on compatible rechits and check hits in a fixed size cone around the extrapolation point
839 
840  edm::LogVerbatim("MtdTracksValidation")
841  << "MtdTracksValidation: DetId= " << det->geographicalId().rawId()
842  << " gp= " << detWithState.second.globalPosition().x() << " " << detWithState.second.globalPosition().y()
843  << " " << detWithState.second.globalPosition().z() << " rho= " << detWithState.second.globalPosition().perp()
844  << " eta= " << detWithState.second.globalPosition().eta()
845  << " phi= " << detWithState.second.globalPosition().phi();
846 
847  for (const auto& recHit : *etlRecHitsHandle) {
848  ETLDetId detId = recHit.id();
849  DetId geoId = detId.geographicalId();
850  const MTDGeomDet* thedet = geom->idToDet(geoId);
851  if (thedet == nullptr)
852  throw cms::Exception("MtdTracksValidation") << "GeographicalID: " << std::hex << geoId.rawId() << " ("
853  << detId.rawId() << ") is invalid!" << std::dec << std::endl;
854  if (geoId == det->geographicalId()) {
855  const ProxyMTDTopology& topoproxy = static_cast<const ProxyMTDTopology&>(thedet->topology());
856  const RectangularMTDTopology& topo = static_cast<const RectangularMTDTopology&>(topoproxy.specificTopology());
857 
858  Local3DPoint local_point(topo.localX(recHit.row()), topo.localY(recHit.column()), 0.);
859  const auto& global_point = thedet->toGlobal(local_point);
860  edm::LogVerbatim("MtdTracksValidation")
861  << "MtdTracksValidation: Hit id= " << detId.rawId() << " time= " << recHit.time()
862  << " dr= " << reco::deltaR(global_point, detWithState.second.globalPosition());
863  if (reco::deltaR(global_point, detWithState.second.globalPosition()) < cluDRradius_) {
864  hcount++;
865  if (hcount == 1) {
866  //extrho = detWithState.second.globalPosition().perp();
867  //exteta = detWithState.second.globalPosition().eta();
868  //extphi = detWithState.second.globalPosition().phi();
869  }
870  }
871  }
872  }
873  }
874  if (hcount > 0) {
875  nlayers++;
876  selvar = (float)hcount;
877  isMatched = true;
878  edm::LogVerbatim("MtdTracksValidation")
879  << "MtdTracksValidation: ETL matched, counts= " << hcount << " #layers= " << nlayers;
880  }
881  }
882 
883  if (!inBTL && !inETL) {
884  edm::LogVerbatim("MtdTracksValidation")
885  << "MtdTracksValidation: track not extrapolating to MTD: pt= " << track.pt() << " eta= " << track.eta()
886  << " phi= " << track.phi() << " vz= " << track.vz()
887  << " vxy= " << std::sqrt(track.vx() * track.vx() + track.vy() * track.vy());
888  }
889  return std::make_pair(inETL, isMatched);
890 }
891 
892 // ------------ method for histogram booking ------------
894  ibook.setCurrentFolder(folder_);
895 
896  // histogram booking
897  meBTLTrackRPTime_ = ibook.book1D("TrackBTLRPTime", "Track t0 with respect to R.P.;t0 [ns]", 100, -1, 3);
898  meBTLTrackEffEtaTot_ = ibook.book1D("TrackBTLEffEtaTot", "Eta of tracks (Tot);#eta_{RECO}", 100, -1.6, 1.6);
899  meBTLTrackEffPhiTot_ = ibook.book1D("TrackBTLEffPhiTot", "Phi of tracks (Tot);#phi_{RECO} [rad]", 100, -3.2, 3.2);
900  meBTLTrackEffPtTot_ = ibook.book1D("TrackBTLEffPtTot", "Pt of tracks (Tot);pt_{RECO} [GeV]", 50, 0, 10);
901  meBTLTrackEffEtaMtd_ = ibook.book1D("TrackBTLEffEtaMtd", "Eta of tracks (Mtd);#eta_{RECO}", 100, -1.6, 1.6);
902  meBTLTrackEffPhiMtd_ = ibook.book1D("TrackBTLEffPhiMtd", "Phi of tracks (Mtd);#phi_{RECO} [rad]", 100, -3.2, 3.2);
903  meBTLTrackEffPtMtd_ = ibook.book1D("TrackBTLEffPtMtd", "Pt of tracks (Mtd);pt_{RECO} [GeV]", 50, 0, 10);
905  ibook.book1D("TrackBTLPtRes", "Track pT resolution ;pT_{Gentrack}-pT_{MTDtrack}/pT_{Gentrack} ", 100, -0.1, 0.1);
906  meETLTrackRPTime_ = ibook.book1D("TrackETLRPTime", "Track t0 with respect to R.P.;t0 [ns]", 100, -1, 3);
908  ibook.book1D("TrackETLEffEtaTotZneg", "Eta of tracks (Tot) (-Z);#eta_{RECO}", 100, -3.2, -1.4);
910  ibook.book1D("TrackETLEffEtaTotZpos", "Eta of tracks (Tot) (+Z);#eta_{RECO}", 100, 1.4, 3.2);
912  ibook.book1D("TrackETLEffEtaTotLowPt0", "Eta of tracks, 0.2 < pt < 0.45 (Tot);#eta_{RECO}", 100, 1.4, 3.2);
914  ibook.book1D("TrackETLEffEtaTotLowPt1", "Eta of tracks, 0.45 < pt < 0.7 (Tot);#eta_{RECO}", 100, 1.4, 3.2);
916  ibook.book1D("TrackETLEffPhiTotZneg", "Phi of tracks (Tot) (-Z);#phi_{RECO} [rad]", 100, -3.2, 3.2);
918  ibook.book1D("TrackETLEffPhiTotZpos", "Phi of tracks (Tot) (+Z);#phi_{RECO} [rad]", 100, -3.2, 3.2);
919  meETLTrackEffPtTot_[0] = ibook.book1D("TrackETLEffPtTotZneg", "Pt of tracks (Tot) (-Z);pt_{RECO} [GeV]", 50, 0, 10);
920  meETLTrackEffPtTot_[1] = ibook.book1D("TrackETLEffPtTotZpos", "Pt of tracks (Tot) (+Z);pt_{RECO} [GeV]", 50, 0, 10);
922  ibook.book1D("TrackETLEffEtaMtdZneg", "Eta of tracks (Mtd) (-Z);#eta_{RECO}", 100, -3.2, -1.4);
924  ibook.book1D("TrackETLEffEtaMtdZpos", "Eta of tracks (Mtd) (+Z);#eta_{RECO}", 100, 1.4, 3.2);
926  ibook.book1D("TrackETLEffEtaMtdLowPt0", "Eta of tracks, 0.2 < pt < 0.45 (Mtd);#eta_{RECO}", 100, 1.4, 3.2);
928  ibook.book1D("TrackETLEffEtaMtdLowPt1", "Eta of tracks, 0.45 < pt < 0.7 (Mtd);#eta_{RECO}", 100, 1.4, 3.2);
930  ibook.book1D("TrackETLEffEta2MtdLowPt0", "Eta of tracks, 0.2 < pt < 0.45 (Mtd 2 hit);#eta_{RECO}", 100, 1.4, 3.2);
932  ibook.book1D("TrackETLEffEta2MtdLowPt1", "Eta of tracks, 0.45 < pt < 0.7 (Mtd 2 hit);#eta_{RECO}", 100, 1.4, 3.2);
934  ibook.book1D("TrackETLEffPhiMtdZneg", "Phi of tracks (Mtd) (-Z);#phi_{RECO} [rad]", 100, -3.2, 3.2);
936  ibook.book1D("TrackETLEffPhiMtdZpos", "Phi of tracks (Mtd) (+Z);#phi_{RECO} [rad]", 100, -3.2, 3.2);
937  meETLTrackEffPtMtd_[0] = ibook.book1D("TrackETLEffPtMtdZneg", "Pt of tracks (Mtd) (-Z);pt_{RECO} [GeV]", 50, 0, 10);
938  meETLTrackEffPtMtd_[1] = ibook.book1D("TrackETLEffPtMtdZpos", "Pt of tracks (Mtd) (+Z);pt_{RECO} [GeV]", 50, 0, 10);
940  ibook.book1D("TrackETLEffEta2MtdZneg", "Eta of tracks (Mtd 2 hit) (-Z);#eta_{RECO}", 100, -3.2, -1.4);
942  ibook.book1D("TrackETLEffEta2MtdZpos", "Eta of tracks (Mtd 2 hit) (+Z);#eta_{RECO}", 100, 1.4, 3.2);
944  ibook.book1D("TrackETLEffPhi2MtdZneg", "Phi of tracks (Mtd 2 hit) (-Z);#phi_{RECO} [rad]", 100, -3.2, 3.2);
946  ibook.book1D("TrackETLEffPhi2MtdZpos", "Phi of tracks (Mtd 2 hit) (+Z);#phi_{RECO} [rad]", 100, -3.2, 3.2);
948  ibook.book1D("TrackETLEffPt2MtdZneg", "Pt of tracks (Mtd 2 hit) (-Z);pt_{RECO} [GeV]", 50, 0, 10);
950  ibook.book1D("TrackETLEffPt2MtdZpos", "Pt of tracks (Mtd 2 hit) (+Z);pt_{RECO} [GeV]", 50, 0, 10);
952  ibook.book1D("TrackETLPtRes", "Track pT resolution;pT_{Gentrack}-pT_{MTDtrack}/pT_{Gentrack} ", 100, -0.1, 0.1);
953 
954  meTracktmtd_ = ibook.book1D("Tracktmtd", "Track time from TrackExtenderWithMTD;tmtd [ns]", 150, 1, 16);
955  meTrackt0Src_ = ibook.book1D("Trackt0Src", "Track time from TrackExtenderWithMTD;t0Src [ns]", 100, -1.5, 1.5);
957  ibook.book1D("TrackSigmat0Src", "Time Error from TrackExtenderWithMTD; #sigma_{t0Src} [ns]", 100, 0, 0.1);
958 
959  meTrackt0Pid_ = ibook.book1D("Trackt0Pid", "Track t0 as stored in TofPid;t0 [ns]", 100, -1, 1);
960  meTrackSigmat0Pid_ = ibook.book1D("TrackSigmat0Pid", "Sigmat0 as stored in TofPid; #sigma_{t0} [ns]", 100, 0, 0.1);
961  meTrackt0SafePid_ = ibook.book1D("Trackt0SafePID", "Track t0 Safe as stored in TofPid;t0 [ns]", 100, -1, 1);
963  "TrackSigmat0SafePID", "Log10(Sigmat0 Safe) as stored in TofPid; Log10(#sigma_{t0} [ns])", 80, -3, 1);
964  meTrackNumHits_ = ibook.book1D("TrackNumHits", "Number of valid MTD hits per track ; Number of hits", 10, -5, 5);
965  meTrackNumHitsNT_ = ibook.book1D(
966  "TrackNumHitsNT", "Number of valid MTD hits per track no time associated; Number of hits", 10, -5, 5);
967  meTrackMVAQual_ = ibook.book1D("TrackMVAQual", "Track MVA Quality as stored in Value Map ; MVAQual", 100, -1, 1);
969  "TrackPathLenghtvsEta", "MTD Track pathlength vs MTD track Eta;|#eta|;Pathlength", 100, 0, 3.2, 100.0, 400.0, "S");
970 
971  meTrackOutermostHitR_ = ibook.book1D("TrackOutermostHitR", "Track outermost hit position R; R[cm]", 40, 0, 120.);
972  meTrackOutermostHitZ_ = ibook.book1D("TrackOutermostHitZ", "Track outermost hit position Z; z[cm]", 100, 0, 300.);
973 
974  meTrackSigmaTof_[0] =
975  ibook.book1D("TrackSigmaTof_Pion", "Sigma(TOF) for pion hypothesis; #sigma_{t0} [ps]", 10, 0, 5);
976  meTrackSigmaTof_[1] =
977  ibook.book1D("TrackSigmaTof_Kaon", "Sigma(TOF) for kaon hypothesis; #sigma_{t0} [ps]", 25, 0, 25);
978  meTrackSigmaTof_[2] =
979  ibook.book1D("TrackSigmaTof_Proton", "Sigma(TOF) for proton hypothesis; #sigma_{t0} [ps]", 50, 0, 50);
980 
981  meTrackSigmaTofvsP_[0] = ibook.bookProfile("TrackSigmaTofvsP_Pion",
982  "Sigma(TOF) for pion hypothesis vs p; p [GeV]; #sigma_{t0} [ps]",
983  20,
984  0,
985  10.,
986  0,
987  50.,
988  "S");
989  meTrackSigmaTofvsP_[1] = ibook.bookProfile("TrackSigmaTofvsP_Kaon",
990  "Sigma(TOF) for kaon hypothesis vs p; p [GeV]; #sigma_{t0} [ps]",
991  20,
992  0,
993  10.,
994  0,
995  50.,
996  "S");
997  meTrackSigmaTofvsP_[2] = ibook.bookProfile("TrackSigmaTofvsP_Proton",
998  "Sigma(TOF) for proton hypothesis vs p; p [GeV]; #sigma_{t0} [ps]",
999  20,
1000  0,
1001  10.,
1002  0,
1003  50.,
1004  "S");
1005 
1006  meExtraPtMtd_ =
1007  ibook.book1D("ExtraPtMtd", "Pt of tracks associated to LV extrapolated to hits; track pt [GeV] ", 110, 0., 11.);
1008  meExtraPtEtl2Mtd_ = ibook.book1D("ExtraPtEtl2Mtd",
1009  "Pt of tracks associated to LV extrapolated to hits, 2 ETL layers; track pt [GeV] ",
1010  110,
1011  0.,
1012  11.);
1013 
1014  meTrackPtTot_ = ibook.book1D("TrackPtTot", "Pt of tracks ; track pt [GeV] ", 110, 0., 11.);
1016  ibook.book1D("MatchedTPEffPtTot", "Pt of tracks matched to TP; track pt [GeV] ", 110, 0., 11.);
1018  ibook.book1D("MatchedTPEffPtTotLV", "Pt of tracks associated to LV matched to TP; track pt [GeV] ", 110, 0., 11.);
1020  ibook.book1D("MatchedTPEffPtMtd", "Pt of tracks matched to TP with time; track pt [GeV] ", 110, 0., 11.);
1022  "MatchedTPEffPtEtl2Mtd", "Pt of tracks matched to TP with time, 2 ETL hits; track pt [GeV] ", 110, 0., 11.);
1023 
1025  "TrackMatchedTPBTLPtResMtd",
1026  "Pt resolution of tracks matched to TP-BTL hit ;|pT_{MTDtrack}-pT_{truth}|/|pT_{Gentrack}-pT_{truth}| ",
1027  100,
1028  0.,
1029  4.);
1031  "TrackMatchedTPETLPtResMtd",
1032  "Pt resolution of tracks matched to TP-ETL hit ;|pT_{MTDtrack}-pT_{truth}|/|pT_{Gentrack}-pT_{truth}| ",
1033  100,
1034  0.,
1035  4.);
1037  "TrackMatchedTPETL2PtResMtd",
1038  "Pt resolution of tracks matched to TP-ETL 2hits ;|pT_{MTDtrack}-pT_{truth}|/|pT_{Gentrack}-pT_{truth}| ",
1039  100,
1040  0.,
1041  4.);
1043  "TrackMatchedTPBTLPtRatioGen", "Pt ratio of Gentracks (BTL) ;pT_{Gentrack}/pT_{truth} ", 100, 0.9, 1.1);
1045  "TrackMatchedTPETLPtRatioGen", "Pt ratio of Gentracks (ETL 1hit) ;pT_{Gentrack}/pT_{truth} ", 100, 0.9, 1.1);
1047  "TrackMatchedTPETL2PtRatioGen", "Pt ratio of Gentracks (ETL 2hits) ;pT_{Gentrack}/pT_{truth} ", 100, 0.9, 1.1);
1048  meBTLTrackMatchedTPPtRatioMtd_ = ibook.book1D("TrackMatchedTPBTLPtRatioMtd",
1049  "Pt ratio of tracks matched to TP-BTL hit ;pT_{MTDtrack}/pT_{truth} ",
1050  100,
1051  0.9,
1052  1.1);
1053  meETLTrackMatchedTPPtRatioMtd_ = ibook.book1D("TrackMatchedTPETLPtRatioMtd",
1054  "Pt ratio of tracks matched to TP-ETL hit ;pT_{MTDtrack}/pT_{truth} ",
1055  100,
1056  0.9,
1057  1.1);
1059  ibook.book1D("TrackMatchedTPETL2PtRatioMtd",
1060  "Pt ratio of tracks matched to TP-ETL 2hits ;pT_{MTDtrack}/pT_{truth} ",
1061  100,
1062  0.9,
1063  1.1);
1064  meBTLTrackMatchedTPPtResvsPtMtd_ = ibook.bookProfile("TrackMatchedTPBTLPtResvsPtMtd",
1065  "Pt resolution of tracks matched to TP-BTL hit vs Pt;pT_{truth} "
1066  "[GeV];|pT_{MTDtrack}-pT_{truth}|/|pT_{Gentrack}-pT_{truth}| ",
1067  20,
1068  0.7,
1069  10.,
1070  0.,
1071  4.,
1072  "s");
1073  meETLTrackMatchedTPPtResvsPtMtd_ = ibook.bookProfile("TrackMatchedTPETLPtResvsPtMtd",
1074  "Pt resolution of tracks matched to TP-ETL hit vs Pt;pT_{truth} "
1075  "[GeV];|pT_{MTDtrack}-pT_{truth}|/|pT_{Gentrack}-pT_{truth}| ",
1076  20,
1077  0.7,
1078  10.,
1079  0.,
1080  4.,
1081  "s");
1083  ibook.bookProfile("TrackMatchedTPETL2PtResvsPtMtd",
1084  "Pt resolution of tracks matched to TP-ETL 2hits Pt pT;pT_{truth} "
1085  "[GeV];|pT_{MTDtrack}-pT_{truth}|/|pT_{Gentrack}-pT_{truth}| ",
1086  20,
1087  0.7,
1088  10.,
1089  0.,
1090  4.,
1091  "s");
1093  "TrackMatchedTPBTLDPtvsPtGen",
1094  "Pt relative difference of Gentracks (BTL) vs Pt;pT_{truth} [GeV];pT_{Gentrack}-pT_{truth}/pT_{truth} ",
1095  20,
1096  0.7,
1097  10.,
1098  -0.1,
1099  0.1,
1100  "s");
1102  "TrackMatchedTPETLDPtvsPtGen",
1103  "Pt relative difference of Gentracks (ETL 1hit) vs Pt;pT_{truth} [GeV];pT_{Gentrack}-pT_{truth}/pT_{truth} ",
1104  20,
1105  0.7,
1106  10.,
1107  -0.1,
1108  0.1,
1109  "s");
1111  "TrackMatchedTPETL2DPtvsPtGen",
1112  "Pt relative difference of Gentracks (ETL 2hits) vs Pt;pT_{truth} [GeV];pT_{Gentrack}-pT_{truth}/pT_{truth} ",
1113  20,
1114  0.7,
1115  10.,
1116  -0.1,
1117  0.1,
1118  "s");
1119  meBTLTrackMatchedTPDPtvsPtMtd_ = ibook.bookProfile("TrackMatchedTPBTLDPtvsPtMtd",
1120  "Pt relative difference of tracks matched to TP-BTL hits vs "
1121  "Pt;pT_{truth} [GeV];pT_{MTDtrack}-pT_{truth}/pT_{truth} ",
1122  20,
1123  0.7,
1124  10.,
1125  -0.1,
1126  0.1,
1127  "s");
1128  meETLTrackMatchedTPDPtvsPtMtd_ = ibook.bookProfile("TrackMatchedTPETLDPtvsPtMtd",
1129  "Pt relative difference of tracks matched to TP-ETL hits vs "
1130  "Pt;pT_{truth} [GeV];pT_{MTDtrack}-pT_{truth}/pT_{truth} ",
1131  20,
1132  0.7,
1133  10.,
1134  -0.1,
1135  0.1,
1136  "s");
1137  meETLTrackMatchedTP2DPtvsPtMtd_ = ibook.bookProfile("TrackMatchedTPETL2DPtvsPtMtd",
1138  "Pt relative difference of tracks matched to TP-ETL 2hits vs "
1139  "Pt;pT_{truth} [GeV];pT_{MTDtrack}-pT_{truth}/pT_{truth} ",
1140  20,
1141  0.7,
1142  10.,
1143  -0.1,
1144  0.1,
1145  "s");
1146 
1148  ibook.book1D("MatchedTPmtdEffPtTot", "Pt of tracks matched to TP-mtd hit; track pt [GeV] ", 110, 0., 11.);
1150  "MatchedTPmtdEffPtMtd", "Pt of tracks matched to TP-mtd hit with time; track pt [GeV] ", 110, 0., 11.);
1151 
1152  meExtraEtaMtd_ =
1153  ibook.book1D("ExtraEtaMtd", "Eta of tracks associated to LV extrapolated to hits; track eta ", 66, 0., 3.3);
1154  meExtraEtaEtl2Mtd_ = ibook.book1D(
1155  "ExtraEtaEtl2Mtd", "Eta of tracks associated to LV extrapolated to hits, 2 ETL layers; track eta ", 66, 0., 3.3);
1156 
1157  meTrackEtaTot_ = ibook.book1D("TrackEtaTot", "Eta of tracks ; track eta ", 66, 0., 3.3);
1159  ibook.book1D("MatchedTPEffEtaTot", "Eta of tracks matched to TP; track eta ", 66, 0., 3.3);
1161  ibook.book1D("MatchedTPEffEtaTotLV", "Eta of tracks associated to LV matched to TP; track eta ", 66, 0., 3.3);
1163  ibook.book1D("MatchedTPEffEtaMtd", "Eta of tracks matched to TP with time; track eta ", 66, 0., 3.3);
1165  "MatchedTPEffEtaEtl2Mtd", "Eta of tracks matched to TP with time, 2 ETL hits; track eta ", 66, 0., 3.3);
1166 
1168  ibook.book1D("MatchedTPmtdEffEtaTot", "Eta of tracks matched to TP-mtd hit; track eta ", 66, 0., 3.3);
1170  ibook.book1D("MatchedTPmtdEffEtaMtd", "Eta of tracks matched to TP-mtd hit with time; track eta ", 66, 0., 3.3);
1171 
1172  meTrackResTot_ = ibook.book1D(
1173  "TrackRes", "t_{rec} - t_{sim} for LV associated tracks matched to TP; t_{rec} - t_{sim} [ns] ", 120, -0.15, 0.15);
1174  meTrackPullTot_ = ibook.book1D(
1175  "TrackPull", "Pull for LV associated tracks matched to TP; (t_{rec}-t_{sim})/#sigma_{t}", 50, -5., 5.);
1177  "TrackResvsMVA",
1178  "t_{rec} - t_{sim} for LV associated tracks matched to TP vs MVA Quality; MVAQual; t_{rec} - t_{sim} [ns] ",
1179  100,
1180  -1.,
1181  1.,
1182  -0.15,
1183  0.15,
1184  "s");
1186  "TrackPullvsMVA",
1187  "Pull for LV associated tracks matched to TP vs MVA Quality; MVAQual; (t_{rec}-t_{sim})/#sigma_{t}",
1188  100,
1189  -1.,
1190  1.,
1191  -5.,
1192  5.,
1193  "s");
1194 
1195  meExtraPhiAtBTL_ = ibook.book1D(
1196  "ExtraPhiAtBTL", "Phi at BTL surface of extrapolated tracks associated to LV; phi [deg]", 720, -180., 180.);
1198  ibook.book1D("ExtraPhiAtBTLmatched",
1199  "Phi at BTL surface of extrapolated tracks associated to LV matched with BTL hits; phi [deg]",
1200  720,
1201  -180.,
1202  180.);
1204  ibook.book1D("ExtraBTLeneInCone",
1205  "BTL reconstructed energy in cone arounnd extrapolated track associated to LV; E [MeV]",
1206  100,
1207  0.,
1208  50.);
1210  ibook.book1D("ExtraMTDfailExtenderEta",
1211  "Eta of tracks associated to LV extrapolated to MTD with no track extender match to hits; track eta",
1212  66,
1213  0.,
1214  3.3);
1215  ;
1217  "ExtraMTDfailExtenderPt",
1218  "Pt of tracks associated to LV extrapolated to MTD with no track extender match to hits; track pt [GeV] ",
1219  110,
1220  0.,
1221  11.);
1222 }
1223 
1224 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
1225 
1228 
1229  desc.add<std::string>("folder", "MTD/Tracks");
1230  desc.add<edm::InputTag>("inputTagG", edm::InputTag("generalTracks"));
1231  desc.add<edm::InputTag>("inputTagT", edm::InputTag("trackExtenderWithMTD"));
1232  desc.add<edm::InputTag>("inputTagV", edm::InputTag("offlinePrimaryVertices4D"));
1233  desc.add<edm::InputTag>("inputTagH", edm::InputTag("generatorSmeared"));
1234  desc.add<edm::InputTag>("SimTag", edm::InputTag("mix", "MergedTrackTruth"));
1235  desc.add<edm::InputTag>("TPtoRecoTrackAssoc", edm::InputTag("trackingParticleRecoTrackAsssociation"));
1236  desc.add<edm::InputTag>("tp2SimAssociationMapTag", edm::InputTag("mtdSimLayerClusterToTPAssociation"));
1237  desc.add<edm::InputTag>("btlRecHits", edm::InputTag("mtdRecHits", "FTLBarrel"));
1238  desc.add<edm::InputTag>("etlRecHits", edm::InputTag("mtdRecHits", "FTLEndcap"));
1239  desc.add<edm::InputTag>("tmtd", edm::InputTag("trackExtenderWithMTD:generalTracktmtd"));
1240  desc.add<edm::InputTag>("sigmatmtd", edm::InputTag("trackExtenderWithMTD:generalTracksigmatmtd"));
1241  desc.add<edm::InputTag>("t0Src", edm::InputTag("trackExtenderWithMTD:generalTrackt0"));
1242  desc.add<edm::InputTag>("sigmat0Src", edm::InputTag("trackExtenderWithMTD:generalTracksigmat0"));
1243  desc.add<edm::InputTag>("trackAssocSrc", edm::InputTag("trackExtenderWithMTD:generalTrackassoc"))
1244  ->setComment("Association between General and MTD Extended tracks");
1245  desc.add<edm::InputTag>("pathLengthSrc", edm::InputTag("trackExtenderWithMTD:generalTrackPathLength"));
1246  desc.add<edm::InputTag>("t0SafePID", edm::InputTag("tofPID:t0safe"));
1247  desc.add<edm::InputTag>("sigmat0SafePID", edm::InputTag("tofPID:sigmat0safe"));
1248  desc.add<edm::InputTag>("sigmat0PID", edm::InputTag("tofPID:sigmat0"));
1249  desc.add<edm::InputTag>("t0PID", edm::InputTag("tofPID:t0"));
1250  desc.add<edm::InputTag>("sigmaTofPi", edm::InputTag("trackExtenderWithMTD:generalTrackSigmaTofPi"));
1251  desc.add<edm::InputTag>("sigmaTofK", edm::InputTag("trackExtenderWithMTD:generalTrackSigmaTofK"));
1252  desc.add<edm::InputTag>("sigmaTofP", edm::InputTag("trackExtenderWithMTD:generalTrackSigmaTofP"));
1253  desc.add<edm::InputTag>("trackMVAQual", edm::InputTag("mtdTrackQualityMVA:mtdQualMVA"));
1254  desc.add<edm::InputTag>("outermostHitPositionSrc",
1255  edm::InputTag("trackExtenderWithMTD:generalTrackOutermostHitPosition"));
1256  desc.add<double>("trackMinimumPt", 0.7); // [GeV]
1257  desc.add<double>("trackMaximumPt", 12.); // [GeV]
1258  desc.add<double>("trackMaximumBtlEta", 1.5);
1259  desc.add<double>("trackMinimumEtlEta", 1.6);
1260  desc.add<double>("trackMaximumEtlEta", 3.);
1261  desc.addUntracked<bool>("optionalPlots", true);
1262 
1263  descriptions.add("mtdTracksValid", desc);
1264 }
1265 
1267  bool match = (tp.status() != 1) ? false : true;
1268  return match;
1269 }
1270 
1272  bool match = false;
1273 
1274  auto x_pv = tp.parentVertex()->position().x();
1275  auto y_pv = tp.parentVertex()->position().y();
1276  auto z_pv = tp.parentVertex()->position().z();
1277 
1278  auto r_pv = std::sqrt(x_pv * x_pv + y_pv * y_pv);
1279 
1280  match = tp.charge() != 0 && std::abs(tp.eta()) < etacutGEN_ && tp.pt() > pTcutBTL_ && r_pv < rBTL_ &&
1281  std::abs(z_pv) < zETL_;
1282  return match;
1283 }
1284 
1286  bool match = false;
1287  match = std::abs(trk.eta()) <= etacutREC_ && trk.pt() > pTcutBTL_;
1288  return match;
1289 }
1290 
1292  bool match = false;
1293  match = std::abs(trk.eta()) <= etacutREC_ && trk.pt() > pTcutETL_ && trk.pt() < pTcutBTL_;
1294  return match;
1295 }
1296 
1298  auto found = r2s_->find(recoTrack);
1299 
1300  // reco track not matched to any TP
1301  if (found == r2s_->end())
1302  return nullptr;
1303 
1304  //matched TP equal to any TP associated to in time events
1305  for (const auto& tp : found->val) {
1306  if (tp.first->eventId().bunchCrossing() == 0)
1307  return &tp.first;
1308  }
1309 
1310  // reco track not matched to any TP from vertex
1311  return nullptr;
1312 }
1313 
MonitorElement * meETLTrackEffEtaTot_[2]
edm::EDGetTokenT< edm::ValueMap< int > > trackAssocToken_
static constexpr double etacutGEN_
Log< level::Info, true > LogVerbatim
MonitorElement * meBTLTrackMatchedTPPtResMtd_
MonitorElement * meTrackMatchedTPEffEtaMtd_
MonitorElement * meBTLTrackEffPhiMtd_
edm::EDGetTokenT< edm::ValueMap< float > > trackMVAQualToken_
edm::EDGetTokenT< edm::ValueMap< float > > pathLengthToken_
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
MonitorElement * meETLTrackMatchedTPPtResvsPtMtd_
MonitorElement * meTrackNumHits_
MonitorElement * meTrackt0Pid_
MonitorElement * meExtraMTDfailExtenderEta_
const std::pair< bool, bool > checkAcceptance(const reco::Track &, const edm::Event &, const edm::EventSetup &, size_t &, float &, float &, float &, float &)
MonitorElement * meETLTrackMatchedTP2DPtvsPtGen_
MonitorElement * meETLTrackRPTime_
MonitorElement * meTrackPullTotvsMVAQual_
MonitorElement * meETLTrackMatchedTP2PtResMtd_
edm::EDGetTokenT< edm::ValueMap< float > > t0SafePidToken_
std::string folder_
edm::EDGetTokenT< edm::ValueMap< float > > t0SrcToken_
static constexpr double rBTL_
MonitorElement * meETLTrackMatchedTP2PtRatioMtd_
edm::ESGetToken< MTDTopology, MTDTopologyRcd > mtdtopoToken_
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
const std::string folder_
const bool trkRecSel(const reco::TrackBase &)
T z() const
Definition: PV3DBase.h:61
static constexpr double pTcutETL_
virtual const Topology & topology() const
Definition: GeomDet.cc:67
edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > builderToken_
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
virtual const PixelTopology & specificTopology() const
MonitorElement * meETLTrackMatchedTP2PtResvsPtMtd_
MonitorElement * meTrackResTotvsMVAQual_
static constexpr double etacutREC_
MonitorElement * meBTLTrackPtRes_
MonitorElement * meETLTrackEffEta2MtdLowPt_[2]
MonitorElement * meETLTrackEffPtTot_[2]
MonitorElement * meBTLTrackEffEtaMtd_
MonitorElement * meETLTrackEffPhi2Mtd_[2]
edm::EDGetTokenT< edm::ValueMap< float > > tmtdToken_
MonitorElement * meExtraBTLeneInCone_
edm::EDGetTokenT< edm::ValueMap< float > > outermostHitPositionToken_
MonitorElement * meExtraMTDfailExtenderPt_
MonitorElement * meExtraEtaMtd_
const reco::SimToRecoCollection * s2r_
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:31
const unsigned long int uniqueId(const uint32_t x, const EncodedEventId &y)
MonitorElement * meBTLTrackMatchedTPPtRatioMtd_
LocalPoint pixelToModuleLocalPoint(const LocalPoint &plp, int row, int col) const
MonitorElement * meTrackMatchedTPmtdEffEtaTot_
static constexpr double cluDRradius_
const reco::RecoToSimCollection * r2s_
const edm::Ref< std::vector< TrackingParticle > > * getMatchedTP(const reco::TrackBaseRef &)
const_iterator find(const key_type &k) const
find element with specified reference key
Detector identifier base class for the MIP Timing Layer.
Definition: MTDDetId.h:21
MonitorElement * meETLTrackMatchedTP2PtRatioGen_
edm::EDGetTokenT< reco::TrackCollection > GenRecTrackToken_
MonitorElement * meETLTrackEffPhiMtd_[2]
edm::EDGetTokenT< reco::TPToSimCollectionMtd > tp2SimAssociationMapToken_
MonitorElement * meTrackResTot_
const_iterator end() const
last iterator over the map (read only)
MonitorElement * meTrackMatchedTPEffEtaTotLV_
void Fill(long long x)
double pt() const
track transverse momentum
Definition: TrackBase.h:637
edm::EDGetTokenT< edm::ValueMap< float > > SigmaTofPToken_
edm::EDGetTokenT< reco::TrackCollection > RecTrackToken_
MonitorElement * meExtraEtaEtl2Mtd_
MonitorElement * meBTLTrackEffPhiTot_
edm::ESGetToken< MTDDetLayerGeometry, MTDRecoGeometryRecord > mtdlayerToken_
const bool trkTPSelAll(const TrackingParticle &)
int iEvent
Definition: GenABIO.cc:224
GlobalPoint globalPosition() const
MonitorElement * meTrackMatchedTPmtdEffEtaMtd_
MonitorElement * meTrackMatchedTPEffEtaTot_
float localX(const float mpX) const override
edm::EDGetTokenT< FTLRecHitCollection > etlRecHitsToken_
MonitorElement * meTrackMatchedTPEffPtTotLV_
MonitorElement * meBTLTrackRPTime_
MonitorElement * meETLTrackEffEta2Mtd_[2]
MonitorElement * meBTLTrackMatchedTPDPtvsPtMtd_
static constexpr double depositBTLthreshold_
MonitorElement * meETLTrackPtRes_
MonitorElement * meETLTrackEffPt2Mtd_[2]
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:408
const bool trkTPSelLV(const TrackingParticle &)
MonitorElement * meETLTrackMatchedTPDPtvsPtGen_
MonitorElement * meTrackt0SafePid_
T sqrt(T t)
Definition: SSEVec.h:23
MonitorElement * meBTLTrackEffEtaTot_
MonitorElement * meETLTrackMatchedTPDPtvsPtMtd_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool isETL(const double eta) const
double f[11][100]
bool isMatched(TrackingRecHit const &hit)
MonitorElement * meBTLTrackMatchedTPPtResvsPtMtd_
MonitorElement * meTrackSigmaTof_[3]
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
int nrows() const override
static constexpr double simUnit_
MonitorElement * meTrackOutermostHitZ_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
edm::EDGetTokenT< edm::ValueMap< float > > t0PidToken_
MonitorElement * meTrackMatchedTPEffPtEtl2Mtd_
MonitorElement * meTrackMatchedTPmtdEffPtMtd_
edm::EDGetTokenT< FTLRecHitCollection > btlRecHitsToken_
MonitorElement * meETLTrackMatchedTPPtRatioMtd_
MonitorElement * meTrackMVAQual_
MonitorElement * meETLTrackEffPhiTot_[2]
float localY(const float mpY) const override
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
const std::vector< const DetLayer * > & allBTLLayers() const
return the BTL DetLayers (barrel), inside-out
edm::EDGetTokenT< edm::ValueMap< float > > SigmatmtdToken_
const bool trkRecSelLowPt(const reco::TrackBase &)
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
edm::EDGetTokenT< TrackingParticleCollection > trackingParticleCollectionToken_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
MonitorElement * meTrackNumHitsNT_
edm::EDGetTokenT< edm::ValueMap< float > > SigmaTofPiToken_
Log< level::Info, false > LogInfo
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:652
Definition: DetId.h:17
edm::EDGetTokenT< reco::SimToRecoCollection > simToRecoAssociationToken_
MonitorElement * meTrackOutermostHitR_
MonitorElement * meTrackEtaTot_
static constexpr double etaMatchCut_
static constexpr double zETL_
static constexpr double depositETLthreshold_
MonitorElement * meTrackMatchedTPEffEtaEtl2Mtd_
unsigned long long uint64_t
Definition: Time.h:13
MonitorElement * meTrackMatchedTPEffPtMtd_
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
MonitorElement * meBTLTrackMatchedTPDPtvsPtGen_
void analyze(const edm::Event &, const edm::EventSetup &) override
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
double b
Definition: hdecay.h:120
void add(std::string const &label, ParameterSetDescription const &psetDescription)
MonitorElement * meTrackSigmat0SafePid_
edm::EDGetTokenT< edm::ValueMap< float > > SigmaTofKToken_
MonitorElement * meETLTrackEffEtaMtd_[2]
int zside() const
Definition: MTDDetId.h:61
MonitorElement * meTrackSigmat0Pid_
MonitorElement * meTrackMatchedTPmtdEffPtTot_
MonitorElement * meBTLTrackEffPtMtd_
MonitorElement * meTrackt0Src_
edm::EDGetTokenT< edm::ValueMap< float > > Sigmat0PidToken_
MonitorElement * meTracktmtd_
MonitorElement * meBTLTrackEffPtTot_
MonitorElement * meTrackPathLenghtvsEta_
MonitorElement * meTrackMatchedTPEffPtTot_
Detector identifier class for the Endcap Timing Layer.
Definition: ETLDetId.h:16
HLT enums.
MonitorElement * meETLTrackMatchedTPPtResMtd_
int nDisc() const
Definition: ETLDetId.h:164
MonitorElement * meTrackPullTot_
double a
Definition: hdecay.h:121
Detector identifier class for the Barrel Timing Layer. The crystal count must start from 0...
Definition: BTLDetId.h:19
MonitorElement * meETLTrackMatchedTPPtRatioGen_
MonitorElement * meExtraPtMtd_
ESTransientHandle< T > getTransientHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:141
MonitorElement * meExtraPhiAtBTLmatched_
edm::EDGetTokenT< reco::RecoToSimCollection > recoToSimAssociationToken_
Monte Carlo truth information used for tracking validation.
MonitorElement * meBTLTrackMatchedTPPtRatioGen_
edm::EDGetTokenT< edm::ValueMap< float > > Sigmat0SrcToken_
MonitorElement * meETLTrackEffPtMtd_[2]
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
MonitorElement * meExtraPtEtl2Mtd_
BTLDetId::CrysLayout crysLayoutFromTopoMode(const int &topoMode)
edm::ESGetToken< MTDGeometry, MTDDigiGeometryRecord > mtdgeoToken_
MonitorElement * meTrackPtTot_
Log< level::Warning, false > LogWarning
auto makeValid(const U &iOtherHandleType) noexcept(false)
Definition: ValidHandle.h:52
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
MonitorElement * meETLTrackMatchedTP2DPtvsPtMtd_
MonitorElement * meETLTrackEffEtaMtdLowPt_[2]
MonitorElement * meTrackSigmat0Src_
const std::vector< const DetLayer * > & allETLLayers() const
return the ETL DetLayers (endcap), -Z to +Z
Definition: Run.h:45
static constexpr double pTcutBTL_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magfieldToken_
MonitorElement * meTrackSigmaTofvsP_[3]
edm::EDGetTokenT< edm::ValueMap< float > > Sigmat0SafePidToken_
MtdTracksValidation(const edm::ParameterSet &)
#define LogDebug(id)
MonitorElement * meETLTrackEffEtaTotLowPt_[2]
MonitorElement * meExtraPhiAtBTL_