CMS 3D CMS Logo

PackedCandidate.cc
Go to the documentation of this file.
6 
9 
10 #include "TMatrixDSym.h"
11 #include "TVectorD.h"
12 using namespace logintpack;
13 
16 
17 void pat::PackedCandidate::pack(bool unpackAfterwards) {
18  float unpackedPt = std::min<float>(p4_.load()->Pt(), MiniFloatConverter::max());
19  packedPt_ = MiniFloatConverter::float32to16(unpackedPt);
20  packedEta_ = int16_t(std::round(p4_.load()->Eta() / 6.0f * std::numeric_limits<int16_t>::max()));
21  packedPhi_ = int16_t(std::round(p4_.load()->Phi() / 3.2f * std::numeric_limits<int16_t>::max()));
22  packedM_ = MiniFloatConverter::float32to16(p4_.load()->M());
23  if (unpackAfterwards) {
24  delete p4_.exchange(nullptr);
25  delete p4c_.exchange(nullptr);
26  unpack(); // force the values to match with the packed ones
27  }
28 }
29 
30 void pat::PackedCandidate::packVtx(bool unpackAfterwards) {
31  reco::VertexRef pvRef = vertexRef();
32  Point pv = pvRef.isNonnull() ? pvRef->position() : Point();
33  float dxPV = vertex_.load()->X() - pv.X(),
34  dyPV = vertex_.load()->Y() - pv.Y(); //, rPV = std::hypot(dxPV, dyPV);
35  float s = std::sin(float(p4_.load()->Phi()) + dphi_),
36  c = std::cos(float(p4_.load()->Phi() + dphi_)); // not the fastest option, but we're in reduced
37  // precision already, so let's avoid more roundoffs
38  dxy_ = -dxPV * s + dyPV * c;
39  // if we want to go back to the full x,y,z we need to store also
40  // float dl = dxPV * c + dyPV * s;
41  // float xRec = - dxy_ * s + dl * c, yRec = dxy_ * c + dl * s;
42  float pzpt = p4_.load()->Pz() / p4_.load()->Pt();
43  dz_ = vertex_.load()->Z() - pv.Z() - (dxPV * c + dyPV * s) * pzpt;
44  packedDxy_ = MiniFloatConverter::float32to16(dxy_ * 100);
45  packedDz_ = pvRef.isNonnull() ? MiniFloatConverter::float32to16(dz_ * 100)
46  : int16_t(std::round(dz_ / 40.f * std::numeric_limits<int16_t>::max()));
47  packedDPhi_ = int16_t(std::round(dphi_ / 3.2f * std::numeric_limits<int16_t>::max()));
48  packedDEta_ = MiniFloatConverter::float32to16(deta_);
49  packedDTrkPt_ = MiniFloatConverter::float32to16(dtrkpt_);
50 
51  if (unpackAfterwards) {
52  delete vertex_.exchange(nullptr);
53  unpackVtx();
54  }
55 }
56 
58  float pt = MiniFloatConverter::float16to32(packedPt_);
59  double shift = (pt < 1. ? 0.1 * pt : 0.1 / pt); // shift particle phi to break
60  // degeneracies in angular separations
61  double sign = ((int(pt * 10) % 2 == 0) ? 1 : -1); // introduce a pseudo-random sign of the shift
62  double phi = int16_t(packedPhi_) * 3.2f / std::numeric_limits<int16_t>::max() +
64  auto p4 = std::make_unique<PolarLorentzVector>(pt,
65  int16_t(packedEta_) * 6.0f / std::numeric_limits<int16_t>::max(),
66  phi,
68  auto p4c = std::make_unique<LorentzVector>(*p4);
69  PolarLorentzVector *expectp4 = nullptr;
70  if (p4_.compare_exchange_strong(expectp4, p4.get())) {
71  p4.release();
72  }
73 
74  // p4c_ works as the guard for unpacking so it
75  // must be set last
76  LorentzVector *expectp4c = nullptr;
77  if (p4c_.compare_exchange_strong(expectp4c, p4c.get())) {
78  p4c.release();
79  }
80 }
81 
83  packedCovariance_.dptdpt = packCovarianceElement(m, 0, 0);
84  packedCovariance_.detadeta = packCovarianceElement(m, 1, 1);
85  packedCovariance_.dphidphi = packCovarianceElement(m, 2, 2);
86  packedCovariance_.dxydxy = packCovarianceElement(m, 3, 3);
87  packedCovariance_.dzdz = packCovarianceElement(m, 4, 4);
88  packedCovariance_.dxydz = packCovarianceElement(m, 3, 4);
89  packedCovariance_.dlambdadz = packCovarianceElement(m, 1, 4);
90  packedCovariance_.dphidxy = packCovarianceElement(m, 2, 3);
91  // unpack afterwards
92  if (unpackAfterwards)
93  unpackCovariance();
94 }
95 
97  const CovarianceParameterization &p = covarianceParameterization();
98  if (p.isValid()) {
99  auto m = std::make_unique<reco::TrackBase::CovarianceMatrix>();
100  for (int i = 0; i < 5; i++)
101  for (int j = 0; j < 5; j++) {
102  (*m)(i, j) = 0;
103  }
104  unpackCovarianceElement(*m, packedCovariance_.dptdpt, 0, 0);
105  unpackCovarianceElement(*m, packedCovariance_.detadeta, 1, 1);
106  unpackCovarianceElement(*m, packedCovariance_.dphidphi, 2, 2);
107  unpackCovarianceElement(*m, packedCovariance_.dxydxy, 3, 3);
108  unpackCovarianceElement(*m, packedCovariance_.dzdz, 4, 4);
109  unpackCovarianceElement(*m, packedCovariance_.dxydz, 3, 4);
110  unpackCovarianceElement(*m, packedCovariance_.dlambdadz, 1, 4);
111  unpackCovarianceElement(*m, packedCovariance_.dphidxy, 2, 3);
112 
113  reco::TrackBase::CovarianceMatrix *expected = nullptr;
114  if (m_.compare_exchange_strong(expected, m.get())) {
115  m.release();
116  }
117 
118  } else {
120  << "You do not have a valid track parameters file loaded. "
121  << "Please check that the release version is compatible with your "
122  "input data"
123  << "or avoid accessing track parameter uncertainties. ";
124  }
125 }
126 
128  reco::VertexRef pvRef = vertexRef();
129  dphi_ = int16_t(packedDPhi_) * 3.2f / std::numeric_limits<int16_t>::max(),
130  deta_ = MiniFloatConverter::float16to32(packedDEta_);
131  dtrkpt_ = MiniFloatConverter::float16to32(packedDTrkPt_);
132  dxy_ = MiniFloatConverter::float16to32(packedDxy_) / 100.;
133  dz_ = pvRef.isNonnull() ? MiniFloatConverter::float16to32(packedDz_) / 100.
134  : int16_t(packedDz_) * 40.f / std::numeric_limits<int16_t>::max();
135  Point pv = pvRef.isNonnull() ? pvRef->position() : Point();
136  float phi = p4_.load()->Phi() + dphi_, s = std::sin(phi), c = std::cos(phi);
137  auto vertex = std::make_unique<Point>(pv.X() - dxy_ * s,
138  pv.Y() + dxy_ * c,
139  pv.Z() + dz_); // for our choice of using the PCA to the PV, by definition the
140  // remaining term -(dx*cos(phi) + dy*sin(phi))*(pz/pt) is zero
141 
142  Point *expected = nullptr;
143  if (vertex_.compare_exchange_strong(expected, vertex.get())) {
144  vertex.release();
145  }
146 }
147 
149  delete p4_.load();
150  delete p4c_.load();
151  delete vertex_.load();
152  delete track_.load();
153  delete m_.load();
154 }
155 
156 float pat::PackedCandidate::dxy(const Point &p) const {
157  maybeUnpackBoth();
158  const float phi = float(p4_.load()->Phi()) + dphi_;
159  return -(vertex_.load()->X() - p.X()) * std::sin(phi) + (vertex_.load()->Y() - p.Y()) * std::cos(phi);
160 }
161 float pat::PackedCandidate::dz(const Point &p) const {
162  maybeUnpackBoth();
163  const float phi = float(p4_.load()->Phi()) + dphi_;
164  const float pzpt = deta_ ? std::sinh(etaAtVtx()) : p4_.load()->Pz() / p4_.load()->Pt();
165  return (vertex_.load()->Z() - p.Z()) -
166  ((vertex_.load()->X() - p.X()) * std::cos(phi) + (vertex_.load()->Y() - p.Y()) * std::sin(phi)) * pzpt;
167 }
168 
170  // perform the regular unpacking of the track
171  if (!track_)
172  unpackTrk();
173 
174  //calculate the determinant and verify positivity
175  double det = 0;
176  bool notPosDef = (!(*m_).Sub<AlgebraicSymMatrix22>(0, 0).Det(det) || det < 0) ||
177  (!(*m_).Sub<AlgebraicSymMatrix33>(0, 0).Det(det) || det < 0) ||
178  (!(*m_).Sub<AlgebraicSymMatrix44>(0, 0).Det(det) || det < 0) || (!(*m_).Det(det) || det < 0);
179 
180  if (notPosDef) {
182  //if not positive-definite, alter values to allow for pos-def
183  TMatrixDSym eigenCov(5);
184  for (int i = 0; i < 5; i++) {
185  for (int j = 0; j < 5; j++) {
186  if (edm::isNotFinite((m)(i, j)))
187  eigenCov(i, j) = 1e-6;
188  else
189  eigenCov(i, j) = (m)(i, j);
190  }
191  }
192  TVectorD eigenValues(5);
193  eigenCov.EigenVectors(eigenValues);
194  double minEigenValue = eigenValues.Min();
195  double delta = 1e-6;
196  if (minEigenValue < 0) {
197  for (int i = 0; i < 5; i++)
198  m(i, i) += delta - minEigenValue;
199  }
200 
201  // make a track object with pos def covariance matrix
202  return reco::Track(normalizedChi2_ * (*track_).ndof(),
203  (*track_).ndof(),
204  *vertex_,
205  (*track_).momentum(),
206  (*track_).charge(),
207  m,
210  } else {
211  // just return a copy of the unpacked track
212  return reco::Track(*track_);
213  }
214 }
215 
217  maybeUnpackBoth();
218  math::RhoEtaPhiVector p3(ptTrk(), etaAtVtx(), phiAtVtx());
219  maybeUnpackCovariance();
220  int numberOfStripLayers = stripLayersWithMeasurement(), numberOfPixelLayers = pixelLayersWithMeasurement();
221  int numberOfPixelHits = this->numberOfPixelHits();
222  int numberOfHits = this->numberOfHits();
223 
224  int ndof = numberOfHits + numberOfPixelHits - 5;
225  LostInnerHits innerLost = lostInnerHits();
226 
227  auto track = std::make_unique<reco::Track>(normalizedChi2_ * ndof,
228  ndof,
229  *vertex_,
230  math::XYZVector(p3.x(), p3.y(), p3.z()),
231  charge(),
232  *(m_.load()),
235  int i = 0;
236  if (firstHit_ == 0) { // Backward compatible
237  if (innerLost == validHitInFirstPixelBarrelLayer) {
238  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, 1, 0, TrackingRecHit::valid);
239  i = 1;
240  }
241  } else {
242  track->appendHitPattern(firstHit_, TrackingRecHit::valid);
243  }
244 
245  if (firstHit_ != 0 && reco::HitPattern::pixelHitFilter(firstHit_))
246  i = 1;
247 
248  // add hits to match the number of laters and validHitInFirstPixelBarrelLayer
249  if (innerLost == validHitInFirstPixelBarrelLayer) {
250  // then to encode the number of layers, we add more hits on distinct layers
251  // (B2, B3, B4, F1, ...)
252  for (; i < numberOfPixelLayers; i++) {
253  if (i <= 3) {
254  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, i + 1, 0, TrackingRecHit::valid);
255  } else {
256  track->appendTrackerHitPattern(PixelSubdetector::PixelEndcap, i - 3, 0, TrackingRecHit::valid);
257  }
258  }
259  } else {
260  // to encode the information on the layers, we add one valid hits per layer
261  // but skipping PXB1
262  int iOffset = 0;
263  if (firstHit_ != 0 && reco::HitPattern::pixelHitFilter(firstHit_)) {
264  iOffset = reco::HitPattern::getLayer(firstHit_);
266  iOffset += 3;
267  } else {
268  iOffset = 1;
269  }
270  for (; i < numberOfPixelLayers; i++) {
271  if (i + iOffset <= 2) {
272  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, i + iOffset + 1, 0, TrackingRecHit::valid);
273  } else {
274  track->appendTrackerHitPattern(PixelSubdetector::PixelEndcap, i + iOffset - 3 + 1, 0, TrackingRecHit::valid);
275  }
276  }
277  }
278  // add extra hits (overlaps, etc), all on the first layer with a hit - to
279  // avoid increasing the layer count
280  for (; i < numberOfPixelHits; i++) {
281  if (firstHit_ != 0 && reco::HitPattern::pixelHitFilter(firstHit_)) {
282  track->appendTrackerHitPattern(reco::HitPattern::getSubStructure(firstHit_),
283  reco::HitPattern::getLayer(firstHit_),
284  0,
286  } else {
287  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel,
288  (innerLost == validHitInFirstPixelBarrelLayer ? 1 : 2),
289  0,
291  }
292  }
293  // now start adding strip layers, putting one hit on each layer so that the
294  // hitPattern.stripLayersWithMeasurement works. we don't know what the layers
295  // where, so we just start with TIB (4 layers), then TOB (6 layers), then TEC
296  // (9) and then TID(3), so that we can get a number of valid strip layers up
297  // to 4+6+9+3
298  if (firstHit_ != 0 && reco::HitPattern::stripHitFilter(firstHit_))
299  i += 1;
300  int slOffset = 0;
301  if (firstHit_ != 0 && reco::HitPattern::stripHitFilter(firstHit_)) {
302  slOffset = reco::HitPattern::getLayer(firstHit_) - 1;
304  slOffset += 4;
306  slOffset += 7;
308  slOffset += 13;
309  }
310  for (int sl = slOffset; sl < numberOfStripLayers + slOffset; ++sl, ++i) {
311  if (sl < 4)
312  track->appendTrackerHitPattern(StripSubdetector::TIB, sl + 1, 1, TrackingRecHit::valid);
313  else if (sl < 4 + 3)
314  track->appendTrackerHitPattern(StripSubdetector::TID, (sl - 4) + 1, 1, TrackingRecHit::valid);
315  else if (sl < 7 + 6)
316  track->appendTrackerHitPattern(StripSubdetector::TOB, (sl - 7) + 1, 1, TrackingRecHit::valid);
317  else if (sl < 13 + 9)
318  track->appendTrackerHitPattern(StripSubdetector::TEC, (sl - 13) + 1, 1, TrackingRecHit::valid);
319  else
320  break; // wtf?
321  }
322  // finally we account for extra strip hits beyond the one-per-layer added
323  // above. we put them all on TIB1, to avoid incrementing the number of
324  // layersWithMeasurement.
325  for (; i < numberOfHits; i++) {
326  if (reco::HitPattern::stripHitFilter(firstHit_)) {
327  track->appendTrackerHitPattern(reco::HitPattern::getSubStructure(firstHit_),
328  reco::HitPattern::getLayer(firstHit_),
329  1,
331  } else {
332  track->appendTrackerHitPattern(StripSubdetector::TIB, 1, 1, TrackingRecHit::valid);
333  }
334  }
335 
336  switch (innerLost) {
337  case validHitInFirstPixelBarrelLayer:
338  break;
339  case noLostInnerHits:
340  break;
341  case oneLostInnerHit:
342  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, 1, 0, TrackingRecHit::missing_inner);
343  break;
344  case moreLostInnerHits:
345  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, 1, 0, TrackingRecHit::missing_inner);
346  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, 2, 0, TrackingRecHit::missing_inner);
347  break;
348  };
349 
350  if (trackHighPurity())
351  track->setQuality(reco::TrackBase::highPurity);
352 
353  reco::Track *expected = nullptr;
354  if (track_.compare_exchange_strong(expected, track.get())) {
355  track.release();
356  }
357 }
358 
360 
362  throw cms::Exception("Invalid Reference") << "this Candidate has no master clone reference."
363  << "Can't call masterClone() method.\n";
364 }
365 
366 bool pat::PackedCandidate::hasMasterClone() const { return false; }
367 
368 bool pat::PackedCandidate::hasMasterClonePtr() const { return false; }
369 
371  throw cms::Exception("Invalid Reference") << "this Candidate has no master clone ptr."
372  << "Can't call masterClonePtr() method.\n";
373 }
374 
375 size_t pat::PackedCandidate::numberOfDaughters() const { return 0; }
376 
377 size_t pat::PackedCandidate::numberOfMothers() const { return 0; }
378 
380  return p4() == o.p4() && vertex() == o.vertex() && charge() == o.charge();
381  // return p4() == o.p4() && charge() == o.charge();
382 }
383 
385 
386 const reco::Candidate *pat::PackedCandidate::mother(size_type) const { return nullptr; }
387 
390  << "This Candidate type does not implement daughter(std::string). "
391  << "Please use CompositeCandidate or NamedCompositeCandidate.\n";
392 }
393 
396  << "This Candidate type does not implement daughter(std::string). "
397  << "Please use CompositeCandidate or NamedCompositeCandidate.\n";
398 }
399 
401 
402 double pat::PackedCandidate::vertexChi2() const { return 0; }
403 
404 double pat::PackedCandidate::vertexNdof() const { return 0; }
405 
406 double pat::PackedCandidate::vertexNormalizedChi2() const { return 0; }
407 
410  << "reco::ConcreteCandidate does not implement vertex covariant "
411  "matrix.\n";
412 }
413 
416  << "reco::ConcreteCandidate does not implement vertex covariant "
417  "matrix.\n";
418 }
419 
420 bool pat::PackedCandidate::longLived() const { return false; }
421 
422 bool pat::PackedCandidate::massConstraint() const { return false; }
423 
424 // puppiweight
425 void pat::PackedCandidate::setPuppiWeight(float p, float p_nolep) {
426  // Set both weights at once to avoid misconfigured weights if called in the
427  // wrong order
428  packedPuppiweight_ = std::numeric_limits<uint8_t>::max() * p;
429  packedPuppiweightNoLepDiff_ = std::numeric_limits<int8_t>::max() * (p_nolep - p);
430 }
431 
433  return 1.f * packedPuppiweight_ / std::numeric_limits<uint8_t>::max();
434 }
435 
437  return 1.f * packedPuppiweightNoLepDiff_ / std::numeric_limits<int8_t>::max() +
438  1.f * packedPuppiweight_ / std::numeric_limits<uint8_t>::max();
439 }
440 
442  if (100 * p > std::numeric_limits<uint8_t>::max())
443  rawCaloFraction_ = std::numeric_limits<uint8_t>::max(); // Set to overflow value
444  else
445  rawCaloFraction_ = 100 * p;
446 }
447 
448 void pat::PackedCandidate::setRawHcalFraction(float p) { rawHcalFraction_ = 100 * p; }
449 
450 void pat::PackedCandidate::setCaloFraction(float p) { caloFraction_ = 100 * p; }
451 
452 void pat::PackedCandidate::setHcalFraction(float p) { hcalFraction_ = 100 * p; }
453 
454 void pat::PackedCandidate::setIsIsolatedChargedHadron(bool p) { isIsolatedChargedHadron_ = p; }
455 
456 void pat::PackedCandidate::setDTimeAssociatedPV(float aTime, float aTimeError) {
457  if (aTime == 0 && aTimeError == 0) {
458  packedTime_ = 0;
459  packedTimeError_ = 0;
460  } else if (aTimeError == 0) {
461  packedTimeError_ = 0;
462  packedTime_ = packTimeNoError(aTime);
463  } else {
464  packedTimeError_ = packTimeError(aTimeError);
465  aTimeError = unpackTimeError(packedTimeError_); // for reproducibility
466  packedTime_ = packTimeWithError(aTime, aTimeError);
467  }
468 }
469 
471 uint8_t pat::PackedCandidate::packTimeError(float timeError) {
472  if (timeError <= 0)
473  return 0;
474  // log-scale packing.
475  // for MIN_TIMEERROR = 0.002, EXPO_TIMEERROR = 5:
476  // minimum value 0.002 = 2ps (packed as 1)
477  // maximum value 0.5 ns (packed as 255)
478  // constant *relative* precision of about 2%
479  return std::max<uint8_t>(
480  std::min(std::round(std::ldexp(std::log2(timeError / MIN_TIMEERROR), +EXPO_TIMEERROR)), 255.f), 1);
481 }
482 float pat::PackedCandidate::unpackTimeError(uint8_t timeError) {
483  return timeError > 0 ? MIN_TIMEERROR * std::exp2(std::ldexp(float(timeError), -EXPO_TIMEERROR)) : -1.0f;
484 }
486  if (time == 0)
487  return 0.f;
488  return (time > 0 ? MIN_TIME_NOERROR : -MIN_TIME_NOERROR) *
489  std::exp2(std::ldexp(float(std::abs(time)), -EXPO_TIME_NOERROR));
490 }
492  // encoding in log scale to store times in a large range with few bits.
493  // for MIN_TIME_NOERROR = 0.0002 and EXPO_TIME_NOERROR = 6:
494  // smallest non-zero time = 0.2 ps (encoded as +/-1)
495  // one BX, +/- 12.5 ns, is fully covered with 11 bits (+/- 1023)
496  // 12 bits cover by far any plausible value (+/-2047 corresponds to about
497  // +/- 0.8 ms!) constant *relative* ~1% precision
498  if (std::abs(time) < MIN_TIME_NOERROR)
499  return 0; // prevent underflows
500  float fpacked = std::ldexp(std::log2(std::abs(time / MIN_TIME_NOERROR)), +EXPO_TIME_NOERROR);
501  return (time > 0 ? +1 : -1) * std::min(std::round(fpacked), 2047.f);
502 }
503 float pat::PackedCandidate::unpackTimeWithError(int16_t time, uint8_t timeError) {
504  if (time % 2 == 0) {
505  // no overflow: drop rightmost bit and unpack in units of timeError
506  return std::ldexp(unpackTimeError(timeError), EXPO_TIME_WITHERROR) * float(time / 2);
507  } else {
508  // overflow: drop rightmost bit, unpack using the noError encoding
510  }
511 }
512 int16_t pat::PackedCandidate::packTimeWithError(float time, float timeError) {
513  // Encode in units of timeError * 2^EXPO_TIME_WITHERROR (~1.6% if
514  // EXPO_TIME_WITHERROR = -6) the largest value that can be stored in 14 bits +
515  // sign bit + overflow bit is about 260 sigmas values larger than that will be
516  // stored using the no-timeError packing (with less precision). overflows of
517  // these kinds should happen only for particles that are late arriving,
518  // out-of-time, or mis-reconstructed, as timeError is O(20ps) and the beam
519  // spot witdth is O(200ps)
520  float fpacked = std::round(time / std::ldexp(timeError, EXPO_TIME_WITHERROR));
521  if (std::abs(fpacked) < 16383.f) { // 16383 = (2^14 - 1) = largest absolute
522  // value for a signed 15 bit integer
523  return int16_t(fpacked) * 2; // make it even, and fit in a signed 16 bit int
524  } else {
525  int16_t packed = packTimeNoError(time); // encode
526  return packed * 2 + (time > 0 ? +1 : -1); // make it odd, to signal that there was an overlow
527  }
528 }
float puppiWeight() const
double vertexNormalizedChi2() const override
chi-squared divided by n.d.o.f.
static constexpr auto TEC
bool massConstraint() const override
do mass constraint?
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:721
float puppiWeightNoLep() const
Weight from full PUPPI.
double vertexNdof() const override
bool overlap(const reco::Candidate &) const override
check overlap with another Candidate
static bool pixelHitFilter(uint16_t pattern)
Definition: HitPattern.h:581
std::pair< unsigned int, unsigned int > unpack(cond::Time_t since)
void setPuppiWeight(float p, float p_nolep=0.0)
size_t size_type
Definition: Candidate.h:29
constexpr bool isNotFinite(T x)
Definition: isFinite.h:9
bool hasMasterClonePtr() const override
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
static float unpackTimeNoError(int16_t time)
void setRawCaloFraction(float p)
Weight from PUPPI removing leptons.
static int16_t packTimeNoError(float time)
GeometricSearchDet Det
Definition: DetBelowR.h:8
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
static int16_t packTimeWithError(float time, float timeError)
static uint8_t packTimeError(float timeError)
static to allow unit testing
RhoEtaPhiVectorD RhoEtaPhiVector
spatial vector with cylindrical internal representation using pseudorapidity
Definition: Vector3D.h:33
static float float16to32(uint16_t h)
Definition: libminifloat.h:13
size_t numberOfMothers() const override
number of mothers
const reco::CandidateBaseRef & masterClone() const override
const reco::CandidatePtr & masterClonePtr() const override
void unpackCovariance() const
virtual const reco::Track pseudoPosDefTrack() const
void setHcalFraction(float p)
Fraction of ECAL+HCAL energy over candidate energy.
static uint16_t float32to16(float x)
Definition: libminifloat.h:17
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
static bool stripHitFilter(uint16_t pattern)
Definition: HitPattern.h:608
math::XYZPoint Point
size_t numberOfDaughters() const override
number of daughters
static CovarianceParameterization covarianceParameterization_
void fillVertexCovariance(CovarianceMatrix &v) const override
fill SMatrix
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
~PackedCandidate() override
destructor
ROOT::Math::SMatrix< double, 4, 4, ROOT::Math::MatRepSym< double, 4 > > AlgebraicSymMatrix44
static constexpr auto TOB
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:713
LostInnerHits
Enumerator specifying the.
void setRawHcalFraction(float p)
Raw ECAL+HCAL energy over candidate energy for isolated charged hadrons.
static constexpr auto TIB
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
static std::once_flag covariance_load_flag
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
ROOT::Math::SMatrix< double, 2, 2, ROOT::Math::MatRepSym< double, 2 > > AlgebraicSymMatrix22
void setDTimeAssociatedPV(float aTime, float aTimeError=0)
set time measurement
Structure Point Contains parameters of Gaussian fits to DMRs.
const reco::Candidate * mother(size_type) const override
return mother at a given position (throws an exception)
void packVtx(bool unpackAfterwards=true)
const reco::Candidate * daughter(size_type) const override
return daughter at a given position (throws an exception)
static unsigned int const shift
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
void setIsIsolatedChargedHadron(bool p)
Fraction of Hcal for HF, neutral hadrons, and charged particles.
double vertexChi2() const override
chi-squares
CovarianceMatrix vertexCovariance() const override
return SMatrix
virtual float dxy() const
dxy with respect to the PV ref
void pack(bool unpackAfterwards=true)
static float max()
Definition: libminifloat.h:93
virtual float dz(size_t ipv=0) const
dz with respect to the PV[ipv]
void packCovariance(const reco::TrackBase::CovarianceMatrix &m, bool unpackAfterwards=true)
static float unpackTimeWithError(int16_t time, uint8_t timeError)
bool hasMasterClone() const override
static constexpr auto TID
static float unpackTimeError(uint8_t timeError)
math::Error< dimension >::type CovarianceMatrix
5 parameter covariance matrix
Definition: TrackBase.h:74
void setCaloFraction(float p)
Fraction of Hcal for isolated charged hadrons.
bool longLived() const override
is long lived?
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:38