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
 Flag isolation (as in particle flow, i.e. at calorimeter surface rather than at PV) flag for charged hadrons. More...
 

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 }
 This refers to the association to PV=ipv. >=PVLoose corresponds to JME definition, >=PVTight to isolation definition. More...
 
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
 
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
 Set the fraction of Hcal needed for HF and neutral hadrons and isolated charged hadrons. More...
 
bool isCaloMuon () const override
 
bool isConvertedPhoton () const override
 
bool isElectron () const override
 
bool isGlobalMuon () const override
 
bool isIsolatedChargedHadron () const
 Set isolation (as in particle flow, i.e. at calorimeter surface rather than at PV) flat for charged hadrons. More...
 
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
 Return reference to a pseudo track made with candidate kinematics, parameterized error for eta,phi,pt and full IP covariance. More...
 
double pt () const override
 transverse momentum More...
 
virtual double ptTrk () const
 pt from the track (normally identical to pt()) More...
 
float puppiWeight () const
 Set both weights at once (with option for only full PUPPI) More...
 
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
 Set the raw ECAL+HCAL energy over candidate energy for isolated charged hadrons. More...
 
void setAssociationQuality (PVAssociationQuality q)
 
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 setHcalFraction (float p)
 Raw ECAL+HCAL energy over candidate energy for isolated charged hadrons. More...
 
virtual void setHits (const reco::Track &tk)
 
void setIsIsolatedChargedHadron (bool p)
 Fraction of Ecal and Hcal for HF and neutral hadrons and isolated charged hadrons. 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 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 void setVertex (const Point &vertex)=0
 set vertex 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
}
 

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

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_
 
int8_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_
 
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 = 6
 
static int EXPO_TIME_WITHERROR = -6
 
static int EXPO_TIMEERROR = 5
 
static float kMinDEtaToStore_ =0.001
 
static float kMinDTrkPtToStore_ =0.001
 
static float MIN_TIME_NOERROR = 0.0002f
 
static float MIN_TIMEERROR = 0.002f
 

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 523 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 466 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 478 of file PackedCandidate.h.

set impact parameters covariance

Enumerator
trackPixelHitsMask 
trackStripHitsMask 
trackStripHitsShift 

Definition at line 408 of file PackedCandidate.h.

Constructor & Destructor Documentation

pat::PackedCandidate::PackedCandidate ( )
inline

default constructor

Definition at line 37 of file PackedCandidate.h.

Referenced by clone().

37  :
38  packedPt_(0), packedEta_(0),
39  packedPhi_(0), packedM_(0),
45  hcalFraction_(0),
46  packedTime_(0),
49  p4_(new PolarLorentzVector(0,0,0,0)), p4c_( new LorentzVector(0,0,0,0)),
50  vertex_(new Point(0,0,0)), dphi_(0), deta_(0), dtrkpt_(0),track_(nullptr), pdgId_(0),
std::atomic< Point * > vertex_
vertex position
reco::VertexRef::key_type pvRefKey_
math::XYZPoint Point
point in the space
PackedCovariance packedCovariance_
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
std::atomic< reco::Track * > track_
reco::Track
math::XYZTLorentzVector LorentzVector
Lorentz vector.
static key_type invalidKey()
Definition: Ref.h:173
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< LorentzVector * > p4c_
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 54 of file PackedCandidate.h.

References packBoth().

56  :
59  p4_( new PolarLorentzVector(c.pt(), c.eta(), c.phi(), c.mass())),
60  p4c_( new LorentzVector(*p4_)), vertex_( new Point(c.vertex())),
61  dphi_(0), deta_(0), dtrkpt_(0),
62  track_(nullptr), pdgId_(c.pdgId()), qualityFlags_(0), pvRefProd_(pvRefProd),
63  pvRefKey_(pvRefKey),m_(nullptr), packedHits_(0), packedLayers_(0),
65  packBoth();
66  }
std::atomic< Point * > vertex_
vertex position
reco::VertexRef::key_type pvRefKey_
math::XYZPoint Point
point in the space
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
std::atomic< reco::Track * > track_
reco::Track
math::XYZTLorentzVector LorentzVector
Lorentz vector.
virtual int pdgId() const =0
PDG identifier.
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< LorentzVector * > p4c_
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 68 of file PackedCandidate.h.

References packBoth().

71  :
74  p4_( new PolarLorentzVector(p4) ), p4c_( new LorentzVector(*p4_)),
75  vertex_( new Point(vtx) ),
76  dphi_(reco::deltaPhi(phiAtVtx,p4_.load()->phi())),
77  deta_(std::abs(etaAtVtx-p4_.load()->eta())>=kMinDEtaToStore_ ? etaAtVtx-p4_.load()->eta() : 0.),
78  dtrkpt_(std::abs(trkPt-p4_.load()->pt())>=kMinDTrkPtToStore_ ? trkPt-p4_.load()->pt() : 0.),
79  track_(nullptr), pdgId_(pdgId),
80  qualityFlags_(0), pvRefProd_(pvRefProd), pvRefKey_(pvRefKey),
82  packBoth();
83  }
virtual float etaAtVtx() const
eta from the track (normally identical to eta())
std::atomic< Point * > vertex_
vertex position
int pdgId() const override
PDG identifier.
reco::VertexRef::key_type pvRefKey_
const LorentzVector & p4() const override
four-momentum Lorentz vecto r
math::XYZPoint Point
point in the space
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
std::atomic< reco::Track * > track_
reco::Track
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< LorentzVector * > p4c_
std::atomic< reco::TrackBase::CovarianceMatrix * > m_
IP covariance.
double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:22
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 85 of file PackedCandidate.h.

References packBoth().

88  :
91  p4_(new PolarLorentzVector(p4.Pt(), p4.Eta(), p4.Phi(), p4.M())),
92  p4c_( new LorentzVector(p4)), vertex_( new Point(vtx) ) ,
93  dphi_(reco::deltaPhi(phiAtVtx,p4_.load()->phi())),
94  deta_(std::abs(etaAtVtx-p4_.load()->eta())>=kMinDEtaToStore_ ? etaAtVtx-p4_.load()->eta() : 0.),
95  dtrkpt_(std::abs(trkPt-p4_.load()->pt())>=kMinDTrkPtToStore_ ? trkPt-p4_.load()->pt() : 0.),
96  track_(nullptr), pdgId_(pdgId), qualityFlags_(0),
97  pvRefProd_(pvRefProd), pvRefKey_(pvRefKey),
99  packBoth();
100  }
virtual float etaAtVtx() const
eta from the track (normally identical to eta())
std::atomic< Point * > vertex_
vertex position
int pdgId() const override
PDG identifier.
reco::VertexRef::key_type pvRefKey_
const LorentzVector & p4() const override
four-momentum Lorentz vecto r
math::XYZPoint Point
point in the space
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
std::atomic< reco::Track * > track_
reco::Track
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< LorentzVector * > p4c_
std::atomic< reco::TrackBase::CovarianceMatrix * > m_
IP covariance.
double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:22
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 102 of file PackedCandidate.h.

102  :
103  packedPt_(iOther.packedPt_), packedEta_(iOther.packedEta_),
104  packedPhi_(iOther.packedPhi_), packedM_(iOther.packedM_),
105  packedDxy_(iOther.packedDxy_), packedDz_(iOther.packedDz_),
106  packedDPhi_(iOther.packedDPhi_),packedDEta_(iOther.packedDEta_),packedDTrkPt_(iOther.packedDTrkPt_),
107  packedCovariance_(iOther.packedCovariance_),
108  packedPuppiweight_(iOther.packedPuppiweight_),
109  packedPuppiweightNoLepDiff_(iOther.packedPuppiweightNoLepDiff_),
110  rawCaloFraction_(iOther.rawCaloFraction_),
111  hcalFraction_(iOther.hcalFraction_),
112  packedTime_(iOther.packedTime_),
113  packedTimeError_(iOther.packedTimeError_),
114  isIsolatedChargedHadron_(iOther.isIsolatedChargedHadron_),
115  //Need to trigger unpacking in iOther
116  p4_( new PolarLorentzVector(iOther.polarP4() ) ),
117  p4c_( new LorentzVector(iOther.p4())), vertex_( new Point(iOther.vertex())),
118  dxy_(iOther.dxy_), dz_(iOther.dz_),
119  dphi_(iOther.dphi_), deta_(iOther.deta_), dtrkpt_(iOther.dtrkpt_),
120  track_( iOther.track_ ? new reco::Track(*iOther.track_) : nullptr),
121  pdgId_(iOther.pdgId_), qualityFlags_(iOther.qualityFlags_),
122  pvRefProd_(iOther.pvRefProd_),pvRefKey_(iOther.pvRefKey_),
123  m_(iOther.m_? new reco::TrackBase::CovarianceMatrix(*iOther.m_) : nullptr),
124  packedHits_(iOther.packedHits_),packedLayers_(iOther.packedLayers_), normalizedChi2_(iOther.normalizedChi2_),
125  covarianceVersion_(iOther.covarianceVersion_), covarianceSchema_(iOther.covarianceSchema_),firstHit_(iOther.firstHit_) {
126  }
std::atomic< Point * > vertex_
vertex position
reco::VertexRef::key_type pvRefKey_
math::XYZPoint Point
point in the space
PackedCovariance packedCovariance_
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
std::atomic< reco::Track * > track_
reco::Track
math::XYZTLorentzVector LorentzVector
Lorentz vector.
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< LorentzVector * > p4c_
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 128 of file PackedCandidate.h.

128  :
129  packedPt_(iOther.packedPt_), packedEta_(iOther.packedEta_),
130  packedPhi_(iOther.packedPhi_), packedM_(iOther.packedM_),
131  packedDxy_(iOther.packedDxy_), packedDz_(iOther.packedDz_),
132  packedDPhi_(iOther.packedDPhi_), packedDEta_(iOther.packedDEta_), packedDTrkPt_(iOther.packedDTrkPt_),
133  packedCovariance_(iOther.packedCovariance_),
134  packedPuppiweight_(iOther.packedPuppiweight_),
135  packedPuppiweightNoLepDiff_(iOther.packedPuppiweightNoLepDiff_),
136  rawCaloFraction_(iOther.rawCaloFraction_),
137  hcalFraction_(iOther.hcalFraction_),
138  packedTime_(iOther.packedTime_),
139  packedTimeError_(iOther.packedTimeError_),
140  isIsolatedChargedHadron_(iOther.isIsolatedChargedHadron_),
141  p4_( iOther.p4_.exchange(nullptr) ) ,
142  p4c_( iOther.p4c_.exchange(nullptr)), vertex_(iOther.vertex_.exchange(nullptr)),
143  dxy_(iOther.dxy_), dz_(iOther.dz_),
144  dphi_(iOther.dphi_), deta_(iOther.deta_), dtrkpt_(iOther.dtrkpt_),
145  track_( iOther.track_.exchange(nullptr) ),
146  pdgId_(iOther.pdgId_), qualityFlags_(iOther.qualityFlags_),
147  pvRefProd_(std::move(iOther.pvRefProd_)),pvRefKey_(iOther.pvRefKey_),
148  m_( iOther.m_.exchange(nullptr)),
149  packedHits_(iOther.packedHits_), packedLayers_(iOther.packedLayers_),normalizedChi2_(iOther.normalizedChi2_),
150  covarianceVersion_(iOther.covarianceVersion_), covarianceSchema_(iOther.covarianceSchema_),firstHit_(iOther.firstHit_) {
151  }
std::atomic< Point * > vertex_
vertex position
reco::VertexRef::key_type pvRefKey_
PackedCovariance packedCovariance_
std::atomic< reco::Track * > track_
reco::Track
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< LorentzVector * > p4c_
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:510
reco::VertexRefProd pvRefProd_
Use these to build a Ref to primary vertex.
pat::PackedCandidate::~PackedCandidate ( )
override

destructor

Definition at line 136 of file PackedCandidate.cc.

Referenced by operator=().

136  {
137  delete p4_.load();
138  delete p4c_.load();
139  delete vertex_.load();
140  delete track_.load();
141  delete m_.load();
142 }
std::atomic< Point * > vertex_
vertex position
std::atomic< reco::Track * > track_
reco::Track
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< LorentzVector * > p4c_
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 505 of file PackedCandidate.h.

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

Referenced by Muon.Muon::ptErr().

505  {
506  if (packedHits_!=0 || packedLayers_ !=0) {
508  return track_.load();
509  }
510  else
511  return nullptr;
512  }
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 325 of file PackedCandidate.h.

References p4c_, and unpack().

325 { if (!p4c_) unpack(); return p4c_.load()->BoostToCM(); }
std::atomic< LorentzVector * > p4c_
int pat::PackedCandidate::charge ( ) const
inlineoverridevirtual

electric charge

Implements reco::Candidate.

Definition at line 301 of file PackedCandidate.h.

References funct::abs(), and pdgId_.

Referenced by pat::PATPackedCandidateProducer::candsOrdering(), MuonPFIsolationWithConeVeto::isInIsolationCone(), ElectronPFIsolationWithConeVeto::isInIsolationCone(), PhotonPFIsolationWithConeVeto::isInIsolationCone(), ElectronPFIsolationWithMapBasedVeto::isInIsolationCone(), PhotonPFIsolationWithMapBasedVeto::isInIsolationCone(), pat::PATTrackAndVertexUnpacker::produce(), pat::PATIsolatedTrackProducer::produce(), and threeCharge().

301  {
302  switch (abs(pdgId_)) {
303  case 211: return (pdgId_>0)-(pdgId_<0);
304  case 11: return (-1)*(pdgId_>0)+(pdgId_<0); //e
305  case 13: return (-1)*(pdgId_>0)+(pdgId_<0); //mu
306  case 15: return (-1)*(pdgId_>0)+(pdgId_<0); //tau
307  case 24: return (pdgId_>0)-(pdgId_<0); //W
308  default: return 0; //FIXME: charge is not defined
309  }
310  }
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 572 of file PackedCandidate.h.

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

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

Definition at line 733 of file PackedCandidate.h.

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

Referenced by packCovarianceElement(), and unpackCovarianceElement().

733  {
734  if (!hasTrackDetails()) throw edm::Exception(edm::errors::InvalidReference, "Trying to access covariance matrix for a PackedCandidate for which it's not available. Check hasTrackDetails() before!\n");
737  {
739  << "Attempting to load multiple covariance version in same process. This is not supported.";
740  }
742  }
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 451 of file PackedCandidate.h.

References covarianceSchema_.

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

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

Definition at line 450 of file PackedCandidate.h.

References covarianceVersion_.

Referenced by setTrackProperties().

450 { 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 300 of file PackedCandidate.cc.

Referenced by operator=().

300  {
301  return nullptr;
302 }
reco::Candidate * pat::PackedCandidate::daughter ( size_type  )
overridevirtual

return daughter at a given position (throws an exception)

Implements reco::Candidate.

Definition at line 322 of file PackedCandidate.cc.

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

return daughter with a specified role name

Implements reco::Candidate.

Definition at line 314 of file PackedCandidate.cc.

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

314  {
316  << "This Candidate type does not implement daughter(std::string). "
317  << "Please use CompositeCandidate or NamedCompositeCandidate.\n";
318 }
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 308 of file PackedCandidate.cc.

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

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

dtime with respect to the PV[ipv]

Definition at line 654 of file PackedCandidate.h.

References dtimeAssociatedPV(), and pvRefKey_.

654 { return dtimeAssociatedPV() + (*pvRefProd_)[pvRefKey_].t()-(*pvRefProd_)[ipv].t(); }
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 656 of file PackedCandidate.h.

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

Referenced by dtime(), and time().

656  {
657  if (packedTime_ == 0) return 0.f;
659  else return unpackTimeNoError(packedTime_);
660  }
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 145 of file PackedCandidate.cc.

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

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

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

uncertainty on dxy

Reimplemented from reco::Candidate.

Definition at line 498 of file PackedCandidate.h.

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

Referenced by pat::PATIsolatedTrackProducer::produce().

498 { maybeUnpackCovariance(); return sqrt((*m_.load())(3,3)); }
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 150 of file PackedCandidate.cc.

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

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

150  {
151  maybeUnpackBoth();
152  const float phi = float(p4_.load()->Phi())+dphi_;
153  return (vertex_.load()->Z()-p.Z()) - ((vertex_.load()->X()-p.X()) * std::cos(phi) + (vertex_.load()->Y()-p.Y()) * std::sin(phi)) * p4_.load()->Pz()/p4_.load()->Pt();
154 }
std::atomic< Point * > vertex_
vertex position
void maybeUnpackBoth() const
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
std::atomic< PolarLorentzVector * > p4_
the four vector
double p() const override
magnitude of momentum vector
double phi() const override
momentum azimuthal angle
virtual float pat::PackedCandidate::dzAssociatedPV ( ) const
inlinevirtual

dz with respect to the PV ref

Definition at line 489 of file PackedCandidate.h.

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

Referenced by fromPV().

489 { maybeUnpackBoth(); return dz_; }
void maybeUnpackBoth() const
float pat::PackedCandidate::dzError ( ) const
inlineoverridevirtual

uncertainty on dz

Reimplemented from reco::Candidate.

Definition at line 496 of file PackedCandidate.h.

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

Referenced by pat::PATIsolatedTrackProducer::produce().

496 { maybeUnpackCovariance(); return sqrt((*m_.load())(4,4)); }
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 329 of file PackedCandidate.h.

References p4c_, and unpack().

Referenced by PuppiProducer::produce(), and Jet.Jet::rawEnergy().

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

transverse energy

Implements reco::Candidate.

Definition at line 331 of file PackedCandidate.h.

References p4c_, and pt().

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

transverse energy squared (use this for cuts)!

Implements reco::Candidate.

Definition at line 333 of file PackedCandidate.h.

References p4c_, and pt().

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

momentum pseudorapidity

Implements reco::Candidate.

Definition at line 376 of file PackedCandidate.h.

References p4_, p4c_, and unpack().

Referenced by Particle.Particle::__str__(), DQMPFCandidateAnalyzer::analyze(), pat::PATPackedCandidateProducer::candsOrdering(), Jet.Jet::jetID(), packCovarianceElement(), Jet.Jet::puJetId(), and unpackCovarianceElement().

376 { if (!p4c_) unpack(); return p4_.load()->Eta(); }
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< LorentzVector * > p4c_
virtual float pat::PackedCandidate::etaAtVtx ( ) const
inlinevirtual

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

Definition at line 368 of file PackedCandidate.h.

References deta_, maybeUnpackBoth(), and p4_.

368  {
369  maybeUnpackBoth();
370  return p4_.load()->eta() + deta_;
371  }
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 343 of file PackedCandidate.cc.

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

Referenced by vertexCovariance().

343  {
345  << "reco::ConcreteCandidate does not implement vertex covariant matrix.\n";
346 }
uint16_t pat::PackedCandidate::firstHit ( ) const
inline

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

Definition at line 543 of file PackedCandidate.h.

References firstHit_.

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

Definition at line 467 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(), MuonPFIsolationWithConeVeto::isInIsolationCone(), ElectronPFIsolationWithConeVeto::isInIsolationCone(), PhotonPFIsolationWithConeVeto::isInIsolationCone(), ElectronPFIsolationWithMapBasedVeto::isInIsolationCone(), PhotonPFIsolationWithMapBasedVeto::isInIsolationCone(), pat::PATTrackAndVertexUnpacker::produce(), PuppiProducer::produce(), pat::PATIsolatedTrackProducer::produce(), and BoostedDoubleSVProducer::setTracksPV().

467  {
468  reco::VertexRef pvRef = vertexRef();
469  if(pvAssociationQuality()==UsedInFitTight and pvRef.key()==ipv) return PVUsedInFit;
470  if(pvRef.key()==ipv or abs(pdgId())==13 or abs(pdgId())==11 ) return PVTight;
471  if(pvAssociationQuality() == CompatibilityBTag and std::abs(dzAssociatedPV()) > std::abs(dz(ipv))) return PVTight; // it is not closest, but at least prevents the B assignment stealing
472  if(pvAssociationQuality() < UsedInFitLoose or pvRef->ndof() < 4.0 ) return PVLoose;
473  return NoPV;
474  }
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:265
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 272 of file PackedCandidate.cc.

Referenced by vertexCovariance().

272  {
273  return false;
274 }
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 276 of file PackedCandidate.cc.

Referenced by vertexCovariance().

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

Set the fraction of Hcal needed for HF and neutral hadrons and isolated charged hadrons.

Definition at line 630 of file PackedCandidate.h.

References hcalFraction_, and setIsIsolatedChargedHadron().

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

Implements reco::Candidate.

Definition at line 616 of file PackedCandidate.h.

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

Implements reco::Candidate.

Definition at line 618 of file PackedCandidate.h.

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

Implements reco::Candidate.

Definition at line 611 of file PackedCandidate.h.

611 { return false; }
bool pat::PackedCandidate::isGlobalMuon ( ) const
inlineoverridevirtual
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 634 of file PackedCandidate.h.

References isIsolatedChargedHadron_.

634 { return isIsolatedChargedHadron_; }
bool pat::PackedCandidate::isJet ( ) const
inlineoverridevirtual

Implements reco::Candidate.

Definition at line 619 of file PackedCandidate.h.

References puppiWeight(), puppiWeightNoLep(), setPuppiWeight(), and setRawCaloFraction().

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

Implements reco::Candidate.

Definition at line 612 of file PackedCandidate.h.

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

Implements reco::Candidate.

Definition at line 617 of file PackedCandidate.h.

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

Implements reco::Candidate.

Definition at line 615 of file PackedCandidate.h.

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

is long lived?

Implements reco::Candidate.

Definition at line 349 of file PackedCandidate.cc.

Referenced by setLongLived().

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

mass

Implements reco::Candidate.

Definition at line 335 of file PackedCandidate.h.

References p4_, p4c_, and unpack().

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

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

do mass constraint?

Implements reco::Candidate.

Definition at line 351 of file PackedCandidate.cc.

Referenced by setMassConstraint().

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

mass squared

Implements reco::Candidate.

Definition at line 337 of file PackedCandidate.h.

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

337 { if (!p4c_) unpack(); auto m = p4_.load()->M(); return m*m;}
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< LorentzVector * > p4c_
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 266 of file PackedCandidate.cc.

References Exception.

Referenced by masterRef(), and vertexCovariance().

266  {
267  throw cms::Exception("Invalid Reference")
268  << "this Candidate has no master clone reference."
269  << "Can't call masterClone() method.\n";
270 }
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 281 of file PackedCandidate.cc.

References Exception.

Referenced by vertexCovariance().

281  {
282  throw cms::Exception("Invalid Reference")
283  << "this Candidate has no master clone ptr."
284  << "Can't call masterClonePtr() method.\n";
285 }
template<typename Ref >
Ref pat::PackedCandidate::masterRef ( ) const
inline

cast master clone reference to a concrete type

Definition at line 609 of file PackedCandidate.h.

References masterClone().

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

Definition at line 692 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().

692 { if (!p4c_) unpack(); if (!vertex_) unpackVtx(); }
std::atomic< Point * > vertex_
vertex position
std::atomic< LorentzVector * > p4c_
void pat::PackedCandidate::maybeUnpackCovariance ( ) const
inlineprotected

Definition at line 694 of file PackedCandidate.h.

References m_, and unpackCovariance().

Referenced by dxyError(), and dzError().

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

Definition at line 693 of file PackedCandidate.h.

References track_, and unpackTrk().

Referenced by bestTrack().

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

spatial momentum vector

Implements reco::Candidate.

Definition at line 322 of file PackedCandidate.h.

References p4c_, and unpack().

322 { if (!p4c_) unpack(); return p4c_.load()->Vect(); }
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 304 of file PackedCandidate.cc.

Referenced by operator=().

304  {
305  return nullptr;
306 }
double pat::PackedCandidate::mt ( ) const
inlineoverridevirtual

transverse mass

Implements reco::Candidate.

Definition at line 340 of file PackedCandidate.h.

References p4_, p4c_, and unpack().

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

transverse mass squared

Implements reco::Candidate.

Definition at line 342 of file PackedCandidate.h.

References p4_, p4c_, and unpack().

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

number of daughters

Implements reco::Candidate.

Definition at line 287 of file PackedCandidate.cc.

Referenced by operator=().

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

number of mothers

Implements reco::Candidate.

Definition at line 291 of file PackedCandidate.cc.

Referenced by operator=().

291  {
292  return 0;
293 }
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 293 of file PackedCandidate.h.

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

Definition at line 154 of file PackedCandidate.h.

References 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_, track_, vertex(), and vertex_.

154  {
155  if(this == &iOther) {
156  return *this;
157  }
158  packedPt_ =iOther.packedPt_;
159  packedEta_=iOther.packedEta_;
160  packedPhi_=iOther.packedPhi_;
161  packedM_=iOther.packedM_;
162  packedDxy_=iOther.packedDxy_;
163  packedDz_=iOther.packedDz_;
164  packedDPhi_=iOther.packedDPhi_;
165  packedDEta_=iOther.packedDEta_;
166  packedDTrkPt_=iOther.packedDTrkPt_;
167  packedCovariance_=iOther.packedCovariance_;
168  packedPuppiweight_=iOther.packedPuppiweight_;
169  packedPuppiweightNoLepDiff_=iOther.packedPuppiweightNoLepDiff_;
170  rawCaloFraction_=iOther.rawCaloFraction_;
171  hcalFraction_=iOther.hcalFraction_;
172  packedTime_=iOther.packedTime_;
173  packedTimeError_=iOther.packedTimeError_;
174  isIsolatedChargedHadron_=iOther.isIsolatedChargedHadron_;
175  //Need to trigger unpacking in iOther
176  if(p4_) {
177  *p4_ = iOther.polarP4();
178  } else {
179  p4_.store( new PolarLorentzVector(iOther.polarP4() ) ) ;
180  }
181  if(p4c_) {
182  *p4c_ = iOther.p4();
183  } else {
184  p4c_.store( new LorentzVector(iOther.p4()));
185  }
186  if(vertex_) {
187  *vertex_ = iOther.vertex();
188  } else {
189  vertex_.store( new Point(iOther.vertex()));
190  }
191  dxy_=iOther.dxy_;
192  dz_ = iOther.dz_;
193  dphi_=iOther.dphi_;
194  deta_=iOther.deta_;
195  dtrkpt_=iOther.dtrkpt_;
196 
197  if(!iOther.track_) {
198  delete track_.exchange(nullptr);
199  } else {
200  if(!track_) {
201  track_.store( new reco::Track(*iOther.track_));
202  } else {
203  *track_ = *(iOther.track_);
204  }
205  }
206 
207  pdgId_=iOther.pdgId_;
208  qualityFlags_=iOther.qualityFlags_;
209  pvRefProd_=iOther.pvRefProd_;
210  pvRefKey_=iOther.pvRefKey_;
211  if(!iOther.m_) {
212  delete m_.exchange(nullptr);
213  } else {
214  if(!m_) {
215  m_.store( new reco::Track::CovarianceMatrix(*iOther.m_));
216  } else {
217  *m_ = *(iOther.m_);
218  }
219  }
220 
221 
222  packedHits_=iOther.packedHits_;
223  packedLayers_=iOther.packedLayers_;
224  normalizedChi2_=iOther.normalizedChi2_;
225  covarianceVersion_=iOther.covarianceVersion_;
226  covarianceSchema_=iOther.covarianceSchema_;
227  firstHit_=iOther.firstHit_;
228  return *this;
229  }
std::atomic< Point * > vertex_
vertex position
reco::VertexRef::key_type pvRefKey_
math::XYZPoint Point
point in the space
PackedCovariance packedCovariance_
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
std::atomic< reco::Track * > track_
reco::Track
math::XYZTLorentzVector LorentzVector
Lorentz vector.
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< LorentzVector * > p4c_
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 231 of file PackedCandidate.h.

References 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_, alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, track_, vertex_, and ~PackedCandidate().

231  {
232  if(this == &iOther) {
233  return *this;
234  }
235  packedPt_ =iOther.packedPt_;
236  packedEta_=iOther.packedEta_;
237  packedPhi_=iOther.packedPhi_;
238  packedM_=iOther.packedM_;
239  packedDxy_=iOther.packedDxy_;
240  packedDz_=iOther.packedDz_;
241  packedDPhi_=iOther.packedDPhi_;
242  packedDEta_=iOther.packedDEta_;
243  packedDTrkPt_=iOther.packedDTrkPt_;
244  packedCovariance_=iOther.packedCovariance_;
245  packedPuppiweight_=iOther.packedPuppiweight_;
246  packedPuppiweightNoLepDiff_=iOther.packedPuppiweightNoLepDiff_;
247  rawCaloFraction_=iOther.rawCaloFraction_;
248  hcalFraction_=iOther.hcalFraction_;
249  packedTime_=iOther.packedTime_;
250  packedTimeError_=iOther.packedTimeError_;
251  isIsolatedChargedHadron_=iOther.isIsolatedChargedHadron_;
252  delete p4_.exchange(iOther.p4_.exchange(nullptr));
253  delete p4c_.exchange(iOther.p4c_.exchange(nullptr));
254  delete vertex_.exchange(iOther.vertex_.exchange(nullptr));
255  dxy_=iOther.dxy_;
256  dz_ = iOther.dz_;
257  dphi_=iOther.dphi_;
258  deta_=iOther.deta_;
259  dtrkpt_=iOther.dtrkpt_;
260  delete track_.exchange(iOther.track_.exchange( nullptr));
261  pdgId_=iOther.pdgId_;
262  qualityFlags_=iOther.qualityFlags_;
263  pvRefProd_=iOther.pvRefProd_;
264  pvRefKey_=iOther.pvRefKey_;
265  delete m_.exchange(iOther.m_.exchange(nullptr));
266  packedHits_=iOther.packedHits_;
267  packedLayers_=iOther.packedLayers_;
268  normalizedChi2_=iOther.normalizedChi2_;
269  covarianceVersion_=iOther.covarianceVersion_;
270  covarianceSchema_=iOther.covarianceSchema_;
271  firstHit_=iOther.firstHit_;
272  return *this;
273  }
std::atomic< Point * > vertex_
vertex position
reco::VertexRef::key_type pvRefKey_
PackedCovariance packedCovariance_
std::atomic< reco::Track * > track_
reco::Track
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< LorentzVector * > p4c_
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 295 of file PackedCandidate.cc.

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

Referenced by covarianceParameterization().

295  {
296  return p4() == o.p4() && vertex() == o.vertex() && charge() == o.charge();
297 // return p4() == o.p4() && charge() == o.charge();
298 }
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 327 of file PackedCandidate.h.

References p4c_, and unpack().

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

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

four-momentum Lorentz vecto r

Implements reco::Candidate.

Definition at line 318 of file PackedCandidate.h.

References p4c_, and unpack().

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

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

Definition at line 13 of file PackedCandidate.cc.

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

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

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

Definition at line 695 of file PackedCandidate.h.

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

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

695 { pack(false); packVtx(false); delete p4_.exchange(nullptr); delete p4c_.exchange(nullptr); delete vertex_.exchange(nullptr); unpack(); unpackVtx(); } // do it this way, so that we don't loose precision on the angles before computing dxy,dz
std::atomic< Point * > vertex_
vertex position
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< LorentzVector * > p4c_
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 71 of file PackedCandidate.cc.

Referenced by setTrackProperties().

71  {
80  //unpack afterwards
81  if(unpackAfterwards) unpackCovariance();
82 }
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 672 of file PackedCandidate.h.

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

672  {
674  }
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 393 of file PackedCandidate.cc.

References f, and min().

393  {
394  if (timeError <= 0) return 0;
395  // log-scale packing.
396  // for MIN_TIMEERROR = 0.002, EXPO_TIMEERROR = 5:
397  // minimum value 0.002 = 2ps (packed as 1)
398  // maximum value 0.5 ns (packed as 255)
399  // constant *relative* precision of about 2%
400  return std::max<uint8_t>( std::min(std::round(std::ldexp(std::log2(timeError/MIN_TIMEERROR), +EXPO_TIMEERROR)), 255.f), 1);
401 }
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 409 of file PackedCandidate.cc.

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

409  {
410  // encoding in log scale to store times in a large range with few bits.
411  // for MIN_TIME_NOERROR = 0.0002 and EXPO_TIME_NOERROR = 6:
412  // smallest non-zero time = 0.2 ps (encoded as +/-1)
413  // one BX, +/- 12.5 ns, is fully covered with 11 bits (+/- 1023)
414  // 12 bits cover by far any plausible value (+/-2047 corresponds to about +/- 0.8 ms!)
415  // constant *relative* ~1% precision
416  if (std::abs(time) < MIN_TIME_NOERROR) return 0; // prevent underflows
417  float fpacked = std::ldexp(std::log2(std::abs(time/MIN_TIME_NOERROR)),+EXPO_TIME_NOERROR);
418  return (time > 0 ? +1 : -1)*std::min(std::round(fpacked), 2047.f);
419 }
static float MIN_TIME_NOERROR
static int EXPO_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 429 of file PackedCandidate.cc.

References funct::abs(), and f.

429  {
430  // Encode in units of timeError * 2^EXPO_TIME_WITHERROR (~1.6% if EXPO_TIME_WITHERROR = -6)
431  // the largest value that can be stored in 14 bits + sign bit + overflow bit is about 260 sigmas
432  // values larger than that will be stored using the no-timeError packing (with less precision).
433  // overflows of these kinds should happen only for particles that are late arriving, out-of-time,
434  // or mis-reconstructed, as timeError is O(20ps) and the beam spot witdth is O(200ps)
435  float fpacked = std::round(time/std::ldexp(timeError, EXPO_TIME_WITHERROR));
436  if (std::abs(fpacked) < 16383.f) { // 16383 = (2^14 - 1) = largest absolute value for a signed 15 bit integer
437  return int16_t(fpacked) * 2; // make it even, and fit in a signed 16 bit int
438  } else {
439  int16_t packed = packTimeNoError(time); // encode
440  return packed * 2 + (time > 0 ? +1 : -1); // make it odd, to signal that there was an overlow
441  }
442 }
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 25 of file PackedCandidate.cc.

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

Referenced by packBoth(), and setVertex().

25  {
26  reco::VertexRef pvRef = vertexRef();
27  Point pv = pvRef.isNonnull() ? pvRef->position() : Point();
28  float dxPV = vertex_.load()->X() - pv.X(), dyPV = vertex_.load()->Y() - pv.Y(); //, rPV = std::hypot(dxPV, dyPV);
29  float s = std::sin(float(p4_.load()->Phi())+dphi_), c = std::cos(float(p4_.load()->Phi()+dphi_)); // not the fastest option, but we're in reduced precision already, so let's avoid more roundoffs
30  dxy_ = - dxPV * s + dyPV * c;
31  // if we want to go back to the full x,y,z we need to store also
32  // float dl = dxPV * c + dyPV * s;
33  // float xRec = - dxy_ * s + dl * c, yRec = dxy_ * c + dl * s;
34  float pzpt = p4_.load()->Pz()/p4_.load()->Pt();
35  dz_ = vertex_.load()->Z() - pv.Z() - (dxPV*c + dyPV*s) * pzpt;
37  packedDz_ = pvRef.isNonnull() ? MiniFloatConverter::float32to16(dz_*100) : int16_t(std::round(dz_/40.f*std::numeric_limits<int16_t>::max()));
38  packedDPhi_ = int16_t(std::round(dphi_/3.2f*std::numeric_limits<int16_t>::max()));
41 
42  if (unpackAfterwards) {
43  delete vertex_.exchange(nullptr);
44  unpackVtx();
45  }
46 }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:253
std::atomic< Point * > vertex_
vertex position
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
math::XYZPoint Point
point in the space
const reco::VertexRef vertexRef() const
static uint16_t float32to16(float x)
Definition: libminifloat.h:15
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
math::XYZPoint Point
def pv(vc)
Definition: MetAnalyzer.py:6
std::atomic< PolarLorentzVector * > p4_
the four vector
double f[11][100]
int pat::PackedCandidate::pdgId ( ) const
inlineoverridevirtual
double pat::PackedCandidate::phi ( ) const
inlineoverridevirtual

momentum azimuthal angle

Implements reco::Candidate.

Definition at line 352 of file PackedCandidate.h.

References p4_, p4c_, and unpack().

Referenced by Particle.Particle::__str__(), DQMPFCandidateAnalyzer::analyze(), and ntupleDataFormat.Track::phiPull().

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

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

Definition at line 360 of file PackedCandidate.h.

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

360  {
361  maybeUnpackBoth();
362  float ret = p4_.load()->Phi() + dphi_;
363  while (ret > float(M_PI)) ret -= 2*float(M_PI);
364  while (ret < -float(M_PI)) ret += 2*float(M_PI);
365  return ret;
366  }
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 320 of file PackedCandidate.h.

References p4_, p4c_, and unpack().

Referenced by operator=().

320 { if (!p4c_) unpack(); return *p4_; }
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< LorentzVector * > p4c_
virtual const reco::Track& pat::PackedCandidate::pseudoTrack ( ) const
inlinevirtual

Return reference to a pseudo track made with candidate kinematics, parameterized error for eta,phi,pt and full IP covariance.

Definition at line 502 of file PackedCandidate.h.

References track_, and unpackTrk().

Referenced by PileupJetIdAlgo::computeIdVariables(), BPHTrackReference::getFromPC(), and pat::PATTrackAndVertexUnpacker::produce().

502 { if (!track_) unpackTrk(); return *track_; }
std::atomic< reco::Track * > track_
reco::Track
double pat::PackedCandidate::pt ( ) const
inlineoverridevirtual
virtual double pat::PackedCandidate::ptTrk ( ) const
inlinevirtual

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

Definition at line 355 of file PackedCandidate.h.

References dtrkpt_, maybeUnpackBoth(), and p4_.

355  {
356  maybeUnpackBoth();
357  return p4_.load()->pt() + dtrkpt_;
358  }
void maybeUnpackBoth() const
std::atomic< PolarLorentzVector * > p4_
the four vector
float pat::PackedCandidate::puppiWeight ( ) const

Set both weights at once (with option for only full PUPPI)

Definition at line 360 of file PackedCandidate.cc.

References logintpack::unpack8logClosed().

Referenced by DQMPFCandidateAnalyzer::analyze(), isJet(), and PuppiProducer::produce().

360 { return unpack8logClosed(packedPuppiweight_,-2,0,64)/2. + 0.5;}
double unpack8logClosed(int8_t i, double lmin, double lmax, uint8_t base=128)
reverse of pack8logClosed
float pat::PackedCandidate::puppiWeightNoLep ( ) const

Weight from full PUPPI.

Definition at line 362 of file PackedCandidate.cc.

References logintpack::unpack8logClosed().

Referenced by DQMPFCandidateAnalyzer::analyze(), isJet(), and PuppiProducer::produce().

double unpack8logClosed(int8_t i, double lmin, double lmax, uint8_t base=128)
reverse of pack8logClosed
const PVAssociationQuality pat::PackedCandidate::pvAssociationQuality ( ) const
inline
double pat::PackedCandidate::px ( ) const
inlineoverridevirtual

x coordinate of momentum vector

Implements reco::Candidate.

Definition at line 344 of file PackedCandidate.h.

References p4c_, and unpack().

Referenced by PuppiProducer::produce().

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

y coordinate of momentum vector

Implements reco::Candidate.

Definition at line 346 of file PackedCandidate.h.

References p4c_, and unpack().

Referenced by PuppiProducer::produce().

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

z coordinate of momentum vector

Implements reco::Candidate.

Definition at line 348 of file PackedCandidate.h.

References p4c_, and unpack().

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

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

rapidity

Implements reco::Candidate.

Definition at line 378 of file PackedCandidate.h.

References p4_, p4c_, and unpack().

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

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

Definition at line 628 of file PackedCandidate.h.

References rawCaloFraction_, and setHcalFraction().

628 { return (rawCaloFraction_/100.); }
void pat::PackedCandidate::setAssociationQuality ( PVAssociationQuality  q)
inline
void pat::PackedCandidate::setCharge ( int  charge)
inlineoverridevirtual

set electric charge

Implements reco::Candidate.

Definition at line 312 of file PackedCandidate.h.

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

set time measurement

Definition at line 379 of file PackedCandidate.cc.

Referenced by setTime(), and timeError().

379  {
380  if (aTime == 0 && aTimeError == 0) {
381  packedTime_ = 0; packedTimeError_ = 0;
382  } else if (aTimeError == 0) {
383  packedTimeError_ = 0;
384  packedTime_ = packTimeNoError(aTime);
385  } else {
386  packedTimeError_ = packTimeError(aTimeError);
387  aTimeError = unpackTimeError(packedTimeError_); // for reproducibility
388  packedTime_ = packTimeWithError(aTime, aTimeError);
389  }
390 }
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 539 of file PackedCandidate.h.

References firstHit_, and listBenchmarks::pattern.

539  {
541  }
void pat::PackedCandidate::setHcalFraction ( float  p)

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

Definition at line 371 of file PackedCandidate.cc.

References AlCaHLTBitMon_ParallelJobs::p.

Referenced by rawCaloFraction().

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

Definition at line 414 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().

414  {
415  // first we count the number of layers with hits
416  int numberOfPixelLayers_ = tk.hitPattern().pixelLayersWithMeasurement();
417  if (numberOfPixelLayers_ > trackPixelHitsMask) numberOfPixelLayers_ = trackPixelHitsMask;
418  int numberOfStripLayers_ = tk.hitPattern().stripLayersWithMeasurement();
419  if (numberOfStripLayers_ > trackStripHitsMask) numberOfStripLayers_ = trackStripHitsMask;
420  packedLayers_ = (numberOfPixelLayers_&trackPixelHitsMask) | (numberOfStripLayers_ << trackStripHitsShift);
421  // now we count number of additional hits, beyond the one-per-layer implied by packedLayers_
422  int numberOfPixelHits_ = tk.hitPattern().numberOfValidPixelHits() - numberOfPixelLayers_;
423  if (numberOfPixelHits_ > trackPixelHitsMask) numberOfPixelHits_ = trackPixelHitsMask;
424  int numberOfStripHits_ = tk.hitPattern().numberOfValidHits() - numberOfPixelHits_ - numberOfPixelLayers_ - numberOfStripLayers_;
425  if (numberOfStripHits_ > trackStripHitsMask) numberOfStripHits_ = trackStripHitsMask;
426 
427  packedHits_ = (numberOfPixelHits_&trackPixelHitsMask) | (numberOfStripHits_ << trackStripHitsShift);
428  }
int numberOfValidHits() const
Definition: HitPattern.h:823
int pixelLayersWithMeasurement() const
Definition: HitPattern.cc:493
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:446
int stripLayersWithMeasurement() const
Definition: HitPattern.h:1035
int numberOfValidPixelHits() const
Definition: HitPattern.h:838
void pat::PackedCandidate::setIsIsolatedChargedHadron ( bool  p)

Fraction of Ecal and Hcal for HF and neutral hadrons and isolated charged hadrons.

Definition at line 375 of file PackedCandidate.cc.

References AlCaHLTBitMon_ParallelJobs::p.

Referenced by hcalFraction().

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

set long lived flag

Implements reco::Candidate.

Definition at line 561 of file PackedCandidate.h.

References longLived().

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

Definition at line 532 of file PackedCandidate.h.

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

532  {
533  int lost = hits; if (lost > 2) lost = 2; // protection against misuse
534  lost++; // shift so it's 0 .. 3 instead of (-1) .. 2
536  }
void pat::PackedCandidate::setMass ( double  m)
inlineoverridevirtual

set particle mass

Implements reco::Candidate.

Definition at line 394 of file PackedCandidate.h.

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

394  {
395  if (!p4c_) unpack();
396  *p4_ = PolarLorentzVector(p4_.load()->Pt(), p4_.load()->Eta(), p4_.load()->Phi(), m);
397  pack();
398  }
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< LorentzVector * > p4c_
void pack(bool unpackAfterwards=true)
void pat::PackedCandidate::setMassConstraint ( )
inlineoverridevirtual

set mass constraint flag

Implements reco::Candidate.

Definition at line 567 of file PackedCandidate.h.

References massConstraint().

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

Definition at line 545 of file PackedCandidate.h.

References muonFlagsMask, muonFlagsShift, and qualityFlags_.

545  {
546  int16_t muonFlags = isStandAlone | (2*isGlobal);
548  }
void pat::PackedCandidate::setP4 ( const LorentzVector p4)
inlineoverridevirtual

set 4-momentum

Implements reco::Candidate.

Definition at line 382 of file PackedCandidate.h.

References maybeUnpackBoth(), p4_, and packBoth().

Referenced by Jet.Jet::setCorrP4().

382  {
383  maybeUnpackBoth(); // changing px,py,pz changes also mapping between dxy,dz and x,y,z
384  *p4_ = PolarLorentzVector(p4.Pt(), p4.Eta(), p4.Phi(), p4.M());
385  packBoth();
386  }
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
void pat::PackedCandidate::setP4 ( const PolarLorentzVector p4)
inlineoverride

set 4-momentum

Definition at line 388 of file PackedCandidate.h.

References maybeUnpackBoth(), p4(), p4_, and packBoth().

Referenced by Jet.Jet::setCorrP4().

388  {
389  maybeUnpackBoth(); // changing px,py,pz changes also mapping between dxy,dz and x,y,z
390  *p4_ = p4;
391  packBoth();
392  }
void maybeUnpackBoth() const
const LorentzVector & p4() const override
four-momentum Lorentz vecto r
std::atomic< PolarLorentzVector * > p4_
the four vector
void pat::PackedCandidate::setPdgId ( int  pdgId)
inlineoverridevirtual

Implements reco::Candidate.

Definition at line 553 of file PackedCandidate.h.

References pdgId(), and pdgId_.

553 { 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 354 of file PackedCandidate.cc.

References logintpack::pack8logClosed().

Referenced by isJet().

354  {
355  // Set both weights at once to avoid misconfigured weights if called in the wrong order
356  packedPuppiweight_ = pack8logClosed((p-0.5)*2,-2,0,64);
358 }
int8_t pack8logClosed(double x, double lmin, double lmax, uint8_t base=128)
double p() const override
magnitude of momentum vector
void pat::PackedCandidate::setPz ( double  pz)
inlineoverridevirtual

Implements reco::Candidate.

Definition at line 399 of file PackedCandidate.h.

References maybeUnpackBoth(), p4_, p4c_, packBoth(), and pz().

399  {
400  maybeUnpackBoth(); // changing px,py,pz changes also mapping between dxy,dz and x,y,z
401  *p4c_ = LorentzVector(p4c_.load()->Px(), p4c_.load()->Py(), pz, p4c_.load()->E());
402  *p4_ = PolarLorentzVector(p4c_.load()->Pt(), p4c_.load()->Eta(), p4c_.load()->Phi(), p4c_.load()->M());
403  packBoth();
404  }
void maybeUnpackBoth() const
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
std::atomic< LorentzVector * > p4c_
void pat::PackedCandidate::setRawCaloFraction ( float  p)

Weight from PUPPI removing leptons.

Definition at line 364 of file PackedCandidate.cc.

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

Referenced by isJet().

364  {
366  rawCaloFraction_ = std::numeric_limits<uint8_t>::max(); // Set to overflow value
367  else
368  rawCaloFraction_ = 100*p;
369 }
double p() const override
magnitude of momentum vector
void pat::PackedCandidate::setStatus ( int  status)
inlineoverridevirtual

set status word

Implements reco::Candidate.

Definition at line 557 of file PackedCandidate.h.

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

set electric charge

Implements reco::Candidate.

Definition at line 316 of file PackedCandidate.h.

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

set time measurement

Definition at line 666 of file PackedCandidate.h.

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

666 { setDTimeAssociatedPV(aTime - vertexRef()->t(), aTimeError); }
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 430 of file PackedCandidate.h.

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

Referenced by setTrackProperties().

430  {
434  setHits(tk);
435  packBoth();
436  packCovariance(covariance,false);
437  }
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:561
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 440 of file PackedCandidate.h.

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

440  {
442  }
CovarianceMatrix covariance() const
return track covariance matrix
Definition: TrackBase.h:731
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)
inlineoverride

set vertex

Definition at line 463 of file PackedCandidate.h.

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

std::atomic< Point * > vertex_
vertex position
void maybeUnpackBoth() const
const Point & vertex() const override
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 296 of file PackedCandidate.h.

296  {
297  return reco::CandidatePtr();
298  }
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 555 of file PackedCandidate.h.

References qualityFlags_.

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

momentum polar angle

Implements reco::Candidate.

Definition at line 374 of file PackedCandidate.h.

References p4_, p4c_, and unpack().

Referenced by Tau.Tau::zImpact().

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

electric charge

Implements reco::Candidate.

Definition at line 314 of file PackedCandidate.h.

References charge().

314 {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 652 of file PackedCandidate.h.

References dtimeAssociatedPV(), and vertexRef().

652 { 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 662 of file PackedCandidate.h.

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

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

Definition at line 448 of file PackedCandidate.h.

References pixelLayersWithMeasurement(), and stripLayersWithMeasurement().

int pixelLayersWithMeasurement() const
int stripLayersWithMeasurement() const
bool pat::PackedCandidate::trackHighPurity ( ) const
inline
void pat::PackedCandidate::unpack ( ) const
protected

Definition at line 48 of file PackedCandidate.cc.

References MiniFloatConverter::float16to32(), createfilelist::int, hpstanc_transforms::max, p4, 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().

48  {
50  double shift = (pt<1. ? 0.1*pt : 0.1/pt); // shift particle phi to break degeneracies in angular separations
51  double sign = ( ( int(pt*10) % 2 == 0 ) ? 1 : -1 ); // introduce a pseudo-random sign of the shift
52  double phi = int16_t(packedPhi_)*3.2f/std::numeric_limits<int16_t>::max() + sign*shift*3.2/std::numeric_limits<int16_t>::max();
53  auto p4 = std::make_unique<PolarLorentzVector>(pt,
55  phi,
57  auto p4c = std::make_unique<LorentzVector>( *p4 );
58  PolarLorentzVector* expectp4= nullptr;
59  if( p4_.compare_exchange_strong(expectp4,p4.get()) ) {
60  p4.release();
61  }
62 
63  //p4c_ works as the guard for unpacking so it
64  // must be set last
65  LorentzVector* expectp4c = nullptr;
66  if(p4c_.compare_exchange_strong(expectp4c, p4c.get()) ) {
67  p4c.release();
68  }
69 }
const LorentzVector & p4() const override
four-momentum Lorentz vecto r
static float float16to32(uint16_t h)
Definition: libminifloat.h:10
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
math::XYZTLorentzVector LorentzVector
std::atomic< PolarLorentzVector * > p4_
the four vector
double pt() const override
transverse momentum
std::atomic< LorentzVector * > p4c_
double phi() const override
momentum azimuthal angle
static unsigned int const shift
void pat::PackedCandidate::unpackCovariance ( ) const
protected

Definition at line 84 of file PackedCandidate.cc.

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

Referenced by maybeUnpackCovariance().

84  {
86  if(p.isValid())
87  {
88  auto m = std::make_unique<reco::TrackBase::CovarianceMatrix>() ;
89  for(int i=0;i<5;i++)
90  for(int j=0;j<5;j++){
91  (*m)(i,j)=0;
92  }
101  reco::TrackBase::CovarianceMatrix* expected = nullptr;
102  if( m_.compare_exchange_strong(expected,m.get()) ) {
103  m.release();
104  }
105 
106  } else {
108  << "You do not have a valid track parameters file loaded. "
109  << "Please check that the release version is compatible with your input data"
110  <<"or avoid accessing track parameter uncertainties. ";
111  }
112 }
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 669 of file PackedCandidate.h.

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

669  {
671  }
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 402 of file PackedCandidate.cc.

Referenced by timeError().

402  {
403  return timeError > 0 ? MIN_TIMEERROR * std::exp2(std::ldexp(float(timeError),-EXPO_TIMEERROR)) : -1.0f;
404 }
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 405 of file PackedCandidate.cc.

References funct::abs().

Referenced by dtimeAssociatedPV(), and unpackTimeWithError().

405  {
406  if (time == 0) return 0.f;
407  return (time > 0 ? MIN_TIME_NOERROR : -MIN_TIME_NOERROR) * std::exp2(std::ldexp(float(std::abs(time)),-EXPO_TIME_NOERROR));
408 }
static float MIN_TIME_NOERROR
static int EXPO_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 420 of file PackedCandidate.cc.

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

Referenced by dtimeAssociatedPV().

420  {
421  if (time % 2 == 0) {
422  // no overflow: drop rightmost bit and unpack in units of timeError
423  return std::ldexp(unpackTimeError(timeError), EXPO_TIME_WITHERROR) * float(time/2);
424  } else {
425  // overflow: drop rightmost bit, unpack using the noError encoding
427  }
428 }
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 156 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().

156  {
157  maybeUnpackBoth();
160  int numberOfStripLayers = stripLayersWithMeasurement(), numberOfPixelLayers = pixelLayersWithMeasurement();
161  int numberOfPixelHits = this->numberOfPixelHits();
162  int numberOfHits = this->numberOfHits();
163 
164  int ndof = numberOfHits+numberOfPixelHits-5;
165  LostInnerHits innerLost = lostInnerHits();
166 
167  auto track = std::make_unique<reco::Track>(normalizedChi2_*ndof,ndof,*vertex_,math::XYZVector(p3.x(),p3.y(),p3.z()),charge(),*(m_.load()),reco::TrackBase::undefAlgorithm,reco::TrackBase::loose);
168  int i=0;
169  if ( firstHit_ == 0) { //Backward compatible
170  if(innerLost == validHitInFirstPixelBarrelLayer){
171  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, 1, 0, TrackingRecHit::valid);
172  i=1;
173  }
174  } else {
175  track->appendHitPattern(firstHit_,TrackingRecHit::valid);
176  }
177 
179 
180  // add hits to match the number of laters and validHitInFirstPixelBarrelLayer
181  if(innerLost == validHitInFirstPixelBarrelLayer){
182  // then to encode the number of layers, we add more hits on distinct layers (B2, B3, B4, F1, ...)
183  for(; i<numberOfPixelLayers; i++) {
184  if (i <= 3) {
185  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, i+1, 0, TrackingRecHit::valid);
186  } else {
187  track->appendTrackerHitPattern(PixelSubdetector::PixelEndcap, i-3, 0, TrackingRecHit::valid);
188  }
189  }
190  } else {
191  // to encode the information on the layers, we add one valid hits per layer but skipping PXB1
192  int iOffset=0;
196  } else {iOffset=1; }
197  for(;i<numberOfPixelLayers; i++) {
198  if (i+iOffset <= 2 ) { track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, i+iOffset+1, 0, TrackingRecHit::valid); }
199  else {track->appendTrackerHitPattern(PixelSubdetector::PixelEndcap, i+iOffset-3+1, 0, TrackingRecHit::valid); }
200 
201  }
202  }
203  // add extra hits (overlaps, etc), all on the first layer with a hit - to avoid increasing the layer count
204  for(;i<numberOfPixelHits; i++) {
207  } else {
208  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, (innerLost == validHitInFirstPixelBarrelLayer ? 1 : 2), 0, TrackingRecHit::valid);
209  }
210  }
211  // now start adding strip layers, putting one hit on each layer so that the hitPattern.stripLayersWithMeasurement works.
212  // we don't know what the layers where, so we just start with TIB (4 layers), then TOB (6 layers), then TEC (9)
213  // and then TID(3), so that we can get a number of valid strip layers up to 4+6+9+3
215  int slOffset=0;
221  }
222  for(int sl=slOffset; sl < numberOfStripLayers+slOffset; ++sl, ++i) {
223  if (sl < 4) track->appendTrackerHitPattern(StripSubdetector::TIB, sl +1, 1, TrackingRecHit::valid);
224  else if (sl < 4+3) track->appendTrackerHitPattern(StripSubdetector::TID, (sl- 4)+1, 1, TrackingRecHit::valid);
225  else if (sl < 7+6) track->appendTrackerHitPattern(StripSubdetector::TOB, (sl-7)+1, 1, TrackingRecHit::valid);
226  else if (sl < 13+9) track->appendTrackerHitPattern(StripSubdetector::TEC, (sl-13)+1, 1, TrackingRecHit::valid);
227  else break; // wtf?
228  }
229  // finally we account for extra strip hits beyond the one-per-layer added above. we put them all on TIB1,
230  // to avoid incrementing the number of layersWithMeasurement.
231  for(;i<numberOfHits;i++) {
234  } else {
235  track->appendTrackerHitPattern(StripSubdetector::TIB, 1, 1, TrackingRecHit::valid);
236  }
237  }
238 
239 
240  switch (innerLost) {
242  break;
243  case noLostInnerHits:
244  break;
245  case oneLostInnerHit:
246  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, 1, 0, TrackingRecHit::missing_inner);
247  break;
248  case moreLostInnerHits:
249  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, 1, 0, TrackingRecHit::missing_inner);
250  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, 2, 0, TrackingRecHit::missing_inner);
251  break;
252  };
253 
255 
256  reco::Track* expected = nullptr;
257  if( track_.compare_exchange_strong(expected,track.get()) ) {
258  track.release();
259  }
260 
261 
262 }
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:700
static bool pixelHitFilter(uint16_t pattern)
Definition: HitPattern.h:564
virtual float etaAtVtx() const
eta from the track (normally identical to eta())
std::atomic< Point * > vertex_
vertex position
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
std::atomic< reco::Track * > track_
reco::Track
void maybeUnpackCovariance() const
bool trackHighPurity() const
true if the track had the highPurity quality bit
LostInnerHits lostInnerHits() const
static bool stripHitFilter(uint16_t pattern)
Definition: HitPattern.h:595
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:691
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 114 of file PackedCandidate.cc.

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

Referenced by maybeUnpackBoth(), and packBoth().

114  {
115  reco::VertexRef pvRef = vertexRef();
121  Point pv = pvRef.isNonnull() ? pvRef->position() : Point();
122  float phi = p4_.load()->Phi()+dphi_, s = std::sin(phi), c = std::cos(phi);
123  auto vertex = std::make_unique<Point>(pv.X() - dxy_ * s,
124  pv.Y() + dxy_ * c,
125  pv.Z() + dz_ ); // for our choice of using the PCA to the PV, by definition the remaining term -(dx*cos(phi) + dy*sin(phi))*(pz/pt) is zero
126 
127 
128 
129 
130  Point* expected = nullptr;
131  if( vertex_.compare_exchange_strong(expected,vertex.get()) ) {
132  vertex.release();
133  }
134 }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:253
std::atomic< Point * > vertex_
vertex position
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:10
const Point & vertex() const override
vertex position
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
math::XYZPoint Point
def pv(vc)
Definition: MetAnalyzer.py:6
std::atomic< PolarLorentzVector * > p4_
the four vector
double phi() const override
momentum azimuthal angle
const Point& pat::PackedCandidate::vertex ( ) const
inlineoverridevirtual

vertex position

Implements reco::Candidate.

Definition at line 455 of file PackedCandidate.h.

References maybeUnpackBoth(), and vertex_.

Referenced by Tau.Tau::dxy(), operator=(), and setVertex().

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

chi-squares

Implements reco::Candidate.

Definition at line 326 of file PackedCandidate.cc.

Referenced by clone().

326  {
327  return 0;
328 }
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 338 of file PackedCandidate.cc.

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

338  {
340  << "reco::ConcreteCandidate does not implement vertex covariant matrix.\n";
341 }
CovarianceMatrix pat::PackedCandidate::vertexCovariance ( ) const
inlineoverridevirtual

return SMatrix

Reimplemented from reco::Candidate.

Definition at line 590 of file PackedCandidate.h.

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

Referenced by clone().

590 { CovarianceMatrix m; fillVertexCovariance(m); return m; }
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 330 of file PackedCandidate.cc.

Referenced by clone().

330  {
331  return 0;
332 }
double pat::PackedCandidate::vertexNormalizedChi2 ( ) const
overridevirtual

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

Implements reco::Candidate.

Definition at line 334 of file PackedCandidate.cc.

Referenced by clone().

334  {
335  return 0;
336 }
const reco::VertexRef pat::PackedCandidate::vertexRef ( ) const
inline

Definition at line 482 of file PackedCandidate.h.

References pvRefKey_, and pvRefProd_.

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

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 457 of file PackedCandidate.h.

References maybeUnpackBoth(), and vertex_.

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

y coordinate of vertex position

Implements reco::Candidate.

Definition at line 459 of file PackedCandidate.h.

References maybeUnpackBoth(), and vertex_.

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

z coordinate of vertex position

Implements reco::Candidate.

Definition at line 461 of file PackedCandidate.h.

References maybeUnpackBoth(), and vertex_.

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

Friends And Related Function Documentation

friend class ::OverlapChecker
friend

Definition at line 747 of file PackedCandidate.h.

friend class ::testPackedCandidate
friend

Definition at line 677 of file PackedCandidate.h.

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

Definition at line 746 of file PackedCandidate.h.

friend class ShallowCloneCandidate
friend

Definition at line 748 of file PackedCandidate.h.

friend class ShallowClonePtrCandidate
friend

Definition at line 749 of file PackedCandidate.h.

Member Data Documentation

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

Definition at line 732 of file PackedCandidate.h.

CovarianceParameterization pat::PackedCandidate::covarianceParameterization_
staticprotected

Definition at line 730 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 712 of file PackedCandidate.h.

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

float pat::PackedCandidate::dphi_
mutableprotected

Definition at line 712 of file PackedCandidate.h.

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

float pat::PackedCandidate::dtrkpt_
mutableprotected

Definition at line 712 of file PackedCandidate.h.

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

float pat::PackedCandidate::dxy_
mutableprotected

Definition at line 712 of file PackedCandidate.h.

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

float pat::PackedCandidate::dz_
mutableprotected

Definition at line 712 of file PackedCandidate.h.

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

int pat::PackedCandidate::EXPO_TIME_NOERROR = 6
staticprotected

Definition at line 768 of file PackedCandidate.h.

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

Definition at line 769 of file PackedCandidate.h.

int pat::PackedCandidate::EXPO_TIMEERROR = 5
staticprotected

Definition at line 767 of file PackedCandidate.h.

uint16_t pat::PackedCandidate::firstHit_

Definition at line 771 of file PackedCandidate.h.

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

int8_t pat::PackedCandidate::hcalFraction_
protected

Definition at line 701 of file PackedCandidate.h.

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

bool pat::PackedCandidate::isIsolatedChargedHadron_
protected

Definition at line 705 of file PackedCandidate.h.

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

float pat::PackedCandidate::kMinDEtaToStore_ =0.001
staticprotected

Definition at line 678 of file PackedCandidate.h.

float pat::PackedCandidate::kMinDTrkPtToStore_ =0.001
staticprotected

Definition at line 679 of file PackedCandidate.h.

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

long lived flag

Definition at line 559 of file PackedCandidate.h.

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

IP covariance.

Definition at line 723 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 565 of file PackedCandidate.h.

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

Definition at line 766 of file PackedCandidate.h.

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

Definition at line 765 of file PackedCandidate.h.

uint8_t pat::PackedCandidate::normalizedChi2_
protected

track quality information

Definition at line 727 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 684 of file PackedCandidate.h.

Referenced by operator=().

uint16_t pat::PackedCandidate::packedDEta_
protected

Definition at line 683 of file PackedCandidate.h.

Referenced by operator=().

uint16_t pat::PackedCandidate::packedDPhi_
protected

Definition at line 683 of file PackedCandidate.h.

Referenced by operator=().

uint16_t pat::PackedCandidate::packedDTrkPt_
protected

Definition at line 683 of file PackedCandidate.h.

Referenced by operator=().

uint16_t pat::PackedCandidate::packedDxy_
protected

Definition at line 683 of file PackedCandidate.h.

Referenced by operator=().

uint16_t pat::PackedCandidate::packedDz_
protected

Definition at line 683 of file PackedCandidate.h.

Referenced by operator=().

uint16_t pat::PackedCandidate::packedEta_
protected

Definition at line 682 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 682 of file PackedCandidate.h.

Referenced by operator=().

uint16_t pat::PackedCandidate::packedPhi_
protected

Definition at line 682 of file PackedCandidate.h.

Referenced by operator=().

uint16_t pat::PackedCandidate::packedPt_
protected

Definition at line 682 of file PackedCandidate.h.

Referenced by operator=().

int8_t pat::PackedCandidate::packedPuppiweight_
protected

Definition at line 698 of file PackedCandidate.h.

Referenced by operator=().

int8_t pat::PackedCandidate::packedPuppiweightNoLepDiff_
protected

Definition at line 699 of file PackedCandidate.h.

Referenced by operator=().

int16_t pat::PackedCandidate::packedTime_
protected

Definition at line 702 of file PackedCandidate.h.

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

uint8_t pat::PackedCandidate::packedTimeError_
protected

Definition at line 703 of file PackedCandidate.h.

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

int pat::PackedCandidate::pdgId_
protected

PDG identifier.

Definition at line 716 of file PackedCandidate.h.

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

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

Definition at line 720 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 719 of file PackedCandidate.h.

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

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

Definition at line 700 of file PackedCandidate.h.

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

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

reco::Track

Definition at line 714 of file PackedCandidate.h.

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

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

vertex position

Definition at line 711 of file PackedCandidate.h.

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