1 #ifndef __DataFormats_PatCandidates_PackedCandidate_h__ 2 #define __DataFormats_PatCandidates_PackedCandidate_h__ 19 class testPackedCandidate;
48 p4_(new PolarLorentzVector(0,0,0,0)),
p4c_( new LorentzVector(0,0,0,0)),
73 p4_( new PolarLorentzVector(p4) ),
p4c_( new LorentzVector(*
p4_)),
90 p4_(new PolarLorentzVector(p4.
Pt(), p4.
Eta(), p4.
Phi(), p4.M())),
91 p4c_( new LorentzVector(p4)),
vertex_( new Point(vtx) ) ,
113 p4_( new PolarLorentzVector(iOther.
polarP4() ) ),
150 if(
this == &iOther) {
191 delete track_.exchange(
nullptr);
205 delete m_.exchange(
nullptr);
224 if(
this == &iOther) {
242 delete p4_.exchange(iOther.p4_.exchange(
nullptr));
243 delete p4c_.exchange(iOther.p4c_.exchange(
nullptr));
244 delete vertex_.exchange(iOther.vertex_.exchange(
nullptr));
250 delete track_.exchange(iOther.track_.exchange(
nullptr));
255 delete m_.exchange(iOther.m_.exchange(
nullptr));
320 double et()
const {
return (
pt()<=0) ? 0 :
p4c_.load()->Et(); }
322 double et2()
const {
return (
pt()<=0) ? 0 :
p4c_.load()->Et2(); }
351 float ret =
p4_.load()->Phi() +
dphi_;
371 virtual void setP4(
const LorentzVector &
p4 ) {
377 virtual void setP4(
const PolarLorentzVector &
p4 ) {
480 virtual float dxy(
const Point &
p)
const ;
482 virtual float dz(
const Point &p)
const ;
522 int lost =
hits;
if (lost > 2) lost = 2;
528 int16_t muonFlags = isStandAlone | (2*isGlobal);
590 template<
typename Ref>
594 virtual bool isMuon()
const {
return false; }
601 virtual bool isJet()
const {
return false; }
642 friend class ::testPackedCandidate;
651 void pack(
bool unpackAfterwards=
true) ;
653 void packVtx(
bool unpackAfterwards=
true) ;
671 mutable std::atomic<PolarLorentzVector*>
p4_;
672 mutable std::atomic<LorentzVector*>
p4c_;
697 std::call_once(covariance_load_flag,[](
int v) { covarianceParameterization_.load(v); } ,
covarianceVersion_ );
701 <<
"Attempting to load multiple covariance version in same process. This is not supported.";
708 template<
typename,
typename,
typename>
friend struct component;
709 friend class ::OverlapChecker;
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
edm::Ref< Container > Ref
virtual size_t numberOfMothers() const
number of mothers
virtual bool hasMasterClonePtr() const
virtual void setPdgId(int pdgId)
virtual float etaAtVtx() const
eta from the track (normally identical to eta())
int covarianceSchema() const
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
float unpack(uint16_t packed, int schema, int i, int j, float pt, float eta, int nHits, int pixelHits, float cii=1., float cjj=1.) const
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
uint16_t packCovarianceElement(const reco::TrackBase::CovarianceMatrix &m, int i, int j) const
float hcalFraction() const
Set the fraction of Hcal needed for HF and neutral hadrons and isolated charged 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
int pixelLayersWithMeasurement() const
uint16_t covarianceSchema_
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 void setCovarianceVersion(int v)
virtual double vertexNdof() const
void setRawCaloFraction(float p)
Weight from PUPPI removing leptons.
PackedCandidate(const PackedCandidate &iOther)
void unpackCovarianceElement(reco::TrackBase::CovarianceMatrix &m, uint16_t packed, int i, int j) const
PackedCovariance packedCovariance_
virtual double pt() const
transverse momentum
virtual void setStatus(int status)
set status word
key_type key() const
Accessor for product key.
int pixelLayersWithMeasurement() const
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
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)
float pack(float value, int schema, int i, int j, float pt, float eta, int nHits, int pixelHits, float cii=1., float cjj=1.) const
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 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)
Raw ECAL+HCAL energy over candidate energy for isolated charged hadrons.
math::XYZTLorentzVector LorentzVector
Lorentz vector.
virtual void setTrackProperties(const reco::Track &tk, int quality, int covarianceVersion)
void maybeUnpackCovariance() const
const PVAssoc fromPV(size_t ipv=0) const
bool isIsolatedChargedHadron_
CovarianceMatrix covariance() const
return track covariance matrix
virtual double py() const
y coordinate of momentum vector
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
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
static CovarianceParameterization covarianceParameterization_
int8_t packedPuppiweight_
virtual double energy() const
energy
virtual double ptTrk() const
pt from the track (normally identical to pt())
#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
int stripLayersWithMeasurement() 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
PackedCandidate(const PolarLorentzVector &p4, const Point &vtx, float trkPt, float etaAtVtx, float phiAtVtx, int pdgId, const reco::VertexRefProd &pvRefProd, reco::VertexRef::key_type pvRefKey)
virtual double vertexNormalizedChi2() const
chi-squared divided by n.d.o.f.
virtual void setThreeCharge(int threecharge)
set electric charge
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
int trackerLayersWithMeasurement() const
std::atomic< LorentzVector * > p4c_
virtual const PolarLorentzVector & polarP4() const
four-momentum Lorentz vector
bool hasTrackDetails() const
Return true if a bestTrack can be extracted from this Candidate.
uint16_t covarianceVersion_
std::atomic< reco::TrackBase::CovarianceMatrix * > m_
IP covariance.
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.
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?
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
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
int stripLayersWithMeasurement() const
static std::once_flag covariance_load_flag
virtual double vz() const
z coordinate of vertex position
int covarianceVersion() const
virtual void setMass(double m)
set particle mass
virtual reco::CandidatePtr sourceCandidatePtr(size_type i) const
static float kMinDEtaToStore_
virtual float phiAtVtx() const
momentum azimuthal angle from the track (normally identical to phi())
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
float rawCaloFraction() const
Set the raw ECAL+HCAL energy over candidate energy for isolated charged hadrons.
void unpackCovariance() const
CovarianceMatrix vertexCovariance() const
return SMatrix
virtual bool isStandAloneMuon() const
friend class ShallowClonePtrCandidate
Flag isolation (as in particle flow, i.e. at calorimeter surface rather than at PV) flag for charged ...
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)
PackedCandidate(const LorentzVector &p4, const Point &vtx, float trkPt, float etaAtVtx, float phiAtVtx, int pdgId, const reco::VertexRefProd &pvRefProd, reco::VertexRef::key_type pvRefKey)
trackHitShiftsAndMasks
set impact parameters covariance
int numberOfValidPixelHits() const
void setIsIsolatedChargedHadron(bool p)
Fraction of Ecal and Hcal for HF and neutral hadrons and isolated charged hadrons.
virtual const LorentzVector & p4() const
four-momentum Lorentz vecto r
void pack(bool unpackAfterwards=true)
virtual bool isElectron() const
double et() const
transverse energy
virtual double px() const
x coordinate of momentum vector
void packCovariance(const reco::TrackBase::CovarianceMatrix &m, bool unpackAfterwards=true)
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 void setTrackProperties(const reco::Track &tk, const reco::Track::CovarianceMatrix &covariance, int quality, int covarianceVersion)
virtual ~PackedCandidate()
destructor
virtual int pdgId() const
PDG identifier.
void maybeUnpackTrack() const
virtual void setHits(const reco::Track &tk)
bool isIsolatedChargedHadron() const
Set isolation (as in particle flow, i.e. at calorimeter surface rather than at PV) flat for charged h...
const CovarianceParameterization & covarianceParameterization() const
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
static float kMinDTrkPtToStore_
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)