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)
188 const LorentzVector&
p4()
const override {
194 const PolarLorentzVector&
polarP4()
const override {
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();
308 void setP4(
const LorentzVector&
p4)
override {
314 void setP4(
const PolarLorentzVector&
p4)
override {
348 virtual float dxy()
const {
353 virtual float dz()
const {
358 virtual float dxy(
const Point&
p)
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 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