1 #ifndef __AnalysisDataFormats_PackedGenParticle_h__ 2 #define __AnalysisDataFormats_PackedGenParticle_h__ 16 class testPackedGenParticle;
21 friend class ::testPackedGenParticle;
105 p4_.store(
p4_.exchange(
nullptr));
111 if (
this != &iOther) {
117 delete p4_.exchange(iOther.p4_.exchange(
nullptr));
118 delete p4c_.exchange(iOther.p4c_.exchange(
nullptr));
120 delete p4_.exchange(
nullptr);
121 delete p4c_.exchange(
nullptr);
126 dphi_ = iOther.dphi_;
155 if (
mother_->numberOfMothers() > 0)
203 return p4c_.load()->Vect();
210 return p4c_.load()->BoostToCM();
213 double p()
const override {
216 return p4c_.load()->P();
222 return p4c_.load()->E();
225 double et()
const override {
return (
pt() <= 0) ? 0 :
p4c_.load()->Et(); }
227 double et2()
const override {
return (
pt() <= 0) ? 0 :
p4c_.load()->Et2(); }
232 return p4_.load()->M();
238 return p4_.load()->M() *
p4_.load()->M();
242 double mt()
const override {
245 return p4_.load()->Mt();
251 return p4_.load()->Mt2();
254 double px()
const override {
257 return p4c_.load()->Px();
260 double py()
const override {
263 return p4c_.load()->Py();
266 double pz()
const override {
269 return p4c_.load()->Pz();
272 double pt()
const override {
275 return p4_.load()->Pt();
278 double phi()
const override {
281 return p4_.load()->Phi();
287 return p4_.load()->Theta();
290 double eta()
const override {
293 return p4_.load()->Eta();
299 return p4_.load()->Rapidity();
302 double y()
const override {
305 return p4_.load()->Rapidity();
348 virtual float dxy()
const {
353 virtual float dz()
const {
360 virtual float dz(
const Point&
p)
const;
367 int status()
const override {
return 1; }
422 template <
typename Ref>
429 bool isMuon()
const override;
436 bool isJet()
const override;
478 void pack(
bool unpackAfterwards =
true);
482 mutable std::atomic<PolarLorentzVector*>
p4_;
483 mutable std::atomic<LorentzVector*>
p4c_;
498 template <
typename,
typename,
typename>
500 friend class ::OverlapChecker;
bool hasMasterClone() const override
bool fromHardProcess() const
const Point & vertex() const override
vertex position
bool isDirectHardProcessTauDecayProduct() const
bool isStandAloneMuon() const override
Point vertex_
vertex position
edm::Ref< Container > Ref
reco::GenStatusFlags & statusFlags()
edm::Ref< pat::PackedGenParticleCollection > PackedGenParticleRef
static const unsigned int longLivedTag
long lived flag
reco::GenParticleRef motherRef() const
direct access to the mother reference (may be null)
math::XYZVector Vector
point in the space
friend class ShallowCloneCandidate
const reco::GenParticleRef & lastPrunedRef() const
last surviving in pruned
bool fromHardProcessFinalState() const
void setMassConstraint() override
set mass constraint flag
double et() const override
transverse energy
bool isCaloMuon() const override
bool longLived() const override
is long lived?
Vector boostToCM() const override
int pdgId_
PDG identifier.
int charge() const override
electric charge
virtual float dz() const
dz with respect to the PV ref
double vertexNdof() const override
size_t numberOfDaughters() const override
number of daughters
bool isDirectHardProcessTauDecayProductFinalState() const
bool isNonnull() const
Checks for non-null.
double vy() const override
y coordinate of vertex position
PackedGenParticle(const PackedGenParticle &iOther)
int status() const override
status word
friend class ShallowClonePtrCandidate
bool isDirectPromptTauDecayProduct() const
PackedGenParticle()
default constructor
Ref masterRef() const
cast master clone reference to a concrete type
bool isJet() const override
void setCharge(int charge) override
set electric charge
PackedGenParticle & operator=(PackedGenParticle const &iOther)
std::atomic< LorentzVector * > p4c_
void setMass(double m) override
set particle mass
void pack(bool unpackAfterwards=true)
Vector momentum() const override
spatial momentum vector
math::XYZPoint Point
point in the space
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
virtual float dxy() const
dxy with respect to the PV ref
void setVertex(const Point &vertex) override
set vertex
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
PackedGenParticle(const reco::GenParticle &c)
const LorentzVector & p4() const override
four-momentum Lorentz vecto r
double vertexNormalizedChi2() const override
chi-squared divided by n.d.o.f.
bool hasMasterClonePtr() const override
double pz() const override
z coordinate of momentum vector
void fillVertexCovariance(CovarianceMatrix &v) const override
fill SMatrix
const PolarLorentzVector & polarP4() const override
four-momentum Lorentz vector
double rapidity() const override
rapidity
size_t numberOfMothers() const override
number of mothers
reco::GenParticleRef mother_
Ref to first mother.
math::XYZVector Vector
point in the space
size_t numberOfSourceCandidatePtrs() const override
double vertexChi2() const override
chi-squares
void setPz(double pz) override
bool overlap(const reco::Candidate &) const override
check overlap with another Candidate
double massSqr() const override
mass squared
double et2() const override
transverse energy squared (use this for cuts)!
PackedGenParticle & operator=(PackedGenParticle &&iOther)
int pdgId() const override
PDG identifier.
~PackedGenParticle() override
destructor
void setThreeCharge(int threecharge) override
set electric charge
void setPdgId(int pdgId) override
bool isElectron() const override
get a component
int threeCharge() const override
electric charge
double phi() const override
momentum azimuthal angle
PackedGenParticle(const reco::GenParticle &c, const edm::Ref< reco::GenParticleCollection > &mother)
const reco::CandidatePtr & masterClonePtr() const override
void setLongLived() override
set long lived flag
bool massConstraint() const override
do mass constraint?
const reco::CandidateBaseRef & masterClone() const override
bool isPromptFinalState() const
double mtSqr() const override
transverse mass squared
double px() const override
x coordinate of momentum vector
static const unsigned int massConstraintTag
do mass constraint flag
reco::CandidateCollection daughters
collection of daughter candidates
bool isDirectPromptTauDecayProductFinalState() const
std::atomic< PolarLorentzVector * > p4_
the four vector
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
bool isConvertedPhoton() const override
void setP4(const PolarLorentzVector &p4) override
set 4-momentum
double py() const override
y coordinate of momentum vector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
double vx() const override
x coordinate of vertex position
XYZPointD XYZPoint
point in space with cartesian internal representation
const reco::Candidate * daughter(size_type) const override
return daughter at a given position (throws an exception)
double vz() const override
z coordinate of vertex position
double y() const override
rapidity
PackedGenParticle(PackedGenParticle &&iOther)
PackedGenParticle * clone() const override
returns a clone of the Candidate object
double mass() const override
mass
std::vector< pat::PackedGenParticle > PackedGenParticleCollection
math::XYZTLorentzVector LorentzVector
Lorentz vector.
reco::CandidatePtr sourceCandidatePtr(size_type i) const override
void setStatus(int status) override
set status word
const reco::Candidate * mother(size_type) const override
return mother at a given position (throws an exception)
Structure Point Contains parameters of Gaussian fits to DMRs.
bool isGlobalMuon() const override
double eta() const override
momentum pseudorapidity
reco::GenStatusFlags statusFlags_
bool isTrackerMuon() const override
double pt() const override
transverse momentum
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
bool isPhoton() const override
void setP4(const LorentzVector &p4) override
set 4-momentum
double energy() const override
energy
edm::RefVector< pat::PackedGenParticleCollection > PackedGenParticleRefVector
double theta() const override
momentum polar angle
CovarianceMatrix vertexCovariance() const override
return SMatrix
double p() const override
magnitude of momentum vector
bool isMuon() const override
math::XYZTLorentzVector LorentzVector
Lorentz vector.
double mt() const override
transverse mass
const reco::GenStatusFlags & statusFlags() const
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.