CMS 3D CMS Logo

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

#include <PackedCandidate.h>

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

Classes

struct  PackedCovariance
 Flag isolation (as in particle flow, i.e. at calorimeter surface rather than at PV) flag for charged hadrons. More...
 

Public Types

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

Public Member Functions

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

Static Public Attributes

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

Protected Types

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

Protected Member Functions

const CovarianceParameterizationcovarianceParameterization () const
 
void maybeUnpackBoth () const
 
void maybeUnpackCovariance () const
 
void maybeUnpackTrack () const
 
virtual bool overlap (const reco::Candidate &) const
 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
 

Protected Attributes

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

Static Protected Attributes

static std::once_flag covariance_load_flag
 
static CovarianceParameterization covarianceParameterization_
 
static float kMinDEtaToStore_ =0.001
 
static float kMinDTrkPtToStore_ =0.001
 

Private Member Functions

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

Friends

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

Detailed Description

Definition at line 22 of file PackedCandidate.h.

Member Typedef Documentation

collection of daughter candidates

Definition at line 25 of file PackedCandidate.h.

typedef unsigned int pat::PackedCandidate::index

Definition at line 35 of file PackedCandidate.h.

Lorentz vector.

Definition at line 27 of file PackedCandidate.h.

point in the space

Definition at line 31 of file PackedCandidate.h.

Lorentz vector.

Definition at line 29 of file PackedCandidate.h.

point in the space

Definition at line 33 of file PackedCandidate.h.

Member Enumeration Documentation

Enumerator specifying the.

Enumerator
validHitInFirstPixelBarrelLayer 
noLostInnerHits 
oneLostInnerHit 
moreLostInnerHits 

Definition at line 512 of file PackedCandidate.h.

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

Enumerator
NoPV 
PVLoose 
PVTight 
PVUsedInFit 

Definition at line 455 of file PackedCandidate.h.

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

Enumerator
NotReconstructedPrimary 
OtherDeltaZ 
CompatibilityBTag 
CompatibilityDz 
UsedInFitLoose 
UsedInFitTight 

Definition at line 467 of file PackedCandidate.h.

set impact parameters covariance

Enumerator
trackPixelHitsMask 
trackStripHitsMask 
trackStripHitsShift 

Definition at line 397 of file PackedCandidate.h.

Constructor & Destructor Documentation

pat::PackedCandidate::PackedCandidate ( )
inline

default constructor

Definition at line 38 of file PackedCandidate.h.

Referenced by clone().

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

Definition at line 53 of file PackedCandidate.h.

References packBoth().

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

Definition at line 67 of file PackedCandidate.h.

References packBoth().

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

Definition at line 84 of file PackedCandidate.h.

References packBoth().

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

Definition at line 101 of file PackedCandidate.h.

101  :
102  packedPt_(iOther.packedPt_), packedEta_(iOther.packedEta_),
103  packedPhi_(iOther.packedPhi_), packedM_(iOther.packedM_),
104  packedDxy_(iOther.packedDxy_), packedDz_(iOther.packedDz_),
105  packedDPhi_(iOther.packedDPhi_),packedDEta_(iOther.packedDEta_),packedDTrkPt_(iOther.packedDTrkPt_),
106  packedCovariance_(iOther.packedCovariance_),
107  packedPuppiweight_(iOther.packedPuppiweight_),
108  packedPuppiweightNoLepDiff_(iOther.packedPuppiweightNoLepDiff_),
109  rawCaloFraction_(iOther.rawCaloFraction_),
110  hcalFraction_(iOther.hcalFraction_),
111  isIsolatedChargedHadron_(iOther.isIsolatedChargedHadron_),
112  //Need to trigger unpacking in iOther
113  p4_( new PolarLorentzVector(iOther.polarP4() ) ),
114  p4c_( new LorentzVector(iOther.p4())), vertex_( new Point(iOther.vertex())),
115  dxy_(iOther.dxy_), dz_(iOther.dz_),
116  dphi_(iOther.dphi_), deta_(iOther.deta_), dtrkpt_(iOther.dtrkpt_),
117  track_( iOther.track_ ? new reco::Track(*iOther.track_) : nullptr),
118  pdgId_(iOther.pdgId_), qualityFlags_(iOther.qualityFlags_),
119  pvRefProd_(iOther.pvRefProd_),pvRefKey_(iOther.pvRefKey_),
120  m_(iOther.m_? new reco::TrackBase::CovarianceMatrix(*iOther.m_) : nullptr),
121  packedHits_(iOther.packedHits_),packedLayers_(iOther.packedLayers_), normalizedChi2_(iOther.normalizedChi2_),
122  covarianceVersion_(iOther.covarianceVersion_), covarianceSchema_(iOther.covarianceSchema_) {
123  }
std::atomic< Point * > vertex_
vertex position
reco::VertexRef::key_type pvRefKey_
math::XYZPoint Point
point in the space
PackedCovariance packedCovariance_
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
std::atomic< reco::Track * > track_
reco::Track
math::XYZTLorentzVector LorentzVector
Lorentz vector.
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< LorentzVector * > p4c_
std::atomic< reco::TrackBase::CovarianceMatrix * > m_
IP covariance.
uint8_t normalizedChi2_
track quality information
int pdgId_
PDG identifier.
math::Error< dimension >::type CovarianceMatrix
5 parameter covariance matrix
Definition: TrackBase.h:77
reco::VertexRefProd pvRefProd_
Use these to build a Ref to primary vertex.
pat::PackedCandidate::PackedCandidate ( PackedCandidate &&  iOther)
inline

Definition at line 125 of file PackedCandidate.h.

125  :
126  packedPt_(iOther.packedPt_), packedEta_(iOther.packedEta_),
127  packedPhi_(iOther.packedPhi_), packedM_(iOther.packedM_),
128  packedDxy_(iOther.packedDxy_), packedDz_(iOther.packedDz_),
129  packedDPhi_(iOther.packedDPhi_), packedDEta_(iOther.packedDEta_), packedDTrkPt_(iOther.packedDTrkPt_),
130  packedCovariance_(iOther.packedCovariance_),
131  packedPuppiweight_(iOther.packedPuppiweight_),
132  packedPuppiweightNoLepDiff_(iOther.packedPuppiweightNoLepDiff_),
133  rawCaloFraction_(iOther.rawCaloFraction_),
134  hcalFraction_(iOther.hcalFraction_),
135  isIsolatedChargedHadron_(iOther.isIsolatedChargedHadron_),
136  p4_( iOther.p4_.exchange(nullptr) ) ,
137  p4c_( iOther.p4c_.exchange(nullptr)), vertex_(iOther.vertex_.exchange(nullptr)),
138  dxy_(iOther.dxy_), dz_(iOther.dz_),
139  dphi_(iOther.dphi_), deta_(iOther.deta_), dtrkpt_(iOther.dtrkpt_),
140  track_( iOther.track_.exchange(nullptr) ),
141  pdgId_(iOther.pdgId_), qualityFlags_(iOther.qualityFlags_),
142  pvRefProd_(std::move(iOther.pvRefProd_)),pvRefKey_(iOther.pvRefKey_),
143  m_( iOther.m_.exchange(nullptr)),
144  packedHits_(iOther.packedHits_), packedLayers_(iOther.packedLayers_),normalizedChi2_(iOther.normalizedChi2_),
145  covarianceVersion_(iOther.covarianceVersion_), covarianceSchema_(iOther.covarianceSchema_) {
146  }
std::atomic< Point * > vertex_
vertex position
reco::VertexRef::key_type pvRefKey_
PackedCovariance packedCovariance_
std::atomic< reco::Track * > track_
reco::Track
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< LorentzVector * > p4c_
std::atomic< reco::TrackBase::CovarianceMatrix * > m_
IP covariance.
uint8_t normalizedChi2_
track quality information
int pdgId_
PDG identifier.
def move(src, dest)
Definition: eostools.py:510
reco::VertexRefProd pvRefProd_
Use these to build a Ref to primary vertex.
pat::PackedCandidate::~PackedCandidate ( )
virtual

destructor

Definition at line 136 of file PackedCandidate.cc.

Referenced by operator=().

136  {
137  delete p4_.load();
138  delete p4c_.load();
139  delete vertex_.load();
140  delete track_.load();
141  delete m_.load();
142 }
std::atomic< Point * > vertex_
vertex position
std::atomic< reco::Track * > track_
reco::Track
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< LorentzVector * > p4c_
std::atomic< reco::TrackBase::CovarianceMatrix * > m_
IP covariance.

Member Function Documentation

virtual const reco::Track* pat::PackedCandidate::bestTrack ( ) const
inlinevirtual

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

Reimplemented from reco::Candidate.

Definition at line 494 of file PackedCandidate.h.

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

Referenced by Muon.Muon::ptErr().

494  {
495  if (packedHits_!=0 || packedLayers_ !=0) {
497  return track_.load();
498  }
499  else
500  return nullptr;
501  }
std::atomic< reco::Track * > track_
reco::Track
void maybeUnpackTrack() const
virtual Vector pat::PackedCandidate::boostToCM ( ) const
inlinevirtual

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

Implements reco::Candidate.

Definition at line 314 of file PackedCandidate.h.

References p4c_, and unpack().

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

electric charge

Implements reco::Candidate.

Definition at line 290 of file PackedCandidate.h.

References funct::abs(), and pdgId_.

Referenced by pat::PATPackedCandidateProducer::candsOrdering(), pat::PATTrackAndVertexUnpacker::produce(), and threeCharge().

290  {
291  switch (abs(pdgId_)) {
292  case 211: return (pdgId_>0)-(pdgId_<0);
293  case 11: return (-1)*(pdgId_>0)+(pdgId_<0); //e
294  case 13: return (-1)*(pdgId_>0)+(pdgId_<0); //mu
295  case 15: return (-1)*(pdgId_>0)+(pdgId_<0); //tau
296  case 24: return (pdgId_>0)-(pdgId_<0); //W
297  default: return 0; //FIXME: charge is not defined
298  }
299  }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int pdgId_
PDG identifier.
virtual PackedCandidate* pat::PackedCandidate::clone ( void  ) const
inlinevirtual

returns a clone of the Candidate object

Implements reco::Candidate.

Definition at line 554 of file PackedCandidate.h.

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

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

Definition at line 696 of file PackedCandidate.h.

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

Referenced by packCovarianceElement(), and unpackCovarianceElement().

696  {
699  {
701  << "Attempting to load multiple covariance version in same process. This is not supported.";
702  }
704  }
static CovarianceParameterization covarianceParameterization_
static std::once_flag covariance_load_flag
int pat::PackedCandidate::covarianceSchema ( ) const
inline

Definition at line 440 of file PackedCandidate.h.

References covarianceSchema_.

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

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

Definition at line 439 of file PackedCandidate.h.

References covarianceVersion_.

Referenced by setTrackProperties().

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

return daughter at a given position (throws an exception)

Implements reco::Candidate.

Definition at line 274 of file PackedCandidate.cc.

Referenced by operator=().

274  {
275  return 0;
276 }
reco::Candidate * pat::PackedCandidate::daughter ( size_type  )
virtual

return daughter at a given position (throws an exception)

Implements reco::Candidate.

Definition at line 296 of file PackedCandidate.cc.

296  {
297  return 0;
298 }
reco::Candidate * pat::PackedCandidate::daughter ( const std::string &  s)
virtual

return daughter with a specified role name

Implements reco::Candidate.

Definition at line 288 of file PackedCandidate.cc.

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

288  {
290  << "This Candidate type does not implement daughter(std::string). "
291  << "Please use CompositeCandidate or NamedCompositeCandidate.\n";
292 }
const reco::Candidate * pat::PackedCandidate::daughter ( const std::string &  s) const
virtual

return daughter with a specified role name

Implements reco::Candidate.

Definition at line 282 of file PackedCandidate.cc.

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

282  {
284  << "This Candidate type does not implement daughter(std::string). "
285  << "Please use CompositeCandidate or NamedCompositeCandidate.\n";
286 }
virtual float pat::PackedCandidate::dxy ( ) const
inlinevirtual

dxy with respect to the PV ref

Definition at line 474 of file PackedCandidate.h.

References dxy_, and maybeUnpackBoth().

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

474 { maybeUnpackBoth(); return dxy_; }
void maybeUnpackBoth() const
float pat::PackedCandidate::dxy ( const Point p) const
virtual

dxy with respect to another point

Definition at line 145 of file PackedCandidate.cc.

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

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

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

uncertainty on dxy

Reimplemented from reco::Candidate.

Definition at line 487 of file PackedCandidate.h.

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

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

dz with respect to the PV[ipv]

Definition at line 476 of file PackedCandidate.h.

References dz_, maybeUnpackBoth(), and pvRefKey_.

Referenced by reco::PFMETProducerMVA::chargedFracInCone(), PileupJetIdAlgo::computeIdVariables(), reco::PFMETProducerMVA::computePFCandidateInfo(), Electron.Electron::cutBasedId(), dzAssociatedPV(), ntupleDataFormat.Track::dzPull(), fromPV(), and PuppiProducer::produce().

476 { maybeUnpackBoth(); return dz_ + (*pvRefProd_)[pvRefKey_].position().z()-(*pvRefProd_)[ipv].position().z(); }
reco::VertexRef::key_type pvRefKey_
void maybeUnpackBoth() const
float pat::PackedCandidate::dz ( const Point p) const
virtual

dz with respect to another point

Definition at line 150 of file PackedCandidate.cc.

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

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

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

dz with respect to the PV ref

Definition at line 478 of file PackedCandidate.h.

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

Referenced by fromPV().

478 { maybeUnpackBoth(); return dz_; }
void maybeUnpackBoth() const
virtual float pat::PackedCandidate::dzError ( ) const
inlinevirtual

uncertainty on dz

Reimplemented from reco::Candidate.

Definition at line 485 of file PackedCandidate.h.

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

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

energy

Implements reco::Candidate.

Definition at line 318 of file PackedCandidate.h.

References p4c_, and unpack().

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

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

transverse energy

Implements reco::Candidate.

Definition at line 320 of file PackedCandidate.h.

References p4c_, and pt().

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

transverse energy squared (use this for cuts)!

Implements reco::Candidate.

Definition at line 322 of file PackedCandidate.h.

References p4c_, and pt().

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

momentum pseudorapidity

Implements reco::Candidate.

Definition at line 365 of file PackedCandidate.h.

References p4_, p4c_, and unpack().

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

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

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

Definition at line 357 of file PackedCandidate.h.

References deta_, maybeUnpackBoth(), and p4_.

357  {
358  maybeUnpackBoth();
359  return p4_.load()->eta() + deta_;
360  }
void maybeUnpackBoth() const
std::atomic< PolarLorentzVector * > p4_
the four vector
void pat::PackedCandidate::fillVertexCovariance ( CovarianceMatrix v) const
virtual

fill SMatrix

Implements reco::Candidate.

Definition at line 317 of file PackedCandidate.cc.

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

Referenced by vertexCovariance().

317  {
319  << "reco::ConcreteCandidate does not implement vertex covariant matrix.\n";
320 }
const PVAssoc pat::PackedCandidate::fromPV ( size_t  ipv = 0) const
inline

Definition at line 456 of file PackedCandidate.h.

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

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

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

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

Referenced by vertexCovariance().

246  {
247  return false;
248 }
bool pat::PackedCandidate::hasMasterClonePtr ( ) const
virtual

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

Referenced by vertexCovariance().

250  {
251  return false;
252 }
bool pat::PackedCandidate::hasTrackDetails ( )
inline

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

Definition at line 503 of file PackedCandidate.h.

References packedHits_, and packedLayers_.

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

503 {return (packedHits_!=0 || packedLayers_ !=0); }
float pat::PackedCandidate::hcalFraction ( ) const
inline

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

Definition at line 612 of file PackedCandidate.h.

References hcalFraction_, and setIsIsolatedChargedHadron().

612 { return (hcalFraction_/100.); }
virtual bool pat::PackedCandidate::isCaloMuon ( ) const
inlinevirtual

Implements reco::Candidate.

Definition at line 598 of file PackedCandidate.h.

598 { return false; }
virtual bool pat::PackedCandidate::isConvertedPhoton ( ) const
inlinevirtual

Implements reco::Candidate.

Definition at line 600 of file PackedCandidate.h.

600 { return false; }
virtual bool pat::PackedCandidate::isElectron ( ) const
inlinevirtual

Implements reco::Candidate.

Definition at line 593 of file PackedCandidate.h.

593 { return false; }
virtual bool pat::PackedCandidate::isGlobalMuon ( ) const
inlinevirtual
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 616 of file PackedCandidate.h.

References isIsolatedChargedHadron_.

616 { return isIsolatedChargedHadron_; }
virtual bool pat::PackedCandidate::isJet ( ) const
inlinevirtual

Implements reco::Candidate.

Definition at line 601 of file PackedCandidate.h.

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

601 { return false; }
virtual bool pat::PackedCandidate::isMuon ( ) const
inlinevirtual

Implements reco::Candidate.

Definition at line 594 of file PackedCandidate.h.

594 { return false; }
virtual bool pat::PackedCandidate::isPhoton ( ) const
inlinevirtual

Implements reco::Candidate.

Definition at line 599 of file PackedCandidate.h.

599 { return false; }
virtual bool pat::PackedCandidate::isStandAloneMuon ( ) const
inlinevirtual
virtual bool pat::PackedCandidate::isTrackerMuon ( ) const
inlinevirtual

Implements reco::Candidate.

Definition at line 597 of file PackedCandidate.h.

597 { return false; }
bool pat::PackedCandidate::longLived ( ) const
virtual

is long lived?

Implements reco::Candidate.

Definition at line 323 of file PackedCandidate.cc.

Referenced by setLongLived().

323 {return false;}
LostInnerHits pat::PackedCandidate::lostInnerHits ( ) const
inline
virtual double pat::PackedCandidate::mass ( ) const
inlinevirtual

mass

Implements reco::Candidate.

Definition at line 324 of file PackedCandidate.h.

References p4_, p4c_, and unpack().

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

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

do mass constraint?

Implements reco::Candidate.

Definition at line 325 of file PackedCandidate.cc.

Referenced by setMassConstraint().

325 {return false;}
virtual double pat::PackedCandidate::massSqr ( ) const
inlinevirtual

mass squared

Implements reco::Candidate.

Definition at line 326 of file PackedCandidate.h.

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

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

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

Implements reco::Candidate.

Definition at line 240 of file PackedCandidate.cc.

References Exception.

Referenced by masterRef(), and vertexCovariance().

240  {
241  throw cms::Exception("Invalid Reference")
242  << "this Candidate has no master clone reference."
243  << "Can't call masterClone() method.\n";
244 }
const reco::CandidatePtr & pat::PackedCandidate::masterClonePtr ( ) const
virtual

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

Implements reco::Candidate.

Definition at line 255 of file PackedCandidate.cc.

References Exception.

Referenced by vertexCovariance().

255  {
256  throw cms::Exception("Invalid Reference")
257  << "this Candidate has no master clone ptr."
258  << "Can't call masterClonePtr() method.\n";
259 }
template<typename Ref >
Ref pat::PackedCandidate::masterRef ( ) const
inline

cast master clone reference to a concrete type

Definition at line 591 of file PackedCandidate.h.

References masterClone().

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

Definition at line 657 of file PackedCandidate.h.

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

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

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

Definition at line 659 of file PackedCandidate.h.

References m_, and unpackCovariance().

Referenced by dxyError(), and dzError().

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

Definition at line 658 of file PackedCandidate.h.

References track_, and unpackTrk().

Referenced by bestTrack().

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

spatial momentum vector

Implements reco::Candidate.

Definition at line 311 of file PackedCandidate.h.

References p4c_, and unpack().

311 { if (!p4c_) unpack(); return p4c_.load()->Vect(); }
std::atomic< LorentzVector * > p4c_
const reco::Candidate * pat::PackedCandidate::mother ( size_type  ) const
virtual

return mother at a given position (throws an exception)

Implements reco::Candidate.

Definition at line 278 of file PackedCandidate.cc.

Referenced by operator=().

278  {
279  return 0;
280 }
virtual double pat::PackedCandidate::mt ( ) const
inlinevirtual

transverse mass

Implements reco::Candidate.

Definition at line 329 of file PackedCandidate.h.

References p4_, p4c_, and unpack().

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

transverse mass squared

Implements reco::Candidate.

Definition at line 331 of file PackedCandidate.h.

References p4_, p4c_, and unpack().

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

number of daughters

Implements reco::Candidate.

Definition at line 261 of file PackedCandidate.cc.

Referenced by operator=().

261  {
262  return 0;
263 }
int pat::PackedCandidate::numberOfHits ( ) const
inline
size_t pat::PackedCandidate::numberOfMothers ( ) const
virtual

number of mothers

Implements reco::Candidate.

Definition at line 265 of file PackedCandidate.cc.

Referenced by operator=().

265  {
266  return 0;
267 }
int pat::PackedCandidate::numberOfPixelHits ( ) const
inline
virtual size_t pat::PackedCandidate::numberOfSourceCandidatePtrs ( ) const
inlinevirtual

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

Implements reco::Candidate.

Definition at line 282 of file PackedCandidate.h.

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

Definition at line 149 of file PackedCandidate.h.

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

149  {
150  if(this == &iOther) {
151  return *this;
152  }
153  packedPt_ =iOther.packedPt_;
154  packedEta_=iOther.packedEta_;
155  packedPhi_=iOther.packedPhi_;
156  packedM_=iOther.packedM_;
157  packedDxy_=iOther.packedDxy_;
158  packedDz_=iOther.packedDz_;
159  packedDPhi_=iOther.packedDPhi_;
160  packedDEta_=iOther.packedDEta_;
161  packedDTrkPt_=iOther.packedDTrkPt_;
162  packedCovariance_=iOther.packedCovariance_;
163  packedPuppiweight_=iOther.packedPuppiweight_;
164  packedPuppiweightNoLepDiff_=iOther.packedPuppiweightNoLepDiff_;
165  rawCaloFraction_=iOther.rawCaloFraction_;
166  hcalFraction_=iOther.hcalFraction_;
167  isIsolatedChargedHadron_=iOther.isIsolatedChargedHadron_;
168  //Need to trigger unpacking in iOther
169  if(p4_) {
170  *p4_ = iOther.polarP4();
171  } else {
172  p4_.store( new PolarLorentzVector(iOther.polarP4() ) ) ;
173  }
174  if(p4c_) {
175  *p4c_ = iOther.p4();
176  } else {
177  p4c_.store( new LorentzVector(iOther.p4()));
178  }
179  if(vertex_) {
180  *vertex_ = iOther.vertex();
181  } else {
182  vertex_.store( new Point(iOther.vertex()));
183  }
184  dxy_=iOther.dxy_;
185  dz_ = iOther.dz_;
186  dphi_=iOther.dphi_;
187  deta_=iOther.deta_;
188  dtrkpt_=iOther.dtrkpt_;
189 
190  if(!iOther.track_) {
191  delete track_.exchange(nullptr);
192  } else {
193  if(!track_) {
194  track_.store( new reco::Track(*iOther.track_));
195  } else {
196  *track_ = *(iOther.track_);
197  }
198  }
199 
200  pdgId_=iOther.pdgId_;
201  qualityFlags_=iOther.qualityFlags_;
202  pvRefProd_=iOther.pvRefProd_;
203  pvRefKey_=iOther.pvRefKey_;
204  if(!iOther.m_) {
205  delete m_.exchange(nullptr);
206  } else {
207  if(!m_) {
208  m_.store( new reco::Track::CovarianceMatrix(*iOther.m_));
209  } else {
210  *m_ = *(iOther.m_);
211  }
212  }
213 
214 
215  packedHits_=iOther.packedHits_;
216  packedLayers_=iOther.packedLayers_;
217  normalizedChi2_=iOther.normalizedChi2_;
218  covarianceVersion_=iOther.covarianceVersion_;
219  covarianceSchema_=iOther.covarianceSchema_;
220  return *this;
221  }
std::atomic< Point * > vertex_
vertex position
reco::VertexRef::key_type pvRefKey_
math::XYZPoint Point
point in the space
PackedCovariance packedCovariance_
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
std::atomic< reco::Track * > track_
reco::Track
math::XYZTLorentzVector LorentzVector
Lorentz vector.
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< LorentzVector * > p4c_
std::atomic< reco::TrackBase::CovarianceMatrix * > m_
IP covariance.
uint8_t normalizedChi2_
track quality information
int pdgId_
PDG identifier.
math::Error< dimension >::type CovarianceMatrix
5 parameter covariance matrix
Definition: TrackBase.h:77
reco::VertexRefProd pvRefProd_
Use these to build a Ref to primary vertex.
PackedCandidate& pat::PackedCandidate::operator= ( PackedCandidate &&  iOther)
inline

Definition at line 223 of file PackedCandidate.h.

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

223  {
224  if(this == &iOther) {
225  return *this;
226  }
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  hcalFraction_=iOther.hcalFraction_;
241  isIsolatedChargedHadron_=iOther.isIsolatedChargedHadron_;
242  delete p4_.exchange(iOther.p4_.exchange(nullptr));
243  delete p4c_.exchange(iOther.p4c_.exchange(nullptr));
244  delete vertex_.exchange(iOther.vertex_.exchange(nullptr));
245  dxy_=iOther.dxy_;
246  dz_ = iOther.dz_;
247  dphi_=iOther.dphi_;
248  deta_=iOther.deta_;
249  dtrkpt_=iOther.dtrkpt_;
250  delete track_.exchange(iOther.track_.exchange( nullptr));
251  pdgId_=iOther.pdgId_;
252  qualityFlags_=iOther.qualityFlags_;
253  pvRefProd_=iOther.pvRefProd_;
254  pvRefKey_=iOther.pvRefKey_;
255  delete m_.exchange(iOther.m_.exchange(nullptr));
256  packedHits_=iOther.packedHits_;
257  packedLayers_=iOther.packedLayers_;
258  normalizedChi2_=iOther.normalizedChi2_;
259  covarianceVersion_=iOther.covarianceVersion_;
260  covarianceSchema_=iOther.covarianceSchema_;
261  return *this;
262  }
std::atomic< Point * > vertex_
vertex position
reco::VertexRef::key_type pvRefKey_
PackedCovariance packedCovariance_
std::atomic< reco::Track * > track_
reco::Track
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< LorentzVector * > p4c_
std::atomic< reco::TrackBase::CovarianceMatrix * > m_
IP covariance.
uint8_t normalizedChi2_
track quality information
int pdgId_
PDG identifier.
reco::VertexRefProd pvRefProd_
Use these to build a Ref to primary vertex.
bool pat::PackedCandidate::overlap ( const reco::Candidate o) const
protectedvirtual

check overlap with another Candidate

Implements reco::Candidate.

Definition at line 269 of file PackedCandidate.cc.

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

Referenced by covarianceParameterization().

269  {
270  return p4() == o.p4() && vertex() == o.vertex() && charge() == o.charge();
271 // return p4() == o.p4() && charge() == o.charge();
272 }
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
virtual int charge() const
electric charge
virtual const Point & vertex() const
vertex position
virtual int charge() const =0
electric charge
virtual const LorentzVector & p4() const
four-momentum Lorentz vecto r
virtual const Point & vertex() const =0
vertex position
virtual double pat::PackedCandidate::p ( ) const
inlinevirtual

magnitude of momentum vector

Implements reco::Candidate.

Definition at line 316 of file PackedCandidate.h.

References p4c_, and unpack().

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

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

four-momentum Lorentz vecto r

Implements reco::Candidate.

Definition at line 307 of file PackedCandidate.h.

References p4c_, and unpack().

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

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

Definition at line 13 of file PackedCandidate.cc.

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

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

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

Definition at line 660 of file PackedCandidate.h.

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

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

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

Definition at line 71 of file PackedCandidate.cc.

Referenced by setTrackProperties().

71  {
80  //unpack afterwards
81  if(unpackAfterwards) unpackCovariance();
82 }
uint16_t packCovarianceElement(const reco::TrackBase::CovarianceMatrix &m, int i, int j) const
PackedCovariance packedCovariance_
void unpackCovariance() const
uint16_t pat::PackedCandidate::packCovarianceElement ( const reco::TrackBase::CovarianceMatrix m,
int  i,
int  j 
) const
inlineprivate

Definition at line 637 of file PackedCandidate.h.

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

637  {
639  }
int numberOfHits() const
virtual double pt() const
transverse momentum
virtual double eta() const
momentum pseudorapidity
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
int numberOfPixelHits() const
const CovarianceParameterization & covarianceParameterization() const
void pat::PackedCandidate::packVtx ( bool  unpackAfterwards = true)
protected

Definition at line 25 of file PackedCandidate.cc.

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

Referenced by packBoth(), and setVertex().

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

momentum azimuthal angle

Implements reco::Candidate.

Definition at line 341 of file PackedCandidate.h.

References p4_, p4c_, and unpack().

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

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

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

Definition at line 349 of file PackedCandidate.h.

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

349  {
350  maybeUnpackBoth();
351  float ret = p4_.load()->Phi() + dphi_;
352  while (ret > float(M_PI)) ret -= 2*float(M_PI);
353  while (ret < -float(M_PI)) ret += 2*float(M_PI);
354  return ret;
355  }
void maybeUnpackBoth() const
std::atomic< PolarLorentzVector * > p4_
the four vector
#define M_PI
int pat::PackedCandidate::pixelLayersWithMeasurement ( ) const
inline
virtual const PolarLorentzVector& pat::PackedCandidate::polarP4 ( ) const
inlinevirtual

four-momentum Lorentz vector

Implements reco::Candidate.

Definition at line 309 of file PackedCandidate.h.

References p4_, p4c_, and unpack().

Referenced by operator=().

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

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

Definition at line 491 of file PackedCandidate.h.

References track_, and unpackTrk().

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

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

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

Definition at line 344 of file PackedCandidate.h.

References dtrkpt_, maybeUnpackBoth(), and p4_.

344  {
345  maybeUnpackBoth();
346  return p4_.load()->pt() + dtrkpt_;
347  }
void maybeUnpackBoth() const
std::atomic< PolarLorentzVector * > p4_
the four vector
float pat::PackedCandidate::puppiWeight ( ) const

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

Definition at line 334 of file PackedCandidate.cc.

References logintpack::unpack8logClosed().

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

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

Weight from full PUPPI.

Definition at line 336 of file PackedCandidate.cc.

References logintpack::unpack8logClosed().

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

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

x coordinate of momentum vector

Implements reco::Candidate.

Definition at line 333 of file PackedCandidate.h.

References p4c_, and unpack().

Referenced by PuppiProducer::produce().

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

y coordinate of momentum vector

Implements reco::Candidate.

Definition at line 335 of file PackedCandidate.h.

References p4c_, and unpack().

Referenced by PuppiProducer::produce().

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

z coordinate of momentum vector

Implements reco::Candidate.

Definition at line 337 of file PackedCandidate.h.

References p4c_, and unpack().

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

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

rapidity

Implements reco::Candidate.

Definition at line 367 of file PackedCandidate.h.

References p4_, p4c_, and unpack().

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

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

Definition at line 610 of file PackedCandidate.h.

References rawCaloFraction_, and setHcalFraction().

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

set electric charge

Implements reco::Candidate.

Definition at line 301 of file PackedCandidate.h.

301 {}
virtual void pat::PackedCandidate::setCovarianceVersion ( int  v)
inlinevirtual
void pat::PackedCandidate::setHcalFraction ( float  p)

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

Definition at line 345 of file PackedCandidate.cc.

References AlCaHLTBitMon_ParallelJobs::p.

Referenced by rawCaloFraction().

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

Definition at line 403 of file PackedCandidate.h.

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

Referenced by setTrackProperties().

403  {
404  // first we count the number of layers with hits
405  int numberOfPixelLayers_ = tk.hitPattern().pixelLayersWithMeasurement();
406  if (numberOfPixelLayers_ > trackPixelHitsMask) numberOfPixelLayers_ = trackPixelHitsMask;
407  int numberOfStripLayers_ = tk.hitPattern().stripLayersWithMeasurement();
408  if (numberOfStripLayers_ > trackStripHitsMask) numberOfStripLayers_ = trackStripHitsMask;
409  packedLayers_ = (numberOfPixelLayers_&trackPixelHitsMask) | (numberOfStripLayers_ << trackStripHitsShift);
410  // now we count number of additional hits, beyond the one-per-layer implied by packedLayers_
411  int numberOfPixelHits_ = tk.hitPattern().numberOfValidPixelHits() - numberOfPixelLayers_;
412  if (numberOfPixelHits_ > trackPixelHitsMask) numberOfPixelHits_ = trackPixelHitsMask;
413  int numberOfStripHits_ = tk.hitPattern().numberOfValidHits() - numberOfPixelHits_ - numberOfPixelLayers_ - numberOfStripLayers_;
414  if (numberOfStripHits_ > trackStripHitsMask) numberOfStripHits_ = trackStripHitsMask;
415 
416  packedHits_ = (numberOfPixelHits_&trackPixelHitsMask) | (numberOfStripHits_ << trackStripHitsShift);
417  }
int numberOfValidHits() const
Definition: HitPattern.h:823
int pixelLayersWithMeasurement() const
Definition: HitPattern.cc:493
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:445
int stripLayersWithMeasurement() const
Definition: HitPattern.h:1035
int numberOfValidPixelHits() const
Definition: HitPattern.h:838
void pat::PackedCandidate::setIsIsolatedChargedHadron ( bool  p)

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

Definition at line 349 of file PackedCandidate.cc.

References AlCaHLTBitMon_ParallelJobs::p.

Referenced by hcalFraction().

349  {
351 }
virtual double p() const
magnitude of momentum vector
virtual void pat::PackedCandidate::setLongLived ( )
inlinevirtual

set long lived flag

Implements reco::Candidate.

Definition at line 543 of file PackedCandidate.h.

References longLived().

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

Definition at line 521 of file PackedCandidate.h.

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

521  {
522  int lost = hits; if (lost > 2) lost = 2; // protection against misuse
523  lost++; // shift so it's 0 .. 3 instead of (-1) .. 2
525  }
virtual void pat::PackedCandidate::setMass ( double  m)
inlinevirtual

set particle mass

Implements reco::Candidate.

Definition at line 383 of file PackedCandidate.h.

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

383  {
384  if (!p4c_) unpack();
385  *p4_ = PolarLorentzVector(p4_.load()->Pt(), p4_.load()->Eta(), p4_.load()->Phi(), m);
386  pack();
387  }
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< LorentzVector * > p4c_
void pack(bool unpackAfterwards=true)
virtual void pat::PackedCandidate::setMassConstraint ( )
inlinevirtual

set mass constraint flag

Implements reco::Candidate.

Definition at line 549 of file PackedCandidate.h.

References massConstraint().

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

Definition at line 527 of file PackedCandidate.h.

References muonFlagsMask, muonFlagsShift, and qualityFlags_.

527  {
528  int16_t muonFlags = isStandAlone | (2*isGlobal);
530  }
virtual void pat::PackedCandidate::setP4 ( const LorentzVector p4)
inlinevirtual

set 4-momentum

Implements reco::Candidate.

Definition at line 371 of file PackedCandidate.h.

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

Referenced by Jet.Jet::setCorrP4().

371  {
372  maybeUnpackBoth(); // changing px,py,pz changes also mapping between dxy,dz and x,y,z
373  *p4_ = PolarLorentzVector(p4.Pt(), p4.Eta(), p4.Phi(), p4.M());
374  packBoth();
375  }
void maybeUnpackBoth() const
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
std::atomic< PolarLorentzVector * > p4_
the four vector
virtual const LorentzVector & p4() const
four-momentum Lorentz vecto r
virtual void pat::PackedCandidate::setP4 ( const PolarLorentzVector p4)
inlinevirtual

set 4-momentum

Definition at line 377 of file PackedCandidate.h.

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

Referenced by Jet.Jet::setCorrP4().

377  {
378  maybeUnpackBoth(); // changing px,py,pz changes also mapping between dxy,dz and x,y,z
379  *p4_ = p4;
380  packBoth();
381  }
void maybeUnpackBoth() const
std::atomic< PolarLorentzVector * > p4_
the four vector
virtual const LorentzVector & p4() const
four-momentum Lorentz vecto r
virtual void pat::PackedCandidate::setPdgId ( int  pdgId)
inlinevirtual

Implements reco::Candidate.

Definition at line 535 of file PackedCandidate.h.

References pdgId(), and pdgId_.

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

Definition at line 328 of file PackedCandidate.cc.

References logintpack::pack8logClosed().

Referenced by isJet().

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

Implements reco::Candidate.

Definition at line 388 of file PackedCandidate.h.

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

388  {
389  maybeUnpackBoth(); // changing px,py,pz changes also mapping between dxy,dz and x,y,z
390  *p4c_ = LorentzVector(p4c_.load()->Px(), p4c_.load()->Py(), pz, p4c_.load()->E());
391  *p4_ = PolarLorentzVector(p4c_.load()->Pt(), p4c_.load()->Eta(), p4c_.load()->Phi(), p4c_.load()->M());
392  packBoth();
393  }
void maybeUnpackBoth() const
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
math::XYZTLorentzVector LorentzVector
Lorentz vector.
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< LorentzVector * > p4c_
virtual double pz() const
z coordinate of momentum vector
void pat::PackedCandidate::setRawCaloFraction ( float  p)

Weight from PUPPI removing leptons.

Definition at line 338 of file PackedCandidate.cc.

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

Referenced by isJet().

338  {
340  rawCaloFraction_ = std::numeric_limits<uint8_t>::max(); // Set to overflow value
341  else
342  rawCaloFraction_ = 100*p;
343 }
virtual double p() const
magnitude of momentum vector
virtual void pat::PackedCandidate::setStatus ( int  status)
inlinevirtual

set status word

Implements reco::Candidate.

Definition at line 539 of file PackedCandidate.h.

539 {} /*FIXME*/
virtual void pat::PackedCandidate::setThreeCharge ( int  threecharge)
inlinevirtual

set electric charge

Implements reco::Candidate.

Definition at line 305 of file PackedCandidate.h.

305 {}
void pat::PackedCandidate::setTrackHighPurity ( bool  highPurity)
inline
virtual void pat::PackedCandidate::setTrackProperties ( const reco::Track tk,
const reco::Track::CovarianceMatrix covariance,
int  quality,
int  covarianceVersion 
)
inlinevirtual

Definition at line 419 of file PackedCandidate.h.

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

Referenced by setTrackProperties().

419  {
423  setHits(tk);
424  packBoth();
425  packCovariance(covariance,false);
426  }
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:556
uint8_t normalizedChi2_
track quality information
int covarianceVersion() const
void packCovariance(const reco::TrackBase::CovarianceMatrix &m, bool unpackAfterwards=true)
virtual void setHits(const reco::Track &tk)
virtual void pat::PackedCandidate::setTrackProperties ( const reco::Track tk,
int  quality,
int  covarianceVersion 
)
inlinevirtual

Definition at line 429 of file PackedCandidate.h.

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

429  {
431  }
CovarianceMatrix covariance() const
return track covariance matrix
Definition: TrackBase.h:726
int covarianceVersion() const
virtual void setTrackProperties(const reco::Track &tk, const reco::Track::CovarianceMatrix &covariance, int quality, int covarianceVersion)
virtual void pat::PackedCandidate::setVertex ( const Point vertex)
inlinevirtual

set vertex

Definition at line 452 of file PackedCandidate.h.

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

std::atomic< Point * > vertex_
vertex position
void maybeUnpackBoth() const
virtual const Point & vertex() const
vertex position
void packVtx(bool unpackAfterwards=true)
virtual reco::CandidatePtr pat::PackedCandidate::sourceCandidatePtr ( size_type  i) const
inlinevirtual

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

Reimplemented from reco::Candidate.

Definition at line 285 of file PackedCandidate.h.

285  {
286  return reco::CandidatePtr();
287  }
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
Definition: CandidateFwd.h:25
virtual int pat::PackedCandidate::status ( ) const
inlinevirtual

status word

Implements reco::Candidate.

Definition at line 537 of file PackedCandidate.h.

References qualityFlags_.

537 { return qualityFlags_; } /*FIXME*/
int pat::PackedCandidate::stripLayersWithMeasurement ( ) const
inline
virtual double pat::PackedCandidate::theta ( ) const
inlinevirtual

momentum polar angle

Implements reco::Candidate.

Definition at line 363 of file PackedCandidate.h.

References p4_, p4c_, and unpack().

Referenced by Tau.Tau::zImpact().

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

electric charge

Implements reco::Candidate.

Definition at line 303 of file PackedCandidate.h.

References charge().

303 {return charge()*3;}
virtual int charge() const
electric charge
int pat::PackedCandidate::trackerLayersWithMeasurement ( ) const
inline

Definition at line 437 of file PackedCandidate.h.

References pixelLayersWithMeasurement(), and stripLayersWithMeasurement().

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

Definition at line 48 of file PackedCandidate.cc.

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

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

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

Definition at line 84 of file PackedCandidate.cc.

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

Referenced by maybeUnpackCovariance().

84  {
86  if(p.isValid())
87  {
88  auto m = std::make_unique<reco::TrackBase::CovarianceMatrix>() ;
89  for(int i=0;i<5;i++)
90  for(int j=0;j<5;j++){
91  (*m)(i,j)=0;
92  }
101  reco::TrackBase::CovarianceMatrix* expected = nullptr;
102  if( m_.compare_exchange_strong(expected,m.get()) ) {
103  m.release();
104  }
105 
106  } else {
108  << "You do not have a valid track parameters file loaded. "
109  << "Please check that the release version is compatible with your input data"
110  <<"or avoid accessing track parameter uncertainties. ";
111  }
112 }
void unpackCovarianceElement(reco::TrackBase::CovarianceMatrix &m, uint16_t packed, int i, int j) const
PackedCovariance packedCovariance_
std::atomic< reco::TrackBase::CovarianceMatrix * > m_
IP covariance.
const CovarianceParameterization & covarianceParameterization() const
math::Error< dimension >::type CovarianceMatrix
5 parameter covariance matrix
Definition: TrackBase.h:77
virtual double p() const
magnitude of momentum vector
void pat::PackedCandidate::unpackCovarianceElement ( reco::TrackBase::CovarianceMatrix m,
uint16_t  packed,
int  i,
int  j 
) const
inlineprivate

Definition at line 634 of file PackedCandidate.h.

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

634  {
636  }
int numberOfHits() const
float unpack(uint16_t packed, int schema, int i, int j, float pt, float eta, int nHits, int pixelHits, float cii=1., float cjj=1.) const
virtual double pt() const
transverse momentum
virtual double eta() const
momentum pseudorapidity
int numberOfPixelHits() const
const CovarianceParameterization & covarianceParameterization() const
void pat::PackedCandidate::unpackTrk ( ) const
protected

Definition at line 156 of file PackedCandidate.cc.

References ALCARECOTkAlJpsiMuMu_cff::charge, reco::TrackBase::highPurity, AnalysisDataFormats_SUSYBSMObjects::hp, mps_fire::i, reco::TrackBase::loose, TrackingRecHit::missing_inner, ndof, p3, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, StripSubdetector::TOB, HiIsolationCommonParameters_cff::track, reco::TrackBase::undefAlgorithm, and TrackingRecHit::valid.

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

156  {
157  maybeUnpackBoth();
160  int numberOfStripLayers = stripLayersWithMeasurement(), numberOfPixelLayers = pixelLayersWithMeasurement();
161  int numberOfPixelHits = this->numberOfPixelHits();
162  int numberOfHits = this->numberOfHits();
163 
164  int ndof = numberOfHits+numberOfPixelHits-5;
165  reco::HitPattern hp, hpExpIn;
166  int i=0;
167  LostInnerHits innerLost = lostInnerHits();
168 
169  auto track = std::make_unique<reco::Track>(normalizedChi2_*ndof,ndof,*vertex_,math::XYZVector(p3.x(),p3.y(),p3.z()),charge(),*(m_.load()),reco::TrackBase::undefAlgorithm,reco::TrackBase::loose);
170 
171  // add hits to match the number of laters and validHitInFirstPixelBarrelLayer
172  if(innerLost == validHitInFirstPixelBarrelLayer){
173  // first we add one hit on the first barrel layer
174  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, 1, 0, TrackingRecHit::valid);
175  // then to encode the number of layers, we add more hits on distinct layers (B2, B3, B4, F1, ...)
176  for(i++; i<numberOfPixelLayers; i++) {
177  if (i <= 3) {
178  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, i+1, 0, TrackingRecHit::valid);
179  } else {
180  track->appendTrackerHitPattern(PixelSubdetector::PixelEndcap, i-3, 0, TrackingRecHit::valid);
181  }
182  }
183  } else {
184  // to encode the information on the layers, we add one valid hits per layer but skipping PXB1
185  for(;i<numberOfPixelLayers; i++) {
186  if (i <= 2 ) {
187  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, i+2, 0, TrackingRecHit::valid);
188  } else {
189  track->appendTrackerHitPattern(PixelSubdetector::PixelEndcap, i-3, 0, TrackingRecHit::valid);
190  }
191  }
192  }
193  // add extra hits (overlaps, etc), all on the first layer with a hit - to avoid increasing the layer count
194  for(;i<numberOfPixelHits; i++) {
195  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, (innerLost == validHitInFirstPixelBarrelLayer ? 1 : 2), 0, TrackingRecHit::valid);
196  }
197  // now start adding strip layers, putting one hit on each layer so that the hitPattern.stripLayersWithMeasurement works.
198  // we don't know what the layers where, so we just start with TIB (4 layers), then TOB (6 layers), then TEC (9)
199  // and then TID(3), so that we can get a number of valid strip layers up to 4+6+9+3
200  for(int sl = 0; sl < numberOfStripLayers; ++sl, ++i) {
201  if (sl < 4) track->appendTrackerHitPattern(StripSubdetector::TIB, sl +1, 1, TrackingRecHit::valid);
202  else if (sl < 4+6) track->appendTrackerHitPattern(StripSubdetector::TOB, (sl- 4)+1, 1, TrackingRecHit::valid);
203  else if (sl < 10+9) track->appendTrackerHitPattern(StripSubdetector::TEC, (sl-10)+1, 1, TrackingRecHit::valid);
204  else if (sl < 19+3) track->appendTrackerHitPattern(StripSubdetector::TID, (sl-13)+1, 1, TrackingRecHit::valid);
205  else break; // wtf?
206  }
207  // finally we account for extra strip hits beyond the one-per-layer added above. we put them all on TIB1,
208  // to avoid incrementing the number of layersWithMeasurement.
209  for(;i<numberOfHits;i++) {
210  track->appendTrackerHitPattern(StripSubdetector::TIB, 1, 1, TrackingRecHit::valid);
211  }
212 
213 
214  switch (innerLost) {
216  break;
217  case noLostInnerHits:
218  break;
219  case oneLostInnerHit:
220  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, 1, 0, TrackingRecHit::missing_inner);
221  break;
222  case moreLostInnerHits:
223  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, 1, 0, TrackingRecHit::missing_inner);
224  track->appendTrackerHitPattern(PixelSubdetector::PixelBarrel, 2, 0, TrackingRecHit::missing_inner);
225  break;
226  };
227 
229 
230  reco::Track* expected = nullptr;
231  if( track_.compare_exchange_strong(expected,track.get()) ) {
232  track.release();
233  }
234 
235 
236 }
virtual float etaAtVtx() const
eta from the track (normally identical to eta())
std::atomic< Point * > vertex_
vertex position
int numberOfHits() const
int pixelLayersWithMeasurement() const
void maybeUnpackBoth() const
RhoEtaPhiVectorD RhoEtaPhiVector
spatial vector with cylindrical internal representation using pseudorapidity
Definition: Vector3D.h:32
std::atomic< reco::Track * > track_
reco::Track
void maybeUnpackCovariance() const
susybsm::HSCParticleRefProd hp
Definition: classes.h:27
bool trackHighPurity() const
true if the track had the highPurity quality bit
LostInnerHits lostInnerHits() const
virtual double ptTrk() const
pt from the track (normally identical to pt())
int stripLayersWithMeasurement() const
virtual int charge() const
electric charge
int numberOfPixelHits() const
std::atomic< reco::TrackBase::CovarianceMatrix * > m_
IP covariance.
LostInnerHits
Enumerator specifying the.
uint8_t normalizedChi2_
track quality information
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
virtual float phiAtVtx() const
momentum azimuthal angle from the track (normally identical to phi())
double p3[4]
Definition: TauolaWrapper.h:91
void pat::PackedCandidate::unpackVtx ( ) const
protected

Definition at line 114 of file PackedCandidate.cc.

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

Referenced by maybeUnpackBoth(), and packBoth().

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

vertex position

Implements reco::Candidate.

Definition at line 444 of file PackedCandidate.h.

References maybeUnpackBoth(), and vertex_.

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

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

chi-squares

Implements reco::Candidate.

Definition at line 300 of file PackedCandidate.cc.

Referenced by clone().

300  {
301  return 0;
302 }
double pat::PackedCandidate::vertexCovariance ( int  i,
int  j 
) const
virtual

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

Implements reco::Candidate.

Definition at line 312 of file PackedCandidate.cc.

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

312  {
314  << "reco::ConcreteCandidate does not implement vertex covariant matrix.\n";
315 }
CovarianceMatrix pat::PackedCandidate::vertexCovariance ( ) const
inlinevirtual

return SMatrix

Reimplemented from reco::Candidate.

Definition at line 572 of file PackedCandidate.h.

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

Referenced by clone().

572 { CovarianceMatrix m; fillVertexCovariance(m); return m; }
virtual void fillVertexCovariance(CovarianceMatrix &v) const
fill SMatrix
double pat::PackedCandidate::vertexNdof ( ) const
virtual

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

Referenced by clone().

304  {
305  return 0;
306 }
double pat::PackedCandidate::vertexNormalizedChi2 ( ) const
virtual

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

Implements reco::Candidate.

Definition at line 308 of file PackedCandidate.cc.

Referenced by clone().

308  {
309  return 0;
310 }
const reco::VertexRef pat::PackedCandidate::vertexRef ( ) const
inline

Definition at line 471 of file PackedCandidate.h.

References pvRefKey_, and pvRefProd_.

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

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

x coordinate of vertex position

Implements reco::Candidate.

Definition at line 446 of file PackedCandidate.h.

References maybeUnpackBoth(), and vertex_.

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

y coordinate of vertex position

Implements reco::Candidate.

Definition at line 448 of file PackedCandidate.h.

References maybeUnpackBoth(), and vertex_.

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

z coordinate of vertex position

Implements reco::Candidate.

Definition at line 450 of file PackedCandidate.h.

References maybeUnpackBoth(), and vertex_.

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

Friends And Related Function Documentation

friend class ::OverlapChecker
friend

Definition at line 709 of file PackedCandidate.h.

friend class ::testPackedCandidate
friend

Definition at line 642 of file PackedCandidate.h.

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

Definition at line 708 of file PackedCandidate.h.

friend class ShallowCloneCandidate
friend

Definition at line 710 of file PackedCandidate.h.

friend class ShallowClonePtrCandidate
friend

Definition at line 711 of file PackedCandidate.h.

Member Data Documentation

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

Definition at line 695 of file PackedCandidate.h.

CovarianceParameterization pat::PackedCandidate::covarianceParameterization_
staticprotected

Definition at line 693 of file PackedCandidate.h.

Referenced by covarianceParameterization().

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

Definition at line 675 of file PackedCandidate.h.

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

float pat::PackedCandidate::dphi_
mutableprotected

Definition at line 675 of file PackedCandidate.h.

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

float pat::PackedCandidate::dtrkpt_
mutableprotected

Definition at line 675 of file PackedCandidate.h.

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

float pat::PackedCandidate::dxy_
mutableprotected

Definition at line 675 of file PackedCandidate.h.

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

float pat::PackedCandidate::dz_
mutableprotected

Definition at line 675 of file PackedCandidate.h.

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

int8_t pat::PackedCandidate::hcalFraction_
protected

Definition at line 666 of file PackedCandidate.h.

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

bool pat::PackedCandidate::isIsolatedChargedHadron_
protected

Definition at line 668 of file PackedCandidate.h.

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

float pat::PackedCandidate::kMinDEtaToStore_ =0.001
staticprotected

Definition at line 643 of file PackedCandidate.h.

float pat::PackedCandidate::kMinDTrkPtToStore_ =0.001
staticprotected

Definition at line 644 of file PackedCandidate.h.

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

long lived flag

Definition at line 541 of file PackedCandidate.h.

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

IP covariance.

Definition at line 686 of file PackedCandidate.h.

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

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

do mass constraint flag

Definition at line 547 of file PackedCandidate.h.

uint8_t pat::PackedCandidate::normalizedChi2_
protected

track quality information

Definition at line 690 of file PackedCandidate.h.

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

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

Definition at line 649 of file PackedCandidate.h.

Referenced by operator=().

uint16_t pat::PackedCandidate::packedDEta_
protected

Definition at line 648 of file PackedCandidate.h.

Referenced by operator=().

uint16_t pat::PackedCandidate::packedDPhi_
protected

Definition at line 648 of file PackedCandidate.h.

Referenced by operator=().

uint16_t pat::PackedCandidate::packedDTrkPt_
protected

Definition at line 648 of file PackedCandidate.h.

Referenced by operator=().

uint16_t pat::PackedCandidate::packedDxy_
protected

Definition at line 648 of file PackedCandidate.h.

Referenced by operator=().

uint16_t pat::PackedCandidate::packedDz_
protected

Definition at line 648 of file PackedCandidate.h.

Referenced by operator=().

uint16_t pat::PackedCandidate::packedEta_
protected

Definition at line 647 of file PackedCandidate.h.

Referenced by operator=().

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

Definition at line 647 of file PackedCandidate.h.

Referenced by operator=().

uint16_t pat::PackedCandidate::packedPhi_
protected

Definition at line 647 of file PackedCandidate.h.

Referenced by operator=().

uint16_t pat::PackedCandidate::packedPt_
protected

Definition at line 647 of file PackedCandidate.h.

Referenced by operator=().

int8_t pat::PackedCandidate::packedPuppiweight_
protected

Definition at line 663 of file PackedCandidate.h.

Referenced by operator=().

int8_t pat::PackedCandidate::packedPuppiweightNoLepDiff_
protected

Definition at line 664 of file PackedCandidate.h.

Referenced by operator=().

int pat::PackedCandidate::pdgId_
protected

PDG identifier.

Definition at line 679 of file PackedCandidate.h.

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

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

Definition at line 683 of file PackedCandidate.h.

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

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

Use these to build a Ref to primary vertex.

Definition at line 682 of file PackedCandidate.h.

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

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

Definition at line 665 of file PackedCandidate.h.

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

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

reco::Track

Definition at line 677 of file PackedCandidate.h.

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

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

vertex position

Definition at line 674 of file PackedCandidate.h.

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