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
 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 }
 
enum  PVAssociationQuality {
  NotReconstructedPrimary = 0, OtherDeltaZ = 1, CompatibilityBTag = 4, CompatibilityDz = 5,
  UsedInFitLoose = 6, UsedInFitTight = 7
}
 
enum  trackHitShiftsAndMasks { trackPixelHitsMask = 7, trackStripHitsMask = 31, trackStripHitsShift = 3 }
 set impact parameters covariance More...
 
typedef math::XYZVector Vector
 point in the space More...
 
- Public Types inherited from reco::Candidate
enum  { dimension = 3 }
 
enum  { size = dimension * (dimension + 1) / 2 }
 matix size More...
 
typedef int Charge
 electric charge type More...
 
typedef candidate::const_iterator const_iterator
 
typedef math::Error< dimension >::type CovarianceMatrix
 covariance error matrix (3x3) More...
 
typedef unsigned int index
 index type More...
 
typedef candidate::iterator iterator
 
typedef math::XYZTLorentzVector LorentzVector
 Lorentz vector. More...
 
typedef math::XYZPoint Point
 point in the space More...
 
typedef math::PtEtaPhiMLorentzVector PolarLorentzVector
 Lorentz vector. More...
 
typedef size_t size_type
 
typedef math::XYZVector Vector
 point in the space More...
 

Public Member Functions

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

Public Attributes

uint16_t firstHit_
 

Static Public Attributes

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

Protected Types

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

Protected Member Functions

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

Static Protected Member Functions

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

Protected Attributes

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

Static Protected Attributes

static std::once_flag covariance_load_flag
 
static CovarianceParameterization covarianceParameterization_
 
static constexpr int EXPO_TIME_NOERROR = 6
 
static constexpr int EXPO_TIME_WITHERROR = -6
 
static constexpr int EXPO_TIMEERROR = 5
 
static constexpr float kMinDEtaToStore_ = 0.001
 
static constexpr float kMinDTrkPtToStore_ = 0.001
 
static constexpr float MIN_TIME_NOERROR = 0.0002f
 
static constexpr 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

◆ daughters

collection of daughter candidates

Definition at line 25 of file PackedCandidate.h.

◆ index

typedef unsigned int pat::PackedCandidate::index

Definition at line 35 of file PackedCandidate.h.

◆ LorentzVector

Lorentz vector.

Definition at line 27 of file PackedCandidate.h.

◆ Point

point in the space

Definition at line 31 of file PackedCandidate.h.

◆ PolarLorentzVector

Lorentz vector.

Definition at line 29 of file PackedCandidate.h.

◆ Vector

point in the space

Definition at line 33 of file PackedCandidate.h.

Member Enumeration Documentation

◆ LostInnerHits

Enumerator specifying the.

Enumerator
validHitInFirstPixelBarrelLayer 
noLostInnerHits 
oneLostInnerHit 
moreLostInnerHits 

Definition at line 799 of file PackedCandidate.h.

799  {
801  noLostInnerHits = 0, // it could still not have a hit in the first layer,
802  // e.g. if it crosses an inactive sensor
803  oneLostInnerHit = 1,
805  };

◆ PVAssoc

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

704 { NoPV = 0, PVLoose = 1, PVTight = 2, PVUsedInFit = 3 };

◆ PVAssociationQuality

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

722  {
724  OtherDeltaZ = 1,
725  CompatibilityBTag = 4,
726  CompatibilityDz = 5,
727  UsedInFitLoose = 6,
728  UsedInFitTight = 7
729  };

◆ qualityFlagsShiftsAndMasks

Enumerator
assignmentQualityMask 
assignmentQualityShift 
trackHighPurityMask 
trackHighPurityShift 
lostInnerHitsMask 
lostInnerHitsShift 
muonFlagsMask 
muonFlagsShift 
egammaFlagsMask 
egammaFlagsShift 

Definition at line 1101 of file PackedCandidate.h.

1101  {
1102  assignmentQualityMask = 0x7,
1104  trackHighPurityMask = 0x8,
1106  lostInnerHitsMask = 0x30,
1107  lostInnerHitsShift = 4,
1108  muonFlagsMask = 0x0600,
1109  muonFlagsShift = 9,
1110  egammaFlagsMask = 0x0800,
1111  egammaFlagsShift = 11
1112  };

◆ trackHitShiftsAndMasks

set impact parameters covariance

Enumerator
trackPixelHitsMask 
trackStripHitsMask 
trackStripHitsShift 

Definition at line 620 of file PackedCandidate.h.

Constructor & Destructor Documentation

◆ PackedCandidate() [1/6]

pat::PackedCandidate::PackedCandidate ( )
inline

default constructor

Definition at line 37 of file PackedCandidate.h.

38  : packedPt_(0),
39  packedEta_(0),
40  packedPhi_(0),
41  packedM_(0),
42  packedDxy_(0),
43  packedDz_(0),
44  packedDPhi_(0),
45  packedDEta_(0),
46  packedDTrkPt_(0),
52  caloFraction_(0),
53  hcalFraction_(0),
54  packedTime_(0),
57  p4_(new PolarLorentzVector(0, 0, 0, 0)),
58  p4c_(new LorentzVector(0, 0, 0, 0)),
59  vertex_(new Point(0, 0, 0)),
60  dphi_(0),
61  deta_(0),
62  dtrkpt_(0),
63  track_(nullptr),
64  pdgId_(0),
65  qualityFlags_(0),
67  m_(nullptr),
68  packedHits_(0),
69  packedLayers_(0),
70  normalizedChi2_(0),
73  firstHit_(0) {}

Referenced by clone().

◆ PackedCandidate() [2/6]

pat::PackedCandidate::PackedCandidate ( const reco::Candidate c,
const reco::VertexRefProd pvRefProd,
reco::VertexRef::key_type  pvRefKey 
)
inlineexplicit

Definition at line 75 of file PackedCandidate.h.

78  : packedPuppiweight_(0),
82  caloFraction_(0),
83  hcalFraction_(0),
84  packedTime_(0),
87  p4_(new PolarLorentzVector(c.pt(), c.eta(), c.phi(), c.mass())),
88  p4c_(new LorentzVector(*p4_)),
89  vertex_(new Point(c.vertex())),
90  dphi_(0),
91  deta_(0),
92  dtrkpt_(0),
93  track_(nullptr),
94  pdgId_(c.pdgId()),
95  qualityFlags_(0),
96  pvRefProd_(pvRefProd),
97  pvRefKey_(pvRefKey),
98  m_(nullptr),
99  packedHits_(0),
100  packedLayers_(0),
101  normalizedChi2_(0),
104  firstHit_(0) {
105  packBoth();
106  }

References packBoth().

◆ PackedCandidate() [3/6]

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

116  : packedPuppiweight_(0),
118  rawCaloFraction_(0),
119  rawHcalFraction_(0),
120  caloFraction_(0),
121  hcalFraction_(0),
122  packedTime_(0),
123  packedTimeError_(0),
125  p4_(new PolarLorentzVector(p4)),
126  p4c_(new LorentzVector(*p4_)),
127  vertex_(new Point(vtx)),
128  dphi_(reco::deltaPhi(phiAtVtx, p4_.load()->phi())),
129  deta_(std::abs(etaAtVtx - p4_.load()->eta()) >= kMinDEtaToStore_ ? etaAtVtx - p4_.load()->eta() : 0.),
130  dtrkpt_(std::abs(trkPt - p4_.load()->pt()) >= kMinDTrkPtToStore_ ? trkPt - p4_.load()->pt() : 0.),
131  track_(nullptr),
132  pdgId_(pdgId),
133  qualityFlags_(0),
134  pvRefProd_(pvRefProd),
135  pvRefKey_(pvRefKey),
136  m_(nullptr),
137  packedHits_(0),
138  packedLayers_(0),
139  normalizedChi2_(0),
142  firstHit_(0) {
143  packBoth();
144  }

References packBoth().

◆ PackedCandidate() [4/6]

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

154  : packedPuppiweight_(0),
156  rawCaloFraction_(0),
157  rawHcalFraction_(0),
158  caloFraction_(0),
159  hcalFraction_(0),
160  packedTime_(0),
161  packedTimeError_(0),
163  p4_(new PolarLorentzVector(p4.Pt(), p4.Eta(), p4.Phi(), p4.M())),
164  p4c_(new LorentzVector(p4)),
165  vertex_(new Point(vtx)),
166  dphi_(reco::deltaPhi(phiAtVtx, p4_.load()->phi())),
167  deta_(std::abs(etaAtVtx - p4_.load()->eta()) >= kMinDEtaToStore_ ? etaAtVtx - p4_.load()->eta() : 0.),
168  dtrkpt_(std::abs(trkPt - p4_.load()->pt()) >= kMinDTrkPtToStore_ ? trkPt - p4_.load()->pt() : 0.),
169  track_(nullptr),
170  pdgId_(pdgId),
171  qualityFlags_(0),
172  pvRefProd_(pvRefProd),
173  pvRefKey_(pvRefKey),
174  m_(nullptr),
175  packedHits_(0),
176  packedLayers_(0),
177  normalizedChi2_(0),
180  firstHit_(0) {
181  packBoth();
182  }

References packBoth().

◆ PackedCandidate() [5/6]

pat::PackedCandidate::PackedCandidate ( const PackedCandidate iOther)
inline

Definition at line 184 of file PackedCandidate.h.

185  : packedPt_(iOther.packedPt_),
186  packedEta_(iOther.packedEta_),
187  packedPhi_(iOther.packedPhi_),
188  packedM_(iOther.packedM_),
189  packedDxy_(iOther.packedDxy_),
190  packedDz_(iOther.packedDz_),
191  packedDPhi_(iOther.packedDPhi_),
192  packedDEta_(iOther.packedDEta_),
193  packedDTrkPt_(iOther.packedDTrkPt_),
194  packedCovariance_(iOther.packedCovariance_),
195  packedPuppiweight_(iOther.packedPuppiweight_),
196  packedPuppiweightNoLepDiff_(iOther.packedPuppiweightNoLepDiff_),
197  rawCaloFraction_(iOther.rawCaloFraction_),
198  rawHcalFraction_(iOther.rawHcalFraction_),
199  caloFraction_(iOther.caloFraction_),
200  hcalFraction_(iOther.hcalFraction_),
201  packedTime_(iOther.packedTime_),
202  packedTimeError_(iOther.packedTimeError_),
203  isIsolatedChargedHadron_(iOther.isIsolatedChargedHadron_),
204  // Need to trigger unpacking in iOther
205  p4_(new PolarLorentzVector(iOther.polarP4())),
206  p4c_(new LorentzVector(iOther.p4())),
207  vertex_((iOther.vertex_ ? new Point(iOther.vertex()) : nullptr)),
208  dxy_(vertex_ ? iOther.dxy_ : 0),
209  dz_(vertex_ ? iOther.dz_ : 0),
210  dphi_(vertex_ ? iOther.dphi_ : 0),
211  deta_(vertex_ ? iOther.deta_ : 0),
212  dtrkpt_(vertex_ ? iOther.dtrkpt_ : 0),
213  track_(iOther.track_ ? new reco::Track(*iOther.track_) : nullptr),
214  pdgId_(iOther.pdgId_),
215  qualityFlags_(iOther.qualityFlags_),
216  pvRefProd_(iOther.pvRefProd_),
217  pvRefKey_(iOther.pvRefKey_),
218  m_(iOther.m_ ? new reco::TrackBase::CovarianceMatrix(*iOther.m_) : nullptr),
219  packedHits_(iOther.packedHits_),
220  packedLayers_(iOther.packedLayers_),
221  normalizedChi2_(iOther.normalizedChi2_),
222  covarianceVersion_(iOther.covarianceVersion_),
223  covarianceSchema_(iOther.covarianceSchema_),
224  firstHit_(iOther.firstHit_) {}

◆ PackedCandidate() [6/6]

pat::PackedCandidate::PackedCandidate ( PackedCandidate &&  iOther)
inline

Definition at line 226 of file PackedCandidate.h.

227  : packedPt_(iOther.packedPt_),
228  packedEta_(iOther.packedEta_),
229  packedPhi_(iOther.packedPhi_),
230  packedM_(iOther.packedM_),
231  packedDxy_(iOther.packedDxy_),
232  packedDz_(iOther.packedDz_),
233  packedDPhi_(iOther.packedDPhi_),
234  packedDEta_(iOther.packedDEta_),
235  packedDTrkPt_(iOther.packedDTrkPt_),
236  packedCovariance_(iOther.packedCovariance_),
237  packedPuppiweight_(iOther.packedPuppiweight_),
238  packedPuppiweightNoLepDiff_(iOther.packedPuppiweightNoLepDiff_),
239  rawCaloFraction_(iOther.rawCaloFraction_),
240  rawHcalFraction_(iOther.rawHcalFraction_),
241  caloFraction_(iOther.caloFraction_),
242  hcalFraction_(iOther.hcalFraction_),
243  packedTime_(iOther.packedTime_),
244  packedTimeError_(iOther.packedTimeError_),
245  isIsolatedChargedHadron_(iOther.isIsolatedChargedHadron_),
246  p4_(iOther.p4_.exchange(nullptr)),
247  p4c_(iOther.p4c_.exchange(nullptr)),
248  vertex_(iOther.vertex_.exchange(nullptr)),
249  dxy_(iOther.dxy_),
250  dz_(iOther.dz_),
251  dphi_(iOther.dphi_),
252  deta_(iOther.deta_),
253  dtrkpt_(iOther.dtrkpt_),
254  track_(iOther.track_.exchange(nullptr)),
255  pdgId_(iOther.pdgId_),
256  qualityFlags_(iOther.qualityFlags_),
257  pvRefProd_(std::move(iOther.pvRefProd_)),
258  pvRefKey_(iOther.pvRefKey_),
259  m_(iOther.m_.exchange(nullptr)),
260  packedHits_(iOther.packedHits_),
261  packedLayers_(iOther.packedLayers_),
262  normalizedChi2_(iOther.normalizedChi2_),
263  covarianceVersion_(iOther.covarianceVersion_),
264  covarianceSchema_(iOther.covarianceSchema_),
265  firstHit_(iOther.firstHit_) {}

◆ ~PackedCandidate()

pat::PackedCandidate::~PackedCandidate ( )
override

destructor

Definition at line 143 of file PackedCandidate.cc.

143  {
144  delete p4_.load();
145  delete p4c_.load();
146  delete vertex_.load();
147  delete track_.load();
148  delete m_.load();
149 }

Member Function Documentation

◆ bestTrack()

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

780  {
781  if (packedHits_ != 0 || packedLayers_ != 0) {
783  return track_.load();
784  } else
785  return nullptr;
786  }

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

Referenced by reco::tau::getTrackFromChargedHadron(), btagbtvdeep::packedCandidateToFeatures(), pat::PATTauProducer::produce(), and Muon.Muon::ptErr().

◆ boostToCM()

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

457  {
458  if (!p4c_)
459  unpack();
460  return p4c_.load()->BoostToCM();
461  }

References p4c_, and unpack().

◆ caloFraction()

float pat::PackedCandidate::caloFraction ( ) const
inline

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

Definition at line 929 of file PackedCandidate.h.

929  {
930  return (caloFraction_ / 100.);
931  }

References caloFraction_.

Referenced by reco::tau::eratio(), AntiElectronIDMVA6< TauType, ElectronType >::getTauVarsTypeSpecific(), reco::tau::PFRecoTauEnergyAlgorithmPlugin::operator()(), and pat::PATTauProducer::produce().

◆ charge()

int pat::PackedCandidate::charge ( ) const
inlineoverridevirtual

electric charge

Implements reco::Candidate.

Definition at line 415 of file PackedCandidate.h.

415  {
416  switch (abs(pdgId_)) {
417  case 211:
418  return (pdgId_ > 0) - (pdgId_ < 0);
419  case 11:
420  return (-1) * (pdgId_ > 0) + (pdgId_ < 0); // e
421  case 13:
422  return (-1) * (pdgId_ > 0) + (pdgId_ < 0); // mu
423  case 15:
424  return (-1) * (pdgId_ > 0) + (pdgId_ < 0); // tau
425  case 24:
426  return (pdgId_ > 0) - (pdgId_ < 0); // W
427  default:
428  return 0; // FIXME: charge is not defined
429  }
430  }

References funct::abs(), and pdgId_.

Referenced by pat::PATIsolatedTrackProducer::produce(), and threeCharge().

◆ clone()

PackedCandidate* pat::PackedCandidate::clone ( void  ) const
inlineoverridevirtual

returns a clone of the Candidate object

Implements reco::Candidate.

Definition at line 854 of file PackedCandidate.h.

854 { return new PackedCandidate(*this); }

References PackedCandidate().

◆ covarianceParameterization()

const CovarianceParameterization& pat::PackedCandidate::covarianceParameterization ( ) const
inlineprotected

Definition at line 1077 of file PackedCandidate.h.

1077  {
1078  if (!hasTrackDetails())
1080  "Trying to access covariance matrix for a "
1081  "PackedCandidate for which it's not available. "
1082  "Check hasTrackDetails() before!\n");
1083  std::call_once(
1087  << "Attempting to load multiple covariance version in same process. "
1088  "This is not supported.";
1089  }
1091  }

References covariance_load_flag, covarianceParameterization_, covarianceVersion_, Exception, hasTrackDetails(), edm::errors::InvalidReference, CovarianceParameterization::load(), CovarianceParameterization::loadedVersion(), edm::errors::UnimplementedFeature, and findQualityFiles::v.

Referenced by packCovarianceElement(), and unpackCovarianceElement().

◆ covarianceSchema()

int pat::PackedCandidate::covarianceSchema ( ) const
inline

Definition at line 673 of file PackedCandidate.h.

673 { return covarianceSchema_; }

References covarianceSchema_.

◆ covarianceVersion()

int pat::PackedCandidate::covarianceVersion ( ) const
inline

Definition at line 672 of file PackedCandidate.h.

672 { return covarianceVersion_; }

References covarianceVersion_.

Referenced by setTrackProperties().

◆ daughter() [1/4]

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 336 of file PackedCandidate.cc.

336  {
338  << "This Candidate type does not implement daughter(std::string). "
339  << "Please use CompositeCandidate or NamedCompositeCandidate.\n";
340 }

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

◆ daughter() [2/4]

reco::Candidate * pat::PackedCandidate::daughter ( const std::string &  s)
overridevirtual

return daughter with a specified role name

Implements reco::Candidate.

Definition at line 342 of file PackedCandidate.cc.

342  {
344  << "This Candidate type does not implement daughter(std::string). "
345  << "Please use CompositeCandidate or NamedCompositeCandidate.\n";
346 }

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

◆ daughter() [3/4]

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 332 of file PackedCandidate.cc.

332 { return nullptr; }

◆ daughter() [4/4]

reco::Candidate * pat::PackedCandidate::daughter ( size_type  )
overridevirtual

return daughter at a given position (throws an exception)

Implements reco::Candidate.

Definition at line 348 of file PackedCandidate.cc.

348 { return nullptr; }

◆ dtime()

virtual float pat::PackedCandidate::dtime ( size_t  ipv = 0) const
inlinevirtual

dtime with respect to the PV[ipv]

Definition at line 965 of file PackedCandidate.h.

965  {
966  return dtimeAssociatedPV() + (*pvRefProd_)[pvRefKey_].t() - (*pvRefProd_)[ipv].t();
967  }

References dtimeAssociatedPV(), and pvRefKey_.

◆ dtimeAssociatedPV()

virtual float pat::PackedCandidate::dtimeAssociatedPV ( ) const
inlinevirtual

dtime with respect to the PV ref

Definition at line 969 of file PackedCandidate.h.

969  {
970  if (packedTime_ == 0)
971  return 0.f;
972  if (packedTimeError_ > 0)
974  else
976  }

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

Referenced by dtime(), and time().

◆ dxy() [1/2]

virtual float pat::PackedCandidate::dxy ( ) const
inlinevirtual

◆ dxy() [2/2]

float pat::PackedCandidate::dxy ( const Point p) const
virtual

dxy with respect to another point

Definition at line 151 of file PackedCandidate.cc.

151  {
152  maybeUnpackBoth();
153  const float phi = float(p4_.load()->Phi()) + dphi_;
154  return -(vertex_.load()->X() - p.X()) * std::sin(phi) + (vertex_.load()->Y() - p.Y()) * std::cos(phi);
155 }

References funct::cos(), dqmMemoryStats::float, AlCaHLTBitMon_ParallelJobs::p, phi, and funct::sin().

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

◆ dxyError()

float pat::PackedCandidate::dxyError ( ) const
inlineoverridevirtual

uncertainty on dxy

Reimplemented from reco::Candidate.

Definition at line 766 of file PackedCandidate.h.

766  {
768  return sqrt((*m_.load())(3, 3));
769  }

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

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

◆ dz() [1/2]

float pat::PackedCandidate::dz ( const Point p) const
virtual

dz with respect to another point

Definition at line 156 of file PackedCandidate.cc.

156  {
157  maybeUnpackBoth();
158  const float phi = float(p4_.load()->Phi()) + dphi_;
159  const float pzpt = deta_ ? std::sinh(etaAtVtx()) : p4_.load()->Pz() / p4_.load()->Pt();
160  return (vertex_.load()->Z() - p.Z()) -
161  ((vertex_.load()->X() - p.X()) * std::cos(phi) + (vertex_.load()->Y() - p.Y()) * std::sin(phi)) * pzpt;
162 }

References funct::cos(), dqmMemoryStats::float, AlCaHLTBitMon_ParallelJobs::p, phi, and funct::sin().

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

◆ dz() [2/2]

virtual float pat::PackedCandidate::dz ( size_t  ipv = 0) const
inlinevirtual

◆ dzAssociatedPV()

virtual float pat::PackedCandidate::dzAssociatedPV ( ) const
inlinevirtual

dz with respect to the PV ref

Definition at line 751 of file PackedCandidate.h.

751  {
752  maybeUnpackBoth();
753  return dz_;
754  }

References dz_, and maybeUnpackBoth().

Referenced by fromPV().

◆ dzError()

float pat::PackedCandidate::dzError ( ) const
inlineoverridevirtual

uncertainty on dz

Reimplemented from reco::Candidate.

Definition at line 761 of file PackedCandidate.h.

761  {
763  return sqrt((*m_.load())(4, 4));
764  }

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

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

◆ energy()

double pat::PackedCandidate::energy ( ) const
inlineoverridevirtual

◆ et()

double pat::PackedCandidate::et ( ) const
inlineoverridevirtual

transverse energy

Implements reco::Candidate.

Definition at line 475 of file PackedCandidate.h.

475 { return (pt() <= 0) ? 0 : p4c_.load()->Et(); }

References p4c_, and pt().

◆ et2()

double pat::PackedCandidate::et2 ( ) const
inlineoverridevirtual

transverse energy squared (use this for cuts)!

Implements reco::Candidate.

Definition at line 477 of file PackedCandidate.h.

477 { return (pt() <= 0) ? 0 : p4c_.load()->Et2(); }

References p4c_, and pt().

◆ eta()

double pat::PackedCandidate::eta ( ) const
inlineoverridevirtual

momentum pseudorapidity

Implements reco::Candidate.

Definition at line 563 of file PackedCandidate.h.

563  {
564  if (!p4c_)
565  unpack();
566  return p4_.load()->Eta();
567  }

References p4_, p4c_, and unpack().

Referenced by Particle.Particle::__str__(), Jet.Jet::jetID(), reco::tau::qcuts::minPackedCandVertexWeight(), packCovarianceElement(), PuppiProducer::produce(), pat::PATTauProducer::produce(), Jet.Jet::puJetId(), and unpackCovarianceElement().

◆ etaAtVtx()

virtual float pat::PackedCandidate::etaAtVtx ( ) const
inlinevirtual

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

Definition at line 551 of file PackedCandidate.h.

551  {
552  maybeUnpackBoth();
553  return p4_.load()->eta() + deta_;
554  }

References deta_, maybeUnpackBoth(), and p4_.

◆ fillVertexCovariance()

void pat::PackedCandidate::fillVertexCovariance ( CovarianceMatrix v) const
overridevirtual

fill SMatrix

Implements reco::Candidate.

Definition at line 362 of file PackedCandidate.cc.

362  {
364  << "reco::ConcreteCandidate does not implement vertex covariant "
365  "matrix.\n";
366 }

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

Referenced by vertexCovariance().

◆ firstHit()

uint16_t pat::PackedCandidate::firstHit ( ) const
inline

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

Definition at line 820 of file PackedCandidate.h.

820 { return firstHit_; }

References firstHit_.

◆ fromPV()

const PVAssoc pat::PackedCandidate::fromPV ( size_t  ipv = 0) const
inline

Definition at line 705 of file PackedCandidate.h.

705  {
706  reco::VertexRef pvRef = vertexRef();
707  if (pvAssociationQuality() == UsedInFitTight and pvRef.key() == ipv)
708  return PVUsedInFit;
709  if (pvRef.key() == ipv or abs(pdgId()) == 13 or abs(pdgId()) == 11)
710  return PVTight;
712  return PVTight; // it is not closest, but at least prevents the B
713  // assignment stealing
714  if (pvAssociationQuality() < UsedInFitLoose or pvRef->ndof() < 4.0)
715  return PVLoose;
716  return NoPV;
717  }

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(), PuppiProducer::produce(), pat::PATIsolatedTrackProducer::produce(), and BoostedDoubleSVProducer::setTracksPV().

◆ hasMasterClone()

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 314 of file PackedCandidate.cc.

314 { return false; }

◆ hasMasterClonePtr()

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 316 of file PackedCandidate.cc.

316 { return false; }

◆ hasTrackDetails()

bool pat::PackedCandidate::hasTrackDetails ( ) const
inline

Return true if a bestTrack can be extracted from this Candidate.

Definition at line 788 of file PackedCandidate.h.

788 { return (packedHits_ != 0 || packedLayers_ != 0); }

References packedHits_, and packedLayers_.

Referenced by covarianceParameterization(), reco::tau::lead_track_chi2(), btagbtvdeep::packedCandidateToFeatures(), and pat::PATIsolatedTrackProducer::produce().

◆ hcalFraction()

float pat::PackedCandidate::hcalFraction ( ) const
inline

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

Definition at line 934 of file PackedCandidate.h.

934  {
935  return (hcalFraction_ / 100.);
936  }

Referenced by reco::tau::eratio(), AntiElectronIDMVA6< TauType, ElectronType >::getTauVarsTypeSpecific(), reco::tau::PFRecoTauEnergyAlgorithmPlugin::operator()(), btagbtvdeep::packedCandidateToFeatures(), and pat::PATTauProducer::produce().

◆ isCaloMuon()

bool pat::PackedCandidate::isCaloMuon ( ) const
inlineoverridevirtual

Implements reco::Candidate.

Definition at line 905 of file PackedCandidate.h.

905 { return false; }

◆ isConvertedPhoton()

bool pat::PackedCandidate::isConvertedPhoton ( ) const
inlineoverridevirtual

Implements reco::Candidate.

Definition at line 907 of file PackedCandidate.h.

907 { return false; }

◆ isElectron()

bool pat::PackedCandidate::isElectron ( ) const
inlineoverridevirtual

Implements reco::Candidate.

Definition at line 900 of file PackedCandidate.h.

900 { return false; }

◆ isGlobalMuon()

bool pat::PackedCandidate::isGlobalMuon ( ) const
inlineoverridevirtual

Implements reco::Candidate.

Definition at line 903 of file PackedCandidate.h.

903 { return ((qualityFlags_ & muonFlagsMask) >> muonFlagsShift) & 2; }

References muonFlagsMask, muonFlagsShift, and qualityFlags_.

Referenced by Muon.Muon::muonID().

◆ isGoodEgamma()

bool pat::PackedCandidate::isGoodEgamma ( ) const
inline

Definition at line 909 of file PackedCandidate.h.

909 { return (qualityFlags_ & egammaFlagsMask) != 0; }

References egammaFlagsMask, and qualityFlags_.

Referenced by setGoodEgamma().

◆ isIsolatedChargedHadron()

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

941  {
943  }

◆ isJet()

bool pat::PackedCandidate::isJet ( ) const
inlineoverridevirtual

Implements reco::Candidate.

Definition at line 908 of file PackedCandidate.h.

908 { return false; }

◆ isMuon()

bool pat::PackedCandidate::isMuon ( ) const
inlineoverridevirtual

Implements reco::Candidate.

Definition at line 901 of file PackedCandidate.h.

901 { return false; }

◆ isPhoton()

bool pat::PackedCandidate::isPhoton ( ) const
inlineoverridevirtual

Implements reco::Candidate.

Definition at line 906 of file PackedCandidate.h.

906 { return false; }

◆ isStandAloneMuon()

bool pat::PackedCandidate::isStandAloneMuon ( ) const
inlineoverridevirtual

Implements reco::Candidate.

Definition at line 902 of file PackedCandidate.h.

902 { return ((qualityFlags_ & muonFlagsMask) >> muonFlagsShift) & 1; }

References muonFlagsMask, muonFlagsShift, and qualityFlags_.

◆ isTrackerMuon()

bool pat::PackedCandidate::isTrackerMuon ( ) const
inlineoverridevirtual

Implements reco::Candidate.

Definition at line 904 of file PackedCandidate.h.

904 { return false; }

◆ longLived()

bool pat::PackedCandidate::longLived ( ) const
overridevirtual

is long lived?

Implements reco::Candidate.

Definition at line 368 of file PackedCandidate.cc.

368 { return false; }

◆ lostInnerHits()

LostInnerHits pat::PackedCandidate::lostInnerHits ( ) const
inline

Definition at line 806 of file PackedCandidate.h.

806  {
808  }

References lostInnerHitsMask, lostInnerHitsShift, and qualityFlags_.

◆ mass()

double pat::PackedCandidate::mass ( ) const
inlineoverridevirtual

mass

Implements reco::Candidate.

Definition at line 479 of file PackedCandidate.h.

479  {
480  if (!p4c_)
481  unpack();
482  return p4_.load()->M();
483  }

References p4_, p4c_, and unpack().

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

◆ massConstraint()

bool pat::PackedCandidate::massConstraint ( ) const
overridevirtual

do mass constraint?

Implements reco::Candidate.

Definition at line 370 of file PackedCandidate.cc.

370 { return false; }

◆ massSqr()

double pat::PackedCandidate::massSqr ( ) const
inlineoverridevirtual

mass squared

Implements reco::Candidate.

Definition at line 485 of file PackedCandidate.h.

485  {
486  if (!p4c_)
487  unpack();
488  auto m = p4_.load()->M();
489  return m * m;
490  }

References visualization-live-secondInstance_cfg::m, p4_, p4c_, and unpack().

◆ masterClone()

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 309 of file PackedCandidate.cc.

309  {
310  throw cms::Exception("Invalid Reference") << "this Candidate has no master clone reference."
311  << "Can't call masterClone() method.\n";
312 }

References Exception.

Referenced by masterRef().

◆ masterClonePtr()

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 318 of file PackedCandidate.cc.

318  {
319  throw cms::Exception("Invalid Reference") << "this Candidate has no master clone ptr."
320  << "Can't call masterClonePtr() method.\n";
321 }

References Exception.

◆ masterRef()

template<typename Ref >
Ref pat::PackedCandidate::masterRef ( ) const
inline

cast master clone reference to a concrete type

Definition at line 896 of file PackedCandidate.h.

896  {
897  return masterClone().template castTo<Ref>();
898  }

References masterClone().

◆ maybeUnpackBoth()

void pat::PackedCandidate::maybeUnpackBoth ( ) const
inlineprotected

Definition at line 1009 of file PackedCandidate.h.

1009  {
1010  if (!p4c_)
1011  unpack();
1012  if (!vertex_)
1013  unpackVtx();
1014  }

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

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

◆ maybeUnpackCovariance()

void pat::PackedCandidate::maybeUnpackCovariance ( ) const
inlineprotected

Definition at line 1019 of file PackedCandidate.h.

1019  {
1020  if (!m_)
1021  unpackCovariance();
1022  }

References m_, and unpackCovariance().

Referenced by dxyError(), and dzError().

◆ maybeUnpackTrack()

void pat::PackedCandidate::maybeUnpackTrack ( ) const
inlineprotected

Definition at line 1015 of file PackedCandidate.h.

1015  {
1016  if (!track_)
1017  unpackTrk();
1018  }

References track_, and unpackTrk().

Referenced by bestTrack().

◆ momentum()

Vector pat::PackedCandidate::momentum ( ) const
inlineoverridevirtual

spatial momentum vector

Implements reco::Candidate.

Definition at line 450 of file PackedCandidate.h.

450  {
451  if (!p4c_)
452  unpack();
453  return p4c_.load()->Vect();
454  }

References p4c_, and unpack().

◆ mother()

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 334 of file PackedCandidate.cc.

334 { return nullptr; }

◆ mt()

double pat::PackedCandidate::mt ( ) const
inlineoverridevirtual

transverse mass

Implements reco::Candidate.

Definition at line 493 of file PackedCandidate.h.

493  {
494  if (!p4c_)
495  unpack();
496  return p4_.load()->Mt();
497  }

References p4_, p4c_, and unpack().

◆ mtSqr()

double pat::PackedCandidate::mtSqr ( ) const
inlineoverridevirtual

transverse mass squared

Implements reco::Candidate.

Definition at line 499 of file PackedCandidate.h.

499  {
500  if (!p4c_)
501  unpack();
502  return p4_.load()->Mt2();
503  }

References p4_, p4c_, and unpack().

◆ numberOfDaughters()

size_t pat::PackedCandidate::numberOfDaughters ( ) const
overridevirtual

number of daughters

Implements reco::Candidate.

Definition at line 323 of file PackedCandidate.cc.

323 { return 0; }

◆ numberOfHits()

int pat::PackedCandidate::numberOfHits ( ) const
inline

◆ numberOfMothers()

size_t pat::PackedCandidate::numberOfMothers ( ) const
overridevirtual

number of mothers

Implements reco::Candidate.

Definition at line 325 of file PackedCandidate.cc.

325 { return 0; }

◆ numberOfPixelHits()

int pat::PackedCandidate::numberOfPixelHits ( ) const
inline

◆ numberOfSourceCandidatePtrs()

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

409 { return 0; }

◆ operator=() [1/2]

PackedCandidate& pat::PackedCandidate::operator= ( const PackedCandidate iOther)
inline

Definition at line 267 of file PackedCandidate.h.

267  {
268  if (this == &iOther) {
269  return *this;
270  }
271  packedPt_ = iOther.packedPt_;
272  packedEta_ = iOther.packedEta_;
273  packedPhi_ = iOther.packedPhi_;
274  packedM_ = iOther.packedM_;
275  packedDxy_ = iOther.packedDxy_;
276  packedDz_ = iOther.packedDz_;
277  packedDPhi_ = iOther.packedDPhi_;
278  packedDEta_ = iOther.packedDEta_;
279  packedDTrkPt_ = iOther.packedDTrkPt_;
280  packedCovariance_ = iOther.packedCovariance_;
281  packedPuppiweight_ = iOther.packedPuppiweight_;
282  packedPuppiweightNoLepDiff_ = iOther.packedPuppiweightNoLepDiff_;
283  rawCaloFraction_ = iOther.rawCaloFraction_;
284  rawHcalFraction_ = iOther.rawHcalFraction_;
285  caloFraction_ = iOther.caloFraction_;
286  hcalFraction_ = iOther.hcalFraction_;
287  packedTime_ = iOther.packedTime_;
288  packedTimeError_ = iOther.packedTimeError_;
289  isIsolatedChargedHadron_ = iOther.isIsolatedChargedHadron_;
290  // Need to trigger unpacking in iOther
291  if (p4_) {
292  *p4_ = iOther.polarP4();
293  } else {
294  p4_.store(new PolarLorentzVector(iOther.polarP4()));
295  }
296  if (p4c_) {
297  *p4c_ = iOther.p4();
298  } else {
299  p4c_.store(new LorentzVector(iOther.p4()));
300  }
301  if (vertex_) {
302  *vertex_ = iOther.vertex();
303  } else {
304  vertex_.store(new Point(iOther.vertex()));
305  }
306  dxy_ = iOther.dxy_;
307  dz_ = iOther.dz_;
308  dphi_ = iOther.dphi_;
309  deta_ = iOther.deta_;
310  dtrkpt_ = iOther.dtrkpt_;
311 
312  if (!iOther.track_) {
313  delete track_.exchange(nullptr);
314  } else {
315  if (!track_) {
316  track_.store(new reco::Track(*iOther.track_));
317  } else {
318  *track_ = *(iOther.track_);
319  }
320  }
321 
322  pdgId_ = iOther.pdgId_;
323  qualityFlags_ = iOther.qualityFlags_;
324  pvRefProd_ = iOther.pvRefProd_;
325  pvRefKey_ = iOther.pvRefKey_;
326  if (!iOther.m_) {
327  delete m_.exchange(nullptr);
328  } else {
329  if (!m_) {
330  m_.store(new reco::Track::CovarianceMatrix(*iOther.m_));
331  } else {
332  *m_ = *(iOther.m_);
333  }
334  }
335 
336  packedHits_ = iOther.packedHits_;
337  packedLayers_ = iOther.packedLayers_;
338  normalizedChi2_ = iOther.normalizedChi2_;
339  covarianceVersion_ = iOther.covarianceVersion_;
340  covarianceSchema_ = iOther.covarianceSchema_;
341  firstHit_ = iOther.firstHit_;
342  return *this;
343  }

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

◆ operator=() [2/2]

PackedCandidate& pat::PackedCandidate::operator= ( PackedCandidate &&  iOther)
inline

Definition at line 345 of file PackedCandidate.h.

345  {
346  if (this == &iOther) {
347  return *this;
348  }
349  packedPt_ = iOther.packedPt_;
350  packedEta_ = iOther.packedEta_;
351  packedPhi_ = iOther.packedPhi_;
352  packedM_ = iOther.packedM_;
353  packedDxy_ = iOther.packedDxy_;
354  packedDz_ = iOther.packedDz_;
355  packedDPhi_ = iOther.packedDPhi_;
356  packedDEta_ = iOther.packedDEta_;
357  packedDTrkPt_ = iOther.packedDTrkPt_;
358  packedCovariance_ = iOther.packedCovariance_;
359  packedPuppiweight_ = iOther.packedPuppiweight_;
360  packedPuppiweightNoLepDiff_ = iOther.packedPuppiweightNoLepDiff_;
361  rawCaloFraction_ = iOther.rawCaloFraction_;
362  rawHcalFraction_ = iOther.rawHcalFraction_;
363  caloFraction_ = iOther.caloFraction_;
364  hcalFraction_ = iOther.hcalFraction_;
365  packedTime_ = iOther.packedTime_;
366  packedTimeError_ = iOther.packedTimeError_;
367  isIsolatedChargedHadron_ = iOther.isIsolatedChargedHadron_;
368  delete p4_.exchange(iOther.p4_.exchange(nullptr));
369  delete p4c_.exchange(iOther.p4c_.exchange(nullptr));
370  delete vertex_.exchange(iOther.vertex_.exchange(nullptr));
371  dxy_ = iOther.dxy_;
372  dz_ = iOther.dz_;
373  dphi_ = iOther.dphi_;
374  deta_ = iOther.deta_;
375  dtrkpt_ = iOther.dtrkpt_;
376  delete track_.exchange(iOther.track_.exchange(nullptr));
377  pdgId_ = iOther.pdgId_;
378  qualityFlags_ = iOther.qualityFlags_;
379  pvRefProd_ = iOther.pvRefProd_;
380  pvRefKey_ = iOther.pvRefKey_;
381  delete m_.exchange(iOther.m_.exchange(nullptr));
382  packedHits_ = iOther.packedHits_;
383  packedLayers_ = iOther.packedLayers_;
384  normalizedChi2_ = iOther.normalizedChi2_;
385  covarianceVersion_ = iOther.covarianceVersion_;
386  covarianceSchema_ = iOther.covarianceSchema_;
387  firstHit_ = iOther.firstHit_;
388  return *this;
389  }

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

◆ overlap()

bool pat::PackedCandidate::overlap ( const reco::Candidate o) const
overrideprotectedvirtual

check overlap with another Candidate

Implements reco::Candidate.

Definition at line 327 of file PackedCandidate.cc.

327  {
328  return p4() == o.p4() && vertex() == o.vertex() && charge() == o.charge();
329  // return p4() == o.p4() && charge() == o.charge();
330 }

References ALCARECOTkAlJpsiMuMu_cff::charge, EcalTangentSkim_cfg::o, p4, and bphysicsOniaDQM_cfi::vertex.

◆ p()

double pat::PackedCandidate::p ( ) const
inlineoverridevirtual

magnitude of momentum vector

Implements reco::Candidate.

Definition at line 463 of file PackedCandidate.h.

463  {
464  if (!p4c_)
465  unpack();
466  return p4c_.load()->P();
467  }

References p4c_, and unpack().

Referenced by AntiElectronIDMVA6< TauType, ElectronType >::getTauVarsTypeSpecific(), and Electron.Electron::ptErr().

◆ p4()

const LorentzVector& pat::PackedCandidate::p4 ( ) const
inlineoverridevirtual

four-momentum Lorentz vecto r

Implements reco::Candidate.

Definition at line 438 of file PackedCandidate.h.

438  {
439  if (!p4c_)
440  unpack();
441  return *p4c_;
442  }

References p4c_, and unpack().

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

◆ pack()

void pat::PackedCandidate::pack ( bool  unpackAfterwards = true)
protected

Definition at line 13 of file PackedCandidate.cc.

13  {
14  float unpackedPt = std::min<float>(p4_.load()->Pt(), MiniFloatConverter::max());
16  packedEta_ = int16_t(std::round(p4_.load()->Eta() / 6.0f * std::numeric_limits<int16_t>::max()));
17  packedPhi_ = int16_t(std::round(p4_.load()->Phi() / 3.2f * std::numeric_limits<int16_t>::max()));
19  if (unpackAfterwards) {
20  delete p4_.exchange(nullptr);
21  delete p4c_.exchange(nullptr);
22  unpack(); // force the values to match with the packed ones
23  }
24 }

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

Referenced by packBoth(), and setMass().

◆ packBoth()

void pat::PackedCandidate::packBoth ( )
inlineprotected

Definition at line 1023 of file PackedCandidate.h.

1023  {
1024  pack(false);
1025  packVtx(false);
1026  delete p4_.exchange(nullptr);
1027  delete p4c_.exchange(nullptr);
1028  delete vertex_.exchange(nullptr);
1029  unpack();
1030  unpackVtx();
1031  } // do it this way, so that we don't loose precision on the angles before

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

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

◆ packCovariance()

void pat::PackedCandidate::packCovariance ( const reco::TrackBase::CovarianceMatrix m,
bool  unpackAfterwards = true 
)
protected

◆ packCovarianceElement()

uint16_t pat::PackedCandidate::packCovarianceElement ( const reco::TrackBase::CovarianceMatrix m,
int  i,
int  j 
) const
inlineprivate

◆ packTimeError()

uint8_t pat::PackedCandidate::packTimeError ( float  timeError)
staticprotected

static to allow unit testing

Definition at line 419 of file PackedCandidate.cc.

419  {
420  if (timeError <= 0)
421  return 0;
422  // log-scale packing.
423  // for MIN_TIMEERROR = 0.002, EXPO_TIMEERROR = 5:
424  // minimum value 0.002 = 2ps (packed as 1)
425  // maximum value 0.5 ns (packed as 255)
426  // constant *relative* precision of about 2%
427  return std::max<uint8_t>(
428  std::min(std::round(std::ldexp(std::log2(timeError / MIN_TIMEERROR), +EXPO_TIMEERROR)), 255.f), 1);
429 }

References f, and min().

◆ packTimeNoError()

int16_t pat::PackedCandidate::packTimeNoError ( float  time)
staticprotected

Definition at line 439 of file PackedCandidate.cc.

439  {
440  // encoding in log scale to store times in a large range with few bits.
441  // for MIN_TIME_NOERROR = 0.0002 and EXPO_TIME_NOERROR = 6:
442  // smallest non-zero time = 0.2 ps (encoded as +/-1)
443  // one BX, +/- 12.5 ns, is fully covered with 11 bits (+/- 1023)
444  // 12 bits cover by far any plausible value (+/-2047 corresponds to about
445  // +/- 0.8 ms!) constant *relative* ~1% precision
447  return 0; // prevent underflows
448  float fpacked = std::ldexp(std::log2(std::abs(time / MIN_TIME_NOERROR)), +EXPO_TIME_NOERROR);
449  return (time > 0 ? +1 : -1) * std::min(std::round(fpacked), 2047.f);
450 }

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

◆ packTimeWithError()

int16_t pat::PackedCandidate::packTimeWithError ( float  time,
float  timeError 
)
staticprotected

Definition at line 460 of file PackedCandidate.cc.

460  {
461  // Encode in units of timeError * 2^EXPO_TIME_WITHERROR (~1.6% if
462  // EXPO_TIME_WITHERROR = -6) the largest value that can be stored in 14 bits +
463  // sign bit + overflow bit is about 260 sigmas values larger than that will be
464  // stored using the no-timeError packing (with less precision). overflows of
465  // these kinds should happen only for particles that are late arriving,
466  // out-of-time, or mis-reconstructed, as timeError is O(20ps) and the beam
467  // spot witdth is O(200ps)
468  float fpacked = std::round(time / std::ldexp(timeError, EXPO_TIME_WITHERROR));
469  if (std::abs(fpacked) < 16383.f) { // 16383 = (2^14 - 1) = largest absolute
470  // value for a signed 15 bit integer
471  return int16_t(fpacked) * 2; // make it even, and fit in a signed 16 bit int
472  } else {
473  int16_t packed = packTimeNoError(time); // encode
474  return packed * 2 + (time > 0 ? +1 : -1); // make it odd, to signal that there was an overlow
475  }
476 }

References funct::abs(), f, and protons_cff::time.

◆ packVtx()

void pat::PackedCandidate::packVtx ( bool  unpackAfterwards = true)
protected

Definition at line 26 of file PackedCandidate.cc.

26  {
27  reco::VertexRef pvRef = vertexRef();
28  Point pv = pvRef.isNonnull() ? pvRef->position() : Point();
29  float dxPV = vertex_.load()->X() - pv.X(),
30  dyPV = vertex_.load()->Y() - pv.Y(); //, rPV = std::hypot(dxPV, dyPV);
31  float s = std::sin(float(p4_.load()->Phi()) + dphi_),
32  c = std::cos(float(p4_.load()->Phi() + dphi_)); // not the fastest option, but we're in reduced
33  // precision already, so let's avoid more roundoffs
34  dxy_ = -dxPV * s + dyPV * c;
35  // if we want to go back to the full x,y,z we need to store also
36  // float dl = dxPV * c + dyPV * s;
37  // float xRec = - dxy_ * s + dl * c, yRec = dxy_ * c + dl * s;
38  float pzpt = p4_.load()->Pz() / p4_.load()->Pt();
39  dz_ = vertex_.load()->Z() - pv.Z() - (dxPV * c + dyPV * s) * pzpt;
42  : int16_t(std::round(dz_ / 40.f * std::numeric_limits<int16_t>::max()));
43  packedDPhi_ = int16_t(std::round(dphi_ / 3.2f * std::numeric_limits<int16_t>::max()));
46 
47  if (unpackAfterwards) {
48  delete vertex_.exchange(nullptr);
49  unpackVtx();
50  }
51 }

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

Referenced by packBoth(), and setVertex().

◆ pdgId()

int pat::PackedCandidate::pdgId ( ) const
inlineoverridevirtual

◆ phi()

double pat::PackedCandidate::phi ( ) const
inlineoverridevirtual

momentum azimuthal angle

Implements reco::Candidate.

Definition at line 529 of file PackedCandidate.h.

529  {
530  if (!p4c_)
531  unpack();
532  return p4_.load()->Phi();
533  }

References p4_, p4c_, and unpack().

Referenced by Particle.Particle::__str__(), reco::tau::qcuts::minPackedCandVertexWeight(), ntupleDataFormat.Track::phiPull(), and pat::PATTauProducer::produce().

◆ phiAtVtx()

virtual float pat::PackedCandidate::phiAtVtx ( ) const
inlinevirtual

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

Definition at line 541 of file PackedCandidate.h.

541  {
542  maybeUnpackBoth();
543  float ret = p4_.load()->Phi() + dphi_;
544  while (ret > float(M_PI))
545  ret -= 2 * float(M_PI);
546  while (ret < -float(M_PI))
547  ret += 2 * float(M_PI);
548  return ret;
549  }

References dphi_, dqmMemoryStats::float, M_PI, maybeUnpackBoth(), p4_, and runTheMatrix::ret.

◆ pixelLayersWithMeasurement()

int pat::PackedCandidate::pixelLayersWithMeasurement ( ) const
inline

Definition at line 668 of file PackedCandidate.h.

668 { return packedLayers_ & trackPixelHitsMask; }

References packedLayers_, and trackPixelHitsMask.

Referenced by numberOfPixelHits(), and trackerLayersWithMeasurement().

◆ polarP4()

const PolarLorentzVector& pat::PackedCandidate::polarP4 ( ) const
inlineoverridevirtual

four-momentum Lorentz vector

Implements reco::Candidate.

Definition at line 444 of file PackedCandidate.h.

444  {
445  if (!p4c_)
446  unpack();
447  return *p4_;
448  }

References p4_, p4c_, and unpack().

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

◆ pseudoTrack()

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

773  {
774  if (!track_)
775  unpackTrk();
776  return *track_;
777  }

References track_, and unpackTrk().

Referenced by reco::tau::lead_track_chi2(), and btagbtvdeep::packedCandidateToFeatures().

◆ pt()

double pat::PackedCandidate::pt ( ) const
inlineoverridevirtual

◆ ptTrk()

virtual double pat::PackedCandidate::ptTrk ( ) const
inlinevirtual

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

Definition at line 536 of file PackedCandidate.h.

536  {
537  maybeUnpackBoth();
538  return p4_.load()->pt() + dtrkpt_;
539  }

References dtrkpt_, maybeUnpackBoth(), and p4_.

◆ puppiWeight()

float pat::PackedCandidate::puppiWeight ( ) const

◆ puppiWeightNoLep()

float pat::PackedCandidate::puppiWeightNoLep ( ) const

Weight from full PUPPI.

Definition at line 384 of file PackedCandidate.cc.

References SiStripPI::max.

Referenced by citk::PFIsolationSumProducerForPUPPI::produce(), and PuppiProducer::produce().

◆ pvAssociationQuality()

const PVAssociationQuality pat::PackedCandidate::pvAssociationQuality ( ) const
inline

◆ px()

double pat::PackedCandidate::px ( ) const
inlineoverridevirtual

x coordinate of momentum vector

Implements reco::Candidate.

Definition at line 505 of file PackedCandidate.h.

505  {
506  if (!p4c_)
507  unpack();
508  return p4c_.load()->Px();
509  }

References p4c_, and unpack().

◆ py()

double pat::PackedCandidate::py ( ) const
inlineoverridevirtual

y coordinate of momentum vector

Implements reco::Candidate.

Definition at line 511 of file PackedCandidate.h.

511  {
512  if (!p4c_)
513  unpack();
514  return p4c_.load()->Py();
515  }

References p4c_, and unpack().

◆ pz()

double pat::PackedCandidate::pz ( ) const
inlineoverridevirtual

z coordinate of momentum vector

Implements reco::Candidate.

Definition at line 517 of file PackedCandidate.h.

517  {
518  if (!p4c_)
519  unpack();
520  return p4c_.load()->Pz();
521  }

References p4c_, and unpack().

Referenced by setPz().

◆ rapidity()

double pat::PackedCandidate::rapidity ( ) const
inlineoverridevirtual

rapidity

Implements reco::Candidate.

Definition at line 569 of file PackedCandidate.h.

569  {
570  if (!p4c_)
571  unpack();
572  return p4_.load()->Rapidity();
573  }

References p4_, p4c_, and unpack().

◆ rawCaloFraction()

float pat::PackedCandidate::rawCaloFraction ( ) const
inline

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

Definition at line 921 of file PackedCandidate.h.

921  {
922  return (rawCaloFraction_ / 100.);
923  }

◆ rawHcalFraction()

float pat::PackedCandidate::rawHcalFraction ( ) const
inline

Set the fraction of Hcal needed isolated charged hadrons.

Definition at line 925 of file PackedCandidate.h.

925  {
926  return (rawHcalFraction_ / 100.);
927  }

References rawHcalFraction_.

◆ setAssociationQuality()

void pat::PackedCandidate::setAssociationQuality ( PVAssociationQuality  q)
inline

◆ setCaloFraction()

void pat::PackedCandidate::setCaloFraction ( float  p)

Fraction of Hcal for isolated charged hadrons.

Definition at line 398 of file PackedCandidate.cc.

398 { caloFraction_ = 100 * p; }

References AlCaHLTBitMon_ParallelJobs::p.

◆ setCharge()

void pat::PackedCandidate::setCharge ( int  charge)
inlineoverridevirtual

set electric charge

Implements reco::Candidate.

Definition at line 432 of file PackedCandidate.h.

432 {}

◆ setCovarianceVersion()

virtual void pat::PackedCandidate::setCovarianceVersion ( int  v)
inlinevirtual

Definition at line 671 of file PackedCandidate.h.

671 { covarianceVersion_ = v; }

References covarianceVersion_, and findQualityFiles::v.

◆ setDTimeAssociatedPV()

void pat::PackedCandidate::setDTimeAssociatedPV ( float  aTime,
float  aTimeError = 0 
)

set time measurement

Definition at line 404 of file PackedCandidate.cc.

404  {
405  if (aTime == 0 && aTimeError == 0) {
406  packedTime_ = 0;
407  packedTimeError_ = 0;
408  } else if (aTimeError == 0) {
409  packedTimeError_ = 0;
410  packedTime_ = packTimeNoError(aTime);
411  } else {
412  packedTimeError_ = packTimeError(aTimeError);
413  aTimeError = unpackTimeError(packedTimeError_); // for reproducibility
414  packedTime_ = packTimeWithError(aTime, aTimeError);
415  }
416 }

Referenced by setTime().

◆ setFirstHit()

void pat::PackedCandidate::setFirstHit ( uint16_t  pattern)
inline

Set first hit from HitPattern.

Definition at line 818 of file PackedCandidate.h.

818 { firstHit_ = pattern; }

References firstHit_, and topSingleLeptonDQM_PU_cfi::pattern.

◆ setGoodEgamma()

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

Definition at line 827 of file PackedCandidate.h.

827  {
828  int16_t egFlags = (isGoodEgamma << egammaFlagsShift) & egammaFlagsMask;
830  }

References egammaFlagsMask, egammaFlagsShift, isGoodEgamma(), and qualityFlags_.

◆ setHcalFraction()

void pat::PackedCandidate::setHcalFraction ( float  p)

Fraction of ECAL+HCAL energy over candidate energy.

Definition at line 400 of file PackedCandidate.cc.

400 { hcalFraction_ = 100 * p; }

References AlCaHLTBitMon_ParallelJobs::p.

◆ setHits()

virtual void pat::PackedCandidate::setHits ( const reco::Track tk)
inlinevirtual

Definition at line 623 of file PackedCandidate.h.

623  {
624  // first we count the number of layers with hits
625  int numberOfPixelLayers_ = tk.hitPattern().pixelLayersWithMeasurement();
626  if (numberOfPixelLayers_ > trackPixelHitsMask)
627  numberOfPixelLayers_ = trackPixelHitsMask;
628  int numberOfStripLayers_ = tk.hitPattern().stripLayersWithMeasurement();
629  if (numberOfStripLayers_ > trackStripHitsMask)
630  numberOfStripLayers_ = trackStripHitsMask;
631  packedLayers_ = (numberOfPixelLayers_ & trackPixelHitsMask) | (numberOfStripLayers_ << trackStripHitsShift);
632  // now we count number of additional hits, beyond the one-per-layer implied
633  // by packedLayers_
634  int numberOfPixelHits_ = tk.hitPattern().numberOfValidPixelHits() - numberOfPixelLayers_;
635  if (numberOfPixelHits_ > trackPixelHitsMask)
636  numberOfPixelHits_ = trackPixelHitsMask;
637  int numberOfStripHits_ =
638  tk.hitPattern().numberOfValidHits() - numberOfPixelHits_ - numberOfPixelLayers_ - numberOfStripLayers_;
639  if (numberOfStripHits_ > trackStripHitsMask)
640  numberOfStripHits_ = trackStripHitsMask;
641 
642  packedHits_ = (numberOfPixelHits_ & trackPixelHitsMask) | (numberOfStripHits_ << trackStripHitsShift);
643  }

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().

◆ setIsIsolatedChargedHadron()

void pat::PackedCandidate::setIsIsolatedChargedHadron ( bool  p)

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

Definition at line 402 of file PackedCandidate.cc.

References AlCaHLTBitMon_ParallelJobs::p.

◆ setLongLived()

void pat::PackedCandidate::setLongLived ( )
inlineoverridevirtual

set long lived flag

Implements reco::Candidate.

Definition at line 843 of file PackedCandidate.h.

843 {} /*FIXME*/

◆ setLostInnerHits()

void pat::PackedCandidate::setLostInnerHits ( LostInnerHits  hits)
inline

Definition at line 809 of file PackedCandidate.h.

809  {
810  int lost = hits;
811  if (lost > 2)
812  lost = 2; // protection against misuse
813  lost++; // shift so it's 0 .. 3 instead of (-1) .. 2
815  }

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

◆ setMass()

void pat::PackedCandidate::setMass ( double  m)
inlineoverridevirtual

set particle mass

Implements reco::Candidate.

Definition at line 601 of file PackedCandidate.h.

601  {
602  if (!p4c_)
603  unpack();
604  *p4_ = PolarLorentzVector(p4_.load()->Pt(), p4_.load()->Eta(), p4_.load()->Phi(), m);
605  pack();
606  }

References visualization-live-secondInstance_cfg::m, p4_, p4c_, pack(), and unpack().

◆ setMassConstraint()

void pat::PackedCandidate::setMassConstraint ( )
inlineoverridevirtual

set mass constraint flag

Implements reco::Candidate.

Definition at line 849 of file PackedCandidate.h.

849 {} /*FIXME*/

◆ setMuonID()

void pat::PackedCandidate::setMuonID ( bool  isStandAlone,
bool  isGlobal 
)
inline

Definition at line 822 of file PackedCandidate.h.

822  {
823  int16_t muonFlags = isStandAlone | (2 * isGlobal);
825  }

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

◆ setP4() [1/2]

void pat::PackedCandidate::setP4 ( const LorentzVector p4)
inlineoverridevirtual

set 4-momentum

Implements reco::Candidate.

Definition at line 581 of file PackedCandidate.h.

581  {
582  maybeUnpackBoth(); // changing px,py,pz changes also mapping between dxy,dz
583  // and x,y,z
584  dphi_ += polarP4().Phi() - p4.Phi();
585  deta_ += polarP4().Eta() - p4.Eta();
586  dtrkpt_ += polarP4().Pt() - p4.Pt();
587  *p4_ = PolarLorentzVector(p4.Pt(), p4.Eta(), p4.Phi(), p4.M());
588  packBoth();
589  }

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

Referenced by Jet.Jet::setCorrP4().

◆ setP4() [2/2]

void pat::PackedCandidate::setP4 ( const PolarLorentzVector p4)
inlineoverride

set 4-momentum

Definition at line 591 of file PackedCandidate.h.

591  {
592  maybeUnpackBoth(); // changing px,py,pz changes also mapping between dxy,dz
593  // and x,y,z
594  dphi_ += polarP4().Phi() - p4.Phi();
595  deta_ += polarP4().Eta() - p4.Eta();
596  dtrkpt_ += polarP4().Pt() - p4.Pt();
597  *p4_ = p4;
598  packBoth();
599  }

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

Referenced by Jet.Jet::setCorrP4().

◆ setPdgId()

void pat::PackedCandidate::setPdgId ( int  pdgId)
inlineoverridevirtual

Implements reco::Candidate.

Definition at line 835 of file PackedCandidate.h.

835 { pdgId_ = pdgId; }

References pdgId(), and pdgId_.

◆ setPuppiWeight()

void pat::PackedCandidate::setPuppiWeight ( float  p,
float  p_nolep = 0.0 
)

Definition at line 373 of file PackedCandidate.cc.

373  {
374  // Set both weights at once to avoid misconfigured weights if called in the
375  // wrong order
378 }

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

◆ setPz()

void pat::PackedCandidate::setPz ( double  pz)
inlineoverridevirtual

Implements reco::Candidate.

Definition at line 607 of file PackedCandidate.h.

607  {
608  maybeUnpackBoth(); // changing px,py,pz changes also mapping between dxy,dz
609  // and x,y,z
610  *p4c_ = LorentzVector(p4c_.load()->Px(), p4c_.load()->Py(), pz, p4c_.load()->E());
611  dphi_ += polarP4().Phi() - p4c_.load()->Phi();
612  deta_ += polarP4().Eta() - p4c_.load()->Eta();
613  dtrkpt_ += polarP4().Pt() - p4c_.load()->Pt();
614  *p4_ = PolarLorentzVector(p4c_.load()->Pt(), p4c_.load()->Eta(), p4c_.load()->Phi(), p4c_.load()->M());
615  packBoth();
616  }

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

◆ setRawCaloFraction()

void pat::PackedCandidate::setRawCaloFraction ( float  p)

Weight from PUPPI removing leptons.

Definition at line 389 of file PackedCandidate.cc.

389  {
390  if (100 * p > std::numeric_limits<uint8_t>::max())
391  rawCaloFraction_ = std::numeric_limits<uint8_t>::max(); // Set to overflow value
392  else
393  rawCaloFraction_ = 100 * p;
394 }

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

◆ setRawHcalFraction()

void pat::PackedCandidate::setRawHcalFraction ( float  p)

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

Definition at line 396 of file PackedCandidate.cc.

396 { rawHcalFraction_ = 100 * p; }

References AlCaHLTBitMon_ParallelJobs::p.

◆ setStatus()

void pat::PackedCandidate::setStatus ( int  status)
inlineoverridevirtual

set status word

Implements reco::Candidate.

Definition at line 839 of file PackedCandidate.h.

839 {} /*FIXME*/

◆ setThreeCharge()

void pat::PackedCandidate::setThreeCharge ( int  threecharge)
inlineoverridevirtual

set electric charge

Implements reco::Candidate.

Definition at line 436 of file PackedCandidate.h.

436 {}

◆ setTime()

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

set time measurement

Definition at line 982 of file PackedCandidate.h.

982 { setDTimeAssociatedPV(aTime - vertexRef()->t(), aTimeError); }

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

◆ setTrackHighPurity()

void pat::PackedCandidate::setTrackHighPurity ( bool  highPurity)
inline

set to true if the track had the highPurity quality bit

Definition at line 793 of file PackedCandidate.h.

References qualityFlags_, trackHighPurityMask, and trackHighPurityShift.

◆ setTrackProperties() [1/2]

virtual void pat::PackedCandidate::setTrackProperties ( const reco::Track tk,
const reco::Track::CovarianceMatrix covariance,
int  quality,
int  covarianceVersion 
)
inlinevirtual

◆ setTrackProperties() [2/2]

virtual void pat::PackedCandidate::setTrackProperties ( const reco::Track tk,
int  quality,
int  covarianceVersion 
)
inlinevirtual

◆ setVertex()

void pat::PackedCandidate::setVertex ( const Point vertex)
inlineoverridevirtual

set vertex

Implements reco::Candidate.

Definition at line 696 of file PackedCandidate.h.

696  {
697  maybeUnpackBoth();
698  *vertex_ = vertex;
699  packVtx();
700  }

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

◆ sourceCandidatePtr()

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

412 { return reco::CandidatePtr(); }

◆ status()

int pat::PackedCandidate::status ( ) const
inlineoverridevirtual

status word

Implements reco::Candidate.

Definition at line 837 of file PackedCandidate.h.

837 { return qualityFlags_; } /*FIXME*/

References qualityFlags_.

◆ stripLayersWithMeasurement()

int pat::PackedCandidate::stripLayersWithMeasurement ( ) const
inline

Definition at line 669 of file PackedCandidate.h.

669 { return (packedLayers_ >> trackStripHitsShift); }

References packedLayers_, and trackStripHitsShift.

Referenced by numberOfHits(), and trackerLayersWithMeasurement().

◆ theta()

double pat::PackedCandidate::theta ( ) const
inlineoverridevirtual

momentum polar angle

Implements reco::Candidate.

Definition at line 557 of file PackedCandidate.h.

557  {
558  if (!p4c_)
559  unpack();
560  return p4_.load()->Theta();
561  }

References p4_, p4c_, and unpack().

Referenced by Tau.Tau::zImpact().

◆ threeCharge()

int pat::PackedCandidate::threeCharge ( ) const
inlineoverridevirtual

electric charge

Implements reco::Candidate.

Definition at line 434 of file PackedCandidate.h.

434 { return charge() * 3; }

References charge().

◆ time()

virtual float pat::PackedCandidate::time ( ) const
inlinevirtual

time (wrt nominal zero of the collision)

Definition at line 963 of file PackedCandidate.h.

963 { return vertexRef()->t() + dtimeAssociatedPV(); }

References dtimeAssociatedPV(), and vertexRef().

Referenced by TransientTrackBuilder::build().

◆ timeError()

virtual float pat::PackedCandidate::timeError ( ) const
inlinevirtual

time measurement uncertainty (-1 if not available)

Definition at line 978 of file PackedCandidate.h.

References packedTimeError_, and unpackTimeError().

Referenced by TransientTrackBuilder::build().

◆ trackerLayersWithMeasurement()

int pat::PackedCandidate::trackerLayersWithMeasurement ( ) const
inline

◆ trackHighPurity()

bool pat::PackedCandidate::trackHighPurity ( ) const
inline

true if the track had the highPurity quality bit

Definition at line 791 of file PackedCandidate.h.

References qualityFlags_, trackHighPurityMask, and trackHighPurityShift.

◆ unpack()

void pat::PackedCandidate::unpack ( ) const
protected

Definition at line 53 of file PackedCandidate.cc.

53  {
55  double shift = (pt < 1. ? 0.1 * pt : 0.1 / pt); // shift particle phi to break
56  // degeneracies in angular separations
57  double sign = ((int(pt * 10) % 2 == 0) ? 1 : -1); // introduce a pseudo-random sign of the shift
58  double phi = int16_t(packedPhi_) * 3.2f / std::numeric_limits<int16_t>::max() +
60  auto p4 = std::make_unique<PolarLorentzVector>(pt,
62  phi,
64  auto p4c = std::make_unique<LorentzVector>(*p4);
65  PolarLorentzVector *expectp4 = nullptr;
66  if (p4_.compare_exchange_strong(expectp4, p4.get())) {
67  p4.release();
68  }
69 
70  // p4c_ works as the guard for unpacking so it
71  // must be set last
72  LorentzVector *expectp4c = nullptr;
73  if (p4c_.compare_exchange_strong(expectp4c, p4c.get())) {
74  p4c.release();
75  }
76 }

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

◆ unpackCovariance()

void pat::PackedCandidate::unpackCovariance ( ) const
protected

Definition at line 92 of file PackedCandidate.cc.

92  {
94  if (p.isValid()) {
95  auto m = std::make_unique<reco::TrackBase::CovarianceMatrix>();
96  for (int i = 0; i < 5; i++)
97  for (int j = 0; j < 5; j++) {
98  (*m)(i, j) = 0;
99  }
108  reco::TrackBase::CovarianceMatrix *expected = nullptr;
109  if (m_.compare_exchange_strong(expected, m.get())) {
110  m.release();
111  }
112 
113  } else {
115  << "You do not have a valid track parameters file loaded. "
116  << "Please check that the release version is compatible with your "
117  "input data"
118  << "or avoid accessing track parameter uncertainties. ";
119  }
120 }

References Exception, mps_fire::i, dqmiolumiharvest::j, visualization-live-secondInstance_cfg::m, AlCaHLTBitMon_ParallelJobs::p, and edm::errors::UnimplementedFeature.

Referenced by maybeUnpackCovariance().

◆ unpackCovarianceElement()

void pat::PackedCandidate::unpackCovarianceElement ( reco::TrackBase::CovarianceMatrix m,
uint16_t  packed,
int  i,
int  j 
) const
inlineprivate

◆ unpackTimeError()

float pat::PackedCandidate::unpackTimeError ( uint8_t  timeError)
staticprotected

Definition at line 430 of file PackedCandidate.cc.

430  {
431  return timeError > 0 ? MIN_TIMEERROR * std::exp2(std::ldexp(float(timeError), -EXPO_TIMEERROR)) : -1.0f;
432 }

Referenced by timeError().

◆ unpackTimeNoError()

float pat::PackedCandidate::unpackTimeNoError ( int16_t  time)
staticprotected

Definition at line 433 of file PackedCandidate.cc.

433  {
434  if (time == 0)
435  return 0.f;
436  return (time > 0 ? MIN_TIME_NOERROR : -MIN_TIME_NOERROR) *
437  std::exp2(std::ldexp(float(std::abs(time)), -EXPO_TIME_NOERROR));
438 }

References funct::abs(), and protons_cff::time.

Referenced by dtimeAssociatedPV(), and unpackTimeWithError().

◆ unpackTimeWithError()

float pat::PackedCandidate::unpackTimeWithError ( int16_t  time,
uint8_t  timeError 
)
staticprotected

Definition at line 451 of file PackedCandidate.cc.

451  {
452  if (time % 2 == 0) {
453  // no overflow: drop rightmost bit and unpack in units of timeError
454  return std::ldexp(unpackTimeError(timeError), EXPO_TIME_WITHERROR) * float(time / 2);
455  } else {
456  // overflow: drop rightmost bit, unpack using the noError encoding
458  }
459 }

References dqmMemoryStats::float, protons_cff::time, and unpackTimeNoError().

Referenced by dtimeAssociatedPV().

◆ unpackTrk()

void pat::PackedCandidate::unpackTrk ( ) const
protected

Definition at line 164 of file PackedCandidate.cc.

164  {
165  maybeUnpackBoth();
168  int numberOfStripLayers = stripLayersWithMeasurement(), numberOfPixelLayers = pixelLayersWithMeasurement();
169  int numberOfPixelHits = this->numberOfPixelHits();
170  int numberOfHits = this->numberOfHits();
171 
172  int ndof = numberOfHits + numberOfPixelHits - 5;
173  LostInnerHits innerLost = lostInnerHits();
174 
175  auto track = std::make_unique<reco::Track>(normalizedChi2_ * ndof,
176  ndof,
177  *vertex_,
178  math::XYZVector(p3.x(), p3.y(), p3.z()),
179  charge(),
180  *(m_.load()),
183  int i = 0;
184  if (firstHit_ == 0) { // Backward compatible
185  if (innerLost == validHitInFirstPixelBarrelLayer) {
186  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, 1, 0, TrackingRecHit::valid);
187  i = 1;
188  }
189  } else {
190  track->appendHitPattern(firstHit_, TrackingRecHit::valid);
191  }
192 
194  i = 1;
195 
196  // add hits to match the number of laters and validHitInFirstPixelBarrelLayer
197  if (innerLost == validHitInFirstPixelBarrelLayer) {
198  // then to encode the number of layers, we add more hits on distinct layers
199  // (B2, B3, B4, F1, ...)
200  for (; i < numberOfPixelLayers; i++) {
201  if (i <= 3) {
202  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, i + 1, 0, TrackingRecHit::valid);
203  } else {
204  track->appendTrackerHitPattern(PixelSubdetector::PixelEndcap, i - 3, 0, TrackingRecHit::valid);
205  }
206  }
207  } else {
208  // to encode the information on the layers, we add one valid hits per layer
209  // but skipping PXB1
210  int iOffset = 0;
214  iOffset += 3;
215  } else {
216  iOffset = 1;
217  }
218  for (; i < numberOfPixelLayers; i++) {
219  if (i + iOffset <= 2) {
220  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, i + iOffset + 1, 0, TrackingRecHit::valid);
221  } else {
222  track->appendTrackerHitPattern(PixelSubdetector::PixelEndcap, i + iOffset - 3 + 1, 0, TrackingRecHit::valid);
223  }
224  }
225  }
226  // add extra hits (overlaps, etc), all on the first layer with a hit - to
227  // avoid increasing the layer count
228  for (; i < numberOfPixelHits; i++) {
230  track->appendTrackerHitPattern(reco::HitPattern::getSubStructure(firstHit_),
232  0,
234  } else {
235  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel,
236  (innerLost == validHitInFirstPixelBarrelLayer ? 1 : 2),
237  0,
239  }
240  }
241  // now start adding strip layers, putting one hit on each layer so that the
242  // hitPattern.stripLayersWithMeasurement works. we don't know what the layers
243  // where, so we just start with TIB (4 layers), then TOB (6 layers), then TEC
244  // (9) and then TID(3), so that we can get a number of valid strip layers up
245  // to 4+6+9+3
247  i += 1;
248  int slOffset = 0;
250  slOffset = reco::HitPattern::getLayer(firstHit_) - 1;
252  slOffset += 4;
254  slOffset += 7;
256  slOffset += 13;
257  }
258  for (int sl = slOffset; sl < numberOfStripLayers + slOffset; ++sl, ++i) {
259  if (sl < 4)
260  track->appendTrackerHitPattern(StripSubdetector::TIB, sl + 1, 1, TrackingRecHit::valid);
261  else if (sl < 4 + 3)
262  track->appendTrackerHitPattern(StripSubdetector::TID, (sl - 4) + 1, 1, TrackingRecHit::valid);
263  else if (sl < 7 + 6)
264  track->appendTrackerHitPattern(StripSubdetector::TOB, (sl - 7) + 1, 1, TrackingRecHit::valid);
265  else if (sl < 13 + 9)
266  track->appendTrackerHitPattern(StripSubdetector::TEC, (sl - 13) + 1, 1, TrackingRecHit::valid);
267  else
268  break; // wtf?
269  }
270  // finally we account for extra strip hits beyond the one-per-layer added
271  // above. we put them all on TIB1, to avoid incrementing the number of
272  // layersWithMeasurement.
273  for (; i < numberOfHits; i++) {
275  track->appendTrackerHitPattern(reco::HitPattern::getSubStructure(firstHit_),
277  1,
279  } else {
280  track->appendTrackerHitPattern(StripSubdetector::TIB, 1, 1, TrackingRecHit::valid);
281  }
282  }
283 
284  switch (innerLost) {
286  break;
287  case noLostInnerHits:
288  break;
289  case oneLostInnerHit:
290  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, 1, 0, TrackingRecHit::missing_inner);
291  break;
292  case moreLostInnerHits:
293  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, 1, 0, TrackingRecHit::missing_inner);
294  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, 2, 0, TrackingRecHit::missing_inner);
295  break;
296  };
297 
298  if (trackHighPurity())
299  track->setQuality(reco::TrackBase::highPurity);
300 
301  reco::Track *expected = nullptr;
302  if (track_.compare_exchange_strong(expected, track.get())) {
303  track.release();
304  }
305 }

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, HLT_FULL_cff::track, reco::TrackBase::undefAlgorithm, and TrackingRecHit::valid.

Referenced by maybeUnpackTrack(), and pseudoTrack().

◆ unpackVtx()

void pat::PackedCandidate::unpackVtx ( ) const
protected

Definition at line 122 of file PackedCandidate.cc.

122  {
123  reco::VertexRef pvRef = vertexRef();
129  : int16_t(packedDz_) * 40.f / std::numeric_limits<int16_t>::max();
130  Point pv = pvRef.isNonnull() ? pvRef->position() : Point();
131  float phi = p4_.load()->Phi() + dphi_, s = std::sin(phi), c = std::cos(phi);
132  auto vertex = std::make_unique<Point>(pv.X() - dxy_ * s,
133  pv.Y() + dxy_ * c,
134  pv.Z() + dz_); // for our choice of using the PCA to the PV, by definition the
135  // remaining term -(dx*cos(phi) + dy*sin(phi))*(pz/pt) is zero
136 
137  Point *expected = nullptr;
138  if (vertex_.compare_exchange_strong(expected, vertex.get())) {
139  vertex.release();
140  }
141 }

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

Referenced by maybeUnpackBoth(), and packBoth().

◆ vertex()

const Point& pat::PackedCandidate::vertex ( ) const
inlineoverridevirtual

vertex position

Implements reco::Candidate.

Definition at line 676 of file PackedCandidate.h.

676  {
677  maybeUnpackBoth();
678  return *vertex_;
679  } //{ if (fromPV_) return Point(0,0,0); else return Point(0,0,100); }

References maybeUnpackBoth(), and vertex_.

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

◆ vertexChi2()

double pat::PackedCandidate::vertexChi2 ( ) const
overridevirtual

chi-squares

Implements reco::Candidate.

Definition at line 350 of file PackedCandidate.cc.

350 { return 0; }

◆ vertexCovariance() [1/2]

CovarianceMatrix pat::PackedCandidate::vertexCovariance ( ) const
inlineoverridevirtual

return SMatrix

Reimplemented from reco::Candidate.

Definition at line 870 of file PackedCandidate.h.

870  {
873  return m;
874  }

References fillVertexCovariance(), and visualization-live-secondInstance_cfg::m.

◆ vertexCovariance() [2/2]

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 356 of file PackedCandidate.cc.

356  {
358  << "reco::ConcreteCandidate does not implement vertex covariant "
359  "matrix.\n";
360 }

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

◆ vertexNdof()

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 352 of file PackedCandidate.cc.

352 { return 0; }

◆ vertexNormalizedChi2()

double pat::PackedCandidate::vertexNormalizedChi2 ( ) const
overridevirtual

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

Implements reco::Candidate.

Definition at line 354 of file PackedCandidate.cc.

354 { return 0; }

◆ vertexRef()

const reco::VertexRef pat::PackedCandidate::vertexRef ( ) const
inline

◆ vx()

double pat::PackedCandidate::vx ( ) const
inlineoverridevirtual

x coordinate of vertex position

Implements reco::Candidate.

Definition at line 681 of file PackedCandidate.h.

681  {
682  maybeUnpackBoth();
683  return vertex_.load()->X();
684  } //{ return 0; }

References maybeUnpackBoth(), and vertex_.

◆ vy()

double pat::PackedCandidate::vy ( ) const
inlineoverridevirtual

y coordinate of vertex position

Implements reco::Candidate.

Definition at line 686 of file PackedCandidate.h.

686  {
687  maybeUnpackBoth();
688  return vertex_.load()->Y();
689  } //{ return 0; }

References maybeUnpackBoth(), and vertex_.

◆ vz()

double pat::PackedCandidate::vz ( ) const
inlineoverridevirtual

z coordinate of vertex position

Implements reco::Candidate.

Definition at line 691 of file PackedCandidate.h.

691  {
692  maybeUnpackBoth();
693  return vertex_.load()->Z();
694  } //{ if (fromPV_) return 0; else return 100; }

References maybeUnpackBoth(), and vertex_.

◆ y()

double pat::PackedCandidate::y ( ) const
inlineoverridevirtual

rapidity

Implements reco::Candidate.

Definition at line 575 of file PackedCandidate.h.

575  {
576  if (!p4c_)
577  unpack();
578  return p4_.load()->Rapidity();
579  }

References p4_, p4c_, and unpack().

Referenced by svgfig.Ellipse::__repr__(), geometryXMLparser.Alignable::pos(), ntupleDataFormat._HitObject::r(), and ntupleDataFormat._HitObject::r3D().

Friends And Related Function Documentation

◆ ::OverlapChecker

friend class ::OverlapChecker
friend

Definition at line 1097 of file PackedCandidate.h.

◆ ::testPackedCandidate

friend class ::testPackedCandidate
friend

Definition at line 995 of file PackedCandidate.h.

◆ component

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

Definition at line 1096 of file PackedCandidate.h.

◆ ShallowCloneCandidate

friend class ShallowCloneCandidate
friend

Definition at line 1098 of file PackedCandidate.h.

◆ ShallowClonePtrCandidate

friend class ShallowClonePtrCandidate
friend

Definition at line 1099 of file PackedCandidate.h.

Member Data Documentation

◆ caloFraction_

uint8_t pat::PackedCandidate::caloFraction_
protected

Definition at line 1040 of file PackedCandidate.h.

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

◆ covariance_load_flag

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

Definition at line 1076 of file PackedCandidate.h.

Referenced by covarianceParameterization().

◆ covarianceParameterization_

CovarianceParameterization pat::PackedCandidate::covarianceParameterization_
staticprotected

Definition at line 1073 of file PackedCandidate.h.

Referenced by covarianceParameterization().

◆ covarianceSchema_

uint16_t pat::PackedCandidate::covarianceSchema_
protected

◆ covarianceVersion_

uint16_t pat::PackedCandidate::covarianceVersion_
protected

◆ deta_

float pat::PackedCandidate::deta_
mutableprotected

Definition at line 1052 of file PackedCandidate.h.

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

◆ dphi_

float pat::PackedCandidate::dphi_
mutableprotected

Definition at line 1052 of file PackedCandidate.h.

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

◆ dtrkpt_

float pat::PackedCandidate::dtrkpt_
mutableprotected

Definition at line 1052 of file PackedCandidate.h.

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

◆ dxy_

float pat::PackedCandidate::dxy_
mutableprotected

Definition at line 1052 of file PackedCandidate.h.

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

◆ dz_

float pat::PackedCandidate::dz_
mutableprotected

Definition at line 1052 of file PackedCandidate.h.

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

◆ EXPO_TIME_NOERROR

constexpr int pat::PackedCandidate::EXPO_TIME_NOERROR = 6
staticconstexprprotected

Definition at line 1125 of file PackedCandidate.h.

◆ EXPO_TIME_WITHERROR

constexpr int pat::PackedCandidate::EXPO_TIME_WITHERROR = -6
staticconstexprprotected

Definition at line 1126 of file PackedCandidate.h.

◆ EXPO_TIMEERROR

constexpr int pat::PackedCandidate::EXPO_TIMEERROR = 5
staticconstexprprotected

Definition at line 1124 of file PackedCandidate.h.

◆ firstHit_

uint16_t pat::PackedCandidate::firstHit_

Definition at line 1128 of file PackedCandidate.h.

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

◆ hcalFraction_

int8_t pat::PackedCandidate::hcalFraction_
protected

Definition at line 1041 of file PackedCandidate.h.

Referenced by operator=().

◆ isIsolatedChargedHadron_

bool pat::PackedCandidate::isIsolatedChargedHadron_
protected

Definition at line 1045 of file PackedCandidate.h.

Referenced by operator=().

◆ kMinDEtaToStore_

constexpr float pat::PackedCandidate::kMinDEtaToStore_ = 0.001
staticconstexprprotected

Definition at line 996 of file PackedCandidate.h.

◆ kMinDTrkPtToStore_

constexpr float pat::PackedCandidate::kMinDTrkPtToStore_ = 0.001
staticconstexprprotected

Definition at line 997 of file PackedCandidate.h.

◆ longLivedTag

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

long lived flag

Definition at line 841 of file PackedCandidate.h.

◆ m_

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

IP covariance.

Definition at line 1063 of file PackedCandidate.h.

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

◆ massConstraintTag

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

do mass constraint flag

Definition at line 847 of file PackedCandidate.h.

◆ MIN_TIME_NOERROR

constexpr float pat::PackedCandidate::MIN_TIME_NOERROR = 0.0002f
staticconstexprprotected

Definition at line 1122 of file PackedCandidate.h.

◆ MIN_TIMEERROR

constexpr float pat::PackedCandidate::MIN_TIMEERROR = 0.002f
staticconstexprprotected

Definition at line 1121 of file PackedCandidate.h.

◆ normalizedChi2_

uint8_t pat::PackedCandidate::normalizedChi2_
protected

track quality information

Definition at line 1070 of file PackedCandidate.h.

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

◆ p4_

std::atomic<PolarLorentzVector *> pat::PackedCandidate::p4_
mutableprotected

◆ p4c_

std::atomic<LorentzVector *> pat::PackedCandidate::p4c_
mutableprotected

◆ packedCovariance_

PackedCovariance pat::PackedCandidate::packedCovariance_
protected

Definition at line 1001 of file PackedCandidate.h.

Referenced by operator=().

◆ packedDEta_

uint16_t pat::PackedCandidate::packedDEta_
protected

Definition at line 1000 of file PackedCandidate.h.

Referenced by operator=().

◆ packedDPhi_

uint16_t pat::PackedCandidate::packedDPhi_
protected

Definition at line 1000 of file PackedCandidate.h.

Referenced by operator=().

◆ packedDTrkPt_

uint16_t pat::PackedCandidate::packedDTrkPt_
protected

Definition at line 1000 of file PackedCandidate.h.

Referenced by operator=().

◆ packedDxy_

uint16_t pat::PackedCandidate::packedDxy_
protected

Definition at line 1000 of file PackedCandidate.h.

Referenced by operator=().

◆ packedDz_

uint16_t pat::PackedCandidate::packedDz_
protected

Definition at line 1000 of file PackedCandidate.h.

Referenced by operator=().

◆ packedEta_

uint16_t pat::PackedCandidate::packedEta_
protected

Definition at line 999 of file PackedCandidate.h.

Referenced by operator=().

◆ packedHits_

uint8_t pat::PackedCandidate::packedHits_
protected

◆ packedLayers_

uint8_t pat::PackedCandidate::packedLayers_
protected

◆ packedM_

uint16_t pat::PackedCandidate::packedM_
protected

Definition at line 999 of file PackedCandidate.h.

Referenced by operator=().

◆ packedPhi_

uint16_t pat::PackedCandidate::packedPhi_
protected

Definition at line 999 of file PackedCandidate.h.

Referenced by operator=().

◆ packedPt_

uint16_t pat::PackedCandidate::packedPt_
protected

Definition at line 999 of file PackedCandidate.h.

Referenced by operator=().

◆ packedPuppiweight_

uint8_t pat::PackedCandidate::packedPuppiweight_
protected

Definition at line 1035 of file PackedCandidate.h.

Referenced by operator=().

◆ packedPuppiweightNoLepDiff_

int8_t pat::PackedCandidate::packedPuppiweightNoLepDiff_
protected

Definition at line 1036 of file PackedCandidate.h.

Referenced by operator=().

◆ packedTime_

int16_t pat::PackedCandidate::packedTime_
protected

Definition at line 1042 of file PackedCandidate.h.

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

◆ packedTimeError_

uint8_t pat::PackedCandidate::packedTimeError_
protected

Definition at line 1043 of file PackedCandidate.h.

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

◆ pdgId_

int pat::PackedCandidate::pdgId_
protected

PDG identifier.

Definition at line 1056 of file PackedCandidate.h.

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

◆ pvRefKey_

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

Definition at line 1060 of file PackedCandidate.h.

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

◆ pvRefProd_

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

Use these to build a Ref to primary vertex.

Definition at line 1059 of file PackedCandidate.h.

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

◆ qualityFlags_

uint16_t pat::PackedCandidate::qualityFlags_
protected

◆ rawCaloFraction_

uint8_t pat::PackedCandidate::rawCaloFraction_
protected

Definition at line 1038 of file PackedCandidate.h.

Referenced by operator=().

◆ rawHcalFraction_

int8_t pat::PackedCandidate::rawHcalFraction_
protected

Definition at line 1039 of file PackedCandidate.h.

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

◆ track_

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

reco::Track

Definition at line 1054 of file PackedCandidate.h.

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

◆ vertex_

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

vertex position

Definition at line 1051 of file PackedCandidate.h.

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

pat::PackedCandidate::qualityFlags_
uint16_t qualityFlags_
Definition: PackedCandidate.h:1057
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:542
pat::PackedCandidate::hasTrackDetails
bool hasTrackDetails() const
Return true if a bestTrack can be extracted from this Candidate.
Definition: PackedCandidate.h:788
reco::HitPattern::getSubStructure
static uint32_t getSubStructure(uint16_t pattern)
Definition: HitPattern.h:695
pat::PackedCandidate::phiAtVtx
virtual float phiAtVtx() const
momentum azimuthal angle from the track (normally identical to phi())
Definition: PackedCandidate.h:541
pat::PackedCandidate::pvRefKey_
reco::VertexRef::key_type pvRefKey_
Definition: PackedCandidate.h:1060
pat::PackedCandidate::dxy_
float dxy_
Definition: PackedCandidate.h:1052
mps_fire.i
i
Definition: mps_fire.py:428
pat::PackedCandidate::packedTime_
int16_t packedTime_
Definition: PackedCandidate.h:1042
pat::PackedCandidate::vertexRef
const reco::VertexRef vertexRef() const
Definition: PackedCandidate.h:738
pat::PackedCandidate::egammaFlagsMask
Definition: PackedCandidate.h:1110
pat::PackedCandidate::packCovarianceElement
uint16_t packCovarianceElement(const reco::TrackBase::CovarianceMatrix &m, int i, int j) const
Definition: PackedCandidate.h:989
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11713
TrackingRecHit::missing_inner
Definition: TrackingRecHit.h:50
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
PixelSubdetector::PixelEndcap
Definition: PixelSubdetector.h:11
reco::TrackBase::loose
Definition: TrackBase.h:152
PixelSubdetector::PixelBarrel
Definition: PixelSubdetector.h:11
pat::PackedCandidate::stripLayersWithMeasurement
int stripLayersWithMeasurement() const
Definition: PackedCandidate.h:669
pat::PackedCandidate::polarP4
const PolarLorentzVector & polarP4() const override
four-momentum Lorentz vector
Definition: PackedCandidate.h:444
pat::PackedCandidate::muonFlagsShift
Definition: PackedCandidate.h:1109
edm::errors::InvalidReference
Definition: EDMException.h:39
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
pat::PackedCandidate::p
double p() const override
magnitude of momentum vector
Definition: PackedCandidate.h:463
pat::PackedCandidate::trackHighPurity
bool trackHighPurity() const
true if the track had the highPurity quality bit
Definition: PackedCandidate.h:791
pat::PackedCandidate::time
virtual float time() const
time (wrt nominal zero of the collision)
Definition: PackedCandidate.h:963
pat::PackedCandidate::pdgId
int pdgId() const override
PDG identifier.
Definition: PackedCandidate.h:833
pat::PackedCandidate::unpackTimeWithError
static float unpackTimeWithError(int16_t time, uint8_t timeError)
Definition: PackedCandidate.cc:451
min
T min(T a, T b)
Definition: MathUtil.h:58
pat::PackedCandidate::packedCovariance_
PackedCovariance packedCovariance_
Definition: PackedCandidate.h:1001
reco::deltaPhi
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
pat::PackedCandidate::oneLostInnerHit
Definition: PackedCandidate.h:803
pat::PackedCandidate::packedDxy_
uint16_t packedDxy_
Definition: PackedCandidate.h:1000
pat::PackedCandidate::dz_
float dz_
Definition: PackedCandidate.h:1052
pat::PackedCandidate::packTimeNoError
static int16_t packTimeNoError(float time)
Definition: PackedCandidate.cc:439
pat::PackedCandidate::covarianceParameterization_
static CovarianceParameterization covarianceParameterization_
Definition: PackedCandidate.h:1073
pat::PackedCandidate::PackedCovariance::dzdz
uint16_t dzdz
Definition: PackedCandidate.h:952
pat::PackedCandidate::covarianceVersion_
uint16_t covarianceVersion_
Definition: PackedCandidate.h:1071
pat::PackedCandidate::PackedCovariance::dxydz
uint16_t dxydz
Definition: PackedCandidate.h:951
pat::PackedCandidate::packedDPhi_
uint16_t packedDPhi_
Definition: PackedCandidate.h:1000
pat::PackedCandidate::unpackTimeNoError
static float unpackTimeNoError(int16_t time)
Definition: PackedCandidate.cc:433
pat::PackedCandidate::moreLostInnerHits
Definition: PackedCandidate.h:804
pat::PackedCandidate::assignmentQualityShift
Definition: PackedCandidate.h:1103
pat::PackedCandidate::maybeUnpackCovariance
void maybeUnpackCovariance() const
Definition: PackedCandidate.h:1019
pat::PackedCandidate::masterClone
const reco::CandidateBaseRef & masterClone() const override
Definition: PackedCandidate.cc:309
pat::PackedCandidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: PackedCandidate.h:27
pat::PackedCandidate::kMinDEtaToStore_
static constexpr float kMinDEtaToStore_
Definition: PackedCandidate.h:996
Validation_hcalonly_cfi.sign
sign
Definition: Validation_hcalonly_cfi.py:32
CovarianceMatrix
Definition: CovarianceMatrix.h:28
pat::PackedCandidate::packedDz_
uint16_t packedDz_
Definition: PackedCandidate.h:1000
CovarianceParameterization::pack
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
Definition: CovarianceParameterization.cc:180
pat::PackedCandidate::trackPixelHitsMask
Definition: PackedCandidate.h:620
pat::PackedCandidate::dtrkpt_
float dtrkpt_
Definition: PackedCandidate.h:1052
pat::PackedCandidate::caloFraction_
uint8_t caloFraction_
Definition: PackedCandidate.h:1040
pat::PackedCandidate::rawCaloFraction_
uint8_t rawCaloFraction_
Definition: PackedCandidate.h:1038
findQualityFiles.v
v
Definition: findQualityFiles.py:179
pat::PackedCandidate::unpackCovarianceElement
void unpackCovarianceElement(reco::TrackBase::CovarianceMatrix &m, uint16_t packed, int i, int j) const
Definition: PackedCandidate.h:985
pat::PackedCandidate::unpackCovariance
void unpackCovariance() const
Definition: PackedCandidate.cc:92
pat::PackedCandidate::pvAssociationQuality
const PVAssociationQuality pvAssociationQuality() const
Definition: PackedCandidate.h:730
pat::PackedCandidate::timeError
virtual float timeError() const
time measurement uncertainty (-1 if not available)
Definition: PackedCandidate.h:978
math::RhoEtaPhiVector
RhoEtaPhiVectorD RhoEtaPhiVector
spatial vector with cylindrical internal representation using pseudorapidity
Definition: Vector3D.h:33
pat::PackedCandidate::PVTight
Definition: PackedCandidate.h:704
pat::PackedCandidate::charge
int charge() const override
electric charge
Definition: PackedCandidate.h:415
pat::PackedCandidate::ptTrk
virtual double ptTrk() const
pt from the track (normally identical to pt())
Definition: PackedCandidate.h:536
pat::PackedCandidate::packTimeError
static uint8_t packTimeError(float timeError)
static to allow unit testing
Definition: PackedCandidate.cc:419
pat::PackedCandidate::m_
std::atomic< reco::TrackBase::CovarianceMatrix * > m_
IP covariance.
Definition: PackedCandidate.h:1063
pat::PackedCandidate::UsedInFitLoose
Definition: PackedCandidate.h:727
pat::PackedCandidate::isIsolatedChargedHadron_
bool isIsolatedChargedHadron_
Definition: PackedCandidate.h:1045
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:42
reco::HitPattern::pixelLayersWithMeasurement
int pixelLayersWithMeasurement() const
Definition: HitPattern.cc:492
edm::Ref< VertexCollection >
pat::PackedCandidate::PVUsedInFit
Definition: PackedCandidate.h:704
quality
const uint32_t *__restrict__ Quality * quality
Definition: CAHitNtupletGeneratorKernelsImpl.h:109
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
ndof
Definition: HIMultiTrackSelector.h:49
pat::PackedCandidate::validHitInFirstPixelBarrelLayer
Definition: PackedCandidate.h:800
pat::PackedCandidate::muonFlagsMask
Definition: PackedCandidate.h:1108
alignCSCRings.s
s
Definition: alignCSCRings.py:92
pat::PackedCandidate::EXPO_TIME_NOERROR
static constexpr int EXPO_TIME_NOERROR
Definition: PackedCandidate.h:1125
reco::HitPattern::stripLayersWithMeasurement
int stripLayersWithMeasurement() const
Definition: HitPattern.h:974
pat::PackedCandidate::packedDEta_
uint16_t packedDEta_
Definition: PackedCandidate.h:1000
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
pat::PackedCandidate::PackedCandidate
PackedCandidate()
default constructor
Definition: PackedCandidate.h:37
pat::PackedCandidate::packedPt_
uint16_t packedPt_
Definition: PackedCandidate.h:999
pat::PackedCandidate::trackStripHitsShift
Definition: PackedCandidate.h:620
pat::PackedCandidate::PackedCovariance::dlambdadz
uint16_t dlambdadz
Definition: PackedCandidate.h:954
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
pat::PackedCandidate::pz
double pz() const override
z coordinate of momentum vector
Definition: PackedCandidate.h:517
pat::PackedCandidate::numberOfHits
int numberOfHits() const
Definition: PackedCandidate.h:665
pat::PackedCandidate::dz
virtual float dz(size_t ipv=0) const
dz with respect to the PV[ipv]
Definition: PackedCandidate.h:746
reco::Track
Definition: Track.h:27
pat::PackedCandidate::unpack
void unpack() const
Definition: PackedCandidate.cc:53
pat::PackedCandidate::MIN_TIME_NOERROR
static constexpr float MIN_TIME_NOERROR
Definition: PackedCandidate.h:1122
pat::PackedCandidate::normalizedChi2_
uint8_t normalizedChi2_
track quality information
Definition: PackedCandidate.h:1070
pat::PackedCandidate::PVAssociationQuality
PVAssociationQuality
Definition: PackedCandidate.h:722
pat::PackedCandidate::pvRefProd_
reco::VertexRefProd pvRefProd_
Use these to build a Ref to primary vertex.
Definition: PackedCandidate.h:1059
svgfig.load
def load(fileName)
Definition: svgfig.py:547
pat::PackedCandidate::packCovariance
void packCovariance(const reco::TrackBase::CovarianceMatrix &m, bool unpackAfterwards=true)
Definition: PackedCandidate.cc:78
pat::PackedCandidate::unpackVtx
void unpackVtx() const
Definition: PackedCandidate.cc:122
pat::PackedCandidate::setTrackProperties
virtual void setTrackProperties(const reco::Track &tk, const reco::Track::CovarianceMatrix &covariance, int quality, int covarianceVersion)
Definition: PackedCandidate.h:645
StripSubdetector::TIB
static constexpr auto TIB
Definition: StripSubdetector.h:16
pat::PackedCandidate::hcalFraction_
int8_t hcalFraction_
Definition: PackedCandidate.h:1041
reco::TrackBase::covariance
CovarianceMatrix covariance() const
return track covariance matrix
Definition: TrackBase.h:716
pat::PackedCandidate::covariance_load_flag
static std::once_flag covariance_load_flag
Definition: PackedCandidate.h:1076
pat::PackedCandidate::EXPO_TIMEERROR
static constexpr int EXPO_TIMEERROR
Definition: PackedCandidate.h:1124
pat::PackedCandidate::rawHcalFraction_
int8_t rawHcalFraction_
Definition: PackedCandidate.h:1039
pat::PackedCandidate::maybeUnpackTrack
void maybeUnpackTrack() const
Definition: PackedCandidate.h:1015
pat::PackedCandidate::PolarLorentzVector
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: PackedCandidate.h:29
pat::PackedCandidate::packedPhi_
uint16_t packedPhi_
Definition: PackedCandidate.h:999
pat::PackedCandidate::deta_
float deta_
Definition: PackedCandidate.h:1052
pat::PackedCandidate::numberOfPixelHits
int numberOfPixelHits() const
Definition: PackedCandidate.h:664
pat::PackedCandidate::noLostInnerHits
Definition: PackedCandidate.h:801
pat::PackedCandidate::pt
double pt() const override
transverse momentum
Definition: PackedCandidate.h:523
pat::PackedCandidate::dzAssociatedPV
virtual float dzAssociatedPV() const
dz with respect to the PV ref
Definition: PackedCandidate.h:751
reco::HitPattern::pixelHitFilter
static bool pixelHitFilter(uint16_t pattern)
Definition: HitPattern.h:573
CovarianceParameterization::unpack
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
Definition: CovarianceParameterization.cc:196
reco::HitPattern::getLayer
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:702
Point
Structure Point Contains parameters of Gaussian fits to DMRs.
Definition: DMRtrends.cc:57
pat::PackedCandidate::CompatibilityDz
Definition: PackedCandidate.h:726
pat::PackedCandidate::trackHighPurityMask
Definition: PackedCandidate.h:1104
pat::PackedCandidate::packTimeWithError
static int16_t packTimeWithError(float time, float timeError)
Definition: PackedCandidate.cc:460
pat::PackedCandidate::OtherDeltaZ
Definition: PackedCandidate.h:724
pat::PackedCandidate::packedPuppiweight_
uint8_t packedPuppiweight_
Definition: PackedCandidate.h:1035
pat::PackedCandidate::egammaFlagsShift
Definition: PackedCandidate.h:1111
pat::PackedCandidate::kMinDTrkPtToStore_
static constexpr float kMinDTrkPtToStore_
Definition: PackedCandidate.h:997
pat::PackedCandidate::CompatibilityBTag
Definition: PackedCandidate.h:725
pat::PackedCandidate::LostInnerHits
LostInnerHits
Enumerator specifying the.
Definition: PackedCandidate.h:799
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
pat::PackedCandidate::packedM_
uint16_t packedM_
Definition: PackedCandidate.h:999
pat::PackedCandidate::covarianceParameterization
const CovarianceParameterization & covarianceParameterization() const
Definition: PackedCandidate.h:1077
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
pat::PackedCandidate::p4_
std::atomic< PolarLorentzVector * > p4_
the four vector
Definition: PackedCandidate.h:1048
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
reco::VertexRef
edm::Ref< VertexCollection > VertexRef
persistent reference to a Vertex
Definition: VertexFwd.h:13
pat::PackedCandidate::packVtx
void packVtx(bool unpackAfterwards=true)
Definition: PackedCandidate.cc:26
MiniFloatConverter::float16to32
static float float16to32(uint16_t h)
Definition: libminifloat.h:12
reco::TrackBase::undefAlgorithm
Definition: TrackBase.h:90
pat::PackedCandidate::covarianceSchema_
uint16_t covarianceSchema_
Definition: PackedCandidate.h:1072
pat::PackedCandidate::phi
double phi() const override
momentum azimuthal angle
Definition: PackedCandidate.h:529
createfilelist.int
int
Definition: createfilelist.py:10
pat::PackedCandidate::vertex_
std::atomic< Point * > vertex_
vertex position
Definition: PackedCandidate.h:1051
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
pat::PackedCandidate::PackedCovariance::detadeta
uint16_t detadeta
Definition: PackedCandidate.h:958
pat::PackedCandidate::track_
std::atomic< reco::Track * > track_
reco::Track
Definition: PackedCandidate.h:1054
pat::PackedCandidate::PackedCovariance::dphidxy
uint16_t dphidxy
Definition: PackedCandidate.h:955
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
topSingleLeptonDQM_PU_cfi.pattern
pattern
Definition: topSingleLeptonDQM_PU_cfi.py:39
submitPVResolutionJobs.q
q
Definition: submitPVResolutionJobs.py:84
pat::PackedCandidate::p4
const LorentzVector & p4() const override
four-momentum Lorentz vecto r
Definition: PackedCandidate.h:438
reco::TrackBase::normalizedChi2
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:593
pat::PackedCandidate::PackedCovariance::dptdpt
uint16_t dptdpt
Definition: PackedCandidate.h:957
pat::PackedCandidate::fillVertexCovariance
void fillVertexCovariance(CovarianceMatrix &v) const override
fill SMatrix
Definition: PackedCandidate.cc:362
pat::PackedCandidate::packedHits_
uint8_t packedHits_
Definition: PackedCandidate.h:1064
TrackingRecHit::valid
Definition: TrackingRecHit.h:46
muons_cff.isGlobal
isGlobal
Definition: muons_cff.py:149
pat::PackedCandidate::packBoth
void packBoth()
Definition: PackedCandidate.h:1023
reco::TrackBase::hitPattern
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:504
pat::PackedCandidate::packedDTrkPt_
uint16_t packedDTrkPt_
Definition: PackedCandidate.h:1000
pat::PackedCandidate::assignmentQualityMask
Definition: PackedCandidate.h:1102
pat::PackedCandidate::setHits
virtual void setHits(const reco::Track &tk)
Definition: PackedCandidate.h:623
pat::PackedCandidate::PackedCovariance::dxydxy
uint16_t dxydxy
Definition: PackedCandidate.h:950
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
pat::PackedCandidate::packedTimeError_
uint8_t packedTimeError_
Definition: PackedCandidate.h:1043
CovarianceParameterization::loadedVersion
int loadedVersion() const
Definition: CovarianceParameterization.h:40
StripSubdetector::TEC
static constexpr auto TEC
Definition: StripSubdetector.h:19
pat::PackedCandidate::firstHit_
uint16_t firstHit_
Definition: PackedCandidate.h:1128
edm::shift
static unsigned const int shift
Definition: LuminosityBlockID.cc:7
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:18
pat::PackedCandidate::NoPV
Definition: PackedCandidate.h:704
LorentzVector
math::XYZTLorentzVector LorentzVector
Definition: HLTMuonMatchAndPlot.h:49
pat::PackedCandidate::covarianceVersion
int covarianceVersion() const
Definition: PackedCandidate.h:672
pat::PackedCandidate::trackHighPurityShift
Definition: PackedCandidate.h:1105
pat::PackedCandidate::PVLoose
Definition: PackedCandidate.h:704
Exception
Definition: hltDiff.cc:245
pat::PackedCandidate::unpackTimeError
static float unpackTimeError(uint8_t timeError)
Definition: PackedCandidate.cc:430
pat::PackedCandidate::lostInnerHitsShift
Definition: PackedCandidate.h:1107
pat::PackedCandidate::packedEta_
uint16_t packedEta_
Definition: PackedCandidate.h:999
pat::PackedCandidate::packedPuppiweightNoLepDiff_
int8_t packedPuppiweightNoLepDiff_
Definition: PackedCandidate.h:1036
muons_cff.highPurity
highPurity
Definition: muons_cff.py:136
pat::PackedCandidate::maybeUnpackBoth
void maybeUnpackBoth() const
Definition: PackedCandidate.h:1009
StripSubdetector::TOB
static constexpr auto TOB
Definition: StripSubdetector.h:18
pat::PackedCandidate::NotReconstructedPrimary
Definition: PackedCandidate.h:723
CovarianceParameterization::load
void load(int version)
Definition: CovarianceParameterization.cc:81
or
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
pat::PackedCandidate::packedLayers_
uint8_t packedLayers_
Definition: PackedCandidate.h:1064
pat::PackedCandidate::pixelLayersWithMeasurement
int pixelLayersWithMeasurement() const
Definition: PackedCandidate.h:668
p3
double p3[4]
Definition: TauolaWrapper.h:91
pat::PackedCandidate::isGoodEgamma
bool isGoodEgamma() const
Definition: PackedCandidate.h:909
pat::PackedCandidate::unpackTrk
void unpackTrk() const
Definition: PackedCandidate.cc:164
reco::HitPattern::numberOfValidPixelHits
int numberOfValidPixelHits() const
Definition: HitPattern.h:800
pat::PackedCandidate::Point
math::XYZPoint Point
point in the space
Definition: PackedCandidate.h:31
edm::Ref::key
key_type key() const
Accessor for product key.
Definition: Ref.h:250
pat::PackedCandidate::lostInnerHits
LostInnerHits lostInnerHits() const
Definition: PackedCandidate.h:806
reco::CandidatePtr
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
Definition: CandidateFwd.h:25
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
pat::PackedCandidate::pack
void pack(bool unpackAfterwards=true)
Definition: PackedCandidate.cc:13
pat::PackedCandidate::lostInnerHitsMask
Definition: PackedCandidate.h:1106
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
reco::HitPattern::numberOfValidHits
int numberOfValidHits() const
Definition: HitPattern.h:786
pat::PackedCandidate::dtimeAssociatedPV
virtual float dtimeAssociatedPV() const
dtime with respect to the PV ref
Definition: PackedCandidate.h:969
pat::PackedCandidate::vertex
const Point & vertex() const override
vertex position
Definition: PackedCandidate.h:676
pat::PackedCandidate::setDTimeAssociatedPV
void setDTimeAssociatedPV(float aTime, float aTimeError=0)
set time measurement
Definition: PackedCandidate.cc:404
reco::TrackBase::CovarianceMatrix
math::Error< dimension >::type CovarianceMatrix
5 parameter covariance matrix
Definition: TrackBase.h:74
pat::PackedCandidate::UsedInFitTight
Definition: PackedCandidate.h:728
reco::HitPattern::stripHitFilter
static bool stripHitFilter(uint16_t pattern)
Definition: HitPattern.h:597
CovarianceParameterization
Definition: CovarianceParameterization.h:24
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
pat::PackedCandidate::etaAtVtx
virtual float etaAtVtx() const
eta from the track (normally identical to eta())
Definition: PackedCandidate.h:551
pat::PackedCandidate::dphi_
float dphi_
Definition: PackedCandidate.h:1052
MiniFloatConverter::max
static float max()
Definition: libminifloat.h:116
pat::PackedCandidate::pdgId_
int pdgId_
PDG identifier.
Definition: PackedCandidate.h:1056
pat::PackedCandidate::p4c_
std::atomic< LorentzVector * > p4c_
Definition: PackedCandidate.h:1049
pat::PackedCandidate::EXPO_TIME_WITHERROR
static constexpr int EXPO_TIME_WITHERROR
Definition: PackedCandidate.h:1126
pat::PackedCandidate::PackedCovariance::dphidphi
uint16_t dphidphi
Definition: PackedCandidate.h:959
edm::errors::UnimplementedFeature
Definition: EDMException.h:38
MiniFloatConverter::float32to16
static uint16_t float32to16(float x)
Definition: libminifloat.h:20
StripSubdetector::TID
static constexpr auto TID
Definition: StripSubdetector.h:17
edm::Ref< VertexCollection >::invalidKey
static key_type invalidKey()
Definition: Ref.h:168
pat::PackedCandidate::eta
double eta() const override
momentum pseudorapidity
Definition: PackedCandidate.h:563
pat::PackedCandidate::MIN_TIMEERROR
static constexpr float MIN_TIMEERROR
Definition: PackedCandidate.h:1121
reco::TrackBase::highPurity
Definition: TrackBase.h:154
pat::PackedCandidate::trackStripHitsMask
Definition: PackedCandidate.h:620