|
|
Go to the documentation of this file. 1 #ifndef __DataFormats_PatCandidates_PackedCandidate_h__
2 #define __DataFormats_PatCandidates_PackedCandidate_h__
19 class testPackedCandidate;
246 p4_(iOther.
p4_.exchange(nullptr)),
247 p4c_(iOther.
p4c_.exchange(nullptr)),
259 m_(iOther.
m_.exchange(nullptr)),
268 if (
this == &iOther) {
313 delete track_.exchange(
nullptr);
327 delete m_.exchange(
nullptr);
346 if (
this == &iOther) {
368 delete p4_.exchange(iOther.p4_.exchange(
nullptr));
369 delete p4c_.exchange(iOther.p4c_.exchange(
nullptr));
370 delete vertex_.exchange(iOther.vertex_.exchange(
nullptr));
373 dphi_ = iOther.dphi_;
374 deta_ = iOther.deta_;
376 delete track_.exchange(iOther.track_.exchange(
nullptr));
381 delete m_.exchange(iOther.m_.exchange(
nullptr));
453 return p4c_.load()->Vect();
460 return p4c_.load()->BoostToCM();
463 double p()
const override {
466 return p4c_.load()->P();
472 return p4c_.load()->E();
475 double et()
const override {
return (
pt() <= 0) ? 0 :
p4c_.load()->Et(); }
477 double et2()
const override {
return (
pt() <= 0) ? 0 :
p4c_.load()->Et2(); }
482 return p4_.load()->M();
488 auto m =
p4_.load()->M();
493 double mt()
const override {
496 return p4_.load()->Mt();
502 return p4_.load()->Mt2();
505 double px()
const override {
508 return p4c_.load()->Px();
511 double py()
const override {
514 return p4c_.load()->Py();
517 double pz()
const override {
520 return p4c_.load()->Pz();
523 double pt()
const override {
526 return p4_.load()->Pt();
529 double phi()
const override {
532 return p4_.load()->Phi();
560 return p4_.load()->Theta();
563 double eta()
const override {
566 return p4_.load()->Eta();
572 return p4_.load()->Rapidity();
575 double y()
const override {
578 return p4_.load()->Rapidity();
637 int numberOfStripHits_ =
681 double vx()
const override {
686 double vy()
const override {
691 double vz()
const override {
741 virtual float dxy()
const {
746 virtual float dz(
size_t ipv = 0)
const {
748 return dz_ + (*pvRefProd_)[
pvRefKey_].position().z() - (*pvRefProd_)[ipv].position().z();
758 virtual float dz(
const Point &
p)
const;
763 return sqrt((*
m_.load())(4, 4));
768 return sqrt((*
m_.load())(3, 3));
823 int16_t muonFlags = isStandAlone | (2 *
isGlobal);
895 template <
typename Ref>
901 bool isMuon()
const override {
return false; }
908 bool isJet()
const override {
return false; }
913 float p_nolep = 0.0);
965 virtual float dtime(
size_t ipv = 0)
const {
995 friend class ::testPackedCandidate;
1003 void pack(
bool unpackAfterwards =
true);
1005 void packVtx(
bool unpackAfterwards =
true);
1026 delete p4_.exchange(
nullptr);
1027 delete p4c_.exchange(
nullptr);
1028 delete vertex_.exchange(
nullptr);
1048 mutable std::atomic<PolarLorentzVector *>
p4_;
1049 mutable std::atomic<LorentzVector *>
p4c_;
1063 mutable std::atomic<reco::TrackBase::CovarianceMatrix *>
m_;
1080 "Trying to access covariance matrix for a "
1081 "PackedCandidate for which it's not available. "
1082 "Check hasTrackDetails() before!\n");
1087 <<
"Attempting to load multiple covariance version in same process. "
1088 "This is not supported.";
1095 template <
typename,
typename,
typename>
1097 friend class ::OverlapChecker;
ret
prodAgent to be discontinued
bool hasTrackDetails() const
Return true if a bestTrack can be extracted from this Candidate.
Ref masterRef() const
cast master clone reference to a concrete type
static const unsigned int massConstraintTag
do mass constraint flag
bool isElectron() const override
double mass() const override
mass
void setTrackHighPurity(bool highPurity)
set to true if the track had the highPurity quality bit
virtual float phiAtVtx() const
momentum azimuthal angle from the track (normally identical to phi())
reco::VertexRef::key_type pvRefKey_
size_t numberOfDaughters() const override
number of daughters
float rawCaloFraction() const
math::XYZVector Vector
point in the space
const reco::VertexRef vertexRef() const
void setIsIsolatedChargedHadron(bool p)
Fraction of Hcal for HF, neutral hadrons, and charged particles.
uint16_t packCovarianceElement(const reco::TrackBase::CovarianceMatrix &m, int i, int j) const
void setPdgId(int pdgId) override
~PackedCandidate() override
destructor
PackedCandidate * clone() const override
returns a clone of the Candidate object
int stripLayersWithMeasurement() const
const PolarLorentzVector & polarP4() const override
four-momentum Lorentz vector
math::XYZVector Vector
point in the space
bool isStandAloneMuon() const override
double p() const override
magnitude of momentum vector
bool trackHighPurity() const
true if the track had the highPurity quality bit
virtual float time() const
time (wrt nominal zero of the collision)
int pdgId() const override
PDG identifier.
static float unpackTimeWithError(int16_t time, uint8_t timeError)
PackedCovariance packedCovariance_
void setLongLived() override
set long lived flag
double py() const override
y coordinate of momentum vector
void setRawCaloFraction(float p)
Weight from PUPPI removing leptons.
float caloFraction() const
Set the fraction of ECAL+HCAL energy over candidate energy.
static int16_t packTimeNoError(float time)
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
static CovarianceParameterization covarianceParameterization_
PackedCandidate(const reco::Candidate &c, const reco::VertexRefProd &pvRefProd, reco::VertexRef::key_type pvRefKey)
uint16_t covarianceVersion_
static float unpackTimeNoError(int16_t time)
void maybeUnpackCovariance() const
const reco::CandidateBaseRef & masterClone() const override
bool isMuon() const override
math::XYZTLorentzVector LorentzVector
Lorentz vector.
edm::RefVector< pat::PackedCandidateCollection > PackedCandidateRefVector
static constexpr float kMinDEtaToStore_
than at PV) flag for charged hadrons
void setFirstHit(uint16_t pattern)
Set first hit from HitPattern.
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
bool hasMasterClonePtr() const override
void unpackCovarianceElement(reco::TrackBase::CovarianceMatrix &m, uint16_t packed, int i, int j) const
void unpackCovariance() const
const PVAssociationQuality pvAssociationQuality() const
virtual float timeError() const
time measurement uncertainty (-1 if not available)
int charge() const override
electric charge
virtual double ptTrk() const
pt from the track (normally identical to pt())
static uint8_t packTimeError(float timeError)
static to allow unit testing
bool isGlobalMuon() const override
PackedCandidate(const PolarLorentzVector &p4, const Point &vtx, float trkPt, float etaAtVtx, float phiAtVtx, int pdgId, const reco::VertexRefProd &pvRefProd, reco::VertexRef::key_type pvRefKey)
std::atomic< reco::TrackBase::CovarianceMatrix * > m_
IP covariance.
void setCharge(int charge) override
set electric charge
bool isIsolatedChargedHadron_
virtual float dtime(size_t ipv=0) const
dtime with respect to the PV[ipv]
int pixelLayersWithMeasurement() const
float dzError() const override
uncertainty on dz
const uint32_t *__restrict__ Quality * quality
PackedCandidate(PackedCandidate &&iOther)
bool longLived() const override
is long lived?
double mt() const override
transverse mass
uint16_t firstHit() const
Return first hit from HitPattern for tracks with high level details.
static constexpr int EXPO_TIME_NOERROR
double energy() const override
energy
int stripLayersWithMeasurement() const
void setPuppiWeight(float p, float p_nolep=0.0)
PackedCandidate()
default constructor
const reco::Track * bestTrack() const override
return a pointer to the track if present. otherwise, return a null pointer
void setMassConstraint() override
set mass constraint flag
bool isTrackerMuon() const override
double px() const override
x coordinate of momentum vector
int threeCharge() const override
electric charge
double massSqr() const override
mass squared
bool isIsolatedChargedHadron() const
size_t numberOfSourceCandidatePtrs() const override
double pz() const override
z coordinate of momentum vector
virtual float dz(size_t ipv=0) const
dz with respect to the PV[ipv]
static constexpr float MIN_TIME_NOERROR
friend class ShallowClonePtrCandidate
uint8_t normalizedChi2_
track quality information
virtual void setTrackProperties(const reco::Track &tk, int quality, int covarianceVersion)
PackedCandidate & operator=(const PackedCandidate &iOther)
reco::VertexRefProd pvRefProd_
Use these to build a Ref to primary vertex.
void packCovariance(const reco::TrackBase::CovarianceMatrix &m, bool unpackAfterwards=true)
void setTime(float aTime, float aTimeError=0)
set time measurement
virtual void setTrackProperties(const reco::Track &tk, const reco::Track::CovarianceMatrix &covariance, int quality, int covarianceVersion)
CovarianceMatrix covariance() const
return track covariance matrix
static std::once_flag covariance_load_flag
static constexpr int EXPO_TIMEERROR
Vector boostToCM() const override
void maybeUnpackTrack() const
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
const PVAssoc fromPV(size_t ipv=0) const
int numberOfPixelHits() const
reco::CandidateCollection daughters
collection of daughter candidates
double pt() const override
transverse momentum
virtual float dzAssociatedPV() const
dz with respect to the PV ref
reco::CandidatePtr sourceCandidatePtr(size_type i) const override
float rawHcalFraction() const
Set the fraction of Hcal needed isolated charged hadrons.
float unpack(uint16_t packed, int schema, int i, int j, float pt, float eta, int nHits, int pixelHits, float cii=1., float cjj=1.) const
virtual const reco::Track & pseudoTrack() const
Structure Point Contains parameters of Gaussian fits to DMRs.
PackedCandidate & operator=(PackedCandidate &&iOther)
XYZPointD XYZPoint
point in space with cartesian internal representation
static int16_t packTimeWithError(float time, float timeError)
qualityFlagsShiftsAndMasks
uint8_t packedPuppiweight_
bool isCaloMuon() const override
static constexpr float kMinDTrkPtToStore_
float puppiWeight() const
const reco::Candidate * mother(size_type) const override
return mother at a given position (throws an exception)
LostInnerHits
Enumerator specifying the.
PackedCandidate(const PackedCandidate &iOther)
bool hasMasterClone() const override
const reco::CandidatePtr & masterClonePtr() const override
const CovarianceParameterization & covarianceParameterization() const
std::atomic< PolarLorentzVector * > p4_
the four vector
double vy() const override
y coordinate of vertex position
XYZVectorD XYZVector
spatial vector with cartesian internal representation
edm::Ref< VertexCollection > VertexRef
persistent reference to a Vertex
void setMass(double m) override
set particle mass
void packVtx(bool unpackAfterwards=true)
uint16_t covarianceSchema_
const reco::Candidate * daughter(size_type) const override
return daughter at a given position (throws an exception)
static const unsigned int longLivedTag
long lived flag
double phi() const override
momentum azimuthal angle
std::atomic< Point * > vertex_
vertex position
std::atomic< reco::Track * > track_
reco::Track
double vz() const override
z coordinate of vertex position
double mtSqr() const override
transverse mass squared
friend class ShallowCloneCandidate
virtual void setCovarianceVersion(int v)
void setMuonID(bool isStandAlone, bool isGlobal)
PackedCandidate(const LorentzVector &p4, const Point &vtx, float trkPt, float etaAtVtx, float phiAtVtx, int pdgId, const reco::VertexRefProd &pvRefProd, reco::VertexRef::key_type pvRefKey)
void setThreeCharge(int threecharge) override
set electric charge
const LorentzVector & p4() const override
four-momentum Lorentz vecto r
bool isPhoton() const override
void setLostInnerHits(LostInnerHits hits)
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
void setP4(const LorentzVector &p4) override
set 4-momentum
void fillVertexCovariance(CovarianceMatrix &v) const override
fill SMatrix
std::remove_cv< typename std::remove_reference< argument_type >::type >::type key_type
int covarianceSchema() const
double theta() const override
momentum polar angle
std::vector< pat::PackedCandidate > PackedCandidateCollection
void setGoodEgamma(bool isGoodEgamma=true)
bool isJet() const override
double vertexChi2() const override
chi-squares
bool overlap(const reco::Candidate &) const override
check overlap with another Candidate
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
virtual float dxy() const
dxy with respect to the PV ref
virtual void setHits(const reco::Track &tk)
double y() const override
rapidity
double vertexNormalizedChi2() const override
chi-squared divided by n.d.o.f.
int loadedVersion() const
float hcalFraction() const
Vector momentum() const override
spatial momentum vector
void setAssociationQuality(PVAssociationQuality q)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
edm::Ref< Container > Ref
int covarianceVersion() const
static float unpackTimeError(uint8_t timeError)
bool isConvertedPhoton() const override
int8_t packedPuppiweightNoLepDiff_
float dxyError() const override
uncertainty on dxy
void setVertex(const Point &vertex) override
set vertex
void maybeUnpackBoth() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
int pixelLayersWithMeasurement() const
bool isGoodEgamma() const
void setPz(double pz) override
int numberOfValidPixelHits() const
double et2() const override
transverse energy squared (use this for cuts)!
math::XYZPoint Point
point in the space
key_type key() const
Accessor for product key.
void setP4(const PolarLorentzVector &p4) override
set 4-momentum
trackHitShiftsAndMasks
set impact parameters covariance
LostInnerHits lostInnerHits() const
bool massConstraint() const override
do mass constraint?
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
Abs< T >::type abs(const T &t)
double et() const override
transverse energy
void pack(bool unpackAfterwards=true)
int trackerLayersWithMeasurement() const
math::XYZTLorentzVector LorentzVector
Lorentz vector.
int numberOfValidHits() const
virtual float dtimeAssociatedPV() const
dtime with respect to the PV ref
void setStatus(int status) override
set status word
const Point & vertex() const override
vertex position
void setDTimeAssociatedPV(float aTime, float aTimeError=0)
set time measurement
CovarianceMatrix vertexCovariance() const override
return SMatrix
void setRawHcalFraction(float p)
Raw ECAL+HCAL energy over candidate energy for isolated charged hadrons.
math::Error< dimension >::type CovarianceMatrix
5 parameter covariance matrix
virtual float etaAtVtx() const
eta from the track (normally identical to eta())
int pdgId_
PDG identifier.
#define CMS_THREAD_GUARD(_var_)
std::atomic< LorentzVector * > p4c_
static constexpr int EXPO_TIME_WITHERROR
void setCaloFraction(float p)
Fraction of Hcal for isolated charged hadrons.
size_t numberOfMothers() const override
number of mothers
double rapidity() const override
rapidity
int status() const override
status word
double vx() const override
x coordinate of vertex position
double eta() const override
momentum pseudorapidity
float puppiWeightNoLep() const
Weight from full PUPPI.
static constexpr float MIN_TIMEERROR
void setHcalFraction(float p)
Fraction of ECAL+HCAL energy over candidate energy.
edm::Ref< pat::PackedCandidateCollection > PackedCandidateRef
double vertexNdof() const override