CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PackedCandidateTrackValidator.cc
Go to the documentation of this file.
9 
12 
21 
24 
25 #include "boost/math/special_functions/sign.hpp"
26 
27 #include <iomanip>
28 
29 namespace {
30  template<typename T> void fillNoFlow(MonitorElement* h, T val){
31  h->Fill(std::min(std::max(val,((T) h->getTH1()->GetXaxis()->GetXmin())),((T) h->getTH1()->GetXaxis()->GetXmax())));
32  }
33 
34  class HitPatternPrinter {
35  public:
36  explicit HitPatternPrinter(const reco::Track& trk): track(trk) {}
37 
38  void print(std::ostream& os) const {
39  const reco::HitPattern &p = track.hitPattern();
40 
41  for (int i = 0; i < p.numberOfHits(reco::HitPattern::TRACK_HITS); ++i) {
43 
44  detLayer(os, p, hit);
45  if(p.missingHitFilter(hit)) {
46  os << "(miss)";
47  }
48  else if(p.inactiveHitFilter(hit)) {
49  os << "(inact)";
50  }
51  else if(p.badHitFilter(hit)) {
52  os << "(bad)";
53  }
54  os << " ";
55  }
56 
58  os << "lost inner ";
59 
60  for (int i = 0; i < p.numberOfHits(reco::HitPattern::MISSING_INNER_HITS); ++i) {
62 
63  if(p.missingHitFilter(hit)) {
64  detLayer(os, p, hit);
65  os << " ";
66  }
67  }
68  }
70  os << "lost outer ";
71 
72  for (int i = 0; i < p.numberOfHits(reco::HitPattern::MISSING_OUTER_HITS); ++i) {
74 
75  if(p.missingHitFilter(hit)) {
76  detLayer(os, p, hit);
77  os << " ";
78  }
79  }
80  }
81  }
82 
83  private:
84  static void detLayer(std::ostream& os, const reco::HitPattern& p, uint32_t hit) {
85  if(p.pixelBarrelHitFilter(hit)) {
86  os << "BPIX";
87  }
88  else if(p.pixelEndcapHitFilter(hit)) {
89  os << "FPIX";
90  }
91  else if(p.stripTIBHitFilter(hit)) {
92  os << "TIB";
93  }
94  else if(p.stripTIDHitFilter(hit)) {
95  os << "TID";
96  }
97  else if(p.stripTOBHitFilter(hit)) {
98  os << "TOB";
99  }
100  else if(p.stripTECHitFilter(hit)) {
101  os << "TEC";
102  }
103  os << p.getLayer(hit);
104  }
105 
106  const reco::Track& track;
107  };
108 
109  std::ostream& operator<<(std::ostream& os, const HitPatternPrinter& hpp) {
110  hpp.print(os);
111  return os;
112  }
113 
114  class TrackAlgoPrinter {
115  public:
116  explicit TrackAlgoPrinter(const reco::Track& trk): track(trk) {}
117 
118  void print(std::ostream& os) const {
120  for(int ialgo=0; ialgo < reco::TrackBase::algoSize; ++ialgo) {
121  auto algo = static_cast<reco::TrackBase::TrackAlgorithm>(ialgo);
122  if(track.isAlgoInMask(algo)) {
123  algos.push_back(algo);
124  }
125  }
126 
127  os << "algo " << reco::TrackBase::algoName(track.algo());
128  if(track.originalAlgo() != track.algo())
129  os << " originalAlgo " << reco::TrackBase::algoName(track.originalAlgo());
130  if(algos.size() > 1) {
131  os << " algoMask";
132  for(auto algo: algos) {
133  os << " " << reco::TrackBase::algoName(algo);
134  }
135  }
136  }
137 
138  private:
139  const reco::Track& track;
140  };
141  std::ostream& operator<<(std::ostream& os, const TrackAlgoPrinter& tap) {
142  tap.print(os);
143  return os;
144  }
145 
146  double diffRelative(double a, double b) {
147  return (a-b)/b;
148  }
149 
150  class LogIntHelper {
151  public:
152  LogIntHelper(double lmin, double lmax): lmin_(lmin), lmax_(lmax) {}
153 
154  class UnderOverflow {
155  public:
156  UnderOverflow(double largestValue, double smallestValue, std::function<double(double)> modifyUnpack):
157  unpackedLargestValue_(modifyUnpack ? modifyUnpack(largestValue) : largestValue),
158  unpackedSmallestValue_(modifyUnpack ? modifyUnpack(smallestValue) : smallestValue)
159  {}
160 
161  bool compatibleWithUnderflow(double value) const {
162  return value == unpackedSmallestValue_;
163  }
164  void printNonOkUnderflow(std::ostream& os) const {
165  os << " (not min " << unpackedSmallestValue_ << ")";
166  }
167 
168  bool compatibleWithOverflow(double value) const {
169  return value == unpackedLargestValue_;
170  }
171  void printNonOkOverflow(std::ostream& os) const {
172  os << " (not max " << unpackedLargestValue_ << ")";
173  }
174 
175  private:
176  // narrow to float to compare apples to apples with values from
177  // PackedCandidate (even though the final comparison is done in
178  // double)
179  const float unpackedLargestValue_;
180  const float unpackedSmallestValue_;
181  };
182 
183  static std::string maxName() { return "max"; }
184  static std::string minName() { return "min"; }
185 
186  UnderOverflow underOverflowHelper(double value, std::function<double(double)> modifyUnpack) const {
187  return UnderOverflow(largestValue(), value >= 0 ? smallestPositiveValue() : std::abs(smallestNegativeValue()), modifyUnpack);
188  }
189 
190  double largestValue() const {
191  return logintpack::unpack8log(127, lmin_, lmax_);
192  }
193 
194  static bool wouldBeDenorm(double value) {
195  return false;
196  }
197 
198  // lessThan means closer to zero
199  bool lessThanSmallestValue(double value) const {
200  if(value >= 0)
201  return value < smallestPositiveValue();
202  else
203  return value > smallestNegativeValue();
204  }
205 
206  double smallestPositiveValue() const {
208  }
209 
210  double smallestNegativeValue() const {
212  }
213 
214  private:
215  const double lmin_;
216  const double lmax_;
217  };
218  class Float16Helper {
219  public:
220  class UnderOverflow {
221  public:
222  static void printNonOkUnderflow(std::ostream& os) {
223  os << " (not 0)";
224  }
225  static bool compatibleWithUnderflow(double value) {
226  return value == 0.0;
227  }
228  static void printNonOkOverflow(std::ostream& os) {
229  os << " (not inf)";
230  }
231  static bool compatibleWithOverflow(double value) {
232  return edm::isNotFinite(value);
233  }
234  };
235 
236  static std::string maxName() { return "inf"; }
237  static std::string minName() { return "0"; }
238 
239  static UnderOverflow underOverflowHelper(double value, std::function<double(double)>) {
240  return UnderOverflow();
241  }
242 
243  static double largestValue() {
245  }
246 
247  static bool wouldBeDenorm(double value) {
248  const float valuef = static_cast<float>(value);
249  return valuef >= MiniFloatConverter::denorm_min() && valuef < MiniFloatConverter::min();
250  }
251 
252  static bool lessThanSmallestValue(double value) {
253  return std::abs(value) < smallestValue();
254  }
255 
256  static double smallestValue() {
258  }
259  };
260 
261  enum class RangeStatus {
262  inrange = 0,
263  inrange_signflip = 1,
264  denormal = 2,
265  underflow_OK = 3,
266  underflow_notOK = 4,
267  overflow_OK = 5,
268  overflow_notOK = 6
269  };
270  bool isInRange(RangeStatus status) {
271  return status == RangeStatus::inrange || status == RangeStatus::denormal;
272  }
273 
274  template <typename T>
275  class PackedValueCheckResult {
276  public:
277  PackedValueCheckResult(RangeStatus status, double diff,
278  double pcvalue, double trackvalue,
279  double rangeMin, double rangeMax,
280  const typename T::UnderOverflow& underOverflow):
281  diff_(diff), pcvalue_(pcvalue), trackvalue_(trackvalue), rangeMin_(rangeMin), rangeMax_(rangeMax),
282  status_(status), underOverflow_(underOverflow)
283  {}
284 
285  RangeStatus status() const { return status_; }
286  double diff() const { return diff_; }
287 
288  bool outsideExpectedRange() const {
289  if(status_ == RangeStatus::inrange)
290  return diff_ < rangeMin_ || diff_ > rangeMax_;
291  // denormal is considered as "in range" regardless of the expected range
292  return status_ == RangeStatus::underflow_notOK || status_ == RangeStatus::overflow_notOK || status_ == RangeStatus::inrange_signflip;
293  }
294 
295  void print(std::ostream& os) const {
296  if(outsideExpectedRange())
297  os << "!! ";
298  os << "(" << rangeMin_ << "," << rangeMax_ << ") ";
299 
300  os << diff_ << " " << pcvalue_;
301  if(status_ == RangeStatus::underflow_OK || status_ == RangeStatus::underflow_notOK) {
302  os << " (underflow) ";
303  if(status_ == RangeStatus::underflow_notOK)
304  underOverflow_.printNonOkUnderflow(os);
305  }
306  else if(status_ == RangeStatus::overflow_OK || status_ == RangeStatus::overflow_notOK) {
307  os << " (overflow) ";
308  if(status_ == RangeStatus::overflow_notOK)
309  underOverflow_.printNonOkOverflow(os);
310  }
311  else if(status_ == RangeStatus::denormal)
312  os << " (denormal)";
313  os << " " << trackvalue_;
314  }
315 
316  private:
317  const double diff_;
318  const double pcvalue_;
319  const double trackvalue_;
320  const double rangeMin_;
321  const double rangeMax_;
322  const RangeStatus status_;
323  const typename T::UnderOverflow underOverflow_;
324  };
325 
326  struct Range {
327  Range(double mi, double ma): min(mi), max(ma) {}
328  const double min, max;
329  };
330  struct RangeAbs {
331  RangeAbs(double val): min(-val), max(val) {}
332  const double min, max;
333  };
334 
335  template <typename T>
336  class PackedValueCheck {
337  public:
338  template <typename R, typename ...Args>
339  PackedValueCheck(const R& range, Args&&... args):
340  helper_(std::forward<Args>(args)...),
341  rangeMin_(range.min), rangeMax_(range.max)
342  {}
343 
344  void book(DQMStore::IBooker& iBooker,
345  const std::string& name, const std::string& title,
346  int nbins,double min,double max,
347  int flow_nbins,double flow_min,double flow_max) {
348  hInrange = iBooker.book1D(name, title, nbins, min, max);
349  hUnderOverflowSign = iBooker.book1D(name+"UnderOverFlowSign", title+" with over- and underflow, and sign flip", flow_nbins, flow_min, flow_max);
350  hStatus = iBooker.book1D(name+"Status", title+" status", 7, -0.5, 6.5);
351  hStatus->setBinLabel(1, "In range");
352  hStatus->setBinLabel(2, "In range, sign flip");
353  hStatus->setBinLabel(3, "Denormal");
354  hStatus->setBinLabel(4, "Underflow, PC is "+T::minName());
355  hStatus->setBinLabel(5, "Underflow, PC is not "+T::minName());
356  hStatus->setBinLabel(6, "Overflow, PC is "+T::maxName());
357  hStatus->setBinLabel(7, "Overflow, PC is not "+T::maxName());
358  }
359 
360  PackedValueCheckResult<T> fill(double pcvalue, double trackvalue,
361  std::function<double(double)> modifyPack=std::function<double(double)>(),
362  std::function<double(double)> modifyUnpack=std::function<double(double)>()) {
363  const auto diff = diffRelative(pcvalue, trackvalue);
364 
365  const auto tmpSigned = modifyPack ? modifyPack(trackvalue) : trackvalue;
366  const auto tmp = std::abs(tmpSigned);
367  const auto underOverflow = helper_.underOverflowHelper(tmpSigned, modifyUnpack);
369  if(tmp > helper_.largestValue()) {
370  fillNoFlow(hUnderOverflowSign, diff);
371  if(underOverflow.compatibleWithOverflow(std::abs(pcvalue))) {
372  status = RangeStatus::overflow_OK;
373  }
374  else {
375  status = RangeStatus::overflow_notOK;
376  }
377  }
378  else if(helper_.lessThanSmallestValue(tmpSigned)) {
379  fillNoFlow(hUnderOverflowSign, diff);
380  if(underOverflow.compatibleWithUnderflow(std::abs(pcvalue))) {
381  status = RangeStatus::underflow_OK;
382  }
383  else {
384  status = RangeStatus::underflow_notOK;
385  }
386  }
387  else {
388  if(boost::math::sign(pcvalue) == boost::math::sign(trackvalue)) {
389  if(T::wouldBeDenorm(tmp)) {
390  status = RangeStatus::denormal;
391  }
392  else {
393  status = RangeStatus::inrange;
394  }
395  fillNoFlow(hInrange, diff);
396  }
397  else {
398  fillNoFlow(hUnderOverflowSign, diff);
399  status = RangeStatus::inrange_signflip;
400  }
401  }
402  hStatus->Fill(static_cast<int>(status));
403 
404  return PackedValueCheckResult<T>(status, diff, pcvalue, trackvalue, rangeMin_, rangeMax_, underOverflow);
405  }
406 
407  private:
408  const T helper_;
409  const double rangeMin_;
410  const double rangeMax_;
411 
412  MonitorElement *hInrange;
413  MonitorElement *hUnderOverflowSign;
414  MonitorElement *hStatus;
415  };
416  template <typename T>
417  std::ostream& operator<<(std::ostream& os, const PackedValueCheckResult<T>& res) {
418  res.print(os);
419  return os;
420  }
421 }
422 
424  public:
427 
428  void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
429  void analyze(const edm::Event&, const edm::EventSetup& ) override;
430 
431  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
432 
433  private:
434 
438 
440 
441  enum {
450  };
452 
456 
459 
462 
466  PackedValueCheck<Float16Helper> h_diffDxyAssocPV;
467  PackedValueCheck<Float16Helper> h_diffDzAssocPV;
470 
473 
474  PackedValueCheck<LogIntHelper> h_diffCovQoverpQoverp;
475  PackedValueCheck<LogIntHelper> h_diffCovLambdaLambda;
476  PackedValueCheck<LogIntHelper> h_diffCovLambdaDsz;
477  PackedValueCheck<LogIntHelper> h_diffCovPhiPhi;
478  PackedValueCheck<LogIntHelper> h_diffCovPhiDxy;
479  PackedValueCheck<Float16Helper> h_diffCovDxyDxy;
480  PackedValueCheck<Float16Helper> h_diffCovDxyDsz;
481  PackedValueCheck<Float16Helper> h_diffCovDszDsz;
482 
486 
489 
492 
493 
497 
502 
506 };
507 
509  tracksToken_(consumes<edm::View<reco::Track>>(iConfig.getUntrackedParameter<edm::InputTag>("tracks"))),
510  verticesToken_(consumes<reco::VertexCollection>(iConfig.getUntrackedParameter<edm::InputTag>("vertices"))),
511  trackToPackedCandidateToken_(consumes<edm::Association<pat::PackedCandidateCollection>>(iConfig.getUntrackedParameter<edm::InputTag>("trackToPackedCandidateAssociation"))),
512  rootFolder_(iConfig.getUntrackedParameter<std::string>("rootFolder")),
513  h_diffDxyAssocPV(RangeAbs(0.001)),
514  h_diffDzAssocPV(RangeAbs(0.001)),
515  h_diffCovQoverpQoverp(Range(-1e-6, 0.13), -15, 0), // despite of ceil in pack, there is rounding in double->float
516  h_diffCovLambdaLambda(Range(-1e-6, 0.13), -20, -5), // despite of ceil in pack, there is rounding in double->float
517  h_diffCovLambdaDsz(RangeAbs(0.13), -17, -4),
518  h_diffCovPhiPhi(RangeAbs(0.13), -15, 0),
519  h_diffCovPhiDxy(RangeAbs(0.13), -17, -4),
520  h_diffCovDxyDxy(RangeAbs(0.001)),
521  h_diffCovDxyDsz(RangeAbs(0.001)),
522  h_diffCovDszDsz(RangeAbs(0.001))
523 {}
524 
526 
529 
530  desc.addUntracked<edm::InputTag>("tracks", edm::InputTag("generalTracks"));
531  desc.addUntracked<edm::InputTag>("vertices", edm::InputTag("offlinePrimaryVertices"));
532  desc.addUntracked<edm::InputTag>("trackToPackedCandidateAssociation", edm::InputTag("packedPFCandidates"));
533  desc.addUntracked<std::string>("rootFolder", "Tracking/PackedCandidate");
534 
535  descriptions.add("packedCandidateTrackValidator", desc);
536 }
537 
539  iBooker.setCurrentFolder(rootFolder_);
540 
541  h_selectionFlow = iBooker.book1D("selectionFlow", "Track selection flow", 8, -0.5, 7.5);
542  h_selectionFlow->setBinLabel(1, "All tracks");
543  h_selectionFlow->setBinLabel(2, "Associated to PackedCandidate");
544  h_selectionFlow->setBinLabel(3, "PC is charged"),
545  h_selectionFlow->setBinLabel(4, "PC has track");
546  h_selectionFlow->setBinLabel(5, "PC is not electron");
547  h_selectionFlow->setBinLabel(6, "PC has hits");
548  h_selectionFlow->setBinLabel(7, "PC ndof != 0");
549  h_selectionFlow->setBinLabel(8, "Track: no missing inner hits");
550 
551  constexpr int diffBins = 50;
552 
553  h_diffVx = iBooker.book1D("diffVx", "PackedCandidate::bestTrack() - reco::Track in vx()", diffBins, -0.2, 0.2); // not equal
554  h_diffVy = iBooker.book1D("diffVy", "PackedCandidate::bestTrack() - reco::Track in vy()", diffBins, -0.2, 0.2); // not equal
555  h_diffVz = iBooker.book1D("diffVz", "PackedCandidate::bestTrack() - reco::Track in vz()", diffBins, -0.4, 0.4); // not equal
556 
557  h_diffNormalizedChi2 = iBooker.book1D("diffNormalizedChi2", "PackedCandidate::bestTrack() - reco::Track in normalizedChi2()", 30, -1.5, 1.5); // expected difference in -1...0
558  h_diffNdof = iBooker.book1D("diffNdof", "PackedCandidate::bestTrack() - reco::Track in ndof()", 33, -30.5, 2.5); // to monitor the difference
559 
560  h_diffCharge = iBooker.book1D("diffCharge", "PackedCandidate::bestTrack() - reco::Track in charge()", 5, -2.5, 2.5); // expect equality
561  h_diffIsHighPurity = iBooker.book1D("diffIsHighPurity", "PackedCandidate::bestTrack() - reco::Track in quality(highPurity)", 3, -1.5, 1.5); // expect equality
562 
563  h_diffPt = iBooker.book1D("diffPt", "(PackedCandidate::bestTrack() - reco::Track)/reco::Track in pt()", diffBins, -1.1, 1.1); // not equal, keep
564  h_diffEta = iBooker.book1D("diffEta", "PackedCandidate::bestTrack() - reco::Track in eta()", diffBins, -0.001, 0.001); // not equal, keep
565  h_diffPhi = iBooker.book1D("diffPhi", "PackedCandidate::bestTrack() - reco::Track in phi()", diffBins, -0.0005, 0.0005); // expect equality within precision
566 
567  h_diffDxyAssocPV.book(iBooker, "diffDxyAssocPV", "(PackedCandidate::dxy() - reco::Track::dxy(assocPV))/reco::Track",
568  40, -0.001, 0.001, // expect equality within precision
569  50, -0.5, 0.5);
570  h_diffDzAssocPV.book(iBooker, "diffDzAssocPV","(PackedCandidate::dzAssociatedPV() - reco::Track::dz(assocPV))/reco::Track",
571  40, -0.001, 0.001, // expect equality within precision
572  50, -0.5, 0.5);
573  h_diffDxyPV = iBooker.book1D("diffDxyPV", "(PackedCandidate::dxy(PV) - reco::Track::dxy(PV))/reco::Track", diffBins, -0.01, 0.01); // expect equality within precision (worse than assocPV)
574  h_diffDzPV = iBooker.book1D("diffDzPV", "(PackedCandidate::dz(PV) - reco::Track::dz(PV))/reco::Track", diffBins, -0.01, 0.01); // expect equality wihtin precision (worse than assocPV)
575  h_diffTrackDxyAssocPV = iBooker.book1D("diffTrackDxyAssocPV", "(PackedCandidate::bestTrack()::dxy(assocPV)) - reco::Track::dxy(assocPV))/reco::Track", diffBins, -0.01, 0.01); // not equal
576  h_diffTrackDzAssocPV = iBooker.book1D("diffTrackDzAssocPV", "(PackedCandidate::bestTrack()::dz(assocPV)) - reco::Track::dz(assocPV))/reco::Track", diffBins, -0.01, 0.01); // not equal
577 
578  h_diffCovQoverpQoverp.book(iBooker, "diffCovQoverpQoverp", "(PackedCandidate::bestTrack() - reco::Track)/reco::track in cov(qoverp, qoverp)",
579  40, -0.05, 0.15, // expect equality within precision (worst precision is exp(1/128*15) =~ 12 %
580  50, -0.5, 0.5);
581  h_diffCovLambdaLambda.book(iBooker, "diffCovLambdaLambda", "(PackedCandidate::bestTrack() - reco::Track)/reco::Track in cov(lambda, lambda)",
582  40, -0.05, 0.15, // expect equality within precision worst precision is exp(1/128*(20-5)) =~ 12 % (multiplied by pt^2 in packing & unpacking)
583  50, -0.5, 0.5);
584  h_diffCovLambdaDsz.book(iBooker, "diffCovLambdaDsz", "(PackedCandidate::bestTrack() - reco::Track)/reco::Track in cov(lambda, dsz)",
585  60, -0.15, 0.15, // expect equality within precision, worst precision is exp(1/128*(17-4) =~ 11 %
586  50, -1, 1);
587  h_diffCovPhiPhi.book(iBooker, "diffCovPhiPhi", "(PackedCandidate::bestTrack() - reco::Track)/reco::Track in cov(phi, phi)",
588  40, -0.05, 0.15, // expect equality within precision worst precision is exp(1/128*(20-5)) =~ 12 % (multiplied by pt^2 in packing & unpacking)
589  50, -0.5, 0.5);
590  h_diffCovPhiDxy.book(iBooker, "diffCovPhiDxy", "(PackedCandidate::bestTrack() - reco::Track)/reco::Track in cov(phi, dxy)",
591  60, -0.15, 0.15, // expect equality within precision, wors precision is exp(1/128)*(17-4) =~ 11 %
592  50, -1, 1);
593  h_diffCovDxyDxy.book(iBooker, "diffCovDxyDxy", "(PackedCandidate::bestTrack() - reco::Track)/reco::Track in cov(dxy, dxy)",
594  40, -0.001, 0.001,
595  50, -0.1, 0.1);
596  h_diffCovDxyDsz.book(iBooker, "diffCovDxyDsz", "(PackedCandidate::bestTrack() - reco::Track)/reco::Track in cov(dxy, dsz)",
597  40, -0.001, 0.001, // expect equality within precision
598  50, -0.5, 0.5);
599  h_diffCovDszDsz.book(iBooker, "diffCovDszDsz", "(PackedCandidate::bestTrack() - reco::Track)/reco::Track in cov(dsz, dsz)",
600  40, -0.001, 0.001, // expect equality within precision
601  50, -0.1, 0.1);
602 
603  h_diffDxyError = iBooker.book1D("diffDxyError", "(PackedCandidate::dxyError() - reco::Track::dxyError())/reco::Track", 40, -0.001, 0.001); // expect equality within precision
604  h_diffDszError = iBooker.book1D("diffDszError", "(PackedCandidate::dzError() - reco::Track::dszError())/reco::Track", 40, -0.001, 0.001); // ideally, not equal, but for now they are
605  h_diffDzError = iBooker.book1D("diffDzError", "(PackedCandidate::dzError() - reco::Track::dzError())/reco::Track", 40, -0.001, 0.001); // expect equality within precision (not currently the case)
606 
607  h_diffTrackDxyError = iBooker.book1D("diffTrackDxyError", "(PackedCandidate::bestTrack() - reco::Track)/reco::Track in dxyError()", 40, -0.001, 0.001); // expect equality within precision
608  h_diffTrackDzError = iBooker.book1D("diffTrackDzError", "(PackedCandidate::bestTrack() - reco::Track)/reco::Track in dzError()", 40, -0.05, 0.05); // not equal
609 
610  h_diffPtError = iBooker.book1D("diffPtError", "(PackedCandidate::bestTrack() - reco::Track)/reco::Track in ptError()", diffBins, -1.1, 1.1); // not equal
611  h_diffEtaError = iBooker.book1D("diffEtaError", "(PackedCandidate::bestTrack() - reco::Track)/reco::Track in etaError()", 60, -0.15, 0.15); // not equal
612 
613 
614  h_diffNumberOfPixelHits = iBooker.book1D("diffNumberOfPixelHits", "PackedCandidate::numberOfPixelHits() - reco::Track::hitPattern::numberOfValidPixelHits()", 5, -2.5, 2.5); // expect equality
615  h_diffNumberOfHits = iBooker.book1D("diffNumberOfHits", "PackedCandidate::numberHits() - reco::Track::hitPattern::numberOfValidHits()", 5, -2.5, 2.5); // expect equality
616  h_diffLostInnerHits = iBooker.book1D("diffLostInnerHits", "PackedCandidate::lostInnerHits() - reco::Track::hitPattern::numberOfLostHits(MISSING_INNER_HITS)", 5, -2.5, 2.5); // expect equality
617 
618  h_diffHitPatternNumberOfValidPixelHits = iBooker.book1D("diffHitPatternNumberOfValidPixelHits", "PackedCandidate::bestTrack() - reco::Track in hitPattern::numberOfValidPixelHits()", 13, -10.5, 2.5); // not equal
619  h_diffHitPatternNumberOfValidHits = iBooker.book1D("diffHitPatternNumberOfValidHits", "PackedCandidate::bestTrack() - reco::Track in hitPattern::numberOfValidHits()", 13, -10.5, 2.5); // not equal
620  h_diffHitPatternNumberOfLostInnerHits = iBooker.book1D("diffHitPatternNumberOfLostPixelHits", "PackedCandidate::bestTrack() - reco::Track in hitPattern::numberOfLostHits(MISSING_INNER_HITS)", 13, -10.5, 2.5); // not equal
621  h_diffHitPatternHasValidHitInFirstPixelBarrel = iBooker.book1D("diffHitPatternHasValidHitInFirstPixelBarrel", "PackedCandidate::bestTrack() - reco::Track in hitPattern::hasValidHitInFirstPixelBarrel", 3, -1.5, 1.5); // expect equality
622 
623  h_numberPixelHitsOverMax = iBooker.book1D("numberPixelHitsOverMax", "Number of pixel hits over the maximum of PackedCandidate", 10, 0, 10);
624  h_numberStripHitsOverMax = iBooker.book1D("numberStripHitsOverMax", "Number of strip hits over the maximum of PackedCandidate", 10, 0, 10);
625  h_numberHitsOverMax = iBooker.book1D("numberHitsOverMax", "Number of hits over the maximum of PackedCandidate", 20, 0, 20);
626 }
627 
630  iEvent.getByToken(tracksToken_, htracks);
631  const auto& tracks = *htracks;
632 
634  iEvent.getByToken(verticesToken_, hvertices);
635  const auto& vertices = *hvertices;
636 
637  if(vertices.empty())
638  return;
639  const reco::Vertex& pv = vertices[0];
640 
643  const auto& trackToPackedCandidate = *hassoc;
644 
645  for(size_t i=0; i<tracks.size(); ++i) {
646  auto trackPtr = tracks.ptrAt(i);
647  const reco::Track& track = *trackPtr;
649 
650  pat::PackedCandidateRef pcRef = trackToPackedCandidate[trackPtr];
651  if(pcRef.isNull()) {
652  continue;
653  }
655 
656  // Filter out neutral PackedCandidates, some of them may have track associated, and for those the charge comparison fails
657  if(pcRef->charge() == 0) {
658  continue;
659  }
661 
662  const reco::Track *trackPcPtr = pcRef->bestTrack();
663  if(!trackPcPtr) {
664  continue;
665  }
667 
668  // Filter out electrons to avoid comparisons to PackedCandidates with GsfTrack
669  if(std::abs(pcRef->pdgId()) == 11) {
670  continue;
671  }
673 
674  // Filter out PackedCandidate-tracks with no hits, as they won't have their details filled
675  const reco::Track& trackPc = *trackPcPtr;
676  if(trackPc.hitPattern().numberOfValidHits() == 0) {
677  continue;
678  }
680 
681  auto slimmedVertexRef = pcRef->vertexRef();
682  const reco::Vertex& pcVertex = vertices[slimmedVertexRef.key()];
683 
684  fillNoFlow(h_diffVx, trackPc.vx() - track.vx());
685  fillNoFlow(h_diffVy, trackPc.vy() - track.vy());
686  fillNoFlow(h_diffVz, trackPc.vz() - track.vz());
687 
688  // PackedCandidate recalculates the ndof in unpacking as
689  // (nhits+npixelhits-5), but some strip hits may have dimension 2.
690  // If PackedCandidate has ndof=0, the resulting normalizedChi2
691  // will be 0 too. Hence, the comparison makes sense only for those
692  // PackedCandidates that have ndof != 0.
693  double diffNormalizedChi2 = 0;
694  if(trackPc.ndof() != 0) {
696  diffNormalizedChi2 = trackPc.normalizedChi2() - track.normalizedChi2();
697  fillNoFlow(h_diffNormalizedChi2, diffNormalizedChi2);
698  }
699  fillNoFlow(h_diffNdof, trackPc.ndof() - track.ndof());
700 
701  auto diffCharge = trackPc.charge() - track.charge();
702  fillNoFlow(h_diffCharge, diffCharge);
703  int diffHP = static_cast<int>(trackPc.quality(reco::TrackBase::highPurity)) - static_cast<int>(track.quality(reco::TrackBase::highPurity));
704  fillNoFlow(h_diffIsHighPurity, diffHP);
705 
706  const auto diffPt = diffRelative(trackPc.pt(), track.pt());
707  const auto diffPhi = reco::deltaPhi(trackPc.phi(), track.phi());
708  fillNoFlow(h_diffPt , diffPt);
709  fillNoFlow(h_diffEta, trackPc.eta() - track.eta());
710  fillNoFlow(h_diffPhi, diffPhi);
711 
712  const auto diffDxyAssocPV = h_diffDxyAssocPV.fill(pcRef->dxy( ) , track.dxy(pcVertex.position()), [](double value){return value*100.;});
713  const auto diffDzAssocPV = h_diffDzAssocPV.fill( pcRef->dzAssociatedPV(), track.dz(pcVertex.position()) , [](double value){return value*100.;});
714  const auto diffDxyPV = diffRelative(pcRef->dxy(pv.position()), track.dxy(pv.position()));
715  const auto diffDzPV = diffRelative(pcRef->dz(pv.position()) , track.dz(pv.position()));
716  fillNoFlow(h_diffDxyPV , diffDxyPV);
717  fillNoFlow(h_diffDzPV , diffDzPV);
718  fillNoFlow(h_diffTrackDxyAssocPV, diffRelative(trackPc.dxy(pcVertex.position()), track.dxy(pcVertex.position())));
719  fillNoFlow(h_diffTrackDzAssocPV , diffRelative(trackPc.dz(pcVertex.position()) , track.dz(pcVertex.position())));
720 
721  auto fillCov1 = [&](auto& hlp, const int i, const int j) {
722  return hlp.fill(trackPc.covariance(i, j), track.covariance(i, j));
723  };
724  auto fillCov2 = [&](auto& hlp, const int i, const int j, std::function<double(double)> modifyPack) {
725  return hlp.fill(trackPc.covariance(i, j), track.covariance(i, j), modifyPack);
726  };
727  auto fillCov3 = [&](auto& hlp, const int i, const int j, std::function<double(double)> modifyPack, std::function<double(double)> modifyUnpack) {
728  return hlp.fill(trackPc.covariance(i, j), track.covariance(i, j), modifyPack, modifyUnpack);
729  };
730 
731  const auto pcPt = pcRef->pt();
732  const auto diffCovQoverpQoverp = fillCov3(h_diffCovQoverpQoverp, reco::TrackBase::i_qoverp, reco::TrackBase::i_qoverp, [=](double val){return val*pcPt*pcPt;}, [=](double val){return val/pcPt/pcPt;});
733  const auto diffCovLambdaLambda = fillCov1(h_diffCovLambdaLambda, reco::TrackBase::i_lambda, reco::TrackBase::i_lambda);
734  const auto diffCovLambdaDsz = fillCov1(h_diffCovLambdaDsz, reco::TrackBase::i_lambda, reco::TrackBase::i_dsz);
735  const auto diffCovPhiPhi = fillCov3(h_diffCovPhiPhi, reco::TrackBase::i_phi, reco::TrackBase::i_phi, [=](double val){return val*pcPt*pcPt;}, [=](double val){return val/pcPt/pcPt;});
736  const auto diffCovPhiDxy = fillCov1(h_diffCovPhiDxy, reco::TrackBase::i_phi, reco::TrackBase::i_dxy);
737  const auto diffCovDxyDxy = fillCov2(h_diffCovDxyDxy, reco::TrackBase::i_dxy, reco::TrackBase::i_dxy, [](double value){return value*10000.;});
738  const auto diffCovDxyDsz = fillCov2(h_diffCovDxyDsz, reco::TrackBase::i_dxy, reco::TrackBase::i_dsz, [](double value){return value*10000.;});
739  const auto diffCovDszDsz = fillCov2(h_diffCovDszDsz, reco::TrackBase::i_dsz, reco::TrackBase::i_dsz, [](double value){return value*10000.;});
740 
741  if(isInRange(diffCovDszDsz.status())) {
742  fillNoFlow(h_diffDszError, diffRelative(pcRef->dzError(), track.dszError()));
743  fillNoFlow(h_diffDzError, diffRelative(pcRef->dzError(), track.dzError()));
744  fillNoFlow(h_diffTrackDzError, diffRelative(trackPc.dzError(), track.dzError()));
745  }
746  if(isInRange(diffCovDxyDxy.status())) {
747  fillNoFlow(h_diffDxyError, diffRelative(pcRef->dxyError(), track.dxyError()));
748  fillNoFlow(h_diffTrackDxyError, diffRelative(trackPc.dxyError(), track.dxyError()));
749  }
750  fillNoFlow(h_diffPtError , diffRelative(trackPc.ptError() , track.ptError() ));
751  fillNoFlow(h_diffEtaError , diffRelative(trackPc.etaError() , track.etaError() ));
752 
753 
754 
755  // For the non-HitPattern ones, take into account the PackedCandidate packing precision
756  const auto trackNumberOfHits = track.hitPattern().numberOfValidHits();
757  const auto trackNumberOfPixelHits = track.hitPattern().numberOfValidPixelHits();
758  const auto trackNumberOfStripHits = track.hitPattern().numberOfValidStripHits();
759  const auto pcNumberOfHits = pcRef->numberOfHits();
760  const auto pcNumberOfPixelHits = pcRef->numberOfPixelHits();
761  const auto pcNumberOfStripHits = pcNumberOfHits - pcNumberOfPixelHits;
762 
763  const int pixelOverflow = trackNumberOfPixelHits > pat::PackedCandidate::trackPixelHitsMask ? trackNumberOfPixelHits - pat::PackedCandidate::trackPixelHitsMask : 0;
764  const int stripOverflow = trackNumberOfStripHits > pat::PackedCandidate::trackStripHitsMask ? trackNumberOfStripHits - pat::PackedCandidate::trackStripHitsMask : 0;
766  // PackedCandidate counts overflow pixel hits as strip
767  const int pixelInducedStripOverflow = (trackNumberOfStripHits+pixelOverflow) > pat::PackedCandidate::trackStripHitsMask ? (trackNumberOfStripHits+pixelOverflow-stripOverflow) - pat::PackedCandidate::trackStripHitsMask : 0;
768  h_numberPixelHitsOverMax->Fill(pixelOverflow);
769  h_numberStripHitsOverMax->Fill(stripOverflow);
770  h_numberHitsOverMax->Fill(hitsOverflow);
771 
772  int diffNumberOfPixelHits = 0;
773  int diffNumberOfHits = 0;
774  if(pixelOverflow) {
775  diffNumberOfPixelHits = pcNumberOfPixelHits - pat::PackedCandidate::trackPixelHitsMask;
776  }
777  else {
778  diffNumberOfPixelHits = pcNumberOfPixelHits - trackNumberOfPixelHits;
779  }
780  if(stripOverflow || pixelInducedStripOverflow || pixelOverflow) {
781  int diffNumberOfStripHits = 0;
782  if(stripOverflow || pixelInducedStripOverflow) {
783  diffNumberOfStripHits = pcNumberOfStripHits - pat::PackedCandidate::trackStripHitsMask;
784  }
785  else if(pixelOverflow) {
786  diffNumberOfStripHits = (pcNumberOfStripHits - pixelOverflow) - trackNumberOfStripHits;
787  }
788 
789  diffNumberOfHits = diffNumberOfPixelHits + diffNumberOfStripHits;
790  }
791  else {
792  diffNumberOfHits = pcNumberOfHits - trackNumberOfHits;
793  }
794 
795  fillNoFlow(h_diffNumberOfPixelHits, diffNumberOfPixelHits);
796  fillNoFlow(h_diffNumberOfHits, diffNumberOfHits);
797 
798  int diffLostInnerHits = 0;
799  const auto trackLostInnerHits = track.hitPattern().numberOfLostHits(reco::HitPattern::MISSING_INNER_HITS);
800  switch(pcRef->lostInnerHits()) {
803  diffLostInnerHits = -trackLostInnerHits;
804  break;
806  diffLostInnerHits = 1-trackLostInnerHits;
807  break;
809  diffLostInnerHits = trackLostInnerHits>=2 ? 0 : 2-trackLostInnerHits;
810  break;
811  }
812  fillNoFlow(h_diffLostInnerHits, diffLostInnerHits);
813 
814  // For HitPattern ones, calculate the full diff (i.e. some differences are expected)
815  auto diffHitPatternNumberOfValidPixelHits = trackPc.hitPattern().numberOfValidPixelHits() - trackNumberOfPixelHits;
816  fillNoFlow(h_diffHitPatternNumberOfValidPixelHits, diffHitPatternNumberOfValidPixelHits);
817  auto diffHitPatternNumberOfValidHits = trackPc.hitPattern().numberOfValidHits() - trackNumberOfHits;
818  fillNoFlow(h_diffHitPatternNumberOfValidHits, diffHitPatternNumberOfValidHits);
820 
821  // hasValidHitInFirstPixelBarrel is set only if numberOfLostHits(MISSING_INNER_HITS) == 0
822  int diffHitPatternHasValidHitInFirstPixelBarrel = 0;
825  diffHitPatternHasValidHitInFirstPixelBarrel = static_cast<int>(trackPc.hitPattern().hasValidHitInFirstPixelBarrel()) - static_cast<int>(track.hitPattern().hasValidHitInFirstPixelBarrel());
826  fillNoFlow(h_diffHitPatternHasValidHitInFirstPixelBarrel, diffHitPatternHasValidHitInFirstPixelBarrel);
827  }
828 
829  // Print warning if there are differences outside the expected range
830  if(diffNormalizedChi2 < -1 || diffNormalizedChi2 > 0 || diffCharge != 0 || diffHP != 0
831  || std::abs(diffPhi) > 5e-4
832  || diffDxyAssocPV.outsideExpectedRange()
833  || diffDzAssocPV.outsideExpectedRange()
834  || std::abs(diffDxyPV) > 0.05 || std::abs(diffDzPV) > 0.05
835  || diffCovQoverpQoverp.outsideExpectedRange() || diffCovLambdaLambda.outsideExpectedRange()
836  || diffCovLambdaDsz.outsideExpectedRange() || diffCovPhiPhi.outsideExpectedRange()
837  || diffCovPhiDxy.outsideExpectedRange() || diffCovDxyDxy.outsideExpectedRange()
838  || diffCovDxyDsz.outsideExpectedRange() || diffCovDszDsz.outsideExpectedRange()
839  || diffNumberOfPixelHits != 0 || diffNumberOfHits != 0 || diffLostInnerHits != 0
840  || diffHitPatternHasValidHitInFirstPixelBarrel != 0
841  ) {
842 
843  edm::LogInfo("PackedCandidateTrackValidator") << "Track " << i << " pt " << track.pt() << " eta " << track.eta() << " phi " << track.phi() << " chi2 " << track.chi2() << " ndof " << track.ndof()
844  << "\n"
845  << " ptError " << track.ptError() << " etaError " << track.etaError() << " phiError " << track.phiError() << " dxyError " << track.dxyError() << " dzError " << track.dzError()
846  << "\n"
847  << " refpoint " << track.referencePoint() << " momentum " << track.momentum()
848  << "\n"
849  << " dxy " << track.dxy() << " dz " << track.dz()
850  << "\n"
851  << " " << TrackAlgoPrinter(track)
852  << " lost inner hits " << trackLostInnerHits
853  << " lost outer hits " << track.hitPattern().numberOfLostHits(reco::HitPattern::MISSING_OUTER_HITS)
854  << " hitpattern " << HitPatternPrinter(track)
855  << " \n"
856  << " PC " << pcRef.id() << ":" << pcRef.key() << " track pt " << trackPc.pt() << " eta " << trackPc.eta() << " phi " << trackPc.phi() << " (PC " << pcRef->phi() << ") chi2 " << trackPc.chi2() << " ndof " << trackPc.ndof() << " pdgId " << pcRef->pdgId() << " mass " << pcRef->mass()
857  << "\n"
858  << " ptError " << trackPc.ptError() << " etaError " << trackPc.etaError() << " phiError " << trackPc.phiError()
859  << "\n"
860  << " pc.vertex " << pcRef->vertex() << " momentum " << pcRef->momentum() << " track " << trackPc.momentum()
861  << "\n"
862  << " dxy " << trackPc.dxy() << " dz " << trackPc.dz() << " pc.dz " << pcRef->dz()
863  << " dxyError " << trackPc.dxyError() << " dzError " << trackPc.dzError()
864  << "\n"
865  << " dxy(PV) " << trackPc.dxy(pv.position()) << " dz(PV) " << trackPc.dz(pv.position())
866  << " dxy(assocPV) " << trackPc.dxy(pcVertex.position()) << " dz(assocPV) " << trackPc.dz(pcVertex.position())
867  << "\n"
868  << " (diff PackedCandidate track)"
869  << " highPurity " << diffHP << " " << trackPc.quality(reco::TrackBase::highPurity) << " " << track.quality(reco::TrackBase::highPurity)
870  << " charge " << diffCharge << " " << trackPc.charge() << " " << track.charge()
871  << " normalizedChi2 " << diffNormalizedChi2 << " " << trackPc.normalizedChi2() << " " << track.normalizedChi2()
872  << "\n "
873  << " numberOfHits " << diffNumberOfHits << " " << pcNumberOfHits << " " << trackNumberOfHits
874  << " numberOfPixelHits " << diffNumberOfPixelHits << " " << pcNumberOfPixelHits << " " << trackNumberOfPixelHits
875  << " numberOfStripHits # " << pcNumberOfStripHits << " " << trackNumberOfStripHits
876  << "\n "
877  << " hitPattern.numberOfValidPixelHits " << diffHitPatternNumberOfValidPixelHits << " " << trackPc.hitPattern().numberOfValidPixelHits() << " " << track.hitPattern().numberOfValidPixelHits()
878  << " hitPattern.numberOfValidHits " << diffHitPatternNumberOfValidHits << " " << trackPc.hitPattern().numberOfValidHits() << " " << track.hitPattern().numberOfValidHits()
879  << " hitPattern.hasValidHitInFirstPixelBarrel " << diffHitPatternHasValidHitInFirstPixelBarrel << " " << trackPc.hitPattern().hasValidHitInFirstPixelBarrel() << " " << track.hitPattern().hasValidHitInFirstPixelBarrel()
880  << "\n "
881  << " lostInnerHits " << diffLostInnerHits << " " << pcRef->lostInnerHits() << " #"
882  << " phi (5e-4) " << diffPhi << " " << trackPc.phi() << " " << track.phi()
883  << "\n "
884  << " dxy(assocPV) " << diffDxyAssocPV
885  << "\n "
886  << " dz(assocPV) " << diffDzAssocPV
887  << "\n "
888  << " dxy(PV) (0.05) " << diffDxyPV << " " << pcRef->dxy(pv.position()) << " " << track.dxy(pv.position())
889  << "\n "
890  << " dz(PV) (0.05) " << diffDzPV << " " << pcRef->dz(pv.position()) << " " << track.dz(pv.position())
891  << "\n "
892  << " cov(qoverp, qoverp) " << diffCovQoverpQoverp
893  << "\n "
894  << " cov(lambda, lambda) " << diffCovLambdaLambda
895  << "\n "
896  << " cov(lambda, dsz) " << diffCovLambdaDsz
897  << "\n "
898  << " cov(phi, phi) " << diffCovPhiPhi
899  << "\n "
900  << " cov(phi, dxy) " << diffCovPhiDxy
901  << "\n "
902  << " cov(dxy, dxy) " << diffCovDxyDxy
903  << "\n "
904  << " cov(dxy, dsz) " << diffCovDxyDsz
905  << "\n "
906  << " cov(dsz, dsz) " << diffCovDszDsz;
907  }
908  }
909 }
910 
const Point & referencePoint() const
Reference point on the track.
Definition: TrackBase.h:676
static bool stripTECHitFilter(uint16_t pattern)
Definition: HitPattern.h:625
int i
Definition: DBlmapReader.cc:9
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:700
PackedValueCheck< LogIntHelper > h_diffCovLambdaDsz
string fill
Definition: lumiContext.py:319
PackedValueCheck< Float16Helper > h_diffDzAssocPV
PackedValueCheck< Float16Helper > h_diffDxyAssocPV
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
static bool badHitFilter(uint16_t pattern)
Definition: HitPattern.h:802
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
Definition: TrackBase.h:556
edm::EDGetTokenT< edm::View< reco::Track > > tracksToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
PixelRecoRange< float > Range
double dxyError() const
error on dxy
Definition: TrackBase.h:791
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
double unpack8log(int8_t i, double lmin, double lmax, uint8_t base=128)
Definition: liblogintpack.h:52
int numberOfValidHits() const
Definition: HitPattern.h:823
PackedCandidateTrackValidator(const edm::ParameterSet &pset)
std::string print(const Track &, edm::Verbosity=edm::Concise)
Track print utility.
Definition: print.cc:10
double sign(double x)
std::vector< pat::PackedCandidate > PackedCandidateCollection
edm::EDGetTokenT< edm::Association< pat::PackedCandidateCollection > > trackToPackedCandidateToken_
double etaError() const
error on eta
Definition: TrackBase.h:779
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
int numberOfValidStripHits() const
Definition: HitPattern.h:853
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:640
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
constexpr int8_t smallestNegative
Definition: liblogintpack.h:11
key_type key() const
Accessor for product key.
Definition: Ref.h:264
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:670
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
static bool missingHitFilter(uint16_t pattern)
Definition: HitPattern.h:792
list diff
Definition: mps_update.py:85
const Point & position() const
position
Definition: Vertex.h:99
static bool pixelBarrelHitFilter(uint16_t pattern)
Definition: HitPattern.h:575
#define constexpr
ProductID id() const
Accessor for product ID.
Definition: Ref.h:258
void push_back(const T &value)
Definition: VecArray.h:78
TrackAlgorithm
track algorithm
Definition: TrackBase.h:99
static float denorm_min()
Definition: libminifloat.h:79
static bool pixelEndcapHitFilter(uint16_t pattern)
Definition: HitPattern.h:585
void Fill(long long x)
PackedValueCheck< LogIntHelper > h_diffCovLambdaLambda
double dszError() const
error on dsz
Definition: TrackBase.h:803
int iEvent
Definition: GenABIO.cc:230
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:646
bool isNotFinite(T x)
Definition: isFinite.h:10
PackedValueCheck< LogIntHelper > h_diffCovPhiDxy
double chi2() const
chi-squared of the fit
Definition: TrackBase.h:544
PackedValueCheck< Float16Helper > h_diffCovDxyDxy
PackedValueCheck< LogIntHelper > h_diffCovPhiPhi
double ndof() const
number of degrees of freedom of the fit
Definition: TrackBase.h:550
CovarianceMatrix covariance() const
return track covariance matrix
Definition: TrackBase.h:726
helper::RootFunctionHelper< F, args >::root_function function(F &f)
Definition: rootFunction.h:14
double pt() const
track transverse momentum
Definition: TrackBase.h:616
double ptError() const
error on Pt (set to 1000 TeV if charge==0 for safety)
Definition: TrackBase.h:758
double phiError() const
error on phi
Definition: TrackBase.h:785
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int j
Definition: DBlmapReader.cc:9
TH1 * getTH1(void) const
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
T min(T a, T b)
Definition: MathUtil.h:58
static float min()
Definition: libminifloat.h:64
bool isNull() const
Checks for null.
Definition: Ref.h:249
static bool inactiveHitFilter(uint16_t pattern)
Definition: HitPattern.h:797
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
Definition: TrackBase.h:604
double dzError() const
error on dz
Definition: TrackBase.h:809
double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:22
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:664
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
edm::EDGetTokenT< reco::VertexCollection > verticesToken_
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:445
tuple tracks
Definition: testEve_cfg.py:39
std::string algoName() const
Definition: TrackBase.h:503
constexpr int8_t smallestPositive
Definition: liblogintpack.h:8
double b
Definition: hdecay.h:120
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static bool stripTOBHitFilter(uint16_t pattern)
Definition: HitPattern.h:620
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:505
int numberOfLostHits(HitCategory category) const
Definition: HitPattern.h:902
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:658
static bool stripTIBHitFilter(uint16_t pattern)
Definition: HitPattern.h:610
double a
Definition: hdecay.h:121
void analyze(const edm::Event &, const edm::EventSetup &) override
static float max32RoundedToMax16()
Definition: libminifloat.h:56
PackedValueCheck< LogIntHelper > h_diffCovQoverpQoverp
PackedValueCheck< Float16Helper > h_diffCovDxyDsz
int numberOfValidPixelHits() const
Definition: HitPattern.h:838
PackedValueCheck< Float16Helper > h_diffCovDszDsz
int charge() const
track electric charge
Definition: TrackBase.h:562
bool hasValidHitInFirstPixelBarrel() const
Definition: HitPattern.cc:326
uint16_t getHitPattern(HitCategory category, int position) const
Definition: HitPattern.h:515
static bool stripTIDHitFilter(uint16_t pattern)
Definition: HitPattern.h:615
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:586
long double T
constexpr size_type size() const noexcept
Definition: VecArray.h:70
Definition: Run.h:43
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:652
int numberOfHits(HitCategory category) const
Definition: HitPattern.h:807
tuple status
Definition: mps_update.py:57