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);
84 vertex_=std::move(iOther.vertex_);
90 mother_ = std::move(iOther.mother_);
154 double et()
const {
return (
pt()<=0) ? 0 :
p4c_.load()->Et(); }
156 double et2()
const {
return (
pt()<=0) ? 0 :
p4c_.load()->Et2(); }
227 virtual float dxy(
const Point &
p)
const ;
229 virtual float dz(
const Point &
p)
const ;
290 template<
typename Ref>
295 virtual bool isMuon()
const;
302 virtual bool isJet()
const;
341 void pack(
bool unpackAfterwards=
true) ;
345 mutable std::atomic<PolarLorentzVector*>
p4_;
346 mutable std::atomic<LorentzVector*>
p4c_;
361 template<
typename,
typename,
typename>
friend struct component;
362 friend class ::OverlapChecker;
virtual PackedGenParticle * clone() const
returns a clone of the Candidate object
virtual double vx() const
x coordinate of vertex position
virtual void setStatus(int status)
set status word
virtual double pz() const
z coordinate of momentum vector
Point vertex_
vertex position
virtual Vector boostToCM() const
edm::Ref< Container > Ref
reco::GenStatusFlags & statusFlags()
edm::Ref< pat::PackedGenParticleCollection > PackedGenParticleRef
virtual void fillVertexCovariance(CovarianceMatrix &v) const
fill SMatrix
static const unsigned int longLivedTag
long lived flag
CovarianceMatrix vertexCovariance() const
return SMatrix
virtual size_t numberOfMothers() const
number of mothers
math::XYZVector Vector
point in the space
friend class ShallowCloneCandidate
virtual void setVertex(const Point &vertex)
set vertex
virtual double vertexNdof() const
virtual int threeCharge() const
electric charge
int pdgId_
PDG identifier.
virtual void setP4(const PolarLorentzVector &p4)
set 4-momentum
bool isDirectPromptTauDecayProduct() const
virtual void setP4(const LorentzVector &p4)
set 4-momentum
bool fromHardProcessFinalState() const
virtual double vy() const
y coordinate of vertex position
virtual int status() const
status word
virtual bool isTrackerMuon() const
virtual reco::CandidatePtr sourceCandidatePtr(size_type i) const
bool isDirectHardProcessTauDecayProduct() const
virtual bool isJet() const
virtual ~PackedGenParticle()
destructor
PackedGenParticle(const PackedGenParticle &iOther)
virtual double pt() const
transverse momentum
virtual const reco::Candidate * daughter(size_type) const
return daughter at a given position (throws an exception)
friend class ShallowClonePtrCandidate
virtual double mtSqr() const
transverse mass squared
virtual size_t numberOfSourceCandidatePtrs() const
PackedGenParticle()
default constructor
virtual bool isElectron() const
get a component
virtual double theta() const
momentum polar angle
virtual bool isPhoton() const
PackedGenParticle & operator=(PackedGenParticle const &iOther)
std::atomic< LorentzVector * > p4c_
void pack(bool unpackAfterwards=true)
virtual double phi() const
momentum azimuthal angle
bool fromHardProcess() const
virtual Vector momentum() const
spatial momentum vector
math::XYZPoint Point
point in the space
virtual double vertexNormalizedChi2() const
chi-squared divided by n.d.o.f.
virtual double p() const
magnitude of momentum vector
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
virtual void setLongLived()
set long lived flag
PackedGenParticle(const reco::GenParticle &c)
virtual void setThreeCharge(int threecharge)
set electric charge
virtual double massSqr() const
mass squared
bool isDirectPromptTauDecayProductFinalState() const
virtual void setPz(double pz)
reco::GenParticleRef mother_
Ref to first mother.
virtual void setMassConstraint()
set mass constraint flag
virtual double eta() const
momentum pseudorapidity
bool isDirectHardProcessTauDecayProductFinalState() const
virtual bool isMuon() const
virtual const Point & vertex() const
vertex position
virtual bool longLived() const
is long lived?
math::XYZVector Vector
point in the space
virtual const reco::CandidateBaseRef & masterClone() const
virtual double vertexChi2() const
chi-squares
virtual size_t numberOfDaughters() const
number of daughters
virtual const LorentzVector & p4() const
four-momentum Lorentz vecto r
virtual bool isStandAloneMuon() const
bool isPromptFinalState() const
virtual const reco::CandidatePtr & masterClonePtr() const
PackedGenParticle & operator=(PackedGenParticle &&iOther)
virtual double mt() const
transverse mass
virtual bool hasMasterClonePtr() const
const reco::GenParticleRef & motherRef() const
direct access to the mother reference (may be null)
PackedGenParticle(const reco::GenParticle &c, const edm::Ref< reco::GenParticleCollection > &mother)
virtual void setPdgId(int pdgId)
virtual double y() const
rapidity
static const unsigned int massConstraintTag
do mass constraint flag
virtual int pdgId() const
PDG identifier.
reco::CandidateCollection daughters
collection of daughter candidates
virtual bool overlap(const reco::Candidate &) const
check overlap with another Candidate
virtual const PolarLorentzVector & polarP4() const
four-momentum Lorentz vector
std::atomic< PolarLorentzVector * > p4_
the four vector
virtual bool hasMasterClone() const
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
XYZVectorD XYZVector
spatial vector with cartesian internal representation
XYZPointD XYZPoint
point in space with cartesian internal representation
PackedGenParticle(PackedGenParticle &&iOther)
std::vector< pat::PackedGenParticle > PackedGenParticleCollection
const reco::GenStatusFlags & statusFlags() const
math::XYZTLorentzVector LorentzVector
Lorentz vector.
virtual double energy() const
energy
virtual bool isCaloMuon() const
virtual bool isGlobalMuon() const
virtual const reco::Candidate * mother(size_type) const
return mother at a given position (throws an exception)
virtual double rapidity() const
rapidity
virtual double mass() const
mass
virtual int charge() const
electric charge
virtual bool isConvertedPhoton() const
reco::GenStatusFlags statusFlags_
math::XYZPoint Point
point in the space
virtual bool massConstraint() const
do mass constraint?
double et2() const
transverse energy squared (use this for cuts)!
virtual void setCharge(int charge)
set electric charge
virtual double py() const
y coordinate of momentum vector
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
double et() const
transverse energy
virtual void setMass(double m)
set particle mass
virtual double px() const
x coordinate of momentum vector
Ref masterRef() const
cast master clone reference to a concrete type
edm::RefVector< pat::PackedGenParticleCollection > PackedGenParticleRefVector
virtual float dz() const
dz with respect to the PV ref
virtual float dxy() const
dxy with respect to the PV ref
math::XYZTLorentzVector LorentzVector
Lorentz vector.
virtual double vz() const
z coordinate of vertex position
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.