CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Friends
pat::PackedCandidate Class Reference

#include <PackedCandidate.h>

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

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...
 
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 void fillVertexCovariance (CovarianceMatrix &v) const
 fill SMatrix More...
 
const PVAssoc fromPV (size_t ipv=0) const
 
virtual bool hasMasterClone () const
 
virtual bool hasMasterClonePtr () const
 
float hcalFraction () const
 Set the fraction of Ecal and Hcal needed for HF and neutral hadrons. More...
 
virtual bool isCaloMuon () const
 
virtual bool isConvertedPhoton () const
 
virtual bool isElectron () const
 
virtual bool isGlobalMuon () const
 
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::CandidateBaseRef
masterClone () 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 phiAtVtx, int pdgId, const reco::VertexRefProd &pvRefProd, reco::VertexRef::key_type pvRefKey)
 
 PackedCandidate (const LorentzVector &p4, const Point &vtx, 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...
 
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...
 
void setAssociationQuality (PVAssociationQuality q)
 
virtual void setCharge (int charge)
 set electric charge More...
 
void setHcalFraction (float p)
 Weight from PUPPI removing leptons. 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)
 
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)
 
virtual void setTrackProperties (const reco::Track &tk)
 
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

void maybeUnpackBoth () const
 
virtual bool overlap (const reco::Candidate &) const
 check overlap with another Candidate More...
 
void pack (bool unpackAfterwards=true)
 
void packBoth ()
 
void packVtx (bool unpackAfterwards=true)
 
void unpack () const
 
void unpackTrk () const
 
void unpackVtx () const
 

Protected Attributes

float detadeta_
 
float dlambdadz_
 
float dphi_
 
float dphidphi_
 
float dphidxy_
 
float dptdpt_
 
float dxy_
 
float dxydxy_
 IP covariance. More...
 
float dxydz_
 
float dz_
 
float dzdz_
 
int8_t hcalFraction_
 
uint8_t normalizedChi2_
 track quality information More...
 
std::atomic< PolarLorentzVector * > p4_
 the four vector More...
 
std::atomic< LorentzVector * > p4c_
 
int8_t packedCovarianceDetaDeta_
 
int8_t packedCovarianceDlambdaDz_
 
int8_t packedCovarianceDphiDphi_
 
int8_t packedCovarianceDphiDxy_
 
int8_t packedCovarianceDptDpt_
 
uint16_t packedCovarianceDxyDxy_
 
uint16_t packedCovarianceDxyDz_
 
uint16_t packedCovarianceDzDz_
 
uint16_t packedDPhi_
 
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_
 
std::atomic< reco::Track * > track_
 reco::Track More...
 
std::atomic< Point * > vertex_
 vertex position More...
 

Friends

class ::OverlapChecker
 
class ::testPackedCandidate
 Fraction of Ecal and Hcal for HF and neutral hadrons. More...
 
template<typename , typename , typename >
struct component
 
class ShallowCloneCandidate
 
class ShallowClonePtrCandidate
 

Detailed Description

Definition at line 20 of file PackedCandidate.h.

Member Typedef Documentation

collection of daughter candidates

Definition at line 23 of file PackedCandidate.h.

typedef unsigned int pat::PackedCandidate::index

Definition at line 33 of file PackedCandidate.h.

Lorentz vector.

Definition at line 25 of file PackedCandidate.h.

point in the space

Definition at line 29 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.

Member Enumeration Documentation

Enumerator specifying the.

Enumerator
validHitInFirstPixelBarrelLayer 
noLostInnerHits 
oneLostInnerHit 
moreLostInnerHits 

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

set impact parameters covariance

Enumerator
trackPixelHitsMask 
trackStripHitsMask 
trackStripHitsShift 

Definition at line 390 of file PackedCandidate.h.

Constructor & Destructor Documentation

pat::PackedCandidate::PackedCandidate ( )
inline

default constructor

Definition at line 36 of file PackedCandidate.h.

Referenced by clone().

36  :
37  packedPt_(0), packedEta_(0),
38  packedPhi_(0), packedM_(0),
39  packedDxy_(0), packedDz_(0), packedDPhi_(0),
49  hcalFraction_(0),
50  p4_(new PolarLorentzVector(0,0,0,0)), p4c_( new LorentzVector(0,0,0,0)),
51  vertex_(new Point(0,0,0)), dphi_(0), track_(nullptr), pdgId_(0),
53  dxydxy_(0),
54  dzdz_(0),dxydz_(0),dlambdadz_(0), dphidxy_(0),dptdpt_(0),detadeta_(0),
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.
static key_type invalidKey()
Definition: Ref.h:172
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< LorentzVector * > p4c_
uint8_t normalizedChi2_
track quality information
float dxydxy_
IP covariance.
uint16_t packedCovarianceDxyDxy_
int pdgId_
PDG identifier.
pat::PackedCandidate::PackedCandidate ( const reco::Candidate c,
const reco::VertexRefProd pvRefProd,
reco::VertexRef::key_type  pvRefKey 
)
inlineexplicit

Definition at line 57 of file PackedCandidate.h.

References packBoth().

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

Definition at line 70 of file PackedCandidate.h.

References packBoth().

73  :
75  p4_( new PolarLorentzVector(p4) ), p4c_( new LorentzVector(*p4_)),
76  vertex_( new Point(vtx) ), dphi_(reco::deltaPhi(phiAtVtx,p4_.load()->phi())),
77  track_(nullptr), pdgId_(pdgId),
78  qualityFlags_(0), pvRefProd_(pvRefProd), pvRefKey_(pvRefKey),
79  dxydxy_(0),dzdz_(0),dxydz_(0),dlambdadz_(0),dphidxy_(0),dptdpt_(0),
81  packBoth();
82  }
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.
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< LorentzVector * > p4c_
double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:22
uint8_t normalizedChi2_
track quality information
float dxydxy_
IP covariance.
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.
reco::VertexRefProd pvRefProd_
Use these to build a Ref to primary vertex.
pat::PackedCandidate::PackedCandidate ( const LorentzVector p4,
const Point vtx,
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  :
89  p4_(new PolarLorentzVector(p4.Pt(), p4.Eta(), p4.Phi(), p4.M())),
90  p4c_( new LorentzVector(p4)), vertex_( new Point(vtx) ) ,
91  dphi_(reco::deltaPhi(phiAtVtx,p4_.load()->phi())),
92  track_(nullptr), pdgId_(pdgId), qualityFlags_(0),
93  pvRefProd_(pvRefProd), pvRefKey_(pvRefKey),
94  dxydxy_(0),dzdz_(0),dxydz_(0),
97  packBoth();
98  }
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.
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< LorentzVector * > p4c_
double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:22
uint8_t normalizedChi2_
track quality information
float dxydxy_
IP covariance.
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.
reco::VertexRefProd pvRefProd_
Use these to build a Ref to primary vertex.
pat::PackedCandidate::PackedCandidate ( const PackedCandidate iOther)
inline

Definition at line 100 of file PackedCandidate.h.

100  :
101  packedPt_(iOther.packedPt_), packedEta_(iOther.packedEta_),
102  packedPhi_(iOther.packedPhi_), packedM_(iOther.packedM_),
103  packedDxy_(iOther.packedDxy_), packedDz_(iOther.packedDz_), packedDPhi_(iOther.packedDPhi_),
104  packedCovarianceDxyDxy_(iOther.packedCovarianceDxyDxy_),packedCovarianceDxyDz_(iOther.packedCovarianceDxyDz_),
105  packedCovarianceDzDz_(iOther.packedCovarianceDzDz_),
106  packedCovarianceDlambdaDz_(iOther.packedCovarianceDlambdaDz_),
107  packedCovarianceDphiDxy_(iOther.packedCovarianceDphiDxy_),
108  packedCovarianceDptDpt_(iOther.packedCovarianceDptDpt_),
109  packedCovarianceDetaDeta_(iOther.packedCovarianceDetaDeta_),
110  packedCovarianceDphiDphi_(iOther.packedCovarianceDphiDphi_),
111  packedPuppiweight_(iOther.packedPuppiweight_),
112  packedPuppiweightNoLepDiff_(iOther.packedPuppiweightNoLepDiff_),
113  hcalFraction_(iOther.hcalFraction_),
114  //Need to trigger unpacking in iOther
115  p4_( new PolarLorentzVector(iOther.polarP4() ) ),
116  p4c_( new LorentzVector(iOther.p4())), vertex_( new Point(iOther.vertex())),
117  dxy_(iOther.dxy_), dz_(iOther.dz_),dphi_(iOther.dphi_),
118  track_( iOther.track_ ? new reco::Track(*iOther.track_) : nullptr),
119  pdgId_(iOther.pdgId_), qualityFlags_(iOther.qualityFlags_),
120  pvRefProd_(iOther.pvRefProd_),pvRefKey_(iOther.pvRefKey_),
121  dxydxy_(iOther.dxydxy_),dzdz_(iOther.dzdz_),dxydz_(iOther.dxydz_), dlambdadz_(iOther.dlambdadz_),
122  dphidxy_(iOther.dphidxy_),dptdpt_(iOther.dptdpt_), detadeta_(iOther.detadeta_),
123  dphidphi_(iOther.dphidphi_), packedHits_(iOther.packedHits_), packedLayers_(iOther.packedLayers_), normalizedChi2_(iOther.normalizedChi2_) {
124  }
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.
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< LorentzVector * > p4c_
uint8_t normalizedChi2_
track quality information
float dxydxy_
IP covariance.
uint16_t packedCovarianceDxyDxy_
int pdgId_
PDG identifier.
reco::VertexRefProd pvRefProd_
Use these to build a Ref to primary vertex.
pat::PackedCandidate::PackedCandidate ( PackedCandidate &&  iOther)
inline

Definition at line 126 of file PackedCandidate.h.

126  :
127  packedPt_(iOther.packedPt_), packedEta_(iOther.packedEta_),
128  packedPhi_(iOther.packedPhi_), packedM_(iOther.packedM_),
129  packedDxy_(iOther.packedDxy_), packedDz_(iOther.packedDz_), packedDPhi_(iOther.packedDPhi_),
130  packedCovarianceDxyDxy_(iOther.packedCovarianceDxyDxy_),packedCovarianceDxyDz_(iOther.packedCovarianceDxyDz_),
131  packedCovarianceDzDz_(iOther.packedCovarianceDzDz_),
132  packedCovarianceDlambdaDz_(iOther.packedCovarianceDlambdaDz_),
133  packedCovarianceDphiDxy_(iOther.packedCovarianceDphiDxy_),
134  packedCovarianceDptDpt_(iOther.packedCovarianceDptDpt_),
135  packedCovarianceDetaDeta_(iOther.packedCovarianceDetaDeta_),
136  packedCovarianceDphiDphi_(iOther.packedCovarianceDphiDphi_),
137  packedPuppiweight_(iOther.packedPuppiweight_),
138  packedPuppiweightNoLepDiff_(iOther.packedPuppiweightNoLepDiff_),
139  hcalFraction_(iOther.hcalFraction_),
140  p4_( iOther.p4_.exchange(nullptr) ) ,
141  p4c_( iOther.p4c_.exchange(nullptr)), vertex_(iOther.vertex_.exchange(nullptr)),
142  dxy_(iOther.dxy_), dz_(iOther.dz_),dphi_(iOther.dphi_),
143  track_( iOther.track_.exchange(nullptr) ),
144  pdgId_(iOther.pdgId_), qualityFlags_(iOther.qualityFlags_),
145  pvRefProd_(std::move(iOther.pvRefProd_)),pvRefKey_(iOther.pvRefKey_),
146  dxydxy_(iOther.dxydxy_),dzdz_(iOther.dzdz_),dxydz_(iOther.dxydz_), dlambdadz_(iOther.dlambdadz_),
147  dphidxy_(iOther.dphidxy_),dptdpt_(iOther.dptdpt_), detadeta_(iOther.detadeta_),
148  dphidphi_(iOther.dphidphi_), packedHits_(iOther.packedHits_), packedLayers_(iOther.packedLayers_), normalizedChi2_(iOther.normalizedChi2_) {
149  }
std::atomic< Point * > vertex_
vertex position
reco::VertexRef::key_type pvRefKey_
std::atomic< reco::Track * > track_
reco::Track
def move
Definition: eostools.py:510
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< LorentzVector * > p4c_
uint8_t normalizedChi2_
track quality information
float dxydxy_
IP covariance.
uint16_t packedCovarianceDxyDxy_
int pdgId_
PDG identifier.
reco::VertexRefProd pvRefProd_
Use these to build a Ref to primary vertex.
pat::PackedCandidate::~PackedCandidate ( )
virtual

destructor

Definition at line 137 of file PackedCandidate.cc.

137  {
138  delete p4_.load();
139  delete p4c_.load();
140  delete vertex_.load();
141  delete track_.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_

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

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

Referenced by Muon.Muon::ptErr().

482  {
483  if (packedHits_!=0 || packedLayers_ !=0) {
484  if (!track_) unpackTrk();
485  return track_.load();
486  }
487  else
488  return nullptr;
489  }
std::atomic< reco::Track * > track_
reco::Track
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 319 of file PackedCandidate.h.

References p4c_, and unpack().

319 { 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 295 of file PackedCandidate.h.

References funct::abs(), and pdgId_.

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

295  {
296  switch (abs(pdgId_)) {
297  case 211: return (pdgId_>0)-(pdgId_<0);
298  case 11: return (-1)*(pdgId_>0)+(pdgId_<0); //e
299  case 13: return (-1)*(pdgId_>0)+(pdgId_<0); //mu
300  case 15: return (-1)*(pdgId_>0)+(pdgId_<0); //tau
301  case 24: return (pdgId_>0)-(pdgId_<0); //W
302  default: return 0; //FIXME: charge is not defined
303  }
304  }
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 539 of file PackedCandidate.h.

References PackedCandidate().

539  {
540  return new PackedCandidate( *this );
541  }
PackedCandidate()
default constructor
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 286 of file PackedCandidate.cc.

286  {
287  return 0;
288 }
reco::Candidate * pat::PackedCandidate::daughter ( size_type  )
virtual

return daughter at a given position (throws an exception)

Implements reco::Candidate.

Definition at line 308 of file PackedCandidate.cc.

308  {
309  return 0;
310 }
reco::Candidate * pat::PackedCandidate::daughter ( const std::string &  s)
virtual

return daughter with a specified role name

Implements reco::Candidate.

Definition at line 300 of file PackedCandidate.cc.

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

300  {
302  << "This Candidate type does not implement daughter(std::string). "
303  << "Please use CompositeCandidate or NamedCompositeCandidate.\n";
304 }
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 294 of file PackedCandidate.cc.

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

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

dxy with respect to the PV ref

Definition at line 462 of file PackedCandidate.h.

References dxy_, and maybeUnpackBoth().

Referenced by Electron.Electron::cutBasedId(), and PuppiProducer::produce().

462 { 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(), phi(), and funct::sin().

Referenced by Electron.Electron::cutBasedId().

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

References dxydxy_, maybeUnpackBoth(), and mathSSE::sqrt().

475 { maybeUnpackBoth(); return sqrt(dxydxy_); }
void maybeUnpackBoth() const
T sqrt(T t)
Definition: SSEVec.h:18
float dxydxy_
IP covariance.
virtual float pat::PackedCandidate::dz ( size_t  ipv = 0) const
inlinevirtual

dz with respect to the PV[ipv]

Definition at line 464 of file PackedCandidate.h.

References dz_, maybeUnpackBoth(), and pvRefKey_.

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

464 { 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(), phi(), and funct::sin().

Referenced by Electron.Electron::cutBasedId().

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

References dz_, and maybeUnpackBoth().

Referenced by fromPV().

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

uncertainty on dz

Reimplemented from reco::Candidate.

Definition at line 473 of file PackedCandidate.h.

References dzdz_, maybeUnpackBoth(), and mathSSE::sqrt().

473 { maybeUnpackBoth(); return sqrt(dzdz_); }
void maybeUnpackBoth() const
T sqrt(T t)
Definition: SSEVec.h:18
virtual double pat::PackedCandidate::energy ( ) const
inlinevirtual

energy

Implements reco::Candidate.

Definition at line 323 of file PackedCandidate.h.

References p4c_, and unpack().

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

323 { 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 325 of file PackedCandidate.h.

References p4c_, and pt().

325 { 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 327 of file PackedCandidate.h.

References p4c_, and pt().

327 { 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 358 of file PackedCandidate.h.

References p4_, p4c_, and unpack().

Referenced by Particle.Particle::__str__(), pat::PATPackedCandidateProducer::candsOrdering(), METAnalyzer::fillMonitorElement(), Jet.Jet::jetID(), and Jet.Jet::puJetId().

358 { if (!p4c_) unpack(); return p4_.load()->Eta(); }
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< LorentzVector * > p4c_
void pat::PackedCandidate::fillVertexCovariance ( CovarianceMatrix v) const
virtual

fill SMatrix

Implements reco::Candidate.

Definition at line 329 of file PackedCandidate.cc.

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

Referenced by vertexCovariance().

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

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

444  {
445  reco::VertexRef pvRef = vertexRef();
446  if(pvAssociationQuality()==UsedInFitTight and pvRef.key()==ipv) return PVUsedInFit;
447  if(pvRef.key()==ipv or abs(pdgId())==13 or abs(pdgId())==11 ) return PVTight;
448  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
449  if(pvAssociationQuality() < UsedInFitLoose or pvRef->ndof() < 4.0 ) return PVLoose;
450  return NoPV;
451  }
virtual float dz(size_t ipv=0) const
dz with respect to the PV[ipv]
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::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
key_type key() const
Accessor for product key.
Definition: Ref.h:264
const reco::VertexRef vertexRef() const
const PVAssociationQuality pvAssociationQuality() const
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 258 of file PackedCandidate.cc.

258  {
259  return false;
260 }
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 262 of file PackedCandidate.cc.

262  {
263  return false;
264 }
float pat::PackedCandidate::hcalFraction ( ) const
inline

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

Definition at line 595 of file PackedCandidate.h.

References hcalFraction_.

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

Implements reco::Candidate.

Definition at line 583 of file PackedCandidate.h.

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

Implements reco::Candidate.

Definition at line 585 of file PackedCandidate.h.

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

Implements reco::Candidate.

Definition at line 578 of file PackedCandidate.h.

578 { return false; }
virtual bool pat::PackedCandidate::isGlobalMuon ( ) const
inlinevirtual
virtual bool pat::PackedCandidate::isJet ( ) const
inlinevirtual

Implements reco::Candidate.

Definition at line 586 of file PackedCandidate.h.

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

Implements reco::Candidate.

Definition at line 579 of file PackedCandidate.h.

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

Implements reco::Candidate.

Definition at line 584 of file PackedCandidate.h.

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

Implements reco::Candidate.

Definition at line 582 of file PackedCandidate.h.

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

is long lived?

Implements reco::Candidate.

Definition at line 335 of file PackedCandidate.cc.

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

mass

Implements reco::Candidate.

Definition at line 329 of file PackedCandidate.h.

References p4_, p4c_, and unpack().

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

329 { 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 337 of file PackedCandidate.cc.

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

mass squared

Implements reco::Candidate.

Definition at line 331 of file PackedCandidate.h.

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

331 { 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 252 of file PackedCandidate.cc.

References Exception.

Referenced by masterRef().

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

References Exception.

267  {
268  throw cms::Exception("Invalid Reference")
269  << "this Candidate has no master clone ptr."
270  << "Can't call masterClonePtr() method.\n";
271 }
template<typename Ref >
Ref pat::PackedCandidate::masterRef ( ) const
inline

cast master clone reference to a concrete type

Definition at line 576 of file PackedCandidate.h.

References masterClone().

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

Definition at line 610 of file PackedCandidate.h.

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

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

610 { if (!p4c_) unpack(); if (!vertex_) unpackVtx(); }
std::atomic< Point * > vertex_
vertex position
void unpackVtx() const
std::atomic< LorentzVector * > p4c_
virtual Vector pat::PackedCandidate::momentum ( ) const
inlinevirtual

spatial momentum vector

Implements reco::Candidate.

Definition at line 316 of file PackedCandidate.h.

References p4c_, and unpack().

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

290  {
291  return 0;
292 }
virtual double pat::PackedCandidate::mt ( ) const
inlinevirtual

transverse mass

Implements reco::Candidate.

Definition at line 334 of file PackedCandidate.h.

References p4_, p4c_, and unpack().

334 { 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 336 of file PackedCandidate.h.

References p4_, p4c_, and unpack().

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

273  {
274  return 0;
275 }
int pat::PackedCandidate::numberOfHits ( ) const
inline
size_t pat::PackedCandidate::numberOfMothers ( ) const
virtual

number of mothers

Implements reco::Candidate.

Definition at line 277 of file PackedCandidate.cc.

277  {
278  return 0;
279 }
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 287 of file PackedCandidate.h.

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

Definition at line 152 of file PackedCandidate.h.

References detadeta_, dlambdadz_, dphi_, dphidphi_, dphidxy_, dptdpt_, dxy_, dxydxy_, dxydz_, dz_, dzdz_, hcalFraction_, normalizedChi2_, p4(), p4_, p4c_, packedCovarianceDetaDeta_, packedCovarianceDlambdaDz_, packedCovarianceDphiDphi_, packedCovarianceDphiDxy_, packedCovarianceDptDpt_, packedCovarianceDxyDxy_, packedCovarianceDxyDz_, packedCovarianceDzDz_, packedDPhi_, packedDxy_, packedDz_, packedEta_, packedHits_, packedLayers_, packedM_, packedPhi_, packedPt_, packedPuppiweight_, packedPuppiweightNoLepDiff_, pdgId_, polarP4(), pvRefKey_, pvRefProd_, qualityFlags_, track_, vertex(), and vertex_.

152  {
153  if(this == &iOther) {
154  return *this;
155  }
156  packedPt_ =iOther.packedPt_;
157  packedEta_=iOther.packedEta_;
158  packedPhi_=iOther.packedPhi_;
159  packedM_=iOther.packedM_;
160  packedDxy_=iOther.packedDxy_;
161  packedDz_=iOther.packedDz_;
162  packedDPhi_=iOther.packedDPhi_;
163  packedCovarianceDxyDxy_=iOther.packedCovarianceDxyDxy_;
164  packedCovarianceDxyDz_=iOther.packedCovarianceDxyDz_;
165  packedCovarianceDzDz_=iOther.packedCovarianceDzDz_;
166  packedCovarianceDlambdaDz_=iOther.packedCovarianceDlambdaDz_;
167  packedCovarianceDphiDxy_=iOther.packedCovarianceDphiDxy_;
168  packedCovarianceDptDpt_=iOther.packedCovarianceDptDpt_;
169  packedCovarianceDetaDeta_=iOther.packedCovarianceDetaDeta_;
170  packedCovarianceDphiDphi_=iOther.packedCovarianceDphiDphi_;
171  packedPuppiweight_=iOther.packedPuppiweight_;
172  packedPuppiweightNoLepDiff_=iOther.packedPuppiweightNoLepDiff_;
173  hcalFraction_=iOther.hcalFraction_;
174  //Need to trigger unpacking in iOther
175  if(p4_) {
176  *p4_ = iOther.polarP4();
177  } else {
178  p4_.store( new PolarLorentzVector(iOther.polarP4() ) ) ;
179  }
180  if(p4c_) {
181  *p4c_ = iOther.p4();
182  } else {
183  p4c_.store( new LorentzVector(iOther.p4()));
184  }
185  if(vertex_) {
186  *vertex_ = iOther.vertex();
187  } else {
188  vertex_.store( new Point(iOther.vertex()));
189  }
190  dxy_=iOther.dxy_;
191  dz_ = iOther.dz_;
192  dphi_=iOther.dphi_;
193 
194  if(!iOther.track_) {
195  delete track_.exchange(nullptr);
196  } else {
197  if(!track_) {
198  track_.store( new reco::Track(*iOther.track_));
199  } else {
200  *track_ = *(iOther.track_);
201  }
202  }
203 
204  pdgId_=iOther.pdgId_;
205  qualityFlags_=iOther.qualityFlags_;
206  pvRefProd_=iOther.pvRefProd_;
207  pvRefKey_=iOther.pvRefKey_;
208  dxydxy_=iOther.dxydxy_;
209  dzdz_=iOther.dzdz_;
210  dxydz_=iOther.dxydz_;
211  dlambdadz_=iOther.dlambdadz_;
212  dphidxy_=iOther.dphidxy_;
213  dptdpt_=iOther.dptdpt_;
214  detadeta_=iOther.detadeta_;
215  dphidphi_=iOther.dphidphi_;
216  packedHits_=iOther.packedHits_;
217  packedLayers_=iOther.packedLayers_;
218  normalizedChi2_=iOther.normalizedChi2_;
219  return *this;
220  }
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.
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< LorentzVector * > p4c_
uint8_t normalizedChi2_
track quality information
float dxydxy_
IP covariance.
uint16_t packedCovarianceDxyDxy_
int pdgId_
PDG identifier.
reco::VertexRefProd pvRefProd_
Use these to build a Ref to primary vertex.
PackedCandidate& pat::PackedCandidate::operator= ( PackedCandidate &&  iOther)
inline

Definition at line 222 of file PackedCandidate.h.

References detadeta_, dlambdadz_, dphi_, dphidphi_, dphidxy_, dptdpt_, dxy_, dxydxy_, dxydz_, dz_, dzdz_, hcalFraction_, normalizedChi2_, p4_, p4c_, packedCovarianceDetaDeta_, packedCovarianceDlambdaDz_, packedCovarianceDphiDphi_, packedCovarianceDphiDxy_, packedCovarianceDptDpt_, packedCovarianceDxyDxy_, packedCovarianceDxyDz_, packedCovarianceDzDz_, packedDPhi_, packedDxy_, packedDz_, packedEta_, packedHits_, packedLayers_, packedM_, packedPhi_, packedPt_, packedPuppiweight_, packedPuppiweightNoLepDiff_, pdgId_, pvRefKey_, pvRefProd_, qualityFlags_, track_, and vertex_.

222  {
223  if(this == &iOther) {
224  return *this;
225  }
226  packedPt_ =iOther.packedPt_;
227  packedEta_=iOther.packedEta_;
228  packedPhi_=iOther.packedPhi_;
229  packedM_=iOther.packedM_;
230  packedDxy_=iOther.packedDxy_;
231  packedDz_=iOther.packedDz_;
232  packedDPhi_=iOther.packedDPhi_;
233  packedCovarianceDxyDxy_=iOther.packedCovarianceDxyDxy_;
234  packedCovarianceDxyDz_=iOther.packedCovarianceDxyDz_;
235  packedCovarianceDzDz_=iOther.packedCovarianceDzDz_;
236  packedCovarianceDlambdaDz_=iOther.packedCovarianceDlambdaDz_;
237  packedCovarianceDphiDxy_=iOther.packedCovarianceDphiDxy_;
238  packedCovarianceDptDpt_=iOther.packedCovarianceDptDpt_;
239  packedCovarianceDetaDeta_=iOther.packedCovarianceDetaDeta_;
240  packedCovarianceDphiDphi_=iOther.packedCovarianceDphiDphi_;
241  packedPuppiweight_=iOther.packedPuppiweight_;
242  packedPuppiweightNoLepDiff_=iOther.packedPuppiweightNoLepDiff_;
243  hcalFraction_=iOther.hcalFraction_;
244  delete p4_.exchange(iOther.p4_.exchange(nullptr));
245  delete p4c_.exchange(iOther.p4c_.exchange(nullptr));
246  delete vertex_.exchange(iOther.vertex_.exchange(nullptr));
247  dxy_=iOther.dxy_;
248  dz_ = iOther.dz_;
249  dphi_=iOther.dphi_;
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  dxydxy_=iOther.dxydxy_;
256  dzdz_=iOther.dzdz_;
257  dxydz_=iOther.dxydz_;
258  dlambdadz_=iOther.dlambdadz_;
259  dphidxy_=iOther.dphidxy_;
260  dptdpt_=iOther.dptdpt_;
261  detadeta_=iOther.detadeta_;
262  dphidphi_=iOther.dphidphi_;
263  packedHits_=iOther.packedHits_;
264  packedLayers_=iOther.packedLayers_;
265  normalizedChi2_=iOther.normalizedChi2_;
266  return *this;
267  }
std::atomic< Point * > vertex_
vertex position
reco::VertexRef::key_type pvRefKey_
std::atomic< reco::Track * > track_
reco::Track
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< LorentzVector * > p4c_
uint8_t normalizedChi2_
track quality information
float dxydxy_
IP covariance.
uint16_t packedCovarianceDxyDxy_
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 281 of file PackedCandidate.cc.

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

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

magnitude of momentum vector

Implements reco::Candidate.

Definition at line 321 of file PackedCandidate.h.

References p4c_, and unpack().

Referenced by Electron.Electron::ptErr().

321 { 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 312 of file PackedCandidate.h.

References p4c_, and unpack().

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

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

Definition at line 10 of file PackedCandidate.cc.

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

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

10  {
12  packedEta_ = int16_t(std::round(p4_.load()->Eta()/6.0f*std::numeric_limits<int16_t>::max()));
13  packedPhi_ = int16_t(std::round(p4_.load()->Phi()/3.2f*std::numeric_limits<int16_t>::max()));
15  if (unpackAfterwards) {
16  delete p4_.exchange(nullptr);
17  delete p4c_.exchange(nullptr);
18  unpack(); // force the values to match with the packed ones
19  }
20 }
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 611 of file PackedCandidate.h.

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

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

611 { 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
void unpackVtx() const
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< LorentzVector * > p4c_
void packVtx(bool unpackAfterwards=true)
void pack(bool unpackAfterwards=true)
void pat::PackedCandidate::packVtx ( bool  unpackAfterwards = true)
protected

Definition at line 22 of file PackedCandidate.cc.

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

Referenced by packBoth(), and setVertex().

22  {
23  reco::VertexRef pvRef = vertexRef();
24  Point pv = pvRef.isNonnull() ? pvRef->position() : Point();
25  float dxPV = vertex_.load()->X() - pv.X(), dyPV = vertex_.load()->Y() - pv.Y(); //, rPV = std::hypot(dxPV, dyPV);
26  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
27  dxy_ = - dxPV * s + dyPV * c;
28  // if we want to go back to the full x,y,z we need to store also
29  // float dl = dxPV * c + dyPV * s;
30  // float xRec = - dxy_ * s + dl * c, yRec = dxy_ * c + dl * s;
31  float pzpt = p4_.load()->Pz()/p4_.load()->Pt();
32  dz_ = vertex_.load()->Z() - pv.Z() - (dxPV*c + dyPV*s) * pzpt;
34  packedDz_ = pvRef.isNonnull() ? MiniFloatConverter::float32to16(dz_*100) : int16_t(std::round(dz_/40.f*std::numeric_limits<int16_t>::max()));
35  packedDPhi_ = int16_t(std::round(dphi_/3.2f*std::numeric_limits<int16_t>::max()));
39 // packedCovarianceDxyDxy_ = pack8log(dxydxy_,-15,-1); // MiniFloatConverter::float32to16(dxydxy_*10000.);
40 // packedCovarianceDxyDz_ = pack8log(dxydz_,-20,-1); //MiniFloatConverter::float32to16(dxydz_*10000.);
41 // packedCovarianceDzDz_ = pack8log(dzdz_,-13,-1); //MiniFloatConverter::float32to16(dzdz_*10000.);
42 
46  packedCovarianceDphiDxy_ = pack8log(dphidxy_,-17,-4); // MiniFloatConverter::float32to16(dphidxy_*10000.);
47  packedCovarianceDlambdaDz_ = pack8log(dlambdadz_,-17,-4); // MiniFloatConverter::float32to16(dlambdadz_*10000.);
48 
49  /*packedCovarianceDptDpt_ = pack8logCeil(dptdpt_,-15,5,32);
50  packedCovarianceDetaDeta_ = pack8logCeil(detadeta_,-20,0,32);
51  packedCovarianceDphiDphi_ = pack8logCeil(dphidphi_,-15,5,32);
52  packedCovarianceDphiDxy_ = pack8log(dphidxy_,-17,-4); // MiniFloatConverter::float32to16(dphidxy_*10000.);
53  packedCovarianceDlambdaDz_ = pack8log(dlambdadz_,-17,-4); // MiniFloatConverter::float32to16(dlambdadz_*10000.);
54 
55 */
56 /* packedCovarianceDphiDxy_ = MiniFloatConverter::float32to16(dphidxy_*10000.);
57  packedCovarianceDlambdaDz_ = MiniFloatConverter::float32to16(dlambdadz_*10000.);
58  packedCovarianceDetaDeta_ = MiniFloatConverter::float32to16(detadeta_*10000.);
59  packedCovarianceDphiDphi_ = MiniFloatConverter::float32to16(dphidphi_*10000.);
60  packedCovarianceDptDpt_ = MiniFloatConverter::float32to16(dptdpt_*10000.);
61 */
62 // packedCovarianceDphiDxy_ = pack8log(dphidxy_,-17,-4); // MiniFloatConverter::float32to16(dphidxy_*10000.);
63 // packedCovarianceDlambdaDz_ = pack8log(dlambdadz_,-17,-4); // MiniFloatConverter::float32to16(dlambdadz_*10000.);
64 
65  if (unpackAfterwards) {
66  delete vertex_.exchange(nullptr);
67  unpackVtx();
68  }
69 }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:252
std::atomic< Point * > vertex_
vertex position
int8_t pack8log(double x, double lmin, double lmax, uint8_t base=128)
Definition: liblogintpack.h:25
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
math::XYZPoint Point
point in the space
const reco::VertexRef vertexRef() const
void unpackVtx() const
int8_t pack8logCeil(double x, double lmin, double lmax, uint8_t base=128)
Definition: liblogintpack.h:13
static uint16_t float32to16(float x)
Definition: libminifloat.h:15
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
math::XYZPoint Point
std::atomic< PolarLorentzVector * > p4_
the four vector
double f[11][100]
float dxydxy_
IP covariance.
uint16_t packedCovarianceDxyDxy_
virtual int pat::PackedCandidate::pdgId ( ) const
inlinevirtual

PDG identifier.

Implements reco::Candidate.

Definition at line 518 of file PackedCandidate.h.

References pdgId_.

Referenced by Particle.Particle::__str__(), METAnalyzer::fillMonitorElement(), fromPV(), and setPdgId().

518 { return pdgId_; }
int pdgId_
PDG identifier.
virtual double pat::PackedCandidate::phi ( ) const
inlinevirtual

momentum azimuthal angle

Implements reco::Candidate.

Definition at line 346 of file PackedCandidate.h.

References p4_, p4c_, and unpack().

Referenced by Particle.Particle::__str__(), and METAnalyzer::fillMonitorElement().

346 { 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 348 of file PackedCandidate.h.

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

348  {
349  maybeUnpackBoth();
350  float ret = p4_.load()->Phi() + dphi_;
351  while (ret > float(M_PI)) ret -= 2*float(M_PI);
352  while (ret < -float(M_PI)) ret += 2*float(M_PI);
353  return ret;
354  }
tuple ret
prodAgent to be discontinued
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 314 of file PackedCandidate.h.

References p4_, p4c_, and unpack().

Referenced by operator=().

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

References track_, and unpackTrk().

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

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

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

Definition at line 346 of file PackedCandidate.cc.

References logintpack::unpack8logClosed().

Referenced by METAnalyzer::fillMonitorElement(), and PuppiProducer::produce().

346 { 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
Definition: liblogintpack.h:62
float pat::PackedCandidate::puppiWeightNoLep ( ) const

Weight from full PUPPI.

Definition at line 348 of file PackedCandidate.cc.

References logintpack::unpack8logClosed().

Referenced by METAnalyzer::fillMonitorElement().

double unpack8logClosed(int8_t i, double lmin, double lmax, uint8_t base=128)
reverse of pack8logClosed
Definition: liblogintpack.h:62
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 338 of file PackedCandidate.h.

References p4c_, and unpack().

Referenced by PuppiProducer::produce().

338 { 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 340 of file PackedCandidate.h.

References p4c_, and unpack().

Referenced by PuppiProducer::produce().

340 { 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 342 of file PackedCandidate.h.

References p4c_, and unpack().

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

342 { 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 360 of file PackedCandidate.h.

References p4_, p4c_, and unpack().

360 { if (!p4c_) unpack(); return p4_.load()->Rapidity(); }
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< LorentzVector * > p4c_
void pat::PackedCandidate::setAssociationQuality ( PVAssociationQuality  q)
inline
virtual void pat::PackedCandidate::setCharge ( int  charge)
inlinevirtual

set electric charge

Implements reco::Candidate.

Definition at line 306 of file PackedCandidate.h.

306 {}
void pat::PackedCandidate::setHcalFraction ( float  p)

Weight from PUPPI removing leptons.

Definition at line 350 of file PackedCandidate.cc.

References AlCaHLTBitMon_ParallelJobs::p.

350  {
351  hcalFraction_ = 100*p;
352 }
virtual double p() const
magnitude of momentum vector
virtual void pat::PackedCandidate::setLongLived ( )
inlinevirtual

set long lived flag

Implements reco::Candidate.

Definition at line 528 of file PackedCandidate.h.

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

Definition at line 506 of file PackedCandidate.h.

References lostInnerHitsMask, lostInnerHitsShift, and qualityFlags_.

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

set particle mass

Implements reco::Candidate.

Definition at line 376 of file PackedCandidate.h.

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

376  {
377  if (!p4c_) unpack();
378  *p4_ = PolarLorentzVector(p4_.load()->Pt(), p4_.load()->Eta(), p4_.load()->Phi(), m);
379  pack();
380  }
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 534 of file PackedCandidate.h.

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

Definition at line 512 of file PackedCandidate.h.

References muonFlagsMask, muonFlagsShift, and qualityFlags_.

512  {
513  int16_t muonFlags = isStandAlone | (2*isGlobal);
515  }
virtual void pat::PackedCandidate::setP4 ( const LorentzVector p4)
inlinevirtual

set 4-momentum

Implements reco::Candidate.

Definition at line 364 of file PackedCandidate.h.

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

Referenced by Jet.Jet::setCorrP4().

364  {
365  maybeUnpackBoth(); // changing px,py,pz changes also mapping between dxy,dz and x,y,z
366  *p4_ = PolarLorentzVector(p4.Pt(), p4.Eta(), p4.Phi(), p4.M());
367  packBoth();
368  }
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 370 of file PackedCandidate.h.

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

Referenced by Jet.Jet::setCorrP4().

370  {
371  maybeUnpackBoth(); // changing px,py,pz changes also mapping between dxy,dz and x,y,z
372  *p4_ = p4;
373  packBoth();
374  }
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 520 of file PackedCandidate.h.

References pdgId(), and pdgId_.

520 { 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 340 of file PackedCandidate.cc.

References logintpack::pack8logClosed().

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

Implements reco::Candidate.

Definition at line 381 of file PackedCandidate.h.

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

381  {
382  maybeUnpackBoth(); // changing px,py,pz changes also mapping between dxy,dz and x,y,z
383  *p4c_ = LorentzVector(p4c_.load()->Px(), p4c_.load()->Py(), pz, p4c_.load()->E());
384  *p4_ = PolarLorentzVector(p4c_.load()->Pt(), p4c_.load()->Eta(), p4c_.load()->Phi(), p4c_.load()->M());
385  packBoth();
386  }
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
virtual void pat::PackedCandidate::setStatus ( int  status)
inlinevirtual

set status word

Implements reco::Candidate.

Definition at line 524 of file PackedCandidate.h.

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

set electric charge

Implements reco::Candidate.

Definition at line 310 of file PackedCandidate.h.

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

Definition at line 394 of file PackedCandidate.h.

References detadeta_, dlambdadz_, dphidphi_, dphidxy_, dptdpt_, dxydxy_, dxydz_, dzdz_, reco::TrackBase::hitPattern(), reco::TrackBase::normalizedChi2(), normalizedChi2_, reco::HitPattern::numberOfValidHits(), reco::HitPattern::numberOfValidPixelHits(), packBoth(), packedHits_, packedLayers_, reco::HitPattern::pixelLayersWithMeasurement(), pt(), reco::HitPattern::stripLayersWithMeasurement(), trackPixelHitsMask, trackStripHitsMask, and trackStripHitsShift.

Referenced by setTrackProperties().

394  {
395  dxydxy_ = covariance(3,3);
396  dxydz_ = covariance(3,4);
397  dzdz_ = covariance(4,4);
398  dphidxy_ = covariance(2,3);
399  dlambdadz_ = covariance(1,4);
400  dptdpt_ = covariance(0,0)*pt()*pt();
401  detadeta_ = covariance(1,1);
402  dphidphi_ = covariance(2,2)*pt()*pt();
403 
405  // first we count the number of layers with hits
406  int numberOfPixelLayers_ = tk.hitPattern().pixelLayersWithMeasurement();
407  if (numberOfPixelLayers_ > trackPixelHitsMask) numberOfPixelLayers_ = trackPixelHitsMask;
408  int numberOfStripLayers_ = tk.hitPattern().stripLayersWithMeasurement();
409  if (numberOfStripLayers_ > trackStripHitsMask) numberOfStripLayers_ = trackStripHitsMask;
410  packedLayers_ = (numberOfPixelLayers_&trackPixelHitsMask) | (numberOfStripLayers_ << trackStripHitsShift);
411  // now we count number of additional hits, beyond the one-per-layer implied by packedLayers_
412  int numberOfPixelHits_ = tk.hitPattern().numberOfValidPixelHits() - numberOfPixelLayers_;
413  if (numberOfPixelHits_ > trackPixelHitsMask) numberOfPixelHits_ = trackPixelHitsMask;
414  int numberOfStripHits_ = tk.hitPattern().numberOfValidHits() - numberOfPixelHits_ - numberOfPixelLayers_ - numberOfStripLayers_;
415  if (numberOfStripHits_ > trackStripHitsMask) numberOfStripHits_ = trackStripHitsMask;
416  packedHits_ = (numberOfPixelHits_&trackPixelHitsMask) | (numberOfStripHits_ << trackStripHitsShift);
417 
418  packBoth();
419  }
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
int numberOfValidHits() const
Definition: HitPattern.h:823
virtual double pt() const
transverse momentum
int pixelLayersWithMeasurement() const
Definition: HitPattern.cc:508
uint8_t normalizedChi2_
track quality information
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:445
float dxydxy_
IP covariance.
int stripLayersWithMeasurement() const
Definition: HitPattern.h:1035
int numberOfValidPixelHits() const
Definition: HitPattern.h:838
virtual void pat::PackedCandidate::setTrackProperties ( const reco::Track tk)
inlinevirtual

Definition at line 421 of file PackedCandidate.h.

References reco::TrackBase::covariance(), and setTrackProperties().

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

set vertex

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

290  {
291  return reco::CandidatePtr();
292  }
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 522 of file PackedCandidate.h.

References qualityFlags_.

522 { 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 356 of file PackedCandidate.h.

References p4_, p4c_, and unpack().

Referenced by Tau.Tau::zImpact().

356 { 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 308 of file PackedCandidate.h.

References charge().

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

Definition at line 429 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 71 of file PackedCandidate.cc.

References MiniFloatConverter::float16to32(), bookConverter::max, p4, phi(), EnergyCorrector::pt, edm::shift, and jetcorrextractor::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().

71  {
73  double shift = (pt<1. ? 0.1*pt : 0.1/pt); // shift particle phi to break degeneracies in angular separations
74  double sign = ( ( int(pt*10) % 2 == 0 ) ? 1 : -1 ); // introduce a pseudo-random sign of the shift
75  double phi = int16_t(packedPhi_)*3.2f/std::numeric_limits<int16_t>::max() + sign*shift*3.2/std::numeric_limits<int16_t>::max();
76  auto p4 = std::make_unique<PolarLorentzVector>(pt,
78  phi,
80  auto p4c = std::make_unique<LorentzVector>( *p4 );
81  PolarLorentzVector* expectp4= nullptr;
82  if( p4_.compare_exchange_strong(expectp4,p4.get()) ) {
83  p4.release();
84  }
85 
86  //p4c_ works as the guard for unpacking so it
87  // must be set last
88  LorentzVector* expectp4c = nullptr;
89  if(p4c_.compare_exchange_strong(expectp4c, p4c.get()) ) {
90  p4c.release();
91  }
92 }
double sign(double x)
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::unpackTrk ( ) const
protected

Definition at line 156 of file PackedCandidate.cc.

References RecoTauCleanerPlugins::charge, reco::TrackBase::highPurity, AnalysisDataFormats_SUSYBSMObjects::hp, i, reco::TrackBase::loose, visualization-live-secondInstance_cfg::m, TrackingRecHit::missing_inner, ndof, p3, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, EnergyCorrector::pt, StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, StripSubdetector::TOB, reco::TrackBase::undefAlgorithm, and TrackingRecHit::valid.

Referenced by bestTrack(), and pseudoTrack().

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

Definition at line 93 of file PackedCandidate.cc.

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

Referenced by maybeUnpackBoth(), and packBoth().

93  {
94  reco::VertexRef pvRef = vertexRef();
98  Point pv = pvRef.isNonnull() ? pvRef->position() : Point();
99  float phi = p4_.load()->Phi()+dphi_, s = std::sin(phi), c = std::cos(phi);
100  auto vertex = std::make_unique<Point>(pv.X() - dxy_ * s,
101  pv.Y() + dxy_ * c,
102  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
103 // dxydxy_ = unpack8log(packedCovarianceDxyDxy_,-15,-1);
104 // dxydz_ = unpack8log(packedCovarianceDxyDz_,-20,-1);
105 // dzdz_ = unpack8log(packedCovarianceDzDz_,-13,-1);
111 /*
112  dphidxy_ = unpack8log(packedCovarianceDphiDxy_,-17,-4);
113  dlambdadz_ = unpack8log(packedCovarianceDlambdaDz_,-17,-4);
114  dptdpt_ = unpack8log(packedCovarianceDptDpt_,-15,5,32);
115  detadeta_ = unpack8log(packedCovarianceDetaDeta_,-20,0,32);
116  dphidphi_ = unpack8log(packedCovarianceDphiDphi_,-15,5,32);
117 */
118 
119 /* dphidxy_ = MiniFloatConverter::float16to32(packedCovarianceDphiDxy_)/10000.;
120  dlambdadz_ = MiniFloatConverter::float16to32(packedCovarianceDlambdaDz_)/10000.;
121  dptdpt_ = MiniFloatConverter::float16to32(packedCovarianceDptDpt_)/10000.;
122  detadeta_ = MiniFloatConverter::float16to32(packedCovarianceDetaDeta_)/10000.;
123  dphidphi_ = MiniFloatConverter::float16to32(packedCovarianceDphiDphi_)/10000.;
124 */
128 /* dphidxy_ = MiniFloatConverter::float16to32(packedCovarianceDphiDxy_)/10000.;
129  dlambdadz_ =MiniFloatConverter::float16to32(packedCovarianceDlambdaDz_)/10000.;
130 */
131  Point* expected = nullptr;
132  if( vertex_.compare_exchange_strong(expected,vertex.get()) ) {
133  vertex.release();
134  }
135 }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:252
std::atomic< Point * > vertex_
vertex position
double unpack8log(int8_t i, double lmin, double lmax, uint8_t base=128)
Definition: liblogintpack.h:52
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
std::atomic< PolarLorentzVector * > p4_
the four vector
float dxydxy_
IP covariance.
uint16_t packedCovarianceDxyDxy_
virtual const Point & vertex() const
vertex position
virtual const Point& pat::PackedCandidate::vertex ( ) const
inlinevirtual

vertex position

Implements reco::Candidate.

Definition at line 432 of file PackedCandidate.h.

References maybeUnpackBoth(), and vertex_.

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

432 { 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 312 of file PackedCandidate.cc.

312  {
313  return 0;
314 }
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 324 of file PackedCandidate.cc.

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

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

return SMatrix

Reimplemented from reco::Candidate.

Definition at line 557 of file PackedCandidate.h.

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

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

316  {
317  return 0;
318 }
double pat::PackedCandidate::vertexNormalizedChi2 ( ) const
virtual

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

Implements reco::Candidate.

Definition at line 320 of file PackedCandidate.cc.

320  {
321  return 0;
322 }
const reco::VertexRef pat::PackedCandidate::vertexRef ( ) const
inline

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

References maybeUnpackBoth(), and vertex_.

434 { 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 436 of file PackedCandidate.h.

References maybeUnpackBoth(), and vertex_.

436 { 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 438 of file PackedCandidate.h.

References maybeUnpackBoth(), and vertex_.

438 { 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

rapidity

Implements reco::Candidate.

Definition at line 362 of file PackedCandidate.h.

References p4_, p4c_, and unpack().

Referenced by svgfig.Ellipse::__repr__(), Vispa.Gui.WidgetContainer.WidgetContainer::autosize(), Vispa.Gui.VispaWidget.VispaWidget::boundingRect(), geometryXMLparser.Alignable::pos(), and Vispa.Gui.ConnectableWidget.ConnectableWidget::positionizeMenuWidget().

362 { if (!p4c_) unpack(); return p4_.load()->Rapidity(); }
std::atomic< PolarLorentzVector * > p4_
the four vector
std::atomic< LorentzVector * > p4c_

Friends And Related Function Documentation

friend class ::OverlapChecker
friend

Definition at line 644 of file PackedCandidate.h.

friend class ::testPackedCandidate
friend

Fraction of Ecal and Hcal for HF and neutral hadrons.

Definition at line 599 of file PackedCandidate.h.

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

Definition at line 643 of file PackedCandidate.h.

friend class ShallowCloneCandidate
friend

Definition at line 645 of file PackedCandidate.h.

friend class ShallowClonePtrCandidate
friend

Definition at line 646 of file PackedCandidate.h.

Member Data Documentation

float pat::PackedCandidate::detadeta_
mutableprotected

Definition at line 634 of file PackedCandidate.h.

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

float pat::PackedCandidate::dlambdadz_
mutableprotected

Definition at line 634 of file PackedCandidate.h.

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

float pat::PackedCandidate::dphi_
mutableprotected

Definition at line 623 of file PackedCandidate.h.

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

float pat::PackedCandidate::dphidphi_
mutableprotected

Definition at line 634 of file PackedCandidate.h.

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

float pat::PackedCandidate::dphidxy_
mutableprotected

Definition at line 634 of file PackedCandidate.h.

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

float pat::PackedCandidate::dptdpt_
mutableprotected

Definition at line 634 of file PackedCandidate.h.

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

float pat::PackedCandidate::dxy_
mutableprotected

Definition at line 623 of file PackedCandidate.h.

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

float pat::PackedCandidate::dxydxy_
mutableprotected

IP covariance.

Definition at line 634 of file PackedCandidate.h.

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

float pat::PackedCandidate::dxydz_
mutableprotected

Definition at line 634 of file PackedCandidate.h.

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

float pat::PackedCandidate::dz_
mutableprotected

Definition at line 623 of file PackedCandidate.h.

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

float pat::PackedCandidate::dzdz_
mutableprotected

Definition at line 634 of file PackedCandidate.h.

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

int8_t pat::PackedCandidate::hcalFraction_
protected

Definition at line 616 of file PackedCandidate.h.

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

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

long lived flag

Definition at line 526 of file PackedCandidate.h.

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

do mass constraint flag

Definition at line 532 of file PackedCandidate.h.

uint8_t pat::PackedCandidate::normalizedChi2_
protected

track quality information

Definition at line 637 of file PackedCandidate.h.

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

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

the four vector

Definition at line 619 of file PackedCandidate.h.

Referenced by eta(), mass(), massSqr(), mt(), mtSqr(), operator=(), packBoth(), phi(), phiAtVtx(), polarP4(), pt(), rapidity(), setMass(), setP4(), setPz(), theta(), and y().

std::atomic<LorentzVector*> pat::PackedCandidate::p4c_
mutableprotected
int8_t pat::PackedCandidate::packedCovarianceDetaDeta_
protected

Definition at line 605 of file PackedCandidate.h.

Referenced by operator=().

int8_t pat::PackedCandidate::packedCovarianceDlambdaDz_
protected

Definition at line 604 of file PackedCandidate.h.

Referenced by operator=().

int8_t pat::PackedCandidate::packedCovarianceDphiDphi_
protected

Definition at line 605 of file PackedCandidate.h.

Referenced by operator=().

int8_t pat::PackedCandidate::packedCovarianceDphiDxy_
protected

Definition at line 604 of file PackedCandidate.h.

Referenced by operator=().

int8_t pat::PackedCandidate::packedCovarianceDptDpt_
protected

Definition at line 605 of file PackedCandidate.h.

Referenced by operator=().

uint16_t pat::PackedCandidate::packedCovarianceDxyDxy_
protected

Definition at line 603 of file PackedCandidate.h.

Referenced by operator=().

uint16_t pat::PackedCandidate::packedCovarianceDxyDz_
protected

Definition at line 603 of file PackedCandidate.h.

Referenced by operator=().

uint16_t pat::PackedCandidate::packedCovarianceDzDz_
protected

Definition at line 603 of file PackedCandidate.h.

Referenced by operator=().

uint16_t pat::PackedCandidate::packedDPhi_
protected

Definition at line 602 of file PackedCandidate.h.

Referenced by operator=().

uint16_t pat::PackedCandidate::packedDxy_
protected

Definition at line 602 of file PackedCandidate.h.

Referenced by operator=().

uint16_t pat::PackedCandidate::packedDz_
protected

Definition at line 602 of file PackedCandidate.h.

Referenced by operator=().

uint16_t pat::PackedCandidate::packedEta_
protected

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

Referenced by operator=().

uint16_t pat::PackedCandidate::packedPhi_
protected

Definition at line 601 of file PackedCandidate.h.

Referenced by operator=().

uint16_t pat::PackedCandidate::packedPt_
protected

Definition at line 601 of file PackedCandidate.h.

Referenced by operator=().

int8_t pat::PackedCandidate::packedPuppiweight_
protected

Definition at line 614 of file PackedCandidate.h.

Referenced by operator=().

int8_t pat::PackedCandidate::packedPuppiweightNoLepDiff_
protected

Definition at line 615 of file PackedCandidate.h.

Referenced by operator=().

int pat::PackedCandidate::pdgId_
protected

PDG identifier.

Definition at line 627 of file PackedCandidate.h.

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

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

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

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

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

reco::Track

Definition at line 625 of file PackedCandidate.h.

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

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

vertex position

Definition at line 622 of file PackedCandidate.h.

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