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  dz_ = 0;
43  if (p4_.load()->Pt() != 0.f) {
44  float pzpt = p4_.load()->Pz() / p4_.load()->Pt();
45  dz_ = vertex_.load()->Z() - pv.Z() - (dxPV * c + dyPV * s) * pzpt;
46  }
47  packedDxy_ = MiniFloatConverter::float32to16(dxy_ * 100);
48  packedDz_ = pvRef.isNonnull() ? MiniFloatConverter::float32to16(dz_ * 100)
49  : int16_t(std::round(dz_ / 40.f * std::numeric_limits<int16_t>::max()));
50  packedDPhi_ = int16_t(std::round(dphi_ / 3.2f * std::numeric_limits<int16_t>::max()));
51  packedDEta_ = MiniFloatConverter::float32to16(deta_);
52  packedDTrkPt_ = MiniFloatConverter::float32to16(dtrkpt_);
53 
54  if (unpackAfterwards) {
55  delete vertex_.exchange(nullptr);
56  unpackVtx();
57  }
58 }
59 
61  float pt = MiniFloatConverter::float16to32(packedPt_);
62  double shift = (pt < 1. ? 0.1 * pt : 0.1 / pt); // shift particle phi to break
63  // degeneracies in angular separations
64  double sign = ((int(pt * 10) % 2 == 0) ? 1 : -1); // introduce a pseudo-random sign of the shift
65  double phi = int16_t(packedPhi_) * 3.2f / std::numeric_limits<int16_t>::max() +
67  auto p4 = std::make_unique<PolarLorentzVector>(pt,
68  int16_t(packedEta_) * 6.0f / std::numeric_limits<int16_t>::max(),
69  phi,
71  auto p4c = std::make_unique<LorentzVector>(*p4);
72  PolarLorentzVector *expectp4 = nullptr;
73  if (p4_.compare_exchange_strong(expectp4, p4.get())) {
74  p4.release();
75  }
76 
77  // p4c_ works as the guard for unpacking so it
78  // must be set last
79  LorentzVector *expectp4c = nullptr;
80  if (p4c_.compare_exchange_strong(expectp4c, p4c.get())) {
81  p4c.release();
82  }
83 }
84 
86  packedCovariance_.dptdpt = packCovarianceElement(m, 0, 0);
87  packedCovariance_.detadeta = packCovarianceElement(m, 1, 1);
88  packedCovariance_.dphidphi = packCovarianceElement(m, 2, 2);
89  packedCovariance_.dxydxy = packCovarianceElement(m, 3, 3);
90  packedCovariance_.dzdz = packCovarianceElement(m, 4, 4);
91  packedCovariance_.dxydz = packCovarianceElement(m, 3, 4);
92  packedCovariance_.dlambdadz = packCovarianceElement(m, 1, 4);
93  packedCovariance_.dphidxy = packCovarianceElement(m, 2, 3);
94  // unpack afterwards
95  if (unpackAfterwards)
96  unpackCovariance();
97 }
98 
100  const CovarianceParameterization &p = covarianceParameterization();
101  if (p.isValid()) {
102  auto m = std::make_unique<reco::TrackBase::CovarianceMatrix>();
103  for (int i = 0; i < 5; i++)
104  for (int j = 0; j < 5; j++) {
105  (*m)(i, j) = 0;
106  }
107  unpackCovarianceElement(*m, packedCovariance_.dptdpt, 0, 0);
108  unpackCovarianceElement(*m, packedCovariance_.detadeta, 1, 1);
109  unpackCovarianceElement(*m, packedCovariance_.dphidphi, 2, 2);
110  unpackCovarianceElement(*m, packedCovariance_.dxydxy, 3, 3);
111  unpackCovarianceElement(*m, packedCovariance_.dzdz, 4, 4);
112  unpackCovarianceElement(*m, packedCovariance_.dxydz, 3, 4);
113  unpackCovarianceElement(*m, packedCovariance_.dlambdadz, 1, 4);
114  unpackCovarianceElement(*m, packedCovariance_.dphidxy, 2, 3);
115 
116  reco::TrackBase::CovarianceMatrix *expected = nullptr;
117  if (m_.compare_exchange_strong(expected, m.get())) {
118  m.release();
119  }
120 
121  } else {
123  << "You do not have a valid track parameters file loaded. "
124  << "Please check that the release version is compatible with your "
125  "input data"
126  << "or avoid accessing track parameter uncertainties. ";
127  }
128 }
129 
131  reco::VertexRef pvRef = vertexRef();
132  dphi_ = int16_t(packedDPhi_) * 3.2f / std::numeric_limits<int16_t>::max(),
133  deta_ = MiniFloatConverter::float16to32(packedDEta_);
134  dtrkpt_ = MiniFloatConverter::float16to32(packedDTrkPt_);
135  dxy_ = MiniFloatConverter::float16to32(packedDxy_) / 100.;
136  dz_ = pvRef.isNonnull() ? MiniFloatConverter::float16to32(packedDz_) / 100.
137  : int16_t(packedDz_) * 40.f / std::numeric_limits<int16_t>::max();
138  Point pv = pvRef.isNonnull() ? pvRef->position() : Point();
139  float phi = p4_.load()->Phi() + dphi_, s = std::sin(phi), c = std::cos(phi);
140  auto vertex = std::make_unique<Point>(pv.X() - dxy_ * s,
141  pv.Y() + dxy_ * c,
142  pv.Z() + dz_); // for our choice of using the PCA to the PV, by definition the
143  // remaining term -(dx*cos(phi) + dy*sin(phi))*(pz/pt) is zero
144 
145  Point *expected = nullptr;
146  if (vertex_.compare_exchange_strong(expected, vertex.get())) {
147  vertex.release();
148  }
149 }
150 
152  delete p4_.load();
153  delete p4c_.load();
154  delete vertex_.load();
155  delete track_.load();
156  delete m_.load();
157 }
158 
159 float pat::PackedCandidate::dxy(const Point &p) const {
160  maybeUnpackBoth();
161  const float phi = float(p4_.load()->Phi()) + dphi_;
162  return -(vertex_.load()->X() - p.X()) * std::sin(phi) + (vertex_.load()->Y() - p.Y()) * std::cos(phi);
163 }
164 float pat::PackedCandidate::dz(const Point &p) const {
165  maybeUnpackBoth();
166  const float phi = float(p4_.load()->Phi()) + dphi_;
167  const float pzpt = deta_ ? std::sinh(etaAtVtx()) : p4_.load()->Pz() / p4_.load()->Pt();
168  return (vertex_.load()->Z() - p.Z()) -
169  ((vertex_.load()->X() - p.X()) * std::cos(phi) + (vertex_.load()->Y() - p.Y()) * std::sin(phi)) * pzpt;
170 }
171 
173  // perform the regular unpacking of the track
174  if (!track_)
175  unpackTrk();
176 
177  //calculate the determinant and verify positivity
178  double det = 0;
179  bool notPosDef = (!(*m_).Sub<AlgebraicSymMatrix22>(0, 0).Det(det) || det < 0) ||
180  (!(*m_).Sub<AlgebraicSymMatrix33>(0, 0).Det(det) || det < 0) ||
181  (!(*m_).Sub<AlgebraicSymMatrix44>(0, 0).Det(det) || det < 0) || (!(*m_).Det(det) || det < 0);
182 
183  if (notPosDef) {
185  //if not positive-definite, alter values to allow for pos-def
186  TMatrixDSym eigenCov(5);
187  for (int i = 0; i < 5; i++) {
188  for (int j = 0; j < 5; j++) {
189  if (edm::isNotFinite((m)(i, j)))
190  eigenCov(i, j) = 1e-6;
191  else
192  eigenCov(i, j) = (m)(i, j);
193  }
194  }
195  TVectorD eigenValues(5);
196  eigenCov.EigenVectors(eigenValues);
197  double minEigenValue = eigenValues.Min();
198  double delta = 1e-6;
199  if (minEigenValue < 0) {
200  for (int i = 0; i < 5; i++)
201  m(i, i) += delta - minEigenValue;
202  }
203 
204  // make a track object with pos def covariance matrix
205  return reco::Track(normalizedChi2_ * (*track_).ndof(),
206  (*track_).ndof(),
207  *vertex_,
208  (*track_).momentum(),
209  (*track_).charge(),
210  m,
213  } else {
214  // just return a copy of the unpacked track
215  return reco::Track(*track_);
216  }
217 }
218 
220  maybeUnpackBoth();
221  math::RhoEtaPhiVector p3(ptTrk(), etaAtVtx(), phiAtVtx());
222  maybeUnpackCovariance();
223  int numberOfStripLayers = stripLayersWithMeasurement(), numberOfPixelLayers = pixelLayersWithMeasurement();
224  int numberOfPixelHits = this->numberOfPixelHits();
225  int numberOfHits = this->numberOfHits();
226 
227  int ndof = numberOfHits + numberOfPixelHits - 5;
228  LostInnerHits innerLost = lostInnerHits();
229 
230  auto track = std::make_unique<reco::Track>(normalizedChi2_ * ndof,
231  ndof,
232  *vertex_,
233  math::XYZVector(p3.x(), p3.y(), p3.z()),
234  charge(),
235  *(m_.load()),
238  int i = 0;
239  if (firstHit_ == 0) { // Backward compatible
240  if (innerLost == validHitInFirstPixelBarrelLayer) {
241  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, 1, 0, TrackingRecHit::valid);
242  i = 1;
243  }
244  } else {
245  track->appendHitPattern(firstHit_, TrackingRecHit::valid);
246  }
247 
248  if (firstHit_ != 0 && reco::HitPattern::pixelHitFilter(firstHit_))
249  i = 1;
250 
251  // add hits to match the number of laters and validHitInFirstPixelBarrelLayer
252  if (innerLost == validHitInFirstPixelBarrelLayer) {
253  // then to encode the number of layers, we add more hits on distinct layers
254  // (B2, B3, B4, F1, ...)
255  for (; i < numberOfPixelLayers; i++) {
256  if (i <= 3) {
257  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, i + 1, 0, TrackingRecHit::valid);
258  } else {
259  track->appendTrackerHitPattern(PixelSubdetector::PixelEndcap, i - 3, 0, TrackingRecHit::valid);
260  }
261  }
262  } else {
263  // to encode the information on the layers, we add one valid hits per layer
264  // but skipping PXB1
265  int iOffset = 0;
266  if (firstHit_ != 0 && reco::HitPattern::pixelHitFilter(firstHit_)) {
267  iOffset = reco::HitPattern::getLayer(firstHit_);
269  iOffset += 3;
270  } else {
271  iOffset = 1;
272  }
273  for (; i < numberOfPixelLayers; i++) {
274  if (i + iOffset <= 2) {
275  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, i + iOffset + 1, 0, TrackingRecHit::valid);
276  } else {
277  track->appendTrackerHitPattern(PixelSubdetector::PixelEndcap, i + iOffset - 3 + 1, 0, TrackingRecHit::valid);
278  }
279  }
280  }
281  // add extra hits (overlaps, etc), all on the first layer with a hit - to
282  // avoid increasing the layer count
283  for (; i < numberOfPixelHits; i++) {
284  if (firstHit_ != 0 && reco::HitPattern::pixelHitFilter(firstHit_)) {
285  track->appendTrackerHitPattern(reco::HitPattern::getSubStructure(firstHit_),
286  reco::HitPattern::getLayer(firstHit_),
287  0,
289  } else {
290  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel,
291  (innerLost == validHitInFirstPixelBarrelLayer ? 1 : 2),
292  0,
294  }
295  }
296  // now start adding strip layers, putting one hit on each layer so that the
297  // hitPattern.stripLayersWithMeasurement works. we don't know what the layers
298  // where, so we just start with TIB (4 layers), then TOB (6 layers), then TEC
299  // (9) and then TID(3), so that we can get a number of valid strip layers up
300  // to 4+6+9+3
301  if (firstHit_ != 0 && reco::HitPattern::stripHitFilter(firstHit_))
302  i += 1;
303  int slOffset = 0;
304  if (firstHit_ != 0 && reco::HitPattern::stripHitFilter(firstHit_)) {
305  slOffset = reco::HitPattern::getLayer(firstHit_) - 1;
307  slOffset += 4;
309  slOffset += 7;
311  slOffset += 13;
312  }
313  for (int sl = slOffset; sl < numberOfStripLayers + slOffset; ++sl, ++i) {
314  if (sl < 4)
315  track->appendTrackerHitPattern(StripSubdetector::TIB, sl + 1, 1, TrackingRecHit::valid);
316  else if (sl < 4 + 3)
317  track->appendTrackerHitPattern(StripSubdetector::TID, (sl - 4) + 1, 1, TrackingRecHit::valid);
318  else if (sl < 7 + 6)
319  track->appendTrackerHitPattern(StripSubdetector::TOB, (sl - 7) + 1, 1, TrackingRecHit::valid);
320  else if (sl < 13 + 9)
321  track->appendTrackerHitPattern(StripSubdetector::TEC, (sl - 13) + 1, 1, TrackingRecHit::valid);
322  else
323  break; // wtf?
324  }
325  // finally we account for extra strip hits beyond the one-per-layer added
326  // above. we put them all on TIB1, to avoid incrementing the number of
327  // layersWithMeasurement.
328  for (; i < numberOfHits; i++) {
329  if (reco::HitPattern::stripHitFilter(firstHit_)) {
330  track->appendTrackerHitPattern(reco::HitPattern::getSubStructure(firstHit_),
331  reco::HitPattern::getLayer(firstHit_),
332  1,
334  } else {
335  track->appendTrackerHitPattern(StripSubdetector::TIB, 1, 1, TrackingRecHit::valid);
336  }
337  }
338 
339  switch (innerLost) {
340  case validHitInFirstPixelBarrelLayer:
341  break;
342  case noLostInnerHits:
343  break;
344  case oneLostInnerHit:
345  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, 1, 0, TrackingRecHit::missing_inner);
346  break;
347  case moreLostInnerHits:
348  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, 1, 0, TrackingRecHit::missing_inner);
349  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, 2, 0, TrackingRecHit::missing_inner);
350  break;
351  };
352 
353  if (trackHighPurity())
354  track->setQuality(reco::TrackBase::highPurity);
355 
356  reco::Track *expected = nullptr;
357  if (track_.compare_exchange_strong(expected, track.get())) {
358  track.release();
359  }
360 }
361 
363 
365  throw cms::Exception("Invalid Reference") << "this Candidate has no master clone reference."
366  << "Can't call masterClone() method.\n";
367 }
368 
369 bool pat::PackedCandidate::hasMasterClone() const { return false; }
370 
371 bool pat::PackedCandidate::hasMasterClonePtr() const { return false; }
372 
374  throw cms::Exception("Invalid Reference") << "this Candidate has no master clone ptr."
375  << "Can't call masterClonePtr() method.\n";
376 }
377 
378 size_t pat::PackedCandidate::numberOfDaughters() const { return 0; }
379 
380 size_t pat::PackedCandidate::numberOfMothers() const { return 0; }
381 
383  return p4() == o.p4() && vertex() == o.vertex() && charge() == o.charge();
384  // return p4() == o.p4() && charge() == o.charge();
385 }
386 
388 
389 const reco::Candidate *pat::PackedCandidate::mother(size_type) const { return nullptr; }
390 
393  << "This Candidate type does not implement daughter(std::string). "
394  << "Please use CompositeCandidate or NamedCompositeCandidate.\n";
395 }
396 
399  << "This Candidate type does not implement daughter(std::string). "
400  << "Please use CompositeCandidate or NamedCompositeCandidate.\n";
401 }
402 
404 
405 double pat::PackedCandidate::vertexChi2() const { return 0; }
406 
407 double pat::PackedCandidate::vertexNdof() const { return 0; }
408 
409 double pat::PackedCandidate::vertexNormalizedChi2() const { return 0; }
410 
413  << "reco::ConcreteCandidate does not implement vertex covariant "
414  "matrix.\n";
415 }
416 
419  << "reco::ConcreteCandidate does not implement vertex covariant "
420  "matrix.\n";
421 }
422 
423 bool pat::PackedCandidate::longLived() const { return false; }
424 
425 bool pat::PackedCandidate::massConstraint() const { return false; }
426 
427 // puppiweight
428 void pat::PackedCandidate::setPuppiWeight(float p, float p_nolep) {
429  // Set both weights at once to avoid misconfigured weights if called in the
430  // wrong order
431  packedPuppiweight_ = std::numeric_limits<uint8_t>::max() * p;
432  packedPuppiweightNoLepDiff_ = std::numeric_limits<int8_t>::max() * (p_nolep - p);
433 }
434 
436  return 1.f * packedPuppiweight_ / std::numeric_limits<uint8_t>::max();
437 }
438 
440  return 1.f * packedPuppiweightNoLepDiff_ / std::numeric_limits<int8_t>::max() +
441  1.f * packedPuppiweight_ / std::numeric_limits<uint8_t>::max();
442 }
443 
445  if (100 * p > std::numeric_limits<uint8_t>::max())
446  rawCaloFraction_ = std::numeric_limits<uint8_t>::max(); // Set to overflow value
447  else
448  rawCaloFraction_ = 100 * p;
449 }
450 
451 void pat::PackedCandidate::setRawHcalFraction(float p) { rawHcalFraction_ = 100 * p; }
452 
453 void pat::PackedCandidate::setCaloFraction(float p) { caloFraction_ = 100 * p; }
454 
455 void pat::PackedCandidate::setHcalFraction(float p) { hcalFraction_ = 100 * p; }
456 
457 void pat::PackedCandidate::setIsIsolatedChargedHadron(bool p) { isIsolatedChargedHadron_ = p; }
458 
459 void pat::PackedCandidate::setDTimeAssociatedPV(float aTime, float aTimeError) {
460  if (aTime == 0 && aTimeError == 0) {
461  packedTime_ = 0;
462  packedTimeError_ = 0;
463  } else if (aTimeError == 0) {
464  packedTimeError_ = 0;
465  packedTime_ = packTimeNoError(aTime);
466  } else {
467  packedTimeError_ = packTimeError(aTimeError);
468  aTimeError = unpackTimeError(packedTimeError_); // for reproducibility
469  packedTime_ = packTimeWithError(aTime, aTimeError);
470  }
471 }
472 
474 uint8_t pat::PackedCandidate::packTimeError(float timeError) {
475  if (timeError <= 0)
476  return 0;
477  // log-scale packing.
478  // for MIN_TIMEERROR = 0.002, EXPO_TIMEERROR = 5:
479  // minimum value 0.002 = 2ps (packed as 1)
480  // maximum value 0.5 ns (packed as 255)
481  // constant *relative* precision of about 2%
482  return std::max<uint8_t>(
483  std::min(std::round(std::ldexp(std::log2(timeError / MIN_TIMEERROR), +EXPO_TIMEERROR)), 255.f), 1);
484 }
485 float pat::PackedCandidate::unpackTimeError(uint8_t timeError) {
486  return timeError > 0 ? MIN_TIMEERROR * std::exp2(std::ldexp(float(timeError), -EXPO_TIMEERROR)) : -1.0f;
487 }
489  if (time == 0)
490  return 0.f;
491  return (time > 0 ? MIN_TIME_NOERROR : -MIN_TIME_NOERROR) *
492  std::exp2(std::ldexp(float(std::abs(time)), -EXPO_TIME_NOERROR));
493 }
495  // encoding in log scale to store times in a large range with few bits.
496  // for MIN_TIME_NOERROR = 0.0002 and EXPO_TIME_NOERROR = 6:
497  // smallest non-zero time = 0.2 ps (encoded as +/-1)
498  // one BX, +/- 12.5 ns, is fully covered with 11 bits (+/- 1023)
499  // 12 bits cover by far any plausible value (+/-2047 corresponds to about
500  // +/- 0.8 ms!) constant *relative* ~1% precision
501  if (std::abs(time) < MIN_TIME_NOERROR)
502  return 0; // prevent underflows
503  float fpacked = std::ldexp(std::log2(std::abs(time / MIN_TIME_NOERROR)), +EXPO_TIME_NOERROR);
504  return (time > 0 ? +1 : -1) * std::min(std::round(fpacked), 2047.f);
505 }
506 float pat::PackedCandidate::unpackTimeWithError(int16_t time, uint8_t timeError) {
507  if (time % 2 == 0) {
508  // no overflow: drop rightmost bit and unpack in units of timeError
509  return std::ldexp(unpackTimeError(timeError), EXPO_TIME_WITHERROR) * float(time / 2);
510  } else {
511  // overflow: drop rightmost bit, unpack using the noError encoding
513  }
514 }
515 int16_t pat::PackedCandidate::packTimeWithError(float time, float timeError) {
516  // Encode in units of timeError * 2^EXPO_TIME_WITHERROR (~1.6% if
517  // EXPO_TIME_WITHERROR = -6) the largest value that can be stored in 14 bits +
518  // sign bit + overflow bit is about 260 sigmas values larger than that will be
519  // stored using the no-timeError packing (with less precision). overflows of
520  // these kinds should happen only for particles that are late arriving,
521  // out-of-time, or mis-reconstructed, as timeError is O(20ps) and the beam
522  // spot witdth is O(200ps)
523  float fpacked = std::round(time / std::ldexp(timeError, EXPO_TIME_WITHERROR));
524  if (std::abs(fpacked) < 16383.f) { // 16383 = (2^14 - 1) = largest absolute
525  // value for a signed 15 bit integer
526  return int16_t(fpacked) * 2; // make it even, and fit in a signed 16 bit int
527  } else {
528  int16_t packed = packTimeNoError(time); // encode
529  return packed * 2 + (time > 0 ? +1 : -1); // make it odd, to signal that there was an overlow
530  }
531 }
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
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:232
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.
std::pair< unsigned int, unsigned int > unpack(cond::Time_t since)
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