1 #ifndef __DataFormats_PatCandidates_PackedCandidate_h__
2 #define __DataFormats_PatCandidates_PackedCandidate_h__
17 class testPackedCandidate;
153 if(
this == &iOther) {
195 delete track_.exchange(
nullptr);
222 if(
this == &iOther) {
243 delete p4_.exchange(iOther.p4_.exchange(
nullptr));
244 delete p4c_.exchange(iOther.p4c_.exchange(
nullptr));
245 delete vertex_.exchange(iOther.vertex_.exchange(
nullptr));
249 delete track_.exchange(iOther.track_.exchange(
nullptr));
323 double et()
const {
return (
pt()<=0) ? 0 :
p4c_.load()->Et(); }
325 double et2()
const {
return (
pt()<=0) ? 0 :
p4c_.load()->Et2(); }
349 while (ret >
float(
M_PI)) ret -= 2*float(
M_PI);
350 while (ret < -
float(
M_PI)) ret += 2*float(
M_PI);
390 dzdz_ = covariance(4,4);
399 if (numberOfPixelHits_ > 7) numberOfPixelHits_ = 7;
401 if (numberOfStripHits_ > 31) numberOfStripHits_ = 31;
402 packedHits_ = (numberOfPixelHits_&0x7) | (numberOfStripHits_ << 3);
450 virtual float dxy(
const Point &
p)
const ;
452 virtual float dz(
const Point &
p)
const ;
489 int lost = hits;
if (lost > 2) lost = 2;
495 int16_t muonFlags = isStandAlone | (2*isGlobal);
557 template<
typename Ref>
561 virtual bool isMuon()
const {
return false; }
568 virtual bool isJet()
const {
return false; }
581 friend class ::testPackedCandidate;
588 void pack(
bool unpackAfterwards=
true) ;
590 void packVtx(
bool unpackAfterwards=
true) ;
601 mutable std::atomic<PolarLorentzVector*>
p4_;
602 mutable std::atomic<LorentzVector*>
p4c_;
float puppiWeight() const
Set both weights at once (with option for only full PUPPI)
virtual float dz(size_t ipv=0) const
dz with respect to the PV[ipv]
virtual void setP4(const LorentzVector &p4)
set 4-momentum
void setMuonID(bool isStandAlone, bool isGlobal)
virtual void setVertex(const Point &vertex)
set vertex
virtual void setTrackProperties(const reco::Track &tk, const reco::Track::CovarianceMatrix &covariance)
set impact parameters covariance
edm::Ref< Container > Ref
virtual size_t numberOfMothers() const
number of mothers
virtual bool hasMasterClonePtr() const
virtual void setPdgId(int pdgId)
math::XYZVector Vector
point in the space
float puppiWeightNoLep() const
Weight from full PUPPI.
void setPuppiWeight(float p, float p_nolep=0.0)
virtual float dzError() const
uncertainty on dz
std::atomic< Point * > vertex_
vertex position
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
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
float hcalFraction() const
Set the fraction of Ecal and Hcal needed for HF and neutral hadrons.
virtual const reco::Track * bestTrack() const
return a pointer to the track if present. otherwise, return a null pointer
reco::VertexRef::key_type pvRefKey_
virtual bool isCaloMuon() const
PackedCandidate(const LorentzVector &p4, const Point &vtx, float phiAtVtx, int pdgId, const reco::VertexRefProd &pvRefProd, reco::VertexRef::key_type pvRefKey)
void maybeUnpackBoth() const
static const unsigned int longLivedTag
long lived flag
int numberOfValidHits() const
PackedCandidate & operator=(const PackedCandidate &iOther)
virtual double y() const
rapidity
virtual void fillVertexCovariance(CovarianceMatrix &v) const
fill SMatrix
static const unsigned int massConstraintTag
do mass constraint flag
virtual double mtSqr() const
transverse mass squared
std::vector< pat::PackedCandidate > PackedCandidateCollection
math::XYZPoint Point
point in the space
virtual double vertexNdof() const
int8_t packedCovarianceDphiDphi_
PackedCandidate(const PackedCandidate &iOther)
virtual double pt() const
transverse momentum
virtual void setStatus(int status)
set status word
key_type key() const
Accessor for product key.
virtual double vx() const
x coordinate of vertex position
virtual bool overlap(const reco::Candidate &) const
check overlap with another Candidate
virtual bool isPhoton() const
virtual double eta() const
momentum pseudorapidity
int8_t packedCovarianceDptDpt_
virtual void setP4(const PolarLorentzVector &p4)
set 4-momentum
const reco::VertexRef vertexRef() const
PackedCandidate(PackedCandidate &&iOther)
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
PackedCandidate(const reco::Candidate &c, const reco::VertexRefProd &pvRefProd, reco::VertexRef::key_type pvRefKey)
uint16_t packedCovarianceDzDz_
int8_t packedCovarianceDetaDeta_
uint16_t packedCovarianceDxyDz_
PackedCandidate(const PolarLorentzVector &p4, const Point &vtx, float phiAtVtx, int pdgId, const reco::VertexRefProd &pvRefProd, reco::VertexRef::key_type pvRefKey)
Ref masterRef() const
cast master clone reference to a concrete type
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
reco::CandidateCollection daughters
collection of daughter candidates
virtual const reco::Candidate * daughter(size_type) const
return daughter at a given position (throws an exception)
virtual double phi() const
momentum azimuthal angle
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
qualityFlagsShiftsAndMasks
virtual void setTrackProperties(const reco::Track &tk)
virtual bool isTrackerMuon() const
virtual void setLongLived()
set long lived flag
virtual double mass() const
mass
virtual bool isConvertedPhoton() const
virtual void setMassConstraint()
set mass constraint flag
std::atomic< reco::Track * > track_
reco::Track
virtual bool isMuon() const
const PVAssociationQuality pvAssociationQuality() const
virtual PackedCandidate * clone() const
returns a clone of the Candidate object
void setHcalFraction(float p)
Weight from PUPPI removing leptons.
math::XYZTLorentzVector LorentzVector
Lorentz vector.
const PVAssoc fromPV(size_t ipv=0) const
CovarianceMatrix covariance() const
return track covariance matrix
virtual double py() const
y coordinate of momentum vector
bool trackHighPurity() const
true if the track had the highPurity quality bit
LostInnerHits lostInnerHits() const
virtual int status() const
status word
PackedCandidate()
default constructor
virtual double rapidity() const
rapidity
virtual const reco::CandidateBaseRef & masterClone() const
edm::Ref< pat::PackedCandidateCollection > PackedCandidateRef
friend class ShallowCloneCandidate
int8_t packedPuppiweight_
virtual double energy() const
energy
#define CMS_THREAD_GUARD(_var_)
double et2() const
transverse energy squared (use this for cuts)!
Abs< T >::type abs(const T &t)
virtual bool isJet() const
virtual int charge() const
electric charge
virtual const reco::Track & pseudoTrack() const
Return reference to a pseudo track made with candidate kinematics, parameterized error for eta...
virtual double theta() const
momentum polar angle
std::atomic< PolarLorentzVector * > p4_
the four vector
virtual int threeCharge() const
electric charge
virtual double vertexNormalizedChi2() const
chi-squared divided by n.d.o.f.
virtual void setThreeCharge(int threecharge)
set electric charge
int8_t packedCovarianceDlambdaDz_
virtual void setPz(double pz)
virtual double mt() const
transverse mass
edm::Ref< VertexCollection > VertexRef
persistent reference to a Vertex
virtual float dzAssociatedPV() const
dz with respect to the PV ref
int numberOfPixelHits() const
virtual const reco::CandidatePtr & masterClonePtr() const
virtual double vy() const
y coordinate of vertex position
std::atomic< LorentzVector * > p4c_
virtual const PolarLorentzVector & polarP4() const
four-momentum Lorentz vector
LostInnerHits
Enumerator specifying the.
uint8_t normalizedChi2_
track quality information
PVAssoc
This refers to the association to PV=ipv. >=PVLoose corresponds to JME definition, >=PVTight to isolation definition.
int8_t packedCovarianceDphiDxy_
virtual size_t numberOfSourceCandidatePtrs() const
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
virtual Vector momentum() const
spatial momentum vector
virtual bool isGlobalMuon() const
int8_t packedPuppiweightNoLepDiff_
virtual bool massConstraint() const
do mass constraint?
Candidate()
default constructor
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
float dxydxy_
IP covariance.
XYZVectorD XYZVector
spatial vector with cartesian internal representation
virtual double massSqr() const
mass squared
XYZPointD XYZPoint
point in space with cartesian internal representation
edm::RefVector< pat::PackedCandidateCollection > PackedCandidateRefVector
virtual Vector boostToCM() const
uint16_t packedCovarianceDxyDxy_
virtual double vz() const
z coordinate of vertex position
virtual void setMass(double m)
set particle mass
virtual reco::CandidatePtr sourceCandidatePtr(size_type i) const
virtual float phiAtVtx() const
momentum azimuthal angle from the track (normally identical to phi())
math::XYZTLorentzVector LorentzVector
Lorentz vector.
int pdgId_
PDG identifier.
virtual const Point & vertex() const
vertex position
edm::RefProd< VertexCollection > VertexRefProd
persistent reference to a Vertex
virtual size_t numberOfDaughters() const
number of daughters
CovarianceMatrix vertexCovariance() const
return SMatrix
virtual bool isStandAloneMuon() const
friend class ShallowClonePtrCandidate
virtual bool longLived() const
is long lived?
PackedCandidate & operator=(PackedCandidate &&iOther)
virtual const reco::Candidate * mother(size_type) const
return mother at a given position (throws an exception)
virtual void setCharge(int charge)
set electric charge
void packVtx(bool unpackAfterwards=true)
void setLostInnerHits(LostInnerHits hits)
int numberOfValidPixelHits() const
virtual const LorentzVector & p4() const
four-momentum Lorentz vecto r
math::XYZPoint Point
point in the space
void pack(bool unpackAfterwards=true)
virtual bool isElectron() const
double et() const
transverse energy
virtual double px() const
x coordinate of momentum vector
virtual float dxy() const
dxy with respect to the PV ref
virtual double vertexChi2() const
chi-squares
void setTrackHighPurity(bool highPurity)
set to true if the track had the highPurity quality bit
virtual ~PackedCandidate()
destructor
virtual int pdgId() const
PDG identifier.
virtual double pz() const
z coordinate of momentum vector
virtual float dxyError() const
uncertainty on dxy
math::XYZVector Vector
point in the space
boost::remove_cv< typename boost::remove_reference< argument_type >::type >::type key_type
math::Error< dimension >::type CovarianceMatrix
5 parameter covariance matrix
virtual double p() const
magnitude of momentum vector
virtual bool hasMasterClone() const
reco::VertexRefProd pvRefProd_
Use these to build a Ref to primary vertex.
void setAssociationQuality(PVAssociationQuality q)
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.