1 #ifndef __AnalysisDataFormats_PackedGenParticle_h__ 2 #define __AnalysisDataFormats_PackedGenParticle_h__ 16 class testPackedGenParticle;
21 friend class ::testPackedGenParticle;
41 :
p4_(new PolarLorentzVector(c.
pt(), c.
eta(), c.
phi(), c.
mass())),
p4c_( new LorentzVector(*
p4_)),
vertex_(0,0,0),
pdgId_(c.
pdgId()),
charge_(c.
charge()),
mother_(c.
motherRef(0)),
44 :
p4_(new PolarLorentzVector(c.
pt(), c.
eta(), c.
phi(), c.
mass())),
p4c_(new LorentzVector(*
p4_)),
vertex_(0,0,0),
pdgId_(c.
pdgId()),
charge_(c.
charge()),
mother_(mother),
66 p4_.store(
p4_.exchange(
nullptr) );
67 p4c_.store(
p4c_.exchange(
nullptr) );
78 delete p4_.exchange(iOther.p4_.exchange(
nullptr));
79 delete p4c_.exchange(iOther.p4c_.exchange(
nullptr)) ;
81 delete p4_.exchange(
nullptr);
82 delete p4c_.exchange(
nullptr);
115 if(
mother_->numberOfMothers() > 0)
165 double et()
const override {
return (
pt()<=0) ? 0 :
p4c_.load()->Et(); }
167 double et2()
const override {
return (
pt()<=0) ? 0 :
p4c_.load()->Et2(); }
194 double y()
const override {
if (!
p4c_)
unpack();
return p4_.load()->Rapidity(); }
196 void setP4(
const LorentzVector &
p4 )
override {
202 void setP4(
const PolarLorentzVector &
p4 )
override {
238 virtual float dxy(
const Point &
p)
const ;
240 virtual float dz(
const Point &p)
const ;
248 int status()
const override {
return 1; }
301 template<
typename Ref>
306 bool isMuon()
const override;
313 bool isJet()
const override;
352 void pack(
bool unpackAfterwards=
true) ;
356 mutable std::atomic<PolarLorentzVector*>
p4_;
357 mutable std::atomic<LorentzVector*>
p4c_;
372 template<
typename,
typename,
typename>
friend struct component;
373 friend class ::OverlapChecker;
bool isConvertedPhoton() const override
const reco::Candidate * mother(size_type) const override
return mother at a given position (throws an exception)
bool isTrackerMuon() const override
double py() const override
y coordinate of momentum vector
Point vertex_
vertex position
edm::Ref< Container > Ref
reco::GenStatusFlags & statusFlags()
edm::Ref< pat::PackedGenParticleCollection > PackedGenParticleRef
bool isNonnull() const
Checks for non-null.
static const unsigned int longLivedTag
long lived flag
bool isElectron() const override
get a component
int threeCharge() const override
electric charge
friend class ShallowCloneCandidate
void setMassConstraint() override
set mass constraint flag
double eta() const override
momentum pseudorapidity
bool isGlobalMuon() const override
const reco::Candidate * daughter(size_type) const override
return daughter at a given position (throws an exception)
int pdgId_
PDG identifier.
bool isDirectPromptTauDecayProduct() const
bool fromHardProcessFinalState() const
const PolarLorentzVector & polarP4() const override
four-momentum Lorentz vector
bool isDirectHardProcessTauDecayProduct() const
CovarianceMatrix vertexCovariance() const override
return SMatrix
PackedGenParticle(const PackedGenParticle &iOther)
friend class ShallowClonePtrCandidate
double energy() const override
energy
bool massConstraint() const override
do mass constraint?
const reco::CandidatePtr & masterClonePtr() const override
PackedGenParticle()
default constructor
bool isPhoton() const override
double pz() const override
z coordinate of momentum vector
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
double vz() const override
z coordinate of vertex position
void pack(bool unpackAfterwards=true)
Vector momentum() const override
spatial momentum vector
bool fromHardProcess() const
math::XYZPoint Point
point in the space
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
double px() const override
x coordinate of momentum vector
void setVertex(const Point &vertex) override
set vertex
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
reco::GenParticleRef motherRef() const
direct access to the mother reference (may be null)
PackedGenParticle(const reco::GenParticle &c)
double mass() const override
mass
double pt() const override
transverse momentum
double p() const override
magnitude of momentum vector
bool isDirectPromptTauDecayProductFinalState() const
int status() const override
status word
double theta() const override
momentum polar angle
reco::GenParticleRef mother_
Ref to first mother.
bool isDirectHardProcessTauDecayProductFinalState() const
math::XYZVector Vector
point in the space
bool isCaloMuon() const override
void setPz(double pz) override
bool hasMasterClonePtr() const override
size_t numberOfDaughters() const override
number of daughters
bool isPromptFinalState() const
PackedGenParticle & operator=(PackedGenParticle &&iOther)
~PackedGenParticle() override
destructor
void setThreeCharge(int threecharge) override
set electric charge
bool longLived() const override
is long lived?
const LorentzVector & p4() const override
four-momentum Lorentz vecto r
void setPdgId(int pdgId) override
double massSqr() const override
mass squared
size_t numberOfSourceCandidatePtrs() const override
PackedGenParticle(const reco::GenParticle &c, const edm::Ref< reco::GenParticleCollection > &mother)
const reco::GenParticleRef & lastPrunedRef() const
last surviving in pruned
double vx() const override
x coordinate of vertex position
void setLongLived() override
set long lived flag
double et2() const override
transverse energy squared (use this for cuts)!
static const unsigned int massConstraintTag
do mass constraint flag
reco::CandidateCollection daughters
collection of daughter candidates
std::atomic< PolarLorentzVector * > p4_
the four vector
double et() const override
transverse energy
int pdgId() const override
PDG identifier.
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
reco::CandidatePtr sourceCandidatePtr(size_type i) const override
void setP4(const PolarLorentzVector &p4) override
set 4-momentum
int charge() const override
electric charge
XYZVectorD XYZVector
spatial vector with cartesian internal representation
XYZPointD XYZPoint
point in space with cartesian internal representation
double mtSqr() const override
transverse mass squared
PackedGenParticle(PackedGenParticle &&iOther)
const Point & vertex() const override
vertex position
std::vector< pat::PackedGenParticle > PackedGenParticleCollection
double mt() const override
transverse mass
double vertexNdof() const override
const reco::GenStatusFlags & statusFlags() const
bool isJet() const override
void setStatus(int status) override
set status word
const reco::CandidateBaseRef & masterClone() const override
double vy() const override
y coordinate of vertex position
reco::GenStatusFlags statusFlags_
bool hasMasterClone() const override
double phi() const override
momentum azimuthal angle
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
double y() const override
rapidity
void setP4(const LorentzVector &p4) override
set 4-momentum
Ref masterRef() const
cast master clone reference to a concrete type
edm::RefVector< pat::PackedGenParticleCollection > PackedGenParticleRefVector
double rapidity() const override
rapidity
double vertexNormalizedChi2() const override
chi-squared divided by n.d.o.f.
virtual float dz() const
dz with respect to the PV ref
size_t numberOfMothers() const override
number of mothers
void fillVertexCovariance(CovarianceMatrix &v) const override
fill SMatrix
virtual float dxy() const
dxy with respect to the PV ref
PackedGenParticle * clone() const override
returns a clone of the Candidate object
bool isStandAloneMuon() const override
math::XYZTLorentzVector LorentzVector
Lorentz vector.
bool overlap(const reco::Candidate &) const override
check overlap with another Candidate
double vertexChi2() const override
chi-squares
Vector boostToCM() const override
bool isMuon() const override