CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Friends
pat::PackedCandidate Class Reference

#include <PackedCandidate.h>

Inheritance diagram for pat::PackedCandidate:
reco::Candidate

Classes

struct  PackedCovariance
 

Public Types

typedef reco::CandidateCollection daughters
 collection of daughter candidates More...
 
typedef unsigned int index
 
typedef math::XYZTLorentzVector LorentzVector
 Lorentz vector. More...
 
enum  LostInnerHits { validHitInFirstPixelBarrelLayer = -1, noLostInnerHits = 0, oneLostInnerHit = 1, moreLostInnerHits = 2 }
 Enumerator specifying the. More...
 
typedef math::XYZPoint Point
 point in the space More...
 
typedef math::PtEtaPhiMLorentzVector PolarLorentzVector
 Lorentz vector. More...
 
enum  PVAssoc { NoPV = 0, PVLoose = 1, PVTight = 2, PVUsedInFit = 3 }
 
enum  PVAssociationQuality {
  NotReconstructedPrimary = 0, OtherDeltaZ = 1, CompatibilityBTag = 4, CompatibilityDz = 5,
  UsedInFitLoose = 6, UsedInFitTight = 7
}
 
enum  trackHitShiftsAndMasks { trackPixelHitsMask = 7, trackStripHitsMask = 31, trackStripHitsShift = 3 }
 set impact parameters covariance More...
 
typedef math::XYZVector Vector
 point in the space More...
 
- Public Types inherited from reco::Candidate
enum  { dimension = 3 }
 
enum  { size = dimension * (dimension + 1)/2 }
 matix size More...
 
typedef int Charge
 electric charge type More...
 
typedef candidate::const_iterator const_iterator
 
typedef math::Error< dimension >::type CovarianceMatrix
 covariance error matrix (3x3) More...
 
typedef unsigned int index
 index type More...
 
typedef candidate::iterator iterator
 
typedef math::XYZTLorentzVector LorentzVector
 Lorentz vector. More...
 
typedef math::XYZPoint Point
 point in the space More...
 
typedef math::PtEtaPhiMLorentzVector PolarLorentzVector
 Lorentz vector. More...
 
typedef size_t size_type
 
typedef math::XYZVector Vector
 point in the space More...
 

Public Member Functions

const reco::TrackbestTrack () const override
 return a pointer to the track if present. otherwise, return a null pointer More...
 
Vector boostToCM () const override
 
float caloFraction () const
 Set the fraction of ECAL+HCAL energy over candidate energy. More...
 
int charge () const override
 electric charge More...
 
PackedCandidateclone () const override
 returns a clone of the Candidate object More...
 
int covarianceSchema () const
 
int covarianceVersion () const
 
const reco::Candidatedaughter (size_type) const override
 return daughter at a given position (throws an exception) More...
 
reco::Candidatedaughter (size_type) override
 return daughter at a given position (throws an exception) More...
 
reco::Candidatedaughter (const std::string &s) override
 return daughter with a specified role name More...
 
const reco::Candidatedaughter (const std::string &s) const override
 return daughter with a specified role name More...
 
virtual float dtime (size_t ipv=0) const
 dtime with respect to the PV[ipv] More...
 
virtual float dtimeAssociatedPV () const
 dtime with respect to the PV ref More...
 
virtual float dxy () const
 dxy with respect to the PV ref More...
 
virtual float dxy (const Point &p) const
 dxy with respect to another point More...
 
float dxyError () const override
 uncertainty on dxy More...
 
virtual float dz (size_t ipv=0) const
 dz with respect to the PV[ipv] More...
 
virtual float dz (const Point &p) const
 dz with respect to another point More...
 
virtual float dzAssociatedPV () const
 dz with respect to the PV ref More...
 
float dzError () const override
 uncertainty on dz More...
 
double energy () const override
 energy More...
 
double et () const override
 transverse energy More...
 
double et2 () const override
 transverse energy squared (use this for cuts)! More...
 
double eta () const override
 momentum pseudorapidity More...
 
virtual float etaAtVtx () const
 eta from the track (normally identical to eta()) More...
 
void fillVertexCovariance (CovarianceMatrix &v) const override
 fill SMatrix More...
 
uint16_t firstHit () const
 Return first hit from HitPattern for tracks with high level details. More...
 
const PVAssoc fromPV (size_t ipv=0) const
 
bool hasMasterClone () const override
 
bool hasMasterClonePtr () const override
 
bool hasTrackDetails () const
 Return true if a bestTrack can be extracted from this Candidate. More...
 
float hcalFraction () const
 
bool isCaloMuon () const override
 
bool isConvertedPhoton () const override
 
bool isElectron () const override
 
bool isGlobalMuon () const override
 
bool isGoodEgamma () const
 
bool isIsolatedChargedHadron () const
 
bool isJet () const override
 
bool isMuon () const override
 
bool isPhoton () const override
 
bool isStandAloneMuon () const override
 
bool isTrackerMuon () const override
 
bool longLived () const override
 is long lived? More...
 
LostInnerHits lostInnerHits () const
 
double mass () const override
 mass More...
 
bool massConstraint () const override
 do mass constraint? More...
 
double massSqr () const override
 mass squared More...
 
const reco::CandidateBaseRefmasterClone () const override
 
const reco::CandidatePtrmasterClonePtr () const override
 
template<typename Ref >
Ref masterRef () const
 cast master clone reference to a concrete type More...
 
Vector momentum () const override
 spatial momentum vector More...
 
const reco::Candidatemother (size_type) const override
 return mother at a given position (throws an exception) More...
 
double mt () const override
 transverse mass More...
 
double mtSqr () const override
 transverse mass squared More...
 
size_t numberOfDaughters () const override
 number of daughters More...
 
int numberOfHits () const
 
size_t numberOfMothers () const override
 number of mothers More...
 
int numberOfPixelHits () const
 
size_t numberOfSourceCandidatePtrs () const override
 
PackedCandidateoperator= (const PackedCandidate &iOther)
 
PackedCandidateoperator= (PackedCandidate &&iOther)
 
double p () const override
 magnitude of momentum vector More...
 
const LorentzVectorp4 () const override
 four-momentum Lorentz vecto r More...
 
 PackedCandidate ()
 default constructor More...
 
 PackedCandidate (const reco::Candidate &c, const reco::VertexRefProd &pvRefProd, reco::VertexRef::key_type pvRefKey)
 
 PackedCandidate (const PolarLorentzVector &p4, const Point &vtx, float trkPt, float etaAtVtx, float phiAtVtx, int pdgId, const reco::VertexRefProd &pvRefProd, reco::VertexRef::key_type pvRefKey)
 
 PackedCandidate (const LorentzVector &p4, const Point &vtx, float trkPt, float etaAtVtx, float phiAtVtx, int pdgId, const reco::VertexRefProd &pvRefProd, reco::VertexRef::key_type pvRefKey)
 
 PackedCandidate (const PackedCandidate &iOther)
 
 PackedCandidate (PackedCandidate &&iOther)
 
int pdgId () const override
 PDG identifier. More...
 
double phi () const override
 momentum azimuthal angle More...
 
virtual float phiAtVtx () const
 momentum azimuthal angle from the track (normally identical to phi()) More...
 
int pixelLayersWithMeasurement () const
 
const PolarLorentzVectorpolarP4 () const override
 four-momentum Lorentz vector More...
 
virtual const reco::TrackpseudoTrack () const
 
double pt () const override
 transverse momentum More...
 
virtual double ptTrk () const
 pt from the track (normally identical to pt()) More...
 
float puppiWeight () const
 
float puppiWeightNoLep () const
 Weight from full PUPPI. More...
 
const PVAssociationQuality pvAssociationQuality () const
 
double px () const override
 x coordinate of momentum vector More...
 
double py () const override
 y coordinate of momentum vector More...
 
double pz () const override
 z coordinate of momentum vector More...
 
double rapidity () const override
 rapidity More...
 
float rawCaloFraction () const
 
float rawHcalFraction () const
 Set the fraction of Hcal needed isolated charged hadrons. More...
 
void setAssociationQuality (PVAssociationQuality q)
 
void setCaloFraction (float p)
 Fraction of Hcal for isolated charged hadrons. More...
 
void setCharge (int charge) override
 set electric charge More...
 
virtual void setCovarianceVersion (int v)
 
void setDTimeAssociatedPV (float aTime, float aTimeError=0)
 set time measurement More...
 
void setFirstHit (uint16_t pattern)
 Set first hit from HitPattern. More...
 
void setGoodEgamma (bool isGoodEgamma=true)
 
void setHcalFraction (float p)
 Fraction of ECAL+HCAL energy over candidate energy. More...
 
virtual void setHits (const reco::Track &tk)
 
void setIsIsolatedChargedHadron (bool p)
 Fraction of Hcal for HF, neutral hadrons, and charged particles. More...
 
void setLongLived () override
 set long lived flag More...
 
void setLostInnerHits (LostInnerHits hits)
 
void setMass (double m) override
 set particle mass More...
 
void setMassConstraint () override
 set mass constraint flag More...
 
void setMuonID (bool isStandAlone, bool isGlobal)
 
void setP4 (const LorentzVector &p4) override
 set 4-momentum More...
 
void setP4 (const PolarLorentzVector &p4) override
 set 4-momentum More...
 
void setPdgId (int pdgId) override
 
void setPuppiWeight (float p, float p_nolep=0.0)
 
void setPz (double pz) override
 
void setRawCaloFraction (float p)
 Weight from PUPPI removing leptons. More...
 
void setRawHcalFraction (float p)
 Raw ECAL+HCAL energy over candidate energy for isolated charged hadrons. More...
 
void setStatus (int status) override
 set status word More...
 
void setThreeCharge (int threecharge) override
 set electric charge More...
 
void setTime (float aTime, float aTimeError=0)
 set time measurement More...
 
void setTrackHighPurity (bool highPurity)
 set to true if the track had the highPurity quality bit More...
 
virtual void setTrackProperties (const reco::Track &tk, const reco::Track::CovarianceMatrix &covariance, int quality, int covarianceVersion)
 
virtual void setTrackProperties (const reco::Track &tk, int quality, int covarianceVersion)
 
void setVertex (const Point &vertex) override
 set vertex More...
 
reco::CandidatePtr sourceCandidatePtr (size_type i) const override
 
int status () const override
 status word More...
 
int stripLayersWithMeasurement () const
 
double theta () const override
 momentum polar angle More...
 
int threeCharge () const override
 electric charge More...
 
virtual float time () const
 time (wrt nominal zero of the collision) More...
 
virtual float timeError () const
 time measurement uncertainty (-1 if not available) More...
 
int trackerLayersWithMeasurement () const
 
bool trackHighPurity () const
 true if the track had the highPurity quality bit More...
 
const Pointvertex () const override
 vertex position More...
 
double vertexChi2 () const override
 chi-squares More...
 
double vertexCovariance (int i, int j) const override
 (i, j)-th element of error matrix, i, j = 0, ... 2 More...
 
CovarianceMatrix vertexCovariance () const override
 return SMatrix More...
 
double vertexNdof () const override
 
double vertexNormalizedChi2 () const override
 chi-squared divided by n.d.o.f. More...
 
const reco::VertexRef vertexRef () const
 
double vx () const override
 x coordinate of vertex position More...
 
double vy () const override
 y coordinate of vertex position More...
 
double vz () const override
 z coordinate of vertex position More...
 
double y () const override
 rapidity More...
 
 ~PackedCandidate () override
 destructor More...
 
- Public Member Functions inherited from reco::Candidate
const_iterator begin () const
 first daughter const_iterator More...
 
iterator begin ()
 first daughter iterator More...
 
 Candidate ()
 default constructor More...
 
const_iterator end () const
 last daughter const_iterator More...
 
iterator end ()
 last daughter iterator More...
 
template<typename T >
T get () const
 get a component More...
 
template<typename T , typename Tag >
T get () const
 get a component More...
 
template<typename T >
T get (size_type i) const
 get a component More...
 
template<typename T , typename Tag >
T get (size_type i) const
 get a component More...
 
template<typename Ref >
Ref masterRef () const
 cast master clone reference to a concrete type More...
 
template<typename T >
size_type numberOf () const
 number of components More...
 
template<typename T , typename Tag >
size_type numberOf () const
 number of components More...
 
virtual void setP4 (const PolarLorentzVector &p4)=0
 set 4-momentum More...
 
virtual void setSourceCandidatePtr (const CandidatePtr &ptr)
 Set the ptr to the source Candidate. More...
 
virtual ~Candidate ()
 destructor More...
 

Public Attributes

uint16_t firstHit_
 

Static Public Attributes

static const unsigned int longLivedTag = 0
 long lived flag More...
 
static const unsigned int massConstraintTag = 0
 do mass constraint flag More...
 

Protected Types

enum  qualityFlagsShiftsAndMasks {
  assignmentQualityMask = 0x7, assignmentQualityShift = 0, trackHighPurityMask = 0x8, trackHighPurityShift = 3,
  lostInnerHitsMask = 0x30, lostInnerHitsShift = 4, muonFlagsMask = 0x0600, muonFlagsShift = 9,
  egammaFlagsMask = 0x0800, egammaFlagsShift = 11
}
 

Protected Member Functions

const CovarianceParameterizationcovarianceParameterization () const
 
void maybeUnpackBoth () const
 
void maybeUnpackCovariance () const
 
void maybeUnpackTrack () const
 
bool overlap (const reco::Candidate &) const override
 check overlap with another Candidate More...
 
void pack (bool unpackAfterwards=true)
 
void packBoth ()
 
void packCovariance (const reco::TrackBase::CovarianceMatrix &m, bool unpackAfterwards=true)
 
void packVtx (bool unpackAfterwards=true)
 
void unpack () const
 
void unpackCovariance () const
 
void unpackTrk () const
 
void unpackVtx () const
 

Static Protected Member Functions

static uint8_t packTimeError (float timeError)
 static to allow unit testing More...
 
static int16_t packTimeNoError (float time)
 
static int16_t packTimeWithError (float time, float timeError)
 
static float unpackTimeError (uint8_t timeError)
 
static float unpackTimeNoError (int16_t time)
 
static float unpackTimeWithError (int16_t time, uint8_t timeError)
 

Protected Attributes

uint8_t caloFraction_
 
uint16_t covarianceSchema_
 
uint16_t covarianceVersion_
 
float deta_
 
float dphi_
 
float dtrkpt_
 
float dxy_
 
float dz_
 
int8_t hcalFraction_
 
bool isIsolatedChargedHadron_
 
std::atomic< reco::TrackBase::CovarianceMatrix * > m_
 IP covariance. More...
 
uint8_t normalizedChi2_
 track quality information More...
 
std::atomic< PolarLorentzVector * > p4_
 the four vector More...
 
std::atomic< LorentzVector * > p4c_
 
PackedCovariance packedCovariance_
 
uint16_t packedDEta_
 
uint16_t packedDPhi_
 
uint16_t packedDTrkPt_
 
uint16_t packedDxy_
 
uint16_t packedDz_
 
uint16_t packedEta_
 
uint8_t packedHits_
 
uint8_t packedLayers_
 
uint16_t packedM_
 
uint16_t packedPhi_
 
uint16_t packedPt_
 
uint8_t packedPuppiweight_
 
int8_t packedPuppiweightNoLepDiff_
 
int16_t packedTime_
 
uint8_t packedTimeError_
 
int pdgId_
 PDG identifier. More...
 
reco::VertexRef::key_type pvRefKey_
 
reco::VertexRefProd pvRefProd_
 Use these to build a Ref to primary vertex. More...
 
uint16_t qualityFlags_
 
uint8_t rawCaloFraction_
 
int8_t rawHcalFraction_
 
std::atomic< reco::Track * > track_
 reco::Track More...
 
std::atomic< Point * > vertex_
 vertex position More...
 

Static Protected Attributes

static std::once_flag covariance_load_flag
 
static CovarianceParameterization covarianceParameterization_
 
static int EXPO_TIME_NOERROR
 
static int EXPO_TIME_WITHERROR
 
static int EXPO_TIMEERROR
 
static float kMinDEtaToStore_ = 0.001
 
static float kMinDTrkPtToStore_ = 0.001
 
static float MIN_TIME_NOERROR
 
static float MIN_TIMEERROR
 

Private Member Functions

uint16_t packCovarianceElement (const reco::TrackBase::CovarianceMatrix &m, int i, int j) const
 
void unpackCovarianceElement (reco::TrackBase::CovarianceMatrix &m, uint16_t packed, int i, int j) const
 

Friends

class ::OverlapChecker
 
class ::testPackedCandidate
 
template<typename , typename , typename >
struct component
 
class ShallowCloneCandidate
 
class ShallowClonePtrCandidate
 

Detailed Description

Definition at line 22 of file PackedCandidate.h.

Member Typedef Documentation

collection of daughter candidates

Definition at line 25 of file PackedCandidate.h.

typedef unsigned int pat::PackedCandidate::index

Definition at line 35 of file PackedCandidate.h.

Lorentz vector.

Definition at line 27 of file PackedCandidate.h.

point in the space

Definition at line 31 of file PackedCandidate.h.

Lorentz vector.

Definition at line 29 of file PackedCandidate.h.

point in the space

Definition at line 33 of file PackedCandidate.h.

Member Enumeration Documentation

Enumerator specifying the.

Enumerator
validHitInFirstPixelBarrelLayer 
noLostInnerHits 
oneLostInnerHit 
moreLostInnerHits 

Definition at line 737 of file PackedCandidate.h.

This refers to the association to PV=ipv. >=PVLoose corresponds to JME definition, >=PVTight to isolation definition

Enumerator
NoPV 
PVLoose 
PVTight 
PVUsedInFit 

Definition at line 632 of file PackedCandidate.h.

The following contains information about how the association to the PV, given in vertexRef, is obtained.

Enumerator
NotReconstructedPrimary 
OtherDeltaZ 
CompatibilityBTag 
CompatibilityDz 
UsedInFitLoose 
UsedInFitTight 

Definition at line 651 of file PackedCandidate.h.

Enumerator
assignmentQualityMask 
assignmentQualityShift 
trackHighPurityMask 
trackHighPurityShift 
lostInnerHitsMask 
lostInnerHitsShift 
muonFlagsMask 
muonFlagsShift 
egammaFlagsMask 
egammaFlagsShift 

Definition at line 1058 of file PackedCandidate.h.

set impact parameters covariance

Enumerator
trackPixelHitsMask 
trackStripHitsMask 
trackStripHitsShift 

Definition at line 531 of file PackedCandidate.h.

Constructor & Destructor Documentation

pat::PackedCandidate::PackedCandidate ( )
inline

default constructor

Definition at line 37 of file PackedCandidate.h.

Referenced by clone().

38  : packedPt_(0), packedEta_(0), packedPhi_(0), packedM_(0), packedDxy_(0),
44  p4_(new PolarLorentzVector(0, 0, 0, 0)),
45  p4c_(new LorentzVector(0, 0, 0, 0)), vertex_(new Point(0, 0, 0)),
46  dphi_(0), deta_(0), dtrkpt_(0), track_(nullptr), pdgId_(0),
reco::VertexRef::key_type pvRefKey_
std::atomic< LorentzVector * > p4c_
math::XYZPoint Point
point in the space
PackedCovariance packedCovariance_
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
math::XYZTLorentzVector LorentzVector
Lorentz vector.
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< Point * > vertex_
vertex position
static key_type invalidKey()
Definition: Ref.h:171
std::atomic< reco::Track * > track_
reco::Track
std::atomic< reco::TrackBase::CovarianceMatrix * > m_
IP covariance.
uint8_t normalizedChi2_
track quality information
int pdgId_
PDG identifier.
pat::PackedCandidate::PackedCandidate ( const reco::Candidate c,
const reco::VertexRefProd pvRefProd,
reco::VertexRef::key_type  pvRefKey 
)
inlineexplicit

Definition at line 51 of file PackedCandidate.h.

References packBoth().

58  p4_(new PolarLorentzVector(c.pt(), c.eta(), c.phi(), c.mass())),
59  p4c_(new LorentzVector(*p4_)), vertex_(new Point(c.vertex())), dphi_(0),
60  deta_(0), dtrkpt_(0), track_(nullptr), pdgId_(c.pdgId()),
61  qualityFlags_(0), pvRefProd_(pvRefProd), pvRefKey_(pvRefKey),
62  m_(nullptr), packedHits_(0), packedLayers_(0), normalizedChi2_(0),
64  packBoth();
65  }
reco::VertexRef::key_type pvRefKey_
std::atomic< LorentzVector * > p4c_
math::XYZPoint Point
point in the space
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
math::XYZTLorentzVector LorentzVector
Lorentz vector.
virtual int pdgId() const =0
PDG identifier.
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< Point * > vertex_
vertex position
std::atomic< reco::Track * > track_
reco::Track
std::atomic< reco::TrackBase::CovarianceMatrix * > m_
IP covariance.
uint8_t normalizedChi2_
track quality information
virtual double eta() const =0
momentum pseudorapidity
virtual double pt() const =0
transverse momentum
virtual double mass() const =0
mass
int pdgId_
PDG identifier.
virtual const Point & vertex() const =0
vertex position
virtual double phi() const =0
momentum azimuthal angle
reco::VertexRefProd pvRefProd_
Use these to build a Ref to primary vertex.
pat::PackedCandidate::PackedCandidate ( const PolarLorentzVector p4,
const Point vtx,
float  trkPt,
float  etaAtVtx,
float  phiAtVtx,
int  pdgId,
const reco::VertexRefProd pvRefProd,
reco::VertexRef::key_type  pvRefKey 
)
inlineexplicit

Definition at line 67 of file PackedCandidate.h.

References packBoth().

75  p4c_(new LorentzVector(*p4_)), vertex_(new Point(vtx)),
76  dphi_(reco::deltaPhi(phiAtVtx, p4_.load()->phi())),
77  deta_(std::abs(etaAtVtx - p4_.load()->eta()) >= kMinDEtaToStore_
78  ? etaAtVtx - p4_.load()->eta()
79  : 0.),
80  dtrkpt_(std::abs(trkPt - p4_.load()->pt()) >= kMinDTrkPtToStore_
81  ? trkPt - p4_.load()->pt()
82  : 0.),
83  track_(nullptr), pdgId_(pdgId), qualityFlags_(0), pvRefProd_(pvRefProd),
84  pvRefKey_(pvRefKey), m_(nullptr), packedHits_(0), packedLayers_(0),
86  firstHit_(0) {
87  packBoth();
88  }
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:22
virtual float etaAtVtx() const
eta from the track (normally identical to eta())
int pdgId() const override
PDG identifier.
reco::VertexRef::key_type pvRefKey_
std::atomic< LorentzVector * > p4c_
const LorentzVector & p4() const override
four-momentum Lorentz vecto r
math::XYZPoint Point
point in the space
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
math::XYZTLorentzVector LorentzVector
Lorentz vector.
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< Point * > vertex_
vertex position
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::atomic< reco::Track * > track_
reco::Track
std::atomic< reco::TrackBase::CovarianceMatrix * > m_
IP covariance.
uint8_t normalizedChi2_
track quality information
static float kMinDEtaToStore_
virtual float phiAtVtx() const
momentum azimuthal angle from the track (normally identical to phi())
int pdgId_
PDG identifier.
static float kMinDTrkPtToStore_
reco::VertexRefProd pvRefProd_
Use these to build a Ref to primary vertex.
pat::PackedCandidate::PackedCandidate ( const LorentzVector p4,
const Point vtx,
float  trkPt,
float  etaAtVtx,
float  phiAtVtx,
int  pdgId,
const reco::VertexRefProd pvRefProd,
reco::VertexRef::key_type  pvRefKey 
)
inlineexplicit

Definition at line 90 of file PackedCandidate.h.

References packBoth().

98  p4_(new PolarLorentzVector(p4.Pt(), p4.Eta(), p4.Phi(), p4.M())),
99  p4c_(new LorentzVector(p4)), vertex_(new Point(vtx)),
100  dphi_(reco::deltaPhi(phiAtVtx, p4_.load()->phi())),
101  deta_(std::abs(etaAtVtx - p4_.load()->eta()) >= kMinDEtaToStore_
102  ? etaAtVtx - p4_.load()->eta()
103  : 0.),
104  dtrkpt_(std::abs(trkPt - p4_.load()->pt()) >= kMinDTrkPtToStore_
105  ? trkPt - p4_.load()->pt()
106  : 0.),
107  track_(nullptr), pdgId_(pdgId), qualityFlags_(0), pvRefProd_(pvRefProd),
108  pvRefKey_(pvRefKey), m_(nullptr), packedHits_(0), packedLayers_(0),
110  firstHit_(0) {
111  packBoth();
112  }
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:22
virtual float etaAtVtx() const
eta from the track (normally identical to eta())
int pdgId() const override
PDG identifier.
reco::VertexRef::key_type pvRefKey_
std::atomic< LorentzVector * > p4c_
const LorentzVector & p4() const override
four-momentum Lorentz vecto r
math::XYZPoint Point
point in the space
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
math::XYZTLorentzVector LorentzVector
Lorentz vector.
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< Point * > vertex_
vertex position
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::atomic< reco::Track * > track_
reco::Track
std::atomic< reco::TrackBase::CovarianceMatrix * > m_
IP covariance.
uint8_t normalizedChi2_
track quality information
static float kMinDEtaToStore_
virtual float phiAtVtx() const
momentum azimuthal angle from the track (normally identical to phi())
int pdgId_
PDG identifier.
static float kMinDTrkPtToStore_
reco::VertexRefProd pvRefProd_
Use these to build a Ref to primary vertex.
pat::PackedCandidate::PackedCandidate ( const PackedCandidate iOther)
inline

Definition at line 114 of file PackedCandidate.h.

115  : packedPt_(iOther.packedPt_), packedEta_(iOther.packedEta_),
116  packedPhi_(iOther.packedPhi_), packedM_(iOther.packedM_),
117  packedDxy_(iOther.packedDxy_), packedDz_(iOther.packedDz_),
118  packedDPhi_(iOther.packedDPhi_), packedDEta_(iOther.packedDEta_),
119  packedDTrkPt_(iOther.packedDTrkPt_),
120  packedCovariance_(iOther.packedCovariance_),
121  packedPuppiweight_(iOther.packedPuppiweight_),
122  packedPuppiweightNoLepDiff_(iOther.packedPuppiweightNoLepDiff_),
123  rawCaloFraction_(iOther.rawCaloFraction_),
124  rawHcalFraction_(iOther.rawHcalFraction_),
125  caloFraction_(iOther.caloFraction_),
126  hcalFraction_(iOther.hcalFraction_), packedTime_(iOther.packedTime_),
127  packedTimeError_(iOther.packedTimeError_),
128  isIsolatedChargedHadron_(iOther.isIsolatedChargedHadron_),
129  // Need to trigger unpacking in iOther
130  p4_(new PolarLorentzVector(iOther.polarP4())),
131  p4c_(new LorentzVector(iOther.p4())),
132  vertex_(new Point(iOther.vertex())), dxy_(iOther.dxy_), dz_(iOther.dz_),
133  dphi_(iOther.dphi_), deta_(iOther.deta_), dtrkpt_(iOther.dtrkpt_),
134  track_(iOther.track_ ? new reco::Track(*iOther.track_) : nullptr),
135  pdgId_(iOther.pdgId_), qualityFlags_(iOther.qualityFlags_),
136  pvRefProd_(iOther.pvRefProd_), pvRefKey_(iOther.pvRefKey_),
137  m_(iOther.m_ ? new reco::TrackBase::CovarianceMatrix(*iOther.m_)
138  : nullptr),
139  packedHits_(iOther.packedHits_), packedLayers_(iOther.packedLayers_),
140  normalizedChi2_(iOther.normalizedChi2_),
141  covarianceVersion_(iOther.covarianceVersion_),
142  covarianceSchema_(iOther.covarianceSchema_),
143  firstHit_(iOther.firstHit_) {}
reco::VertexRef::key_type pvRefKey_
std::atomic< LorentzVector * > p4c_
math::XYZPoint Point
point in the space
PackedCovariance packedCovariance_
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
math::XYZTLorentzVector LorentzVector
Lorentz vector.
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< Point * > vertex_
vertex position
std::atomic< reco::Track * > track_
reco::Track
std::atomic< reco::TrackBase::CovarianceMatrix * > m_
IP covariance.
uint8_t normalizedChi2_
track quality information
int pdgId_
PDG identifier.
math::Error< dimension >::type CovarianceMatrix
5 parameter covariance matrix
Definition: TrackBase.h:77
reco::VertexRefProd pvRefProd_
Use these to build a Ref to primary vertex.
pat::PackedCandidate::PackedCandidate ( PackedCandidate &&  iOther)
inline

Definition at line 145 of file PackedCandidate.h.

146  : packedPt_(iOther.packedPt_), packedEta_(iOther.packedEta_),
147  packedPhi_(iOther.packedPhi_), packedM_(iOther.packedM_),
148  packedDxy_(iOther.packedDxy_), packedDz_(iOther.packedDz_),
149  packedDPhi_(iOther.packedDPhi_), packedDEta_(iOther.packedDEta_),
150  packedDTrkPt_(iOther.packedDTrkPt_),
151  packedCovariance_(iOther.packedCovariance_),
152  packedPuppiweight_(iOther.packedPuppiweight_),
153  packedPuppiweightNoLepDiff_(iOther.packedPuppiweightNoLepDiff_),
154  rawCaloFraction_(iOther.rawCaloFraction_),
155  rawHcalFraction_(iOther.rawHcalFraction_),
156  caloFraction_(iOther.caloFraction_),
157  hcalFraction_(iOther.hcalFraction_), packedTime_(iOther.packedTime_),
158  packedTimeError_(iOther.packedTimeError_),
159  isIsolatedChargedHadron_(iOther.isIsolatedChargedHadron_),
160  p4_(iOther.p4_.exchange(nullptr)), p4c_(iOther.p4c_.exchange(nullptr)),
161  vertex_(iOther.vertex_.exchange(nullptr)), dxy_(iOther.dxy_),
162  dz_(iOther.dz_), dphi_(iOther.dphi_), deta_(iOther.deta_),
163  dtrkpt_(iOther.dtrkpt_), track_(iOther.track_.exchange(nullptr)),
164  pdgId_(iOther.pdgId_), qualityFlags_(iOther.qualityFlags_),
165  pvRefProd_(std::move(iOther.pvRefProd_)), pvRefKey_(iOther.pvRefKey_),
166  m_(iOther.m_.exchange(nullptr)), packedHits_(iOther.packedHits_),
167  packedLayers_(iOther.packedLayers_),
168  normalizedChi2_(iOther.normalizedChi2_),
169  covarianceVersion_(iOther.covarianceVersion_),
170  covarianceSchema_(iOther.covarianceSchema_),
171  firstHit_(iOther.firstHit_) {}
reco::VertexRef::key_type pvRefKey_
std::atomic< LorentzVector * > p4c_
PackedCovariance packedCovariance_
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< Point * > vertex_
vertex position
std::atomic< reco::Track * > track_
reco::Track
std::atomic< reco::TrackBase::CovarianceMatrix * > m_
IP covariance.
uint8_t normalizedChi2_
track quality information
int pdgId_
PDG identifier.
def move(src, dest)
Definition: eostools.py:511
reco::VertexRefProd pvRefProd_
Use these to build a Ref to primary vertex.
pat::PackedCandidate::~PackedCandidate ( )
override

destructor

Definition at line 156 of file PackedCandidate.cc.

Referenced by operator=().

156  {
157  delete p4_.load();
158  delete p4c_.load();
159  delete vertex_.load();
160  delete track_.load();
161  delete m_.load();
162 }
std::atomic< LorentzVector * > p4c_
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< Point * > vertex_
vertex position
std::atomic< reco::Track * > track_
reco::Track
std::atomic< reco::TrackBase::CovarianceMatrix * > m_
IP covariance.

Member Function Documentation

const reco::Track* pat::PackedCandidate::bestTrack ( ) const
inlineoverridevirtual

return a pointer to the track if present. otherwise, return a null pointer

Reimplemented from reco::Candidate.

Definition at line 713 of file PackedCandidate.h.

References maybeUnpackTrack(), packedHits_, packedLayers_, and track_.

Referenced by reco::tau::getTrackFromChargedHadron(), reco::tau::PFRecoTauChargedHadronFromGenericTrackPlugin< TrackClass >::getTrackPtError(), btagbtvdeep::packedCandidateToFeatures(), Muon.Muon::ptErr(), and PFTau3ProngReco::~PFTau3ProngReco().

713  {
714  if (packedHits_ != 0 || packedLayers_ != 0) {
716  return track_.load();
717  } else
718  return nullptr;
719  }
std::atomic< reco::Track * > track_
reco::Track
void maybeUnpackTrack() const
Vector pat::PackedCandidate::boostToCM ( ) const
inlineoverridevirtual

boost vector to boost a Lorentz vector to the particle center of mass system

Implements reco::Candidate.

Definition at line 365 of file PackedCandidate.h.

References p4c_, and unpack().

365  {
366  if (!p4c_)
367  unpack();
368  return p4c_.load()->BoostToCM();
369  }
std::atomic< LorentzVector * > p4c_
float pat::PackedCandidate::caloFraction ( ) const
inline

Set the fraction of ECAL+HCAL energy over candidate energy.

Definition at line 876 of file PackedCandidate.h.

References caloFraction_, hcalFraction(), hcalFraction_, isIsolatedChargedHadron(), isIsolatedChargedHadron_, setHcalFraction(), and setIsIsolatedChargedHadron().

876  {
877  return (caloFraction_ / 100.);
878  }
int pat::PackedCandidate::charge ( ) const
inlineoverridevirtual

electric charge

Implements reco::Candidate.

Definition at line 323 of file PackedCandidate.h.

References funct::abs(), and pdgId_.

Referenced by pat::PATPackedCandidateProducer::candsOrdering(), reco::tau::PFRecoTauChargedHadronFromGenericTrackPlugin< TrackClass >::filterTrack(), DPFIsolation::getPredictions(), pat::PATTrackAndVertexUnpacker::produce(), pat::PATIsolatedTrackProducer::produce(), and threeCharge().

323  {
324  switch (abs(pdgId_)) {
325  case 211:
326  return (pdgId_ > 0) - (pdgId_ < 0);
327  case 11:
328  return (-1) * (pdgId_ > 0) + (pdgId_ < 0); // e
329  case 13:
330  return (-1) * (pdgId_ > 0) + (pdgId_ < 0); // mu
331  case 15:
332  return (-1) * (pdgId_ > 0) + (pdgId_ < 0); // tau
333  case 24:
334  return (pdgId_ > 0) - (pdgId_ < 0); // W
335  default:
336  return 0; // FIXME: charge is not defined
337  }
338  }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int pdgId_
PDG identifier.
PackedCandidate* pat::PackedCandidate::clone ( void  ) const
inlineoverridevirtual

returns a clone of the Candidate object

Implements reco::Candidate.

Definition at line 795 of file PackedCandidate.h.

References mps_fire::i, PackedCandidate(), vertexChi2(), vertexCovariance(), vertexNdof(), and vertexNormalizedChi2().

795 { return new PackedCandidate(*this); }
PackedCandidate()
default constructor
const CovarianceParameterization& pat::PackedCandidate::covarianceParameterization ( ) const
inlineprotected

Definition at line 1034 of file PackedCandidate.h.

References covarianceParameterization_, covarianceVersion_, Exception, hasTrackDetails(), edm::errors::InvalidReference, overlap(), and edm::errors::UnimplementedFeature.

Referenced by packCovarianceElement(), and unpackCovarianceElement().

1034  {
1035  if (!hasTrackDetails())
1037  "Trying to access covariance matrix for a "
1038  "PackedCandidate for which it's not available. "
1039  "Check hasTrackDetails() before!\n");
1040  std::call_once(covariance_load_flag,
1041  [](int v) { covarianceParameterization_.load(v); },
1045  << "Attempting to load multiple covariance version in same process. "
1046  "This is not supported.";
1047  }
1049  }
static CovarianceParameterization covarianceParameterization_
bool hasTrackDetails() const
Return true if a bestTrack can be extracted from this Candidate.
static std::once_flag covariance_load_flag
int pat::PackedCandidate::covarianceSchema ( ) const
inline

Definition at line 601 of file PackedCandidate.h.

References covarianceSchema_.

Referenced by pat::PATPackedCandidateProducer::candsOrdering().

601 { return covarianceSchema_; }
int pat::PackedCandidate::covarianceVersion ( ) const
inline

Definition at line 600 of file PackedCandidate.h.

References covarianceVersion_.

Referenced by setTrackProperties().

600 { return covarianceVersion_; }
const reco::Candidate * pat::PackedCandidate::daughter ( size_type  ) const
overridevirtual

return daughter at a given position (throws an exception)

Implements reco::Candidate.

Definition at line 362 of file PackedCandidate.cc.

Referenced by operator=().

362  {
363  return nullptr;
364 }
reco::Candidate * pat::PackedCandidate::daughter ( size_type  )
overridevirtual

return daughter at a given position (throws an exception)

Implements reco::Candidate.

Definition at line 383 of file PackedCandidate.cc.

383 { return nullptr; }
reco::Candidate * pat::PackedCandidate::daughter ( const std::string &  s)
overridevirtual

return daughter with a specified role name

Implements reco::Candidate.

Definition at line 377 of file PackedCandidate.cc.

References Exception, and edm::errors::UnimplementedFeature.

377  {
379  << "This Candidate type does not implement daughter(std::string). "
380  << "Please use CompositeCandidate or NamedCompositeCandidate.\n";
381 }
const reco::Candidate * pat::PackedCandidate::daughter ( const std::string &  s) const
overridevirtual

return daughter with a specified role name

Implements reco::Candidate.

Definition at line 371 of file PackedCandidate.cc.

References Exception, and edm::errors::UnimplementedFeature.

371  {
373  << "This Candidate type does not implement daughter(std::string). "
374  << "Please use CompositeCandidate or NamedCompositeCandidate.\n";
375 }
virtual float pat::PackedCandidate::dtime ( size_t  ipv = 0) const
inlinevirtual

dtime with respect to the PV[ipv]

Definition at line 914 of file PackedCandidate.h.

References dtimeAssociatedPV(), and pvRefKey_.

914  {
915  return dtimeAssociatedPV() + (*pvRefProd_)[pvRefKey_].t() -
916  (*pvRefProd_)[ipv].t();
917  }
reco::VertexRef::key_type pvRefKey_
virtual float dtimeAssociatedPV() const
dtime with respect to the PV ref
virtual float pat::PackedCandidate::dtimeAssociatedPV ( ) const
inlinevirtual

dtime with respect to the PV ref

Definition at line 919 of file PackedCandidate.h.

References packedTime_, packedTimeError_, unpackTimeNoError(), and unpackTimeWithError().

Referenced by dtime(), and time().

919  {
920  if (packedTime_ == 0)
921  return 0.f;
922  if (packedTimeError_ > 0)
924  else
926  }
static float unpackTimeNoError(int16_t time)
static float unpackTimeWithError(int16_t time, uint8_t timeError)
virtual float pat::PackedCandidate::dxy ( ) const
inlinevirtual
float pat::PackedCandidate::dxy ( const Point p) const
virtual

dxy with respect to another point

Definition at line 164 of file PackedCandidate.cc.

References funct::cos(), objects.autophobj::float, phi, and funct::sin().

Referenced by Electron.Electron::cutBasedId(), and ntupleDataFormat.Track::dxyPull().

164  {
165  maybeUnpackBoth();
166  const float phi = float(p4_.load()->Phi()) + dphi_;
167  return -(vertex_.load()->X() - p.X()) * std::sin(phi) +
168  (vertex_.load()->Y() - p.Y()) * std::cos(phi);
169 }
void maybeUnpackBoth() const
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< Point * > vertex_
vertex position
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double phi() const override
momentum azimuthal angle
float pat::PackedCandidate::dxyError ( ) const
inlineoverridevirtual

uncertainty on dxy

Reimplemented from reco::Candidate.

Definition at line 699 of file PackedCandidate.h.

References m_, maybeUnpackCovariance(), and mathSSE::sqrt().

Referenced by DPFIsolation::getPredictions(), btagbtvdeep::packedCandidateToFeatures(), and pat::PATIsolatedTrackProducer::produce().

699  {
701  return sqrt((*m_.load())(3, 3));
702  }
void maybeUnpackCovariance() const
T sqrt(T t)
Definition: SSEVec.h:18
std::atomic< reco::TrackBase::CovarianceMatrix * > m_
IP covariance.
virtual float pat::PackedCandidate::dz ( size_t  ipv = 0) const
inlinevirtual
float pat::PackedCandidate::dz ( const Point p) const
virtual

dz with respect to another point

Definition at line 170 of file PackedCandidate.cc.

References funct::cos(), objects.autophobj::float, phi, and funct::sin().

Referenced by Electron.Electron::cutBasedId(), and ntupleDataFormat.Track::dzPull().

170  {
171  maybeUnpackBoth();
172  const float phi = float(p4_.load()->Phi()) + dphi_;
173  const float pzpt =
174  deta_ ? std::sinh(etaAtVtx()) : p4_.load()->Pz() / p4_.load()->Pt();
175  return (vertex_.load()->Z() - p.Z()) -
176  ((vertex_.load()->X() - p.X()) * std::cos(phi) +
177  (vertex_.load()->Y() - p.Y()) * std::sin(phi)) *
178  pzpt;
179 }
virtual float etaAtVtx() const
eta from the track (normally identical to eta())
void maybeUnpackBoth() const
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< Point * > vertex_
vertex position
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double phi() const override
momentum azimuthal angle
def load(fileName)
Definition: svgfig.py:547
virtual float pat::PackedCandidate::dzAssociatedPV ( ) const
inlinevirtual

dz with respect to the PV ref

Definition at line 684 of file PackedCandidate.h.

References dxy(), dz(), dz_, maybeUnpackBoth(), and p().

Referenced by fromPV().

684  {
685  maybeUnpackBoth();
686  return dz_;
687  }
void maybeUnpackBoth() const
float pat::PackedCandidate::dzError ( ) const
inlineoverridevirtual

uncertainty on dz

Reimplemented from reco::Candidate.

Definition at line 694 of file PackedCandidate.h.

References m_, maybeUnpackCovariance(), and mathSSE::sqrt().

Referenced by DPFIsolation::getPredictions(), btagbtvdeep::packedCandidateToFeatures(), and pat::PATIsolatedTrackProducer::produce().

694  {
696  return sqrt((*m_.load())(4, 4));
697  }
void maybeUnpackCovariance() const
T sqrt(T t)
Definition: SSEVec.h:18
std::atomic< reco::TrackBase::CovarianceMatrix * > m_
IP covariance.
double pat::PackedCandidate::energy ( ) const
inlineoverridevirtual

energy

Implements reco::Candidate.

Definition at line 377 of file PackedCandidate.h.

References p4c_, and unpack().

Referenced by BetaStarVarProducer< T >::calculateCHSEnergies(), PuppiProducer::produce(), and Jet.Jet::rawEnergy().

377  {
378  if (!p4c_)
379  unpack();
380  return p4c_.load()->E();
381  }
std::atomic< LorentzVector * > p4c_
double pat::PackedCandidate::et ( ) const
inlineoverridevirtual

transverse energy

Implements reco::Candidate.

Definition at line 383 of file PackedCandidate.h.

References p4c_, and pt().

383 { return (pt() <= 0) ? 0 : p4c_.load()->Et(); }
std::atomic< LorentzVector * > p4c_
double pt() const override
transverse momentum
double pat::PackedCandidate::et2 ( ) const
inlineoverridevirtual

transverse energy squared (use this for cuts)!

Implements reco::Candidate.

Definition at line 385 of file PackedCandidate.h.

References p4c_, and pt().

385 { return (pt() <= 0) ? 0 : p4c_.load()->Et2(); }
std::atomic< LorentzVector * > p4c_
double pt() const override
transverse momentum
double pat::PackedCandidate::eta ( ) const
inlineoverridevirtual
virtual float pat::PackedCandidate::etaAtVtx ( ) const
inlinevirtual

eta from the track (normally identical to eta())

Definition at line 459 of file PackedCandidate.h.

References deta_, maybeUnpackBoth(), and p4_.

459  {
460  maybeUnpackBoth();
461  return p4_.load()->eta() + deta_;
462  }
void maybeUnpackBoth() const
std::atomic< PolarLorentzVector * > p4_
the four vector
void pat::PackedCandidate::fillVertexCovariance ( CovarianceMatrix v) const
overridevirtual

fill SMatrix

Implements reco::Candidate.

Definition at line 397 of file PackedCandidate.cc.

References Exception, and edm::errors::UnimplementedFeature.

Referenced by vertexCovariance().

397  {
399  << "reco::ConcreteCandidate does not implement vertex covariant "
400  "matrix.\n";
401 }
uint16_t pat::PackedCandidate::firstHit ( ) const
inline

Return first hit from HitPattern for tracks with high level details.

Definition at line 760 of file PackedCandidate.h.

References firstHit_.

760 { return firstHit_; }
const PVAssoc pat::PackedCandidate::fromPV ( size_t  ipv = 0) const
inline

Definition at line 633 of file PackedCandidate.h.

References funct::abs(), CompatibilityBTag, dz(), dzAssociatedPV(), edm::Ref< C, T, F >::key(), NoPV, or, pdgId(), pvAssociationQuality(), PVLoose, PVTight, PVUsedInFit, UsedInFitLoose, UsedInFitTight, and vertexRef().

Referenced by PileupJetIdAlgo::computeIdVariables(), DPFIsolation::getPredictions(), pat::PATTrackAndVertexUnpacker::produce(), PuppiProducer::produce(), pat::PATIsolatedTrackProducer::produce(), and BoostedDoubleSVProducer::setTracksPV().

633  {
634  reco::VertexRef pvRef = vertexRef();
635  if (pvAssociationQuality() == UsedInFitTight and pvRef.key() == ipv)
636  return PVUsedInFit;
637  if (pvRef.key() == ipv or abs(pdgId()) == 13 or abs(pdgId()) == 11)
638  return PVTight;
640  std::abs(dzAssociatedPV()) > std::abs(dz(ipv)))
641  return PVTight; // it is not closest, but at least prevents the B
642  // assignment stealing
643  if (pvAssociationQuality() < UsedInFitLoose or pvRef->ndof() < 4.0)
644  return PVLoose;
645  return NoPV;
646  }
virtual float dz(size_t ipv=0) const
dz with respect to the PV[ipv]
int pdgId() const override
PDG identifier.
key_type key() const
Accessor for product key.
Definition: Ref.h:263
const reco::VertexRef vertexRef() const
const PVAssociationQuality pvAssociationQuality() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
virtual float dzAssociatedPV() const
dz with respect to the PV ref
bool pat::PackedCandidate::hasMasterClone ( ) const
overridevirtual

returns true if this candidate has a reference to a master clone. This only happens if the concrete Candidate type is ShallowCloneCandidate

Implements reco::Candidate.

Definition at line 343 of file PackedCandidate.cc.

Referenced by vertexCovariance().

343 { return false; }
bool pat::PackedCandidate::hasMasterClonePtr ( ) const
overridevirtual

returns true if this candidate has a ptr to a master clone. This only happens if the concrete Candidate type is ShallowClonePtrCandidate

Implements reco::Candidate.

Definition at line 345 of file PackedCandidate.cc.

Referenced by vertexCovariance().

345 { return false; }
bool pat::PackedCandidate::hasTrackDetails ( ) const
inline
float pat::PackedCandidate::hcalFraction ( ) const
inline

Set the fraction of Hcal needed for HF, neutral hadrons, and charged particles

Definition at line 881 of file PackedCandidate.h.

Referenced by caloFraction(), and btagbtvdeep::packedCandidateToFeatures().

881  {
882  return (hcalFraction_ / 100.);
883  }
bool pat::PackedCandidate::isCaloMuon ( ) const
inlineoverridevirtual

Implements reco::Candidate.

Definition at line 849 of file PackedCandidate.h.

849 { return false; }
bool pat::PackedCandidate::isConvertedPhoton ( ) const
inlineoverridevirtual

Implements reco::Candidate.

Definition at line 851 of file PackedCandidate.h.

851 { return false; }
bool pat::PackedCandidate::isElectron ( ) const
inlineoverridevirtual

Implements reco::Candidate.

Definition at line 840 of file PackedCandidate.h.

840 { return false; }
bool pat::PackedCandidate::isGlobalMuon ( ) const
inlineoverridevirtual
bool pat::PackedCandidate::isGoodEgamma ( ) const
inline
bool pat::PackedCandidate::isIsolatedChargedHadron ( ) const
inline

Set isolation (as in particle flow, i.e. at calorimeter surface rather than at PV) flat for charged hadrons

Definition at line 889 of file PackedCandidate.h.

Referenced by caloFraction().

889  {
891  }
bool pat::PackedCandidate::isJet ( ) const
inlineoverridevirtual

Implements reco::Candidate.

Definition at line 852 of file PackedCandidate.h.

852 { return false; }
bool pat::PackedCandidate::isMuon ( ) const
inlineoverridevirtual

Implements reco::Candidate.

Definition at line 841 of file PackedCandidate.h.

841 { return false; }
bool pat::PackedCandidate::isPhoton ( ) const
inlineoverridevirtual

Implements reco::Candidate.

Definition at line 850 of file PackedCandidate.h.

850 { return false; }
bool pat::PackedCandidate::isStandAloneMuon ( ) const
inlineoverridevirtual
bool pat::PackedCandidate::isTrackerMuon ( ) const
inlineoverridevirtual

Implements reco::Candidate.

Definition at line 848 of file PackedCandidate.h.

848 { return false; }
bool pat::PackedCandidate::longLived ( ) const
overridevirtual

is long lived?

Implements reco::Candidate.

Definition at line 403 of file PackedCandidate.cc.

Referenced by setLongLived().

403 { return false; }
LostInnerHits pat::PackedCandidate::lostInnerHits ( ) const
inline
double pat::PackedCandidate::mass ( ) const
inlineoverridevirtual

mass

Implements reco::Candidate.

Definition at line 387 of file PackedCandidate.h.

References p4_, p4c_, and unpack().

Referenced by Particle.Particle::__str__(), DiObject.DiMuon::__str__(), and PuppiProducer::produce().

387  {
388  if (!p4c_)
389  unpack();
390  return p4_.load()->M();
391  }
std::atomic< LorentzVector * > p4c_
std::atomic< PolarLorentzVector * > p4_
the four vector
bool pat::PackedCandidate::massConstraint ( ) const
overridevirtual

do mass constraint?

Implements reco::Candidate.

Definition at line 405 of file PackedCandidate.cc.

Referenced by setMassConstraint().

405 { return false; }
double pat::PackedCandidate::massSqr ( ) const
inlineoverridevirtual

mass squared

Implements reco::Candidate.

Definition at line 393 of file PackedCandidate.h.

References funct::m, p4_, p4c_, and unpack().

393  {
394  if (!p4c_)
395  unpack();
396  auto m = p4_.load()->M();
397  return m * m;
398  }
std::atomic< LorentzVector * > p4c_
std::atomic< PolarLorentzVector * > p4_
the four vector
const reco::CandidateBaseRef & pat::PackedCandidate::masterClone ( ) const
overridevirtual

returns ptr to master clone, if existing. Throws an exception unless the concrete Candidate type is ShallowCloneCandidate

Implements reco::Candidate.

Definition at line 337 of file PackedCandidate.cc.

References Exception.

Referenced by masterRef(), and vertexCovariance().

337  {
338  throw cms::Exception("Invalid Reference")
339  << "this Candidate has no master clone reference."
340  << "Can't call masterClone() method.\n";
341 }
const reco::CandidatePtr & pat::PackedCandidate::masterClonePtr ( ) const
overridevirtual

returns ptr to master clone, if existing. Throws an exception unless the concrete Candidate type is ShallowClonePtrCandidate

Implements reco::Candidate.

Definition at line 347 of file PackedCandidate.cc.

References Exception.

Referenced by vertexCovariance().

347  {
348  throw cms::Exception("Invalid Reference")
349  << "this Candidate has no master clone ptr."
350  << "Can't call masterClonePtr() method.\n";
351 }
template<typename Ref >
Ref pat::PackedCandidate::masterRef ( ) const
inline

cast master clone reference to a concrete type

Definition at line 836 of file PackedCandidate.h.

References masterClone().

836  {
837  return masterClone().template castTo<Ref>();
838  }
const reco::CandidateBaseRef & masterClone() const override
void pat::PackedCandidate::maybeUnpackBoth ( ) const
inlineprotected

Definition at line 966 of file PackedCandidate.h.

References p4c_, unpack(), unpackVtx(), and vertex_.

Referenced by dxy(), dz(), dzAssociatedPV(), etaAtVtx(), phiAtVtx(), ptTrk(), setP4(), setPz(), setVertex(), vertex(), vx(), vy(), and vz().

966  {
967  if (!p4c_)
968  unpack();
969  if (!vertex_)
970  unpackVtx();
971  }
std::atomic< LorentzVector * > p4c_
std::atomic< Point * > vertex_
vertex position
void pat::PackedCandidate::maybeUnpackCovariance ( ) const
inlineprotected

Definition at line 976 of file PackedCandidate.h.

References m_, and unpackCovariance().

Referenced by dxyError(), and dzError().

976  {
977  if (!m_)
979  }
std::atomic< reco::TrackBase::CovarianceMatrix * > m_
IP covariance.
void unpackCovariance() const
void pat::PackedCandidate::maybeUnpackTrack ( ) const
inlineprotected

Definition at line 972 of file PackedCandidate.h.

References track_, and unpackTrk().

Referenced by bestTrack().

972  {
973  if (!track_)
974  unpackTrk();
975  }
std::atomic< reco::Track * > track_
reco::Track
Vector pat::PackedCandidate::momentum ( ) const
inlineoverridevirtual

spatial momentum vector

Implements reco::Candidate.

Definition at line 358 of file PackedCandidate.h.

References p4c_, and unpack().

358  {
359  if (!p4c_)
360  unpack();
361  return p4c_.load()->Vect();
362  }
std::atomic< LorentzVector * > p4c_
const reco::Candidate * pat::PackedCandidate::mother ( size_type  ) const
overridevirtual

return mother at a given position (throws an exception)

Implements reco::Candidate.

Definition at line 366 of file PackedCandidate.cc.

Referenced by operator=().

366  {
367  return nullptr;
368 }
double pat::PackedCandidate::mt ( ) const
inlineoverridevirtual

transverse mass

Implements reco::Candidate.

Definition at line 401 of file PackedCandidate.h.

References p4_, p4c_, and unpack().

401  {
402  if (!p4c_)
403  unpack();
404  return p4_.load()->Mt();
405  }
std::atomic< LorentzVector * > p4c_
std::atomic< PolarLorentzVector * > p4_
the four vector
double pat::PackedCandidate::mtSqr ( ) const
inlineoverridevirtual

transverse mass squared

Implements reco::Candidate.

Definition at line 407 of file PackedCandidate.h.

References p4_, p4c_, and unpack().

407  {
408  if (!p4c_)
409  unpack();
410  return p4_.load()->Mt2();
411  }
std::atomic< LorentzVector * > p4c_
std::atomic< PolarLorentzVector * > p4_
the four vector
size_t pat::PackedCandidate::numberOfDaughters ( ) const
overridevirtual

number of daughters

Implements reco::Candidate.

Definition at line 353 of file PackedCandidate.cc.

Referenced by operator=().

353 { return 0; }
int pat::PackedCandidate::numberOfHits ( ) const
inline
size_t pat::PackedCandidate::numberOfMothers ( ) const
overridevirtual

number of mothers

Implements reco::Candidate.

Definition at line 355 of file PackedCandidate.cc.

Referenced by operator=().

355 { return 0; }
int pat::PackedCandidate::numberOfPixelHits ( ) const
inline
size_t pat::PackedCandidate::numberOfSourceCandidatePtrs ( ) const
inlineoverridevirtual

return the number of source Candidates ( the candidates used to construct this Candidate)

Implements reco::Candidate.

Definition at line 315 of file PackedCandidate.h.

315 { return 0; }
PackedCandidate& pat::PackedCandidate::operator= ( const PackedCandidate iOther)
inline

Definition at line 173 of file PackedCandidate.h.

References caloFraction_, covarianceSchema_, covarianceVersion_, deta_, dphi_, dtrkpt_, dxy_, dz_, firstHit_, hcalFraction_, isIsolatedChargedHadron_, m_, normalizedChi2_, p4(), p4_, p4c_, packedCovariance_, packedDEta_, packedDPhi_, packedDTrkPt_, packedDxy_, packedDz_, packedEta_, packedHits_, packedLayers_, packedM_, packedPhi_, packedPt_, packedPuppiweight_, packedPuppiweightNoLepDiff_, packedTime_, packedTimeError_, pdgId_, polarP4(), pvRefKey_, pvRefProd_, qualityFlags_, rawCaloFraction_, rawHcalFraction_, track_, vertex(), and vertex_.

173  {
174  if (this == &iOther) {
175  return *this;
176  }
177  packedPt_ = iOther.packedPt_;
178  packedEta_ = iOther.packedEta_;
179  packedPhi_ = iOther.packedPhi_;
180  packedM_ = iOther.packedM_;
181  packedDxy_ = iOther.packedDxy_;
182  packedDz_ = iOther.packedDz_;
183  packedDPhi_ = iOther.packedDPhi_;
184  packedDEta_ = iOther.packedDEta_;
185  packedDTrkPt_ = iOther.packedDTrkPt_;
186  packedCovariance_ = iOther.packedCovariance_;
187  packedPuppiweight_ = iOther.packedPuppiweight_;
188  packedPuppiweightNoLepDiff_ = iOther.packedPuppiweightNoLepDiff_;
189  rawCaloFraction_ = iOther.rawCaloFraction_;
190  rawHcalFraction_ = iOther.rawHcalFraction_;
191  caloFraction_ = iOther.caloFraction_;
192  hcalFraction_ = iOther.hcalFraction_;
193  packedTime_ = iOther.packedTime_;
194  packedTimeError_ = iOther.packedTimeError_;
195  isIsolatedChargedHadron_ = iOther.isIsolatedChargedHadron_;
196  // Need to trigger unpacking in iOther
197  if (p4_) {
198  *p4_ = iOther.polarP4();
199  } else {
200  p4_.store(new PolarLorentzVector(iOther.polarP4()));
201  }
202  if (p4c_) {
203  *p4c_ = iOther.p4();
204  } else {
205  p4c_.store(new LorentzVector(iOther.p4()));
206  }
207  if (vertex_) {
208  *vertex_ = iOther.vertex();
209  } else {
210  vertex_.store(new Point(iOther.vertex()));
211  }
212  dxy_ = iOther.dxy_;
213  dz_ = iOther.dz_;
214  dphi_ = iOther.dphi_;
215  deta_ = iOther.deta_;
216  dtrkpt_ = iOther.dtrkpt_;
217 
218  if (!iOther.track_) {
219  delete track_.exchange(nullptr);
220  } else {
221  if (!track_) {
222  track_.store(new reco::Track(*iOther.track_));
223  } else {
224  *track_ = *(iOther.track_);
225  }
226  }
227 
228  pdgId_ = iOther.pdgId_;
229  qualityFlags_ = iOther.qualityFlags_;
230  pvRefProd_ = iOther.pvRefProd_;
231  pvRefKey_ = iOther.pvRefKey_;
232  if (!iOther.m_) {
233  delete m_.exchange(nullptr);
234  } else {
235  if (!m_) {
236  m_.store(new reco::Track::CovarianceMatrix(*iOther.m_));
237  } else {
238  *m_ = *(iOther.m_);
239  }
240  }
241 
242  packedHits_ = iOther.packedHits_;
243  packedLayers_ = iOther.packedLayers_;
244  normalizedChi2_ = iOther.normalizedChi2_;
245  covarianceVersion_ = iOther.covarianceVersion_;
246  covarianceSchema_ = iOther.covarianceSchema_;
247  firstHit_ = iOther.firstHit_;
248  return *this;
249  }
reco::VertexRef::key_type pvRefKey_
std::atomic< LorentzVector * > p4c_
math::XYZPoint Point
point in the space
PackedCovariance packedCovariance_
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
math::XYZTLorentzVector LorentzVector
Lorentz vector.
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< Point * > vertex_
vertex position
std::atomic< reco::Track * > track_
reco::Track
std::atomic< reco::TrackBase::CovarianceMatrix * > m_
IP covariance.
uint8_t normalizedChi2_
track quality information
int pdgId_
PDG identifier.
math::Error< dimension >::type CovarianceMatrix
5 parameter covariance matrix
Definition: TrackBase.h:77
reco::VertexRefProd pvRefProd_
Use these to build a Ref to primary vertex.
PackedCandidate& pat::PackedCandidate::operator= ( PackedCandidate &&  iOther)
inline

Definition at line 251 of file PackedCandidate.h.

References caloFraction_, covarianceSchema_, covarianceVersion_, daughter(), deta_, dphi_, dtrkpt_, dxy_, dz_, firstHit_, hcalFraction_, isIsolatedChargedHadron_, m_, mother(), normalizedChi2_, numberOfDaughters(), numberOfMothers(), p4_, p4c_, packedCovariance_, packedDEta_, packedDPhi_, packedDTrkPt_, packedDxy_, packedDz_, packedEta_, packedHits_, packedLayers_, packedM_, packedPhi_, packedPt_, packedPuppiweight_, packedPuppiweightNoLepDiff_, packedTime_, packedTimeError_, pdgId_, pvRefKey_, pvRefProd_, qualityFlags_, rawCaloFraction_, rawHcalFraction_, alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, track_, vertex_, and ~PackedCandidate().

251  {
252  if (this == &iOther) {
253  return *this;
254  }
255  packedPt_ = iOther.packedPt_;
256  packedEta_ = iOther.packedEta_;
257  packedPhi_ = iOther.packedPhi_;
258  packedM_ = iOther.packedM_;
259  packedDxy_ = iOther.packedDxy_;
260  packedDz_ = iOther.packedDz_;
261  packedDPhi_ = iOther.packedDPhi_;
262  packedDEta_ = iOther.packedDEta_;
263  packedDTrkPt_ = iOther.packedDTrkPt_;
264  packedCovariance_ = iOther.packedCovariance_;
265  packedPuppiweight_ = iOther.packedPuppiweight_;
266  packedPuppiweightNoLepDiff_ = iOther.packedPuppiweightNoLepDiff_;
267  rawCaloFraction_ = iOther.rawCaloFraction_;
268  rawHcalFraction_ = iOther.rawHcalFraction_;
269  caloFraction_ = iOther.caloFraction_;
270  hcalFraction_ = iOther.hcalFraction_;
271  packedTime_ = iOther.packedTime_;
272  packedTimeError_ = iOther.packedTimeError_;
273  isIsolatedChargedHadron_ = iOther.isIsolatedChargedHadron_;
274  delete p4_.exchange(iOther.p4_.exchange(nullptr));
275  delete p4c_.exchange(iOther.p4c_.exchange(nullptr));
276  delete vertex_.exchange(iOther.vertex_.exchange(nullptr));
277  dxy_ = iOther.dxy_;
278  dz_ = iOther.dz_;
279  dphi_ = iOther.dphi_;
280  deta_ = iOther.deta_;
281  dtrkpt_ = iOther.dtrkpt_;
282  delete track_.exchange(iOther.track_.exchange(nullptr));
283  pdgId_ = iOther.pdgId_;
284  qualityFlags_ = iOther.qualityFlags_;
285  pvRefProd_ = iOther.pvRefProd_;
286  pvRefKey_ = iOther.pvRefKey_;
287  delete m_.exchange(iOther.m_.exchange(nullptr));
288  packedHits_ = iOther.packedHits_;
289  packedLayers_ = iOther.packedLayers_;
290  normalizedChi2_ = iOther.normalizedChi2_;
291  covarianceVersion_ = iOther.covarianceVersion_;
292  covarianceSchema_ = iOther.covarianceSchema_;
293  firstHit_ = iOther.firstHit_;
294  return *this;
295  }
reco::VertexRef::key_type pvRefKey_
std::atomic< LorentzVector * > p4c_
PackedCovariance packedCovariance_
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< Point * > vertex_
vertex position
std::atomic< reco::Track * > track_
reco::Track
std::atomic< reco::TrackBase::CovarianceMatrix * > m_
IP covariance.
uint8_t normalizedChi2_
track quality information
int pdgId_
PDG identifier.
reco::VertexRefProd pvRefProd_
Use these to build a Ref to primary vertex.
bool pat::PackedCandidate::overlap ( const reco::Candidate o) const
overrideprotectedvirtual

check overlap with another Candidate

Implements reco::Candidate.

Definition at line 357 of file PackedCandidate.cc.

References ALCARECOTkAlJpsiMuMu_cff::charge, reco::Candidate::charge(), reco::Candidate::p4(), p4, and reco::Candidate::vertex().

Referenced by covarianceParameterization().

357  {
358  return p4() == o.p4() && vertex() == o.vertex() && charge() == o.charge();
359  // return p4() == o.p4() && charge() == o.charge();
360 }
const LorentzVector & p4() const override
four-momentum Lorentz vecto r
int charge() const override
electric charge
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
const Point & vertex() const override
vertex position
virtual int charge() const =0
electric charge
virtual const Point & vertex() const =0
vertex position
double pat::PackedCandidate::p ( ) const
inlineoverridevirtual

magnitude of momentum vector

Implements reco::Candidate.

Definition at line 371 of file PackedCandidate.h.

References p4c_, and unpack().

Referenced by dzAssociatedPV(), and Electron.Electron::ptErr().

371  {
372  if (!p4c_)
373  unpack();
374  return p4c_.load()->P();
375  }
std::atomic< LorentzVector * > p4c_
const LorentzVector& pat::PackedCandidate::p4 ( ) const
inlineoverridevirtual

four-momentum Lorentz vecto r

Implements reco::Candidate.

Definition at line 346 of file PackedCandidate.h.

References p4c_, and unpack().

Referenced by Tau.Tau::dxy_approx(), Tau.Tau::dz(), DPFIsolation::getPredictions(), operator=(), Lepton.Lepton::p4WithFSR(), pat::PATIsolatedTrackProducer::produce(), and setP4().

346  {
347  if (!p4c_)
348  unpack();
349  return *p4c_;
350  }
std::atomic< LorentzVector * > p4c_
void pat::PackedCandidate::pack ( bool  unpackAfterwards = true)
protected

Definition at line 13 of file PackedCandidate.cc.

References MiniFloatConverter::float32to16(), MiniFloatConverter::max(), SiStripPI::max, and timeUnitHelper::unpack().

Referenced by pyrootRender.interactiveRender::draw(), packBoth(), and setMass().

13  {
14  float unpackedPt = std::min<float>(p4_.load()->Pt(), MiniFloatConverter::max());
16  packedEta_ = int16_t(std::round(p4_.load()->Eta() / 6.0f *
18  packedPhi_ = int16_t(std::round(p4_.load()->Phi() / 3.2f *
21  if (unpackAfterwards) {
22  delete p4_.exchange(nullptr);
23  delete p4c_.exchange(nullptr);
24  unpack(); // force the values to match with the packed ones
25  }
26 }
std::atomic< LorentzVector * > p4c_
std::atomic< PolarLorentzVector * > p4_
the four vector
static uint16_t float32to16(float x)
Definition: libminifloat.h:17
static float max()
Definition: libminifloat.h:106
void pat::PackedCandidate::packBoth ( )
inlineprotected

Definition at line 980 of file PackedCandidate.h.

References p4_, p4c_, pack(), packVtx(), unpack(), unpackTrk(), unpackVtx(), and vertex_.

Referenced by PackedCandidate(), setP4(), setPz(), and setTrackProperties().

980  {
981  pack(false);
982  packVtx(false);
983  delete p4_.exchange(nullptr);
984  delete p4c_.exchange(nullptr);
985  delete vertex_.exchange(nullptr);
986  unpack();
987  unpackVtx();
988  } // do it this way, so that we don't loose precision on the angles before
std::atomic< LorentzVector * > p4c_
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< Point * > vertex_
vertex position
void packVtx(bool unpackAfterwards=true)
void pack(bool unpackAfterwards=true)
void pat::PackedCandidate::packCovariance ( const reco::TrackBase::CovarianceMatrix m,
bool  unpackAfterwards = true 
)
protected

Definition at line 88 of file PackedCandidate.cc.

Referenced by setTrackProperties().

89  {
98  // unpack afterwards
99  if (unpackAfterwards)
101 }
uint16_t packCovarianceElement(const reco::TrackBase::CovarianceMatrix &m, int i, int j) const
PackedCovariance packedCovariance_
void unpackCovariance() const
uint16_t pat::PackedCandidate::packCovarianceElement ( const reco::TrackBase::CovarianceMatrix m,
int  i,
int  j 
) const
inlineprivate

Definition at line 943 of file PackedCandidate.h.

References covarianceParameterization(), covarianceSchema_, eta(), funct::m, numberOfHits(), numberOfPixelHits(), CovarianceParameterization::pack(), and pt().

944  {
946  pt(), eta(), numberOfHits(),
948  }
int numberOfHits() const
float pack(float value, int schema, int i, int j, float pt, float eta, int nHits, int pixelHits, float cii=1., float cjj=1.) const
double pt() const override
transverse momentum
int numberOfPixelHits() const
double eta() const override
momentum pseudorapidity
const CovarianceParameterization & covarianceParameterization() const
uint8_t pat::PackedCandidate::packTimeError ( float  timeError)
staticprotected

static to allow unit testing

Definition at line 461 of file PackedCandidate.cc.

References f, and min().

461  {
462  if (timeError <= 0)
463  return 0;
464  // log-scale packing.
465  // for MIN_TIMEERROR = 0.002, EXPO_TIMEERROR = 5:
466  // minimum value 0.002 = 2ps (packed as 1)
467  // maximum value 0.5 ns (packed as 255)
468  // constant *relative* precision of about 2%
469  return std::max<uint8_t>(
470  std::min(std::round(std::ldexp(std::log2(timeError / MIN_TIMEERROR),
471  +EXPO_TIMEERROR)),
472  255.f),
473  1);
474 }
static float MIN_TIMEERROR
virtual float timeError() const
time measurement uncertainty (-1 if not available)
double f[11][100]
T min(T a, T b)
Definition: MathUtil.h:58
int16_t pat::PackedCandidate::packTimeNoError ( float  time)
staticprotected

Definition at line 487 of file PackedCandidate.cc.

References funct::abs(), f, and min().

487  {
488  // encoding in log scale to store times in a large range with few bits.
489  // for MIN_TIME_NOERROR = 0.0002 and EXPO_TIME_NOERROR = 6:
490  // smallest non-zero time = 0.2 ps (encoded as +/-1)
491  // one BX, +/- 12.5 ns, is fully covered with 11 bits (+/- 1023)
492  // 12 bits cover by far any plausible value (+/-2047 corresponds to about
493  // +/- 0.8 ms!) constant *relative* ~1% precision
495  return 0; // prevent underflows
496  float fpacked = std::ldexp(std::log2(std::abs(time / MIN_TIME_NOERROR)),
498  return (time > 0 ? +1 : -1) * std::min(std::round(fpacked), 2047.f);
499 }
static float MIN_TIME_NOERROR
virtual float time() const
time (wrt nominal zero of the collision)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
T min(T a, T b)
Definition: MathUtil.h:58
int16_t pat::PackedCandidate::packTimeWithError ( float  time,
float  timeError 
)
staticprotected

Definition at line 511 of file PackedCandidate.cc.

References funct::abs(), and f.

511  {
512  // Encode in units of timeError * 2^EXPO_TIME_WITHERROR (~1.6% if
513  // EXPO_TIME_WITHERROR = -6) the largest value that can be stored in 14 bits +
514  // sign bit + overflow bit is about 260 sigmas values larger than that will be
515  // stored using the no-timeError packing (with less precision). overflows of
516  // these kinds should happen only for particles that are late arriving,
517  // out-of-time, or mis-reconstructed, as timeError is O(20ps) and the beam
518  // spot witdth is O(200ps)
519  float fpacked = std::round(time / std::ldexp(timeError, EXPO_TIME_WITHERROR));
520  if (std::abs(fpacked) < 16383.f) { // 16383 = (2^14 - 1) = largest absolute
521  // value for a signed 15 bit integer
522  return int16_t(fpacked) * 2; // make it even, and fit in a signed 16 bit int
523  } else {
524  int16_t packed = packTimeNoError(time); // encode
525  return packed * 2 +
526  (time > 0 ? +1
527  : -1); // make it odd, to signal that there was an overlow
528  }
529 }
static int16_t packTimeNoError(float time)
virtual float time() const
time (wrt nominal zero of the collision)
virtual float timeError() const
time measurement uncertainty (-1 if not available)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
static int EXPO_TIME_WITHERROR
void pat::PackedCandidate::packVtx ( bool  unpackAfterwards = true)
protected

Definition at line 28 of file PackedCandidate.cc.

References EnergyCorrector::c, funct::cos(), f, MiniFloatConverter::float32to16(), edm::Ref< C, T, F >::isNonnull(), SiStripPI::max, MetAnalyzer::pv(), alignCSCRings::s, and funct::sin().

Referenced by packBoth(), and setVertex().

28  {
29  reco::VertexRef pvRef = vertexRef();
30  Point pv = pvRef.isNonnull() ? pvRef->position() : Point();
31  float dxPV = vertex_.load()->X() - pv.X(),
32  dyPV = vertex_.load()->Y() - pv.Y(); //, rPV = std::hypot(dxPV, dyPV);
33  float s = std::sin(float(p4_.load()->Phi()) + dphi_),
34  c = std::cos(
35  float(p4_.load()->Phi() +
36  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;
45  packedDz_ = pvRef.isNonnull()
47  : int16_t(std::round(dz_ / 40.f *
48  std::numeric_limits<int16_t>::max()));
49  packedDPhi_ =
50  int16_t(std::round(dphi_ / 3.2f * std::numeric_limits<int16_t>::max()));
53 
54  if (unpackAfterwards) {
55  delete vertex_.exchange(nullptr);
56  unpackVtx();
57  }
58 }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:251
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
math::XYZPoint Point
point in the space
const reco::VertexRef vertexRef() const
std::atomic< PolarLorentzVector * > p4_
the four vector
static uint16_t float32to16(float x)
Definition: libminifloat.h:17
std::atomic< Point * > vertex_
vertex position
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
def pv(vc)
Definition: MetAnalyzer.py:7
double f[11][100]
Structure Point Contains parameters of Gaussian fits to DMRs.
Definition: DMRtrends.cc:55
int pat::PackedCandidate::pdgId ( ) const
inlineoverridevirtual
double pat::PackedCandidate::phi ( ) const
inlineoverridevirtual

momentum azimuthal angle

Implements reco::Candidate.

Definition at line 437 of file PackedCandidate.h.

References p4_, p4c_, and unpack().

Referenced by Particle.Particle::__str__(), DQMPFCandidateAnalyzer::analyze(), MuonFSRProducer::computeRelativeIsolation(), DPFIsolation::getPredictions(), reco::tau::qcuts::minPackedCandVertexWeight(), ntupleDataFormat.Track::phiPull(), and PuppiProducer::produce().

437  {
438  if (!p4c_)
439  unpack();
440  return p4_.load()->Phi();
441  }
std::atomic< LorentzVector * > p4c_
std::atomic< PolarLorentzVector * > p4_
the four vector
virtual float pat::PackedCandidate::phiAtVtx ( ) const
inlinevirtual

momentum azimuthal angle from the track (normally identical to phi())

Definition at line 449 of file PackedCandidate.h.

References dphi_, objects.autophobj::float, M_PI, maybeUnpackBoth(), and p4_.

449  {
450  maybeUnpackBoth();
451  float ret = p4_.load()->Phi() + dphi_;
452  while (ret > float(M_PI))
453  ret -= 2 * float(M_PI);
454  while (ret < -float(M_PI))
455  ret += 2 * float(M_PI);
456  return ret;
457  }
void maybeUnpackBoth() const
std::atomic< PolarLorentzVector * > p4_
the four vector
#define M_PI
int pat::PackedCandidate::pixelLayersWithMeasurement ( ) const
inline
const PolarLorentzVector& pat::PackedCandidate::polarP4 ( ) const
inlineoverridevirtual

four-momentum Lorentz vector

Implements reco::Candidate.

Definition at line 352 of file PackedCandidate.h.

References p4_, p4c_, and unpack().

Referenced by operator=(), pat::PATIsolatedTrackProducer::produce(), setP4(), and setPz().

352  {
353  if (!p4c_)
354  unpack();
355  return *p4_;
356  }
std::atomic< LorentzVector * > p4c_
std::atomic< PolarLorentzVector * > p4_
the four vector
virtual const reco::Track& pat::PackedCandidate::pseudoTrack ( ) const
inlinevirtual
double pat::PackedCandidate::pt ( ) const
inlineoverridevirtual
virtual double pat::PackedCandidate::ptTrk ( ) const
inlinevirtual

pt from the track (normally identical to pt())

Definition at line 444 of file PackedCandidate.h.

References dtrkpt_, maybeUnpackBoth(), and p4_.

444  {
445  maybeUnpackBoth();
446  return p4_.load()->pt() + dtrkpt_;
447  }
void maybeUnpackBoth() const
std::atomic< PolarLorentzVector * > p4_
the four vector
float pat::PackedCandidate::puppiWeight ( ) const
float pat::PackedCandidate::puppiWeightNoLep ( ) const
const PVAssociationQuality pat::PackedCandidate::pvAssociationQuality ( ) const
inline
double pat::PackedCandidate::px ( ) const
inlineoverridevirtual

x coordinate of momentum vector

Implements reco::Candidate.

Definition at line 413 of file PackedCandidate.h.

References p4c_, and unpack().

Referenced by PuppiProducer::produce().

413  {
414  if (!p4c_)
415  unpack();
416  return p4c_.load()->Px();
417  }
std::atomic< LorentzVector * > p4c_
double pat::PackedCandidate::py ( ) const
inlineoverridevirtual

y coordinate of momentum vector

Implements reco::Candidate.

Definition at line 419 of file PackedCandidate.h.

References p4c_, and unpack().

Referenced by PuppiProducer::produce().

419  {
420  if (!p4c_)
421  unpack();
422  return p4c_.load()->Py();
423  }
std::atomic< LorentzVector * > p4c_
double pat::PackedCandidate::pz ( ) const
inlineoverridevirtual

z coordinate of momentum vector

Implements reco::Candidate.

Definition at line 425 of file PackedCandidate.h.

References p4c_, and unpack().

Referenced by PuppiProducer::produce(), and setPz().

425  {
426  if (!p4c_)
427  unpack();
428  return p4c_.load()->Pz();
429  }
std::atomic< LorentzVector * > p4c_
double pat::PackedCandidate::rapidity ( ) const
inlineoverridevirtual

rapidity

Implements reco::Candidate.

Definition at line 477 of file PackedCandidate.h.

References p4_, p4c_, and unpack().

Referenced by PuppiProducer::produce().

477  {
478  if (!p4c_)
479  unpack();
480  return p4_.load()->Rapidity();
481  }
std::atomic< LorentzVector * > p4c_
std::atomic< PolarLorentzVector * > p4_
the four vector
float pat::PackedCandidate::rawCaloFraction ( ) const
inline

Set the raw ECAL+HCAL energy over candidate energy for isolated charged hadrons

Definition at line 866 of file PackedCandidate.h.

Referenced by isGoodEgamma().

866  {
867  return (rawCaloFraction_ / 100.);
868  }
float pat::PackedCandidate::rawHcalFraction ( ) const
inline

Set the fraction of Hcal needed isolated charged hadrons.

Definition at line 871 of file PackedCandidate.h.

References rawHcalFraction_, and setCaloFraction().

871  {
872  return (rawHcalFraction_ / 100.);
873  }
void pat::PackedCandidate::setAssociationQuality ( PVAssociationQuality  q)
inline
void pat::PackedCandidate::setCaloFraction ( float  p)

Fraction of Hcal for isolated charged hadrons.

Definition at line 438 of file PackedCandidate.cc.

References AlCaHLTBitMon_ParallelJobs::p.

Referenced by rawHcalFraction().

438 { caloFraction_ = 100 * p; }
double p() const override
magnitude of momentum vector
void pat::PackedCandidate::setCharge ( int  charge)
inlineoverridevirtual

set electric charge

Implements reco::Candidate.

Definition at line 340 of file PackedCandidate.h.

340 {}
virtual void pat::PackedCandidate::setCovarianceVersion ( int  v)
inlinevirtual
void pat::PackedCandidate::setDTimeAssociatedPV ( float  aTime,
float  aTimeError = 0 
)

set time measurement

Definition at line 446 of file PackedCandidate.cc.

Referenced by setTime(), and timeError().

446  {
447  if (aTime == 0 && aTimeError == 0) {
448  packedTime_ = 0;
449  packedTimeError_ = 0;
450  } else if (aTimeError == 0) {
451  packedTimeError_ = 0;
452  packedTime_ = packTimeNoError(aTime);
453  } else {
454  packedTimeError_ = packTimeError(aTimeError);
455  aTimeError = unpackTimeError(packedTimeError_); // for reproducibility
456  packedTime_ = packTimeWithError(aTime, aTimeError);
457  }
458 }
static int16_t packTimeNoError(float time)
static int16_t packTimeWithError(float time, float timeError)
static uint8_t packTimeError(float timeError)
static to allow unit testing
static float unpackTimeError(uint8_t timeError)
void pat::PackedCandidate::setFirstHit ( uint16_t  pattern)
inline

Set first hit from HitPattern.

Definition at line 758 of file PackedCandidate.h.

References firstHit_, and listBenchmarks::pattern.

void pat::PackedCandidate::setGoodEgamma ( bool  isGoodEgamma = true)
inline
void pat::PackedCandidate::setHcalFraction ( float  p)

Fraction of ECAL+HCAL energy over candidate energy.

Definition at line 440 of file PackedCandidate.cc.

References AlCaHLTBitMon_ParallelJobs::p.

Referenced by caloFraction().

440 { hcalFraction_ = 100 * p; }
double p() const override
magnitude of momentum vector
virtual void pat::PackedCandidate::setHits ( const reco::Track tk)
inlinevirtual

Definition at line 538 of file PackedCandidate.h.

References reco::TrackBase::hitPattern(), reco::HitPattern::numberOfValidHits(), reco::HitPattern::numberOfValidPixelHits(), packedHits_, packedLayers_, reco::HitPattern::pixelLayersWithMeasurement(), reco::HitPattern::stripLayersWithMeasurement(), trackPixelHitsMask, trackStripHitsMask, and trackStripHitsShift.

Referenced by setTrackProperties().

538  {
539  // first we count the number of layers with hits
540  int numberOfPixelLayers_ = tk.hitPattern().pixelLayersWithMeasurement();
541  if (numberOfPixelLayers_ > trackPixelHitsMask)
542  numberOfPixelLayers_ = trackPixelHitsMask;
543  int numberOfStripLayers_ = tk.hitPattern().stripLayersWithMeasurement();
544  if (numberOfStripLayers_ > trackStripHitsMask)
545  numberOfStripLayers_ = trackStripHitsMask;
546  packedLayers_ = (numberOfPixelLayers_ & trackPixelHitsMask) |
547  (numberOfStripLayers_ << trackStripHitsShift);
548  // now we count number of additional hits, beyond the one-per-layer implied
549  // by packedLayers_
550  int numberOfPixelHits_ =
551  tk.hitPattern().numberOfValidPixelHits() - numberOfPixelLayers_;
552  if (numberOfPixelHits_ > trackPixelHitsMask)
553  numberOfPixelHits_ = trackPixelHitsMask;
554  int numberOfStripHits_ = tk.hitPattern().numberOfValidHits() -
555  numberOfPixelHits_ - numberOfPixelLayers_ -
556  numberOfStripLayers_;
557  if (numberOfStripHits_ > trackStripHitsMask)
558  numberOfStripHits_ = trackStripHitsMask;
559 
560  packedHits_ = (numberOfPixelHits_ & trackPixelHitsMask) |
561  (numberOfStripHits_ << trackStripHitsShift);
562  }
int numberOfValidHits() const
Definition: HitPattern.h:896
int pixelLayersWithMeasurement() const
Definition: HitPattern.cc:538
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:485
int stripLayersWithMeasurement() const
Definition: HitPattern.h:1138
int numberOfValidPixelHits() const
Definition: HitPattern.h:916
void pat::PackedCandidate::setIsIsolatedChargedHadron ( bool  p)

Fraction of Hcal for HF, neutral hadrons, and charged particles.

Definition at line 442 of file PackedCandidate.cc.

References AlCaHLTBitMon_ParallelJobs::p.

Referenced by caloFraction().

442  {
444 }
double p() const override
magnitude of momentum vector
void pat::PackedCandidate::setLongLived ( )
inlineoverridevirtual

set long lived flag

Implements reco::Candidate.

Definition at line 784 of file PackedCandidate.h.

References longLived().

784 {} /*FIXME*/
void pat::PackedCandidate::setLostInnerHits ( LostInnerHits  hits)
inline

Definition at line 748 of file PackedCandidate.h.

References hfClusterShapes_cfi::hits, lostInnerHitsMask, lostInnerHitsShift, and qualityFlags_.

748  {
749  int lost = hits;
750  if (lost > 2)
751  lost = 2; // protection against misuse
752  lost++; // shift so it's 0 .. 3 instead of (-1) .. 2
755  }
void pat::PackedCandidate::setMass ( double  m)
inlineoverridevirtual

set particle mass

Implements reco::Candidate.

Definition at line 509 of file PackedCandidate.h.

References funct::m, p4_, p4c_, pack(), and unpack().

509  {
510  if (!p4c_)
511  unpack();
512  *p4_ = PolarLorentzVector(p4_.load()->Pt(), p4_.load()->Eta(),
513  p4_.load()->Phi(), m);
514  pack();
515  }
std::atomic< LorentzVector * > p4c_
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
std::atomic< PolarLorentzVector * > p4_
the four vector
void pack(bool unpackAfterwards=true)
void pat::PackedCandidate::setMassConstraint ( )
inlineoverridevirtual

set mass constraint flag

Implements reco::Candidate.

Definition at line 790 of file PackedCandidate.h.

References massConstraint().

790 {} /*FIXME*/
void pat::PackedCandidate::setMuonID ( bool  isStandAlone,
bool  isGlobal 
)
inline

Definition at line 762 of file PackedCandidate.h.

References muons_cff::isGlobal, muonFlagsMask, muonFlagsShift, and qualityFlags_.

762  {
763  int16_t muonFlags = isStandAlone | (2 * isGlobal);
765  ((muonFlags << muonFlagsShift) & muonFlagsMask);
766  }
void pat::PackedCandidate::setP4 ( const LorentzVector p4)
inlineoverridevirtual

set 4-momentum

Implements reco::Candidate.

Definition at line 489 of file PackedCandidate.h.

References deta_, dphi_, dtrkpt_, maybeUnpackBoth(), p4_, packBoth(), and polarP4().

Referenced by Jet.Jet::setCorrP4().

489  {
490  maybeUnpackBoth(); // changing px,py,pz changes also mapping between dxy,dz
491  // and x,y,z
492  dphi_ += polarP4().Phi() - p4.Phi();
493  deta_ += polarP4().Eta() - p4.Eta();
494  dtrkpt_ += polarP4().Pt() - p4.Pt();
495  *p4_ = PolarLorentzVector(p4.Pt(), p4.Eta(), p4.Phi(), p4.M());
496  packBoth();
497  }
void maybeUnpackBoth() const
const LorentzVector & p4() const override
four-momentum Lorentz vecto r
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
std::atomic< PolarLorentzVector * > p4_
the four vector
const PolarLorentzVector & polarP4() const override
four-momentum Lorentz vector
void pat::PackedCandidate::setP4 ( const PolarLorentzVector p4)
inlineoverride

set 4-momentum

Definition at line 499 of file PackedCandidate.h.

References deta_, dphi_, dtrkpt_, maybeUnpackBoth(), p4(), p4_, packBoth(), and polarP4().

Referenced by Jet.Jet::setCorrP4().

499  {
500  maybeUnpackBoth(); // changing px,py,pz changes also mapping between dxy,dz
501  // and x,y,z
502  dphi_ += polarP4().Phi() - p4.Phi();
503  deta_ += polarP4().Eta() - p4.Eta();
504  dtrkpt_ += polarP4().Pt() - p4.Pt();
505  *p4_ = p4;
506  packBoth();
507  }
void maybeUnpackBoth() const
const LorentzVector & p4() const override
four-momentum Lorentz vecto r
std::atomic< PolarLorentzVector * > p4_
the four vector
const PolarLorentzVector & polarP4() const override
four-momentum Lorentz vector
void pat::PackedCandidate::setPdgId ( int  pdgId)
inlineoverridevirtual

Implements reco::Candidate.

Definition at line 776 of file PackedCandidate.h.

References pdgId(), and pdgId_.

776 { pdgId_ = pdgId; }
int pdgId() const override
PDG identifier.
int pdgId_
PDG identifier.
void pat::PackedCandidate::setPuppiWeight ( float  p,
float  p_nolep = 0.0 
)

Definition at line 408 of file PackedCandidate.cc.

References SiStripPI::max, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by isGoodEgamma().

408  {
409  // Set both weights at once to avoid misconfigured weights if called in the
410  // wrong order
413  std::numeric_limits<int8_t>::max() * (p_nolep - p);
414 }
double p() const override
magnitude of momentum vector
void pat::PackedCandidate::setPz ( double  pz)
inlineoverridevirtual

Implements reco::Candidate.

Definition at line 516 of file PackedCandidate.h.

References deta_, dphi_, dtrkpt_, maybeUnpackBoth(), p4_, p4c_, packBoth(), polarP4(), and pz().

516  {
517  maybeUnpackBoth(); // changing px,py,pz changes also mapping between dxy,dz
518  // and x,y,z
519  *p4c_ = LorentzVector(p4c_.load()->Px(), p4c_.load()->Py(), pz,
520  p4c_.load()->E());
521  dphi_ += polarP4().Phi() - p4c_.load()->Phi();
522  deta_ += polarP4().Eta() - p4c_.load()->Eta();
523  dtrkpt_ += polarP4().Pt() - p4c_.load()->Pt();
524  *p4_ = PolarLorentzVector(p4c_.load()->Pt(), p4c_.load()->Eta(),
525  p4c_.load()->Phi(), p4c_.load()->M());
526  packBoth();
527  }
void maybeUnpackBoth() const
std::atomic< LorentzVector * > p4c_
double pz() const override
z coordinate of momentum vector
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
math::XYZTLorentzVector LorentzVector
Lorentz vector.
std::atomic< PolarLorentzVector * > p4_
the four vector
const PolarLorentzVector & polarP4() const override
four-momentum Lorentz vector
void pat::PackedCandidate::setRawCaloFraction ( float  p)

Weight from PUPPI removing leptons.

Definition at line 426 of file PackedCandidate.cc.

References SiStripPI::max, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by isGoodEgamma().

426  {
427  if (100 * p > std::numeric_limits<uint8_t>::max())
429  std::numeric_limits<uint8_t>::max(); // Set to overflow value
430  else
431  rawCaloFraction_ = 100 * p;
432 }
double p() const override
magnitude of momentum vector
void pat::PackedCandidate::setRawHcalFraction ( float  p)

Raw ECAL+HCAL energy over candidate energy for isolated charged hadrons.

Definition at line 434 of file PackedCandidate.cc.

References AlCaHLTBitMon_ParallelJobs::p.

Referenced by isGoodEgamma().

434  {
435  rawHcalFraction_ = 100 * p;
436 }
double p() const override
magnitude of momentum vector
void pat::PackedCandidate::setStatus ( int  status)
inlineoverridevirtual

set status word

Implements reco::Candidate.

Definition at line 780 of file PackedCandidate.h.

780 {} /*FIXME*/
void pat::PackedCandidate::setThreeCharge ( int  threecharge)
inlineoverridevirtual

set electric charge

Implements reco::Candidate.

Definition at line 344 of file PackedCandidate.h.

344 {}
void pat::PackedCandidate::setTime ( float  aTime,
float  aTimeError = 0 
)
inline

set time measurement

Definition at line 932 of file PackedCandidate.h.

References setDTimeAssociatedPV(), lumiQTWidget::t, and vertexRef().

932  {
933  setDTimeAssociatedPV(aTime - vertexRef()->t(), aTimeError);
934  }
const reco::VertexRef vertexRef() const
void setDTimeAssociatedPV(float aTime, float aTimeError=0)
set time measurement
void pat::PackedCandidate::setTrackHighPurity ( bool  highPurity)
inline
virtual void pat::PackedCandidate::setTrackProperties ( const reco::Track tk,
const reco::Track::CovarianceMatrix covariance,
int  quality,
int  covarianceVersion 
)
inlinevirtual

Definition at line 565 of file PackedCandidate.h.

References covarianceSchema_, covarianceVersion(), covarianceVersion_, reco::TrackBase::normalizedChi2(), normalizedChi2_, packBoth(), packCovariance(), jets_cff::quality, and setHits().

Referenced by setTrackProperties().

567  {
571  setHits(tk);
572  packBoth();
573  packCovariance(covariance, false);
574  }
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:600
uint8_t normalizedChi2_
track quality information
int covarianceVersion() const
void packCovariance(const reco::TrackBase::CovarianceMatrix &m, bool unpackAfterwards=true)
virtual void setHits(const reco::Track &tk)
virtual void pat::PackedCandidate::setTrackProperties ( const reco::Track tk,
int  quality,
int  covarianceVersion 
)
inlinevirtual

Definition at line 578 of file PackedCandidate.h.

References reco::TrackBase::covariance(), covarianceVersion(), jets_cff::quality, and setTrackProperties().

579  {
581  }
CovarianceMatrix covariance() const
return track covariance matrix
Definition: TrackBase.h:782
int covarianceVersion() const
virtual void setTrackProperties(const reco::Track &tk, const reco::Track::CovarianceMatrix &covariance, int quality, int covarianceVersion)
void pat::PackedCandidate::setVertex ( const Point vertex)
inlineoverridevirtual

set vertex

Implements reco::Candidate.

Definition at line 624 of file PackedCandidate.h.

References maybeUnpackBoth(), packVtx(), vertex(), and vertex_.

624  {
625  maybeUnpackBoth();
626  *vertex_ = vertex;
627  packVtx();
628  }
void maybeUnpackBoth() const
const Point & vertex() const override
vertex position
std::atomic< Point * > vertex_
vertex position
void packVtx(bool unpackAfterwards=true)
reco::CandidatePtr pat::PackedCandidate::sourceCandidatePtr ( size_type  i) const
inlineoverridevirtual

return a Ptr to one of the source Candidates ( the candidates used to construct this Candidate)

Reimplemented from reco::Candidate.

Definition at line 318 of file PackedCandidate.h.

318  {
319  return reco::CandidatePtr();
320  }
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
Definition: CandidateFwd.h:25
int pat::PackedCandidate::status ( ) const
inlineoverridevirtual

status word

Implements reco::Candidate.

Definition at line 778 of file PackedCandidate.h.

References qualityFlags_.

778 { return qualityFlags_; } /*FIXME*/
int pat::PackedCandidate::stripLayersWithMeasurement ( ) const
inline
double pat::PackedCandidate::theta ( ) const
inlineoverridevirtual

momentum polar angle

Implements reco::Candidate.

Definition at line 465 of file PackedCandidate.h.

References p4_, p4c_, and unpack().

Referenced by Tau.Tau::zImpact().

465  {
466  if (!p4c_)
467  unpack();
468  return p4_.load()->Theta();
469  }
std::atomic< LorentzVector * > p4c_
std::atomic< PolarLorentzVector * > p4_
the four vector
int pat::PackedCandidate::threeCharge ( ) const
inlineoverridevirtual

electric charge

Implements reco::Candidate.

Definition at line 342 of file PackedCandidate.h.

References charge().

342 { return charge() * 3; }
int charge() const override
electric charge
virtual float pat::PackedCandidate::time ( ) const
inlinevirtual

time (wrt nominal zero of the collision)

Definition at line 912 of file PackedCandidate.h.

References dtimeAssociatedPV(), and vertexRef().

Referenced by TransientTrackBuilder::build().

912 { return vertexRef()->t() + dtimeAssociatedPV(); }
const reco::VertexRef vertexRef() const
virtual float dtimeAssociatedPV() const
dtime with respect to the PV ref
virtual float pat::PackedCandidate::timeError ( ) const
inlinevirtual

time measurement uncertainty (-1 if not available)

Definition at line 928 of file PackedCandidate.h.

References packedTimeError_, setDTimeAssociatedPV(), and unpackTimeError().

Referenced by TransientTrackBuilder::build().

static float unpackTimeError(uint8_t timeError)
int pat::PackedCandidate::trackerLayersWithMeasurement ( ) const
inline

Definition at line 596 of file PackedCandidate.h.

References pixelLayersWithMeasurement(), and stripLayersWithMeasurement().

596  {
598  }
int pixelLayersWithMeasurement() const
int stripLayersWithMeasurement() const
bool pat::PackedCandidate::trackHighPurity ( ) const
inline
void pat::PackedCandidate::unpack ( ) const
protected

Definition at line 60 of file PackedCandidate.cc.

References MiniFloatConverter::float16to32(), createfilelist::int, SiStripPI::max, p4, phi, EnergyCorrector::pt, edm::shift, and Validation_hcalonly_cfi::sign.

Referenced by boostToCM(), energy(), eta(), mass(), massSqr(), maybeUnpackBoth(), momentum(), mt(), mtSqr(), p(), p4(), packBoth(), phi(), polarP4(), pt(), px(), py(), pz(), rapidity(), setMass(), theta(), and y().

60  {
62  double shift =
63  (pt < 1. ? 0.1 * pt : 0.1 / pt); // shift particle phi to break
64  // degeneracies in angular separations
65  double sign = ((int(pt * 10) % 2 == 0)
66  ? 1
67  : -1); // introduce a pseudo-random sign of the shift
68  double phi =
69  int16_t(packedPhi_) * 3.2f / std::numeric_limits<int16_t>::max() +
70  sign * shift * 3.2 / std::numeric_limits<int16_t>::max();
71  auto p4 = std::make_unique<PolarLorentzVector>(
72  pt, int16_t(packedEta_) * 6.0f / std::numeric_limits<int16_t>::max(), phi,
74  auto p4c = std::make_unique<LorentzVector>(*p4);
75  PolarLorentzVector *expectp4 = nullptr;
76  if (p4_.compare_exchange_strong(expectp4, p4.get())) {
77  p4.release();
78  }
79 
80  // p4c_ works as the guard for unpacking so it
81  // must be set last
82  LorentzVector *expectp4c = nullptr;
83  if (p4c_.compare_exchange_strong(expectp4c, p4c.get())) {
84  p4c.release();
85  }
86 }
std::atomic< LorentzVector * > p4c_
const LorentzVector & p4() const override
four-momentum Lorentz vecto r
static float float16to32(uint16_t h)
Definition: libminifloat.h:12
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
std::atomic< PolarLorentzVector * > p4_
the four vector
math::XYZTLorentzVector LorentzVector
double pt() const override
transverse momentum
double phi() const override
momentum azimuthal angle
static unsigned int const shift
void pat::PackedCandidate::unpackCovariance ( ) const
protected

Definition at line 103 of file PackedCandidate.cc.

References Exception, mps_fire::i, CovarianceParameterization::isValid(), funct::m, AlCaHLTBitMon_ParallelJobs::p, and edm::errors::UnimplementedFeature.

Referenced by maybeUnpackCovariance().

103  {
105  if (p.isValid()) {
106  auto m = std::make_unique<reco::TrackBase::CovarianceMatrix>();
107  for (int i = 0; i < 5; i++)
108  for (int j = 0; j < 5; j++) {
109  (*m)(i, j) = 0;
110  }
119  reco::TrackBase::CovarianceMatrix *expected = nullptr;
120  if (m_.compare_exchange_strong(expected, m.get())) {
121  m.release();
122  }
123 
124  } else {
126  << "You do not have a valid track parameters file loaded. "
127  << "Please check that the release version is compatible with your "
128  "input data"
129  << "or avoid accessing track parameter uncertainties. ";
130  }
131 }
void unpackCovarianceElement(reco::TrackBase::CovarianceMatrix &m, uint16_t packed, int i, int j) const
PackedCovariance packedCovariance_
double p() const override
magnitude of momentum vector
std::atomic< reco::TrackBase::CovarianceMatrix * > m_
IP covariance.
const CovarianceParameterization & covarianceParameterization() const
math::Error< dimension >::type CovarianceMatrix
5 parameter covariance matrix
Definition: TrackBase.h:77
void pat::PackedCandidate::unpackCovarianceElement ( reco::TrackBase::CovarianceMatrix m,
uint16_t  packed,
int  i,
int  j 
) const
inlineprivate

Definition at line 937 of file PackedCandidate.h.

References covarianceParameterization(), covarianceSchema_, eta(), funct::m, numberOfHits(), numberOfPixelHits(), pt(), and CovarianceParameterization::unpack().

938  {
940  packed, covarianceSchema_, i, j, pt(), eta(), numberOfHits(),
942  }
int numberOfHits() const
float unpack(uint16_t packed, int schema, int i, int j, float pt, float eta, int nHits, int pixelHits, float cii=1., float cjj=1.) const
double pt() const override
transverse momentum
int numberOfPixelHits() const
double eta() const override
momentum pseudorapidity
const CovarianceParameterization & covarianceParameterization() const
float pat::PackedCandidate::unpackTimeError ( uint8_t  timeError)
staticprotected

Definition at line 475 of file PackedCandidate.cc.

Referenced by timeError().

475  {
476  return timeError > 0
477  ? MIN_TIMEERROR *
478  std::exp2(std::ldexp(float(timeError), -EXPO_TIMEERROR))
479  : -1.0f;
480 }
static float MIN_TIMEERROR
virtual float timeError() const
time measurement uncertainty (-1 if not available)
double f[11][100]
float pat::PackedCandidate::unpackTimeNoError ( int16_t  time)
staticprotected

Definition at line 481 of file PackedCandidate.cc.

References funct::abs().

Referenced by dtimeAssociatedPV(), and unpackTimeWithError().

481  {
482  if (time == 0)
483  return 0.f;
484  return (time > 0 ? MIN_TIME_NOERROR : -MIN_TIME_NOERROR) *
485  std::exp2(std::ldexp(float(std::abs(time)), -EXPO_TIME_NOERROR));
486 }
static float MIN_TIME_NOERROR
virtual float time() const
time (wrt nominal zero of the collision)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
float pat::PackedCandidate::unpackTimeWithError ( int16_t  time,
uint8_t  timeError 
)
staticprotected

Definition at line 500 of file PackedCandidate.cc.

References objects.autophobj::float, and unpackTimeNoError().

Referenced by dtimeAssociatedPV().

501  {
502  if (time % 2 == 0) {
503  // no overflow: drop rightmost bit and unpack in units of timeError
504  return std::ldexp(unpackTimeError(timeError), EXPO_TIME_WITHERROR) *
505  float(time / 2);
506  } else {
507  // overflow: drop rightmost bit, unpack using the noError encoding
509  }
510 }
static float unpackTimeNoError(int16_t time)
virtual float time() const
time (wrt nominal zero of the collision)
virtual float timeError() const
time measurement uncertainty (-1 if not available)
static int EXPO_TIME_WITHERROR
static float unpackTimeError(uint8_t timeError)
void pat::PackedCandidate::unpackTrk ( ) const
protected

Definition at line 181 of file PackedCandidate.cc.

References ALCARECOTkAlJpsiMuMu_cff::charge, reco::HitPattern::getLayer(), reco::HitPattern::getSubStructure(), reco::TrackBase::highPurity, mps_fire::i, reco::TrackBase::loose, TrackingRecHit::missing_inner, ndof, p3, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, reco::HitPattern::pixelHitFilter(), reco::HitPattern::stripHitFilter(), StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, StripSubdetector::TOB, HiIsolationCommonParameters_cff::track, reco::TrackBase::undefAlgorithm, and TrackingRecHit::valid.

Referenced by maybeUnpackTrack(), packBoth(), and pseudoTrack().

181  {
182  maybeUnpackBoth();
185  int numberOfStripLayers = stripLayersWithMeasurement(),
186  numberOfPixelLayers = pixelLayersWithMeasurement();
187  int numberOfPixelHits = this->numberOfPixelHits();
188  int numberOfHits = this->numberOfHits();
189 
190  int ndof = numberOfHits + numberOfPixelHits - 5;
191  LostInnerHits innerLost = lostInnerHits();
192 
193  auto track = std::make_unique<reco::Track>(
195  math::XYZVector(p3.x(), p3.y(), p3.z()), charge(), *(m_.load()),
197  int i = 0;
198  if (firstHit_ == 0) { // Backward compatible
199  if (innerLost == validHitInFirstPixelBarrelLayer) {
200  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, 1, 0,
202  i = 1;
203  }
204  } else {
205  track->appendHitPattern(firstHit_, TrackingRecHit::valid);
206  }
207 
209  i = 1;
210 
211  // add hits to match the number of laters and validHitInFirstPixelBarrelLayer
212  if (innerLost == validHitInFirstPixelBarrelLayer) {
213  // then to encode the number of layers, we add more hits on distinct layers
214  // (B2, B3, B4, F1, ...)
215  for (; i < numberOfPixelLayers; i++) {
216  if (i <= 3) {
217  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, i + 1, 0,
219  } else {
220  track->appendTrackerHitPattern(PixelSubdetector::PixelEndcap, i - 3, 0,
222  }
223  }
224  } else {
225  // to encode the information on the layers, we add one valid hits per layer
226  // but skipping PXB1
227  int iOffset = 0;
232  iOffset += 3;
233  } else {
234  iOffset = 1;
235  }
236  for (; i < numberOfPixelLayers; i++) {
237  if (i + iOffset <= 2) {
238  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel,
239  i + iOffset + 1, 0,
241  } else {
242  track->appendTrackerHitPattern(PixelSubdetector::PixelEndcap,
243  i + iOffset - 3 + 1, 0,
245  }
246  }
247  }
248  // add extra hits (overlaps, etc), all on the first layer with a hit - to
249  // avoid increasing the layer count
250  for (; i < numberOfPixelHits; i++) {
252  track->appendTrackerHitPattern(
255  } else {
256  track->appendTrackerHitPattern(
258  (innerLost == validHitInFirstPixelBarrelLayer ? 1 : 2), 0,
260  }
261  }
262  // now start adding strip layers, putting one hit on each layer so that the
263  // hitPattern.stripLayersWithMeasurement works. we don't know what the layers
264  // where, so we just start with TIB (4 layers), then TOB (6 layers), then TEC
265  // (9) and then TID(3), so that we can get a number of valid strip layers up
266  // to 4+6+9+3
268  i += 1;
269  int slOffset = 0;
271  slOffset = reco::HitPattern::getLayer(firstHit_) - 1;
273  slOffset += 4;
275  slOffset += 7;
277  slOffset += 13;
278  }
279  for (int sl = slOffset; sl < numberOfStripLayers + slOffset; ++sl, ++i) {
280  if (sl < 4)
281  track->appendTrackerHitPattern(StripSubdetector::TIB, sl + 1, 1,
283  else if (sl < 4 + 3)
284  track->appendTrackerHitPattern(StripSubdetector::TID, (sl - 4) + 1, 1,
286  else if (sl < 7 + 6)
287  track->appendTrackerHitPattern(StripSubdetector::TOB, (sl - 7) + 1, 1,
289  else if (sl < 13 + 9)
290  track->appendTrackerHitPattern(StripSubdetector::TEC, (sl - 13) + 1, 1,
292  else
293  break; // wtf?
294  }
295  // finally we account for extra strip hits beyond the one-per-layer added
296  // above. we put them all on TIB1, to avoid incrementing the number of
297  // layersWithMeasurement.
298  for (; i < numberOfHits; i++) {
300  track->appendTrackerHitPattern(
303  } else {
304  track->appendTrackerHitPattern(StripSubdetector::TIB, 1, 1,
306  }
307  }
308 
309  switch (innerLost) {
311  break;
312  case noLostInnerHits:
313  break;
314  case oneLostInnerHit:
315  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, 1, 0,
317  break;
318  case moreLostInnerHits:
319  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, 1, 0,
321  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, 2, 0,
323  break;
324  };
325 
326  if (trackHighPurity())
327  track->setQuality(reco::TrackBase::highPurity);
328 
329  reco::Track *expected = nullptr;
330  if (track_.compare_exchange_strong(expected, track.get())) {
331  track.release();
332  }
333 }
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:759
static bool pixelHitFilter(uint16_t pattern)
Definition: HitPattern.h:602
virtual float etaAtVtx() const
eta from the track (normally identical to eta())
int numberOfHits() const
int pixelLayersWithMeasurement() const
void maybeUnpackBoth() const
RhoEtaPhiVectorD RhoEtaPhiVector
spatial vector with cylindrical internal representation using pseudorapidity
Definition: Vector3D.h:32
int charge() const override
electric charge
void maybeUnpackCovariance() const
bool trackHighPurity() const
true if the track had the highPurity quality bit
std::atomic< Point * > vertex_
vertex position
LostInnerHits lostInnerHits() const
static bool stripHitFilter(uint16_t pattern)
Definition: HitPattern.h:633
virtual double ptTrk() const
pt from the track (normally identical to pt())
int stripLayersWithMeasurement() const
int numberOfPixelHits() const
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:750
std::atomic< reco::Track * > track_
reco::Track
std::atomic< reco::TrackBase::CovarianceMatrix * > m_
IP covariance.
LostInnerHits
Enumerator specifying the.
uint8_t normalizedChi2_
track quality information
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
virtual float phiAtVtx() const
momentum azimuthal angle from the track (normally identical to phi())
double p3[4]
Definition: TauolaWrapper.h:91
void pat::PackedCandidate::unpackVtx ( ) const
protected

Definition at line 133 of file PackedCandidate.cc.

References EnergyCorrector::c, funct::cos(), MiniFloatConverter::float16to32(), edm::Ref< C, T, F >::isNonnull(), SiStripPI::max, phi, MetAnalyzer::pv(), alignCSCRings::s, and funct::sin().

Referenced by maybeUnpackBoth(), and packBoth().

133  {
134  reco::VertexRef pvRef = vertexRef();
139  dz_ = pvRef.isNonnull()
141  : int16_t(packedDz_) * 40.f / std::numeric_limits<int16_t>::max();
142  Point pv = pvRef.isNonnull() ? pvRef->position() : Point();
143  float phi = p4_.load()->Phi() + dphi_, s = std::sin(phi), c = std::cos(phi);
144  auto vertex = std::make_unique<Point>(
145  pv.X() - dxy_ * s, pv.Y() + dxy_ * c,
146  pv.Z() +
147  dz_); // for our choice of using the PCA to the PV, by definition the
148  // remaining term -(dx*cos(phi) + dy*sin(phi))*(pz/pt) is zero
149 
150  Point *expected = nullptr;
151  if (vertex_.compare_exchange_strong(expected, vertex.get())) {
152  vertex.release();
153  }
154 }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:251
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
math::XYZPoint Point
point in the space
const reco::VertexRef vertexRef() const
static float float16to32(uint16_t h)
Definition: libminifloat.h:12
std::atomic< PolarLorentzVector * > p4_
the four vector
const Point & vertex() const override
vertex position
std::atomic< Point * > vertex_
vertex position
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
def pv(vc)
Definition: MetAnalyzer.py:7
double phi() const override
momentum azimuthal angle
Structure Point Contains parameters of Gaussian fits to DMRs.
Definition: DMRtrends.cc:55
const Point& pat::PackedCandidate::vertex ( ) const
inlineoverridevirtual

vertex position

Implements reco::Candidate.

Definition at line 604 of file PackedCandidate.h.

References maybeUnpackBoth(), and vertex_.

Referenced by Tau.Tau::dxy(), reco::tau::PFRecoTauChargedHadronFromGenericTrackPlugin< TrackClass >::getTrackPos(), operator=(), and setVertex().

604  {
605  maybeUnpackBoth();
606  return *vertex_;
607  } //{ if (fromPV_) return Point(0,0,0); else return Point(0,0,100); }
void maybeUnpackBoth() const
std::atomic< Point * > vertex_
vertex position
double pat::PackedCandidate::vertexChi2 ( ) const
overridevirtual

chi-squares

Implements reco::Candidate.

Definition at line 385 of file PackedCandidate.cc.

Referenced by clone().

385 { return 0; }
double pat::PackedCandidate::vertexCovariance ( int  i,
int  j 
) const
overridevirtual

(i, j)-th element of error matrix, i, j = 0, ... 2

Implements reco::Candidate.

Definition at line 391 of file PackedCandidate.cc.

References Exception, and edm::errors::UnimplementedFeature.

391  {
393  << "reco::ConcreteCandidate does not implement vertex covariant "
394  "matrix.\n";
395 }
CovarianceMatrix pat::PackedCandidate::vertexCovariance ( ) const
inlineoverridevirtual

return SMatrix

Reimplemented from reco::Candidate.

Definition at line 811 of file PackedCandidate.h.

References fillVertexCovariance(), hasMasterClone(), hasMasterClonePtr(), funct::m, masterClone(), masterClonePtr(), and findQualityFiles::v.

Referenced by clone().

811  {
814  return m;
815  }
void fillVertexCovariance(CovarianceMatrix &v) const override
fill SMatrix
double pat::PackedCandidate::vertexNdof ( ) const
overridevirtual

Number of degrees of freedom Meant to be Double32_t for soft-assignment fitters: tracks may contribute to the vertex with fractional weights. The ndof is then = to the sum of the track weights. see e.g. CMS NOTE-2006/032, CMS NOTE-2004/002

Implements reco::Candidate.

Definition at line 387 of file PackedCandidate.cc.

Referenced by clone().

387 { return 0; }
double pat::PackedCandidate::vertexNormalizedChi2 ( ) const
overridevirtual

chi-squared divided by n.d.o.f.

Implements reco::Candidate.

Definition at line 389 of file PackedCandidate.cc.

Referenced by clone().

389 { return 0; }
const reco::VertexRef pat::PackedCandidate::vertexRef ( ) const
inline

Definition at line 668 of file PackedCandidate.h.

References pvRefKey_, and pvRefProd_.

Referenced by pat::PATPackedCandidateProducer::candsOrdering(), fromPV(), reco::tau::qcuts::minPackedCandVertexWeight(), PuppiProducer::produce(), setTime(), and time().

668  {
670  }
reco::VertexRef::key_type pvRefKey_
edm::Ref< VertexCollection > VertexRef
persistent reference to a Vertex
Definition: VertexFwd.h:13
reco::VertexRefProd pvRefProd_
Use these to build a Ref to primary vertex.
double pat::PackedCandidate::vx ( ) const
inlineoverridevirtual

x coordinate of vertex position

Implements reco::Candidate.

Definition at line 609 of file PackedCandidate.h.

References maybeUnpackBoth(), and vertex_.

Referenced by DPFIsolation::getPredictions().

609  {
610  maybeUnpackBoth();
611  return vertex_.load()->X();
612  } //{ return 0; }
void maybeUnpackBoth() const
std::atomic< Point * > vertex_
vertex position
double pat::PackedCandidate::vy ( ) const
inlineoverridevirtual

y coordinate of vertex position

Implements reco::Candidate.

Definition at line 614 of file PackedCandidate.h.

References maybeUnpackBoth(), and vertex_.

Referenced by DPFIsolation::getPredictions().

614  {
615  maybeUnpackBoth();
616  return vertex_.load()->Y();
617  } //{ return 0; }
void maybeUnpackBoth() const
std::atomic< Point * > vertex_
vertex position
double pat::PackedCandidate::vz ( ) const
inlineoverridevirtual

z coordinate of vertex position

Implements reco::Candidate.

Definition at line 619 of file PackedCandidate.h.

References maybeUnpackBoth(), and vertex_.

Referenced by DPFIsolation::getPredictions().

619  {
620  maybeUnpackBoth();
621  return vertex_.load()->Z();
622  } //{ if (fromPV_) return 0; else return 100; }
void maybeUnpackBoth() const
std::atomic< Point * > vertex_
vertex position
double pat::PackedCandidate::y ( ) const
inlineoverridevirtual

Friends And Related Function Documentation

friend class ::OverlapChecker
friend

Definition at line 1054 of file PackedCandidate.h.

friend class ::testPackedCandidate
friend

Definition at line 951 of file PackedCandidate.h.

template<typename , typename , typename >
friend struct component
friend

Definition at line 1053 of file PackedCandidate.h.

friend class ShallowCloneCandidate
friend

Definition at line 1055 of file PackedCandidate.h.

friend class ShallowClonePtrCandidate
friend

Definition at line 1056 of file PackedCandidate.h.

Member Data Documentation

uint8_t pat::PackedCandidate::caloFraction_
protected

Definition at line 997 of file PackedCandidate.h.

Referenced by caloFraction(), and operator=().

std::once_flag pat::PackedCandidate::covariance_load_flag
staticprotected

Definition at line 1033 of file PackedCandidate.h.

CovarianceParameterization pat::PackedCandidate::covarianceParameterization_
staticprotected

Definition at line 1030 of file PackedCandidate.h.

Referenced by covarianceParameterization().

uint16_t pat::PackedCandidate::covarianceSchema_
protected
uint16_t pat::PackedCandidate::covarianceVersion_
protected
float pat::PackedCandidate::deta_
mutableprotected

Definition at line 1009 of file PackedCandidate.h.

Referenced by etaAtVtx(), operator=(), setP4(), and setPz().

float pat::PackedCandidate::dphi_
mutableprotected

Definition at line 1009 of file PackedCandidate.h.

Referenced by operator=(), phiAtVtx(), setP4(), and setPz().

float pat::PackedCandidate::dtrkpt_
mutableprotected

Definition at line 1009 of file PackedCandidate.h.

Referenced by operator=(), ptTrk(), setP4(), and setPz().

float pat::PackedCandidate::dxy_
mutableprotected

Definition at line 1009 of file PackedCandidate.h.

Referenced by dxy(), and operator=().

float pat::PackedCandidate::dz_
mutableprotected

Definition at line 1009 of file PackedCandidate.h.

Referenced by dz(), dzAssociatedPV(), and operator=().

int pat::PackedCandidate::EXPO_TIME_NOERROR
staticprotected
Initial value:
=
6

Definition at line 1085 of file PackedCandidate.h.

int pat::PackedCandidate::EXPO_TIME_WITHERROR
staticprotected
Initial value:
=
-6

Definition at line 1087 of file PackedCandidate.h.

int pat::PackedCandidate::EXPO_TIMEERROR
staticprotected
Initial value:
=
5

Definition at line 1083 of file PackedCandidate.h.

uint16_t pat::PackedCandidate::firstHit_

Definition at line 1090 of file PackedCandidate.h.

Referenced by firstHit(), operator=(), and setFirstHit().

int8_t pat::PackedCandidate::hcalFraction_
protected

Definition at line 998 of file PackedCandidate.h.

Referenced by caloFraction(), and operator=().

bool pat::PackedCandidate::isIsolatedChargedHadron_
protected

Definition at line 1002 of file PackedCandidate.h.

Referenced by caloFraction(), and operator=().

float pat::PackedCandidate::kMinDEtaToStore_ = 0.001
staticprotected

Definition at line 952 of file PackedCandidate.h.

float pat::PackedCandidate::kMinDTrkPtToStore_ = 0.001
staticprotected

Definition at line 953 of file PackedCandidate.h.

const unsigned int pat::PackedCandidate::longLivedTag = 0
static

long lived flag

Definition at line 782 of file PackedCandidate.h.

std::atomic<reco::TrackBase::CovarianceMatrix *> pat::PackedCandidate::m_
mutableprotected

IP covariance.

Definition at line 1020 of file PackedCandidate.h.

Referenced by dxyError(), dzError(), maybeUnpackCovariance(), and operator=().

const unsigned int pat::PackedCandidate::massConstraintTag = 0
static

do mass constraint flag

Definition at line 788 of file PackedCandidate.h.

float pat::PackedCandidate::MIN_TIME_NOERROR
staticprotected
Initial value:
=
0.0002f

Definition at line 1080 of file PackedCandidate.h.

float pat::PackedCandidate::MIN_TIMEERROR
staticprotected
Initial value:
=
0.002f

Definition at line 1078 of file PackedCandidate.h.

uint8_t pat::PackedCandidate::normalizedChi2_
protected

track quality information

Definition at line 1027 of file PackedCandidate.h.

Referenced by operator=(), and setTrackProperties().

std::atomic<PolarLorentzVector *> pat::PackedCandidate::p4_
mutableprotected
std::atomic<LorentzVector *> pat::PackedCandidate::p4c_
mutableprotected
PackedCovariance pat::PackedCandidate::packedCovariance_
protected

Definition at line 957 of file PackedCandidate.h.

Referenced by operator=().

uint16_t pat::PackedCandidate::packedDEta_
protected

Definition at line 956 of file PackedCandidate.h.

Referenced by operator=().

uint16_t pat::PackedCandidate::packedDPhi_
protected

Definition at line 956 of file PackedCandidate.h.

Referenced by operator=().

uint16_t pat::PackedCandidate::packedDTrkPt_
protected

Definition at line 956 of file PackedCandidate.h.

Referenced by operator=().

uint16_t pat::PackedCandidate::packedDxy_
protected

Definition at line 956 of file PackedCandidate.h.

Referenced by operator=().

uint16_t pat::PackedCandidate::packedDz_
protected

Definition at line 956 of file PackedCandidate.h.

Referenced by operator=().

uint16_t pat::PackedCandidate::packedEta_
protected

Definition at line 955 of file PackedCandidate.h.

Referenced by operator=().

uint8_t pat::PackedCandidate::packedHits_
protected
uint8_t pat::PackedCandidate::packedLayers_
protected
uint16_t pat::PackedCandidate::packedM_
protected

Definition at line 955 of file PackedCandidate.h.

Referenced by operator=().

uint16_t pat::PackedCandidate::packedPhi_
protected

Definition at line 955 of file PackedCandidate.h.

Referenced by operator=().

uint16_t pat::PackedCandidate::packedPt_
protected

Definition at line 955 of file PackedCandidate.h.

Referenced by operator=().

uint8_t pat::PackedCandidate::packedPuppiweight_
protected

Definition at line 992 of file PackedCandidate.h.

Referenced by operator=().

int8_t pat::PackedCandidate::packedPuppiweightNoLepDiff_
protected

Definition at line 993 of file PackedCandidate.h.

Referenced by operator=().

int16_t pat::PackedCandidate::packedTime_
protected

Definition at line 999 of file PackedCandidate.h.

Referenced by dtimeAssociatedPV(), and operator=().

uint8_t pat::PackedCandidate::packedTimeError_
protected

Definition at line 1000 of file PackedCandidate.h.

Referenced by dtimeAssociatedPV(), operator=(), and timeError().

int pat::PackedCandidate::pdgId_
protected

PDG identifier.

Definition at line 1013 of file PackedCandidate.h.

Referenced by charge(), operator=(), pdgId(), and setPdgId().

reco::VertexRef::key_type pat::PackedCandidate::pvRefKey_
protected

Definition at line 1017 of file PackedCandidate.h.

Referenced by dtime(), dz(), operator=(), and vertexRef().

reco::VertexRefProd pat::PackedCandidate::pvRefProd_
protected

Use these to build a Ref to primary vertex.

Definition at line 1016 of file PackedCandidate.h.

Referenced by operator=(), and vertexRef().

uint16_t pat::PackedCandidate::qualityFlags_
protected
uint8_t pat::PackedCandidate::rawCaloFraction_
protected

Definition at line 995 of file PackedCandidate.h.

Referenced by isGoodEgamma(), and operator=().

int8_t pat::PackedCandidate::rawHcalFraction_
protected

Definition at line 996 of file PackedCandidate.h.

Referenced by operator=(), and rawHcalFraction().

std::atomic<reco::Track *> pat::PackedCandidate::track_
mutableprotected

reco::Track

Definition at line 1011 of file PackedCandidate.h.

Referenced by bestTrack(), maybeUnpackTrack(), operator=(), and pseudoTrack().

std::atomic<Point *> pat::PackedCandidate::vertex_
mutableprotected

vertex position

Definition at line 1008 of file PackedCandidate.h.

Referenced by maybeUnpackBoth(), operator=(), packBoth(), setVertex(), vertex(), vx(), vy(), and vz().