CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends
pat::PackedGenParticle Class Reference

#include <PackedGenParticle.h>

Inheritance diagram for pat::PackedGenParticle:
reco::Candidate

Public Types

typedef reco::CandidateCollection daughters
 collection of daughter candidates More...
 
typedef unsigned int index
 
typedef math::XYZTLorentzVector LorentzVector
 Lorentz vector. More...
 
typedef math::XYZPoint Point
 point in the space More...
 
typedef math::PtEtaPhiMLorentzVector PolarLorentzVector
 Lorentz vector. More...
 
enum  PVAssoc { NoPV =0, PVLoose =1, PVTight =2, PVUsedInFit =3 }
 
typedef math::XYZVector Vector
 point in the space More...
 
- Public Types inherited from reco::Candidate
enum  { dimension = 3 }
 
enum  { size = dimension * (dimension + 1)/2 }
 matix size More...
 
typedef int Charge
 electric charge type More...
 
typedef candidate::const_iterator const_iterator
 
typedef math::Error< dimension >::type CovarianceMatrix
 covariance error matrix (3x3) More...
 
typedef unsigned int index
 index type More...
 
typedef candidate::iterator iterator
 
typedef math::XYZTLorentzVector LorentzVector
 Lorentz vector. More...
 
typedef math::XYZPoint Point
 point in the space More...
 
typedef math::PtEtaPhiMLorentzVector PolarLorentzVector
 Lorentz vector. More...
 
typedef size_t size_type
 
typedef math::XYZVector Vector
 point in the space More...
 

Public Member Functions

Vector boostToCM () const override
 
int charge () const override
 electric charge More...
 
PackedGenParticleclone () const override
 returns a clone of the Candidate object More...
 
const reco::Candidatedaughter (size_type) const override
 return daughter at a given position (throws an exception) More...
 
reco::Candidatedaughter (size_type) override
 return daughter at a given position (throws an exception) More...
 
reco::Candidatedaughter (const std::string &s) override
 return daughter with a specified role name More...
 
const reco::Candidatedaughter (const std::string &s) const override
 return daughter with a specified role name More...
 
virtual float dxy () const
 dxy with respect to the PV ref More...
 
virtual float dxy (const Point &p) const
 dxy with respect to another point More...
 
virtual float dz () const
 dz with respect to the PV ref More...
 
virtual float dz (const Point &p) const
 dz with respect to another point More...
 
double energy () const override
 energy More...
 
double et () const override
 transverse energy More...
 
double et2 () const override
 transverse energy squared (use this for cuts)! More...
 
double eta () const override
 momentum pseudorapidity More...
 
void fillVertexCovariance (CovarianceMatrix &v) const override
 fill SMatrix More...
 
bool fromHardProcessFinalState () const
 
bool hasMasterClone () const override
 
bool hasMasterClonePtr () const override
 
bool isCaloMuon () const override
 
bool isConvertedPhoton () const override
 
bool isDirectHardProcessTauDecayProductFinalState () const
 
bool isDirectPromptTauDecayProductFinalState () const
 
bool isElectron () const override
 get a component More...
 
bool isGlobalMuon () const override
 
bool isJet () const override
 
bool isMuon () const override
 
bool isPhoton () const override
 
bool isPromptFinalState () const
 
bool isStandAloneMuon () const override
 
bool isTrackerMuon () const override
 
const reco::GenParticleReflastPrunedRef () const
 last surviving in pruned More...
 
bool longLived () const override
 is long lived? More...
 
double mass () const override
 mass More...
 
bool massConstraint () const override
 do mass constraint? More...
 
double massSqr () const override
 mass squared More...
 
const reco::CandidateBaseRefmasterClone () const override
 
const reco::CandidatePtrmasterClonePtr () const override
 
template<typename Ref >
Ref masterRef () const
 cast master clone reference to a concrete type More...
 
Vector momentum () const override
 spatial momentum vector More...
 
const reco::Candidatemother (size_type) const override
 return mother at a given position (throws an exception) More...
 
reco::GenParticleRef motherRef () const
 direct access to the mother reference (may be null) More...
 
double mt () const override
 transverse mass More...
 
double mtSqr () const override
 transverse mass squared More...
 
size_t numberOfDaughters () const override
 number of daughters More...
 
size_t numberOfMothers () const override
 number of mothers More...
 
size_t numberOfSourceCandidatePtrs () const override
 
PackedGenParticleoperator= (PackedGenParticle &&iOther)
 
PackedGenParticleoperator= (PackedGenParticle const &iOther)
 
double p () const override
 magnitude of momentum vector More...
 
const LorentzVectorp4 () const override
 four-momentum Lorentz vecto r More...
 
 PackedGenParticle ()
 default constructor More...
 
 PackedGenParticle (const reco::GenParticle &c)
 
 PackedGenParticle (const reco::GenParticle &c, const edm::Ref< reco::GenParticleCollection > &mother)
 
 PackedGenParticle (const PackedGenParticle &iOther)
 
 PackedGenParticle (PackedGenParticle &&iOther)
 
int pdgId () const override
 PDG identifier. More...
 
double phi () const override
 momentum azimuthal angle More...
 
const PolarLorentzVectorpolarP4 () const override
 four-momentum Lorentz vector More...
 
double pt () const override
 transverse momentum More...
 
double px () const override
 x coordinate of momentum vector More...
 
double py () const override
 y coordinate of momentum vector More...
 
double pz () const override
 z coordinate of momentum vector More...
 
double rapidity () const override
 rapidity More...
 
void setCharge (int charge) override
 set electric charge More...
 
void setLongLived () override
 set long lived flag More...
 
void setMass (double m) override
 set particle mass More...
 
void setMassConstraint () override
 set mass constraint flag More...
 
void setP4 (const LorentzVector &p4) override
 set 4-momentum More...
 
void setP4 (const PolarLorentzVector &p4) override
 set 4-momentum More...
 
void setPdgId (int pdgId) override
 
void setPz (double pz) override
 
void setStatus (int status) override
 set status word More...
 
void setThreeCharge (int threecharge) override
 set electric charge More...
 
void setVertex (const Point &vertex) override
 set vertex More...
 
reco::CandidatePtr sourceCandidatePtr (size_type i) const override
 
int status () const override
 status word More...
 
const reco::GenStatusFlagsstatusFlags () const
 
reco::GenStatusFlagsstatusFlags ()
 
double theta () const override
 momentum polar angle More...
 
int threeCharge () const override
 electric charge More...
 
const Pointvertex () const override
 vertex position More...
 
double vertexChi2 () const override
 chi-squares More...
 
double vertexCovariance (int i, int j) const override
 (i, j)-th element of error matrix, i, j = 0, ... 2 More...
 
CovarianceMatrix vertexCovariance () const override
 return SMatrix More...
 
double vertexNdof () const override
 
double vertexNormalizedChi2 () const override
 chi-squared divided by n.d.o.f. More...
 
double vx () const override
 x coordinate of vertex position More...
 
double vy () const override
 y coordinate of vertex position More...
 
double vz () const override
 z coordinate of vertex position More...
 
double y () const override
 rapidity More...
 
 ~PackedGenParticle () override
 destructor More...
 
- Public Member Functions inherited from reco::Candidate
const_iterator begin () const
 first daughter const_iterator More...
 
iterator begin ()
 first daughter iterator More...
 
virtual const TrackbestTrack () const
 
 Candidate ()
 default constructor More...
 
virtual float dxyError () const
 uncertainty on dxy More...
 
virtual float dzError () const
 uncertainty on dz More...
 
const_iterator end () const
 last daughter const_iterator More...
 
iterator end ()
 last daughter iterator More...
 
template<typename T >
T get () const
 get a component More...
 
template<typename T , typename Tag >
T get () const
 get a component More...
 
template<typename T >
T get (size_type i) const
 get a component More...
 
template<typename T , typename Tag >
T get (size_type i) const
 get a component More...
 
template<typename Ref >
Ref masterRef () const
 cast master clone reference to a concrete type More...
 
template<typename T >
size_type numberOf () const
 number of components More...
 
template<typename T , typename Tag >
size_type numberOf () const
 number of components More...
 
virtual void setP4 (const PolarLorentzVector &p4)=0
 set 4-momentum More...
 
virtual void setSourceCandidatePtr (const CandidatePtr &ptr)
 Set the ptr to the source Candidate. More...
 
virtual void setVertex (const Point &vertex)=0
 set vertex More...
 
virtual ~Candidate ()
 destructor More...
 

Static Public Attributes

static const unsigned int longLivedTag = 0
 long lived flag More...
 
static const unsigned int massConstraintTag = 0
 do mass constraint flag More...
 

Protected Member Functions

bool overlap (const reco::Candidate &) const override
 check overlap with another Candidate More...
 
void pack (bool unpackAfterwards=true)
 
void unpack () const
 

Protected Attributes

int8_t charge_
 Charge. More...
 
float dphi_
 
float dxy_
 
float dz_
 
reco::GenParticleRef mother_
 Ref to first mother. More...
 
std::atomic< PolarLorentzVector * > p4_
 the four vector More...
 
std::atomic< LorentzVector * > p4c_
 
uint16_t packedM_
 
uint16_t packedPhi_
 
uint16_t packedPt_
 
uint16_t packedY_
 
int pdgId_
 PDG identifier. More...
 
reco::GenStatusFlags statusFlags_
 
Point vertex_
 vertex position More...
 

Friends

class ::OverlapChecker
 
class ::testPackedGenParticle
 
template<typename , typename , typename >
struct component
 
class ShallowCloneCandidate
 
class ShallowClonePtrCandidate
 

Detailed Description

Definition at line 19 of file PackedGenParticle.h.

Member Typedef Documentation

collection of daughter candidates

Definition at line 24 of file PackedGenParticle.h.

typedef unsigned int pat::PackedGenParticle::index

Definition at line 34 of file PackedGenParticle.h.

Lorentz vector.

Definition at line 26 of file PackedGenParticle.h.

point in the space

Definition at line 30 of file PackedGenParticle.h.

Lorentz vector.

Definition at line 28 of file PackedGenParticle.h.

point in the space

Definition at line 32 of file PackedGenParticle.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

pat::PackedGenParticle::PackedGenParticle ( )
inline

default constructor

Definition at line 37 of file PackedGenParticle.h.

Referenced by clone().

38  : packedPt_(0), packedY_(0), packedPhi_(0), packedM_(0),
39  p4_(nullptr), p4c_(nullptr), vertex_(0,0,0), pdgId_(0), charge_(0) { }
Point vertex_
vertex position
int pdgId_
PDG identifier.
std::atomic< LorentzVector * > p4c_
std::atomic< PolarLorentzVector * > p4_
the four vector
pat::PackedGenParticle::PackedGenParticle ( const reco::GenParticle c)
inlineexplicit

Definition at line 40 of file PackedGenParticle.h.

References pack().

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)),
42  statusFlags_(c.statusFlags()) { pack(); }
int pdgId() const final
PDG identifier.
Point vertex_
vertex position
double eta() const final
momentum pseudorapidity
int pdgId_
PDG identifier.
double pt() const final
transverse momentum
int charge() const final
electric charge
Definition: LeafCandidate.h:91
std::atomic< LorentzVector * > p4c_
void pack(bool unpackAfterwards=true)
reco::GenParticleRef mother_
Ref to first mother.
daughters::value_type motherRef(size_type i=0) const
reference to mother at given position
const GenStatusFlags & statusFlags() const
Definition: GenParticle.h:41
std::atomic< PolarLorentzVector * > p4_
the four vector
reco::GenStatusFlags statusFlags_
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
double phi() const final
momentum azimuthal angle
double mass() const final
mass
math::XYZTLorentzVector LorentzVector
Lorentz vector.
pat::PackedGenParticle::PackedGenParticle ( const reco::GenParticle c,
const edm::Ref< reco::GenParticleCollection > &  mother 
)
inlineexplicit

Definition at line 43 of file PackedGenParticle.h.

References pack().

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),
45  statusFlags_(c.statusFlags()) { pack(); }
int pdgId() const final
PDG identifier.
Point vertex_
vertex position
double eta() const final
momentum pseudorapidity
int pdgId_
PDG identifier.
double pt() const final
transverse momentum
int charge() const final
electric charge
Definition: LeafCandidate.h:91
std::atomic< LorentzVector * > p4c_
void pack(bool unpackAfterwards=true)
reco::GenParticleRef mother_
Ref to first mother.
const GenStatusFlags & statusFlags() const
Definition: GenParticle.h:41
std::atomic< PolarLorentzVector * > p4_
the four vector
reco::GenStatusFlags statusFlags_
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
double phi() const final
momentum azimuthal angle
double mass() const final
mass
math::XYZTLorentzVector LorentzVector
Lorentz vector.
pat::PackedGenParticle::PackedGenParticle ( const PackedGenParticle iOther)
inline

Definition at line 47 of file PackedGenParticle.h.

References p4_, and p4c_.

48  : packedPt_(iOther.packedPt_), packedY_(iOther.packedY_), packedPhi_(iOther.packedPhi_), packedM_(iOther.packedM_),
49  p4_(nullptr),p4c_(nullptr),
50  vertex_(iOther.vertex_), dxy_(iOther.dxy_), dz_(iOther.dz_),dphi_(iOther.dphi_),
51  pdgId_(iOther.pdgId_),charge_(iOther.charge_),mother_(iOther.mother_),
52  statusFlags_(iOther.statusFlags_) {
53  if(iOther.p4c_) {
54  p4_.store( new PolarLorentzVector(*iOther.p4_) );
55  p4c_.store( new LorentzVector(*iOther.p4c_) );
56  }
57  }
Point vertex_
vertex position
int pdgId_
PDG identifier.
std::atomic< LorentzVector * > p4c_
reco::GenParticleRef mother_
Ref to first mother.
std::atomic< PolarLorentzVector * > p4_
the four vector
reco::GenStatusFlags statusFlags_
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
math::XYZTLorentzVector LorentzVector
Lorentz vector.
pat::PackedGenParticle::PackedGenParticle ( PackedGenParticle &&  iOther)
inline

Definition at line 59 of file PackedGenParticle.h.

References p4_, and p4c_.

60  : packedPt_(iOther.packedPt_), packedY_(iOther.packedY_), packedPhi_(iOther.packedPhi_), packedM_(iOther.packedM_),
61  p4_(nullptr),p4c_(nullptr),
62  vertex_(std::move(iOther.vertex_)), dxy_(iOther.dxy_), dz_(iOther.dz_),dphi_(iOther.dphi_),
63  pdgId_(iOther.pdgId_),charge_(iOther.charge_),mother_(std::move(iOther.mother_)),
64  statusFlags_(iOther.statusFlags_) {
65  if(iOther.p4c_) {
66  p4_.store( p4_.exchange(nullptr) );
67  p4c_.store( p4c_.exchange(nullptr) );
68  }
69  }
Point vertex_
vertex position
int pdgId_
PDG identifier.
std::atomic< LorentzVector * > p4c_
reco::GenParticleRef mother_
Ref to first mother.
std::atomic< PolarLorentzVector * > p4_
the four vector
reco::GenStatusFlags statusFlags_
def move(src, dest)
Definition: eostools.py:510
pat::PackedGenParticle::~PackedGenParticle ( )
override

destructor

Definition at line 44 of file PackedGenParticle.cc.

References p4_, and p4c_.

Referenced by operator=().

44  {
45  delete p4_.load();
46  delete p4c_.load();
47  }
std::atomic< LorentzVector * > p4c_
std::atomic< PolarLorentzVector * > p4_
the four vector

Member Function Documentation

Vector pat::PackedGenParticle::boostToCM ( ) const
inlineoverridevirtual

boost vector to boost a Lorentz vector to the particle center of mass system

Implements reco::Candidate.

Definition at line 159 of file PackedGenParticle.h.

References p4c_, and unpack().

159 { if (!p4c_) unpack(); return p4c_.load()->BoostToCM(); }
std::atomic< LorentzVector * > p4c_
int pat::PackedGenParticle::charge ( ) const
inlineoverridevirtual

electric charge

Implements reco::Candidate.

Definition at line 142 of file PackedGenParticle.h.

References charge_.

Referenced by overlap(), setCharge(), and threeCharge().

142  {
143  return charge_;
144  }
PackedGenParticle* pat::PackedGenParticle::clone ( void  ) const
inlineoverridevirtual

returns a clone of the Candidate object

Implements reco::Candidate.

Definition at line 265 of file PackedGenParticle.h.

References mps_fire::i, PackedGenParticle(), vertexChi2(), vertexCovariance(), vertexNdof(), and vertexNormalizedChi2().

265  {
266  return new PackedGenParticle( *this );
267  }
PackedGenParticle()
default constructor
const reco::Candidate * pat::PackedGenParticle::daughter ( size_type  ) const
overridevirtual

return daughter at a given position (throws an exception)

Implements reco::Candidate.

Definition at line 97 of file PackedGenParticle.cc.

Referenced by lastPrunedRef(), and operator=().

97  {
98  return nullptr;
99 }
reco::Candidate * pat::PackedGenParticle::daughter ( size_type  )
overridevirtual

return daughter at a given position (throws an exception)

Implements reco::Candidate.

Definition at line 119 of file PackedGenParticle.cc.

119  {
120  return nullptr;
121 }
reco::Candidate * pat::PackedGenParticle::daughter ( const std::string &  s)
overridevirtual

return daughter with a specified role name

Implements reco::Candidate.

Definition at line 111 of file PackedGenParticle.cc.

References Exception, and edm::errors::UnimplementedFeature.

111  {
113  << "This Candidate type does not implement daughter(std::string). "
114  << "Please use CompositeCandidate or NamedCompositeCandidate.\n";
115 }
const reco::Candidate * pat::PackedGenParticle::daughter ( const std::string &  s) const
overridevirtual

return daughter with a specified role name

Implements reco::Candidate.

Definition at line 105 of file PackedGenParticle.cc.

References Exception, and edm::errors::UnimplementedFeature.

105  {
107  << "This Candidate type does not implement daughter(std::string). "
108  << "Please use CompositeCandidate or NamedCompositeCandidate.\n";
109 }
virtual float pat::PackedGenParticle::dxy ( ) const
inlinevirtual

dxy with respect to the PV ref

Definition at line 234 of file PackedGenParticle.h.

References dxy_, and unpack().

Referenced by Electron.Electron::cutBasedId(), ntupleDataFormat.Track::dxyPull(), and dz().

234 { unpack(); return dxy_; }
float pat::PackedGenParticle::dxy ( const Point p) const
virtual

dxy with respect to another point

Definition at line 50 of file PackedGenParticle.cc.

References funct::cos(), p4_, funct::sin(), unpack(), and vertex_.

Referenced by Electron.Electron::cutBasedId(), and ntupleDataFormat.Track::dxyPull().

50  {
51  unpack();
52  return -(vertex_.X()-p.X()) * std::sin(float(p4_.load()->Phi())) + (vertex_.Y()-p.Y()) * std::cos(float(p4_.load()->Phi()));
53 }
Point vertex_
vertex position
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
double p() const override
magnitude of momentum vector
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
std::atomic< PolarLorentzVector * > p4_
the four vector
virtual float pat::PackedGenParticle::dz ( ) const
inlinevirtual

dz with respect to the PV ref

Definition at line 236 of file PackedGenParticle.h.

References dxy(), dz_, p(), and unpack().

Referenced by Electron.Electron::cutBasedId(), and ntupleDataFormat.Track::dzPull().

236 { unpack(); return dz_; }
float pat::PackedGenParticle::dz ( const Point p) const
virtual

dz with respect to another point

Definition at line 54 of file PackedGenParticle.cc.

References funct::cos(), p4_, funct::sin(), unpack(), and vertex_.

Referenced by Electron.Electron::cutBasedId(), and ntupleDataFormat.Track::dzPull().

54  {
55  unpack();
56  return (vertex_.Z()-p.X()) - ((vertex_.X()-p.X()) * std::cos(float(p4_.load()->Phi())) + (vertex_.Y()-p.Y()) * std::sin(float(p4_.load()->Phi()))) * p4_.load()->Pz()/p4_.load()->Pt();
57 }
Point vertex_
vertex position
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
double p() const override
magnitude of momentum vector
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
std::atomic< PolarLorentzVector * > p4_
the four vector
double pat::PackedGenParticle::energy ( ) const
inlineoverridevirtual

energy

Implements reco::Candidate.

Definition at line 163 of file PackedGenParticle.h.

References p4c_, and unpack().

Referenced by Jet.Jet::rawEnergy().

163 { if (!p4c_) unpack(); return p4c_.load()->E(); }
std::atomic< LorentzVector * > p4c_
double pat::PackedGenParticle::et ( ) const
inlineoverridevirtual

transverse energy

Implements reco::Candidate.

Definition at line 165 of file PackedGenParticle.h.

References p4c_, and pt().

165 { return (pt()<=0) ? 0 : p4c_.load()->Et(); }
std::atomic< LorentzVector * > p4c_
double pt() const override
transverse momentum
double pat::PackedGenParticle::et2 ( ) const
inlineoverridevirtual

transverse energy squared (use this for cuts)!

Implements reco::Candidate.

Definition at line 167 of file PackedGenParticle.h.

References p4c_, and pt().

167 { return (pt()<=0) ? 0 : p4c_.load()->Et2(); }
std::atomic< LorentzVector * > p4c_
double pt() const override
transverse momentum
double pat::PackedGenParticle::eta ( ) const
inlineoverridevirtual

momentum pseudorapidity

Implements reco::Candidate.

Definition at line 190 of file PackedGenParticle.h.

References p4_, p4c_, and unpack().

Referenced by Particle.Particle::__str__(), Jet.Jet::jetID(), Jet.Jet::puJetId(), and unpack().

190 { if (!p4c_) unpack(); return p4_.load()->Eta(); }
std::atomic< LorentzVector * > p4c_
std::atomic< PolarLorentzVector * > p4_
the four vector
void pat::PackedGenParticle::fillVertexCovariance ( CovarianceMatrix v) const
overridevirtual

fill SMatrix

Implements reco::Candidate.

Definition at line 140 of file PackedGenParticle.cc.

References Exception, and edm::errors::UnimplementedFeature.

Referenced by vertexCovariance().

140  {
142  << "reco::ConcreteCandidate does not implement vertex covariant matrix.\n";
143 }
bool pat::PackedGenParticle::fromHardProcessFinalState ( ) const
inline

Definition at line 343 of file PackedGenParticle.h.

References reco::GenStatusFlags::fromHardProcess(), status(), and statusFlags_.

343 { return status()==1 && statusFlags_.fromHardProcess(); }
bool fromHardProcess() const
int status() const override
status word
reco::GenStatusFlags statusFlags_
bool pat::PackedGenParticle::hasMasterClone ( ) const
overridevirtual

returns true if this candidate has a reference to a master clone. This only happens if the concrete Candidate type is ShallowCloneCandidate

Implements reco::Candidate.

Definition at line 68 of file PackedGenParticle.cc.

Referenced by vertexCovariance().

68  {
69  return false;
70 }
bool pat::PackedGenParticle::hasMasterClonePtr ( ) const
overridevirtual

returns true if this candidate has a ptr to a master clone. This only happens if the concrete Candidate type is ShallowClonePtrCandidate

Implements reco::Candidate.

Definition at line 72 of file PackedGenParticle.cc.

Referenced by vertexCovariance().

72  {
73  return false;
74 }
bool pat::PackedGenParticle::isCaloMuon ( ) const
overridevirtual

Implements reco::Candidate.

Definition at line 155 of file PackedGenParticle.cc.

Referenced by masterRef().

155 { return false; }
bool pat::PackedGenParticle::isConvertedPhoton ( ) const
overridevirtual

Implements reco::Candidate.

Definition at line 159 of file PackedGenParticle.cc.

Referenced by masterRef().

159 { return false; }
bool pat::PackedGenParticle::isDirectHardProcessTauDecayProductFinalState ( ) const
inline

Definition at line 347 of file PackedGenParticle.h.

References reco::GenStatusFlags::isDirectHardProcessTauDecayProduct(), status(), and statusFlags_.

bool isDirectHardProcessTauDecayProduct() const
int status() const override
status word
reco::GenStatusFlags statusFlags_
bool pat::PackedGenParticle::isDirectPromptTauDecayProductFinalState ( ) const
inline

Definition at line 332 of file PackedGenParticle.h.

References reco::GenStatusFlags::isDirectPromptTauDecayProduct(), status(), and statusFlags_.

bool isDirectPromptTauDecayProduct() const
int status() const override
status word
reco::GenStatusFlags statusFlags_
bool pat::PackedGenParticle::isElectron ( ) const
overridevirtual

get a component

Implements reco::Candidate.

Definition at line 145 of file PackedGenParticle.cc.

Referenced by masterRef().

145 { return false; }
bool pat::PackedGenParticle::isGlobalMuon ( ) const
overridevirtual

Implements reco::Candidate.

Definition at line 149 of file PackedGenParticle.cc.

Referenced by masterRef(), and Muon.Muon::muonID().

149 { return false; }
bool pat::PackedGenParticle::isJet ( ) const
overridevirtual

Implements reco::Candidate.

Definition at line 161 of file PackedGenParticle.cc.

Referenced by masterRef().

161 { return false; }
bool pat::PackedGenParticle::isMuon ( ) const
overridevirtual

Implements reco::Candidate.

Definition at line 147 of file PackedGenParticle.cc.

Referenced by masterRef().

147 { return false; }
bool pat::PackedGenParticle::isPhoton ( ) const
overridevirtual

Implements reco::Candidate.

Definition at line 157 of file PackedGenParticle.cc.

Referenced by masterRef().

157 { return false; }
bool pat::PackedGenParticle::isPromptFinalState ( ) const
inline

Definition at line 328 of file PackedGenParticle.h.

References reco::GenStatusFlags::isPrompt(), status(), and statusFlags_.

328 { return status()==1 && statusFlags_.isPrompt(); }
bool isPrompt() const
int status() const override
status word
reco::GenStatusFlags statusFlags_
bool pat::PackedGenParticle::isStandAloneMuon ( ) const
overridevirtual

Implements reco::Candidate.

Definition at line 151 of file PackedGenParticle.cc.

Referenced by masterRef().

151 { return false; }
bool pat::PackedGenParticle::isTrackerMuon ( ) const
overridevirtual

Implements reco::Candidate.

Definition at line 153 of file PackedGenParticle.cc.

Referenced by masterRef().

153 { return false; }
const reco::GenParticleRef& pat::PackedGenParticle::lastPrunedRef ( ) const
inline

last surviving in pruned

Definition at line 124 of file PackedGenParticle.h.

References daughter(), mother_, alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.

124 { return mother_; }
reco::GenParticleRef mother_
Ref to first mother.
bool pat::PackedGenParticle::longLived ( ) const
overridevirtual

is long lived?

Implements reco::Candidate.

Definition at line 163 of file PackedGenParticle.cc.

Referenced by setLongLived().

163 {return false;}
double pat::PackedGenParticle::mass ( ) const
inlineoverridevirtual

mass

Implements reco::Candidate.

Definition at line 169 of file PackedGenParticle.h.

References p4_, p4c_, and unpack().

Referenced by Particle.Particle::__str__(), and DiObject.DiMuon::__str__().

169 { if (!p4c_) unpack(); return p4_.load()->M(); }
std::atomic< LorentzVector * > p4c_
std::atomic< PolarLorentzVector * > p4_
the four vector
bool pat::PackedGenParticle::massConstraint ( ) const
overridevirtual

do mass constraint?

Implements reco::Candidate.

Definition at line 165 of file PackedGenParticle.cc.

Referenced by setMassConstraint().

165 {return false;}
double pat::PackedGenParticle::massSqr ( ) const
inlineoverridevirtual

mass squared

Implements reco::Candidate.

Definition at line 171 of file PackedGenParticle.h.

References p4_, p4c_, and unpack().

171 { if (!p4c_) unpack(); return p4_.load()->M()*p4_.load()->M(); }
std::atomic< LorentzVector * > p4c_
std::atomic< PolarLorentzVector * > p4_
the four vector
const reco::CandidateBaseRef & pat::PackedGenParticle::masterClone ( ) const
overridevirtual

returns ptr to master clone, if existing. Throws an exception unless the concrete Candidate type is ShallowCloneCandidate

Implements reco::Candidate.

Definition at line 62 of file PackedGenParticle.cc.

References Exception.

Referenced by masterRef(), and vertexCovariance().

62  {
63  throw cms::Exception("Invalid Reference")
64  << "this Candidate has no master clone reference."
65  << "Can't call masterClone() method.\n";
66 }
const reco::CandidatePtr & pat::PackedGenParticle::masterClonePtr ( ) const
overridevirtual

returns ptr to master clone, if existing. Throws an exception unless the concrete Candidate type is ShallowClonePtrCandidate

Implements reco::Candidate.

Definition at line 77 of file PackedGenParticle.cc.

References Exception.

Referenced by vertexCovariance().

77  {
78  throw cms::Exception("Invalid Reference")
79  << "this Candidate has no master clone ptr."
80  << "Can't call masterClonePtr() method.\n";
81 }
template<typename Ref >
Ref pat::PackedGenParticle::masterRef ( ) const
inline

cast master clone reference to a concrete type

Definition at line 302 of file PackedGenParticle.h.

References isCaloMuon(), isConvertedPhoton(), isElectron(), isGlobalMuon(), isJet(), isMuon(), isPhoton(), isStandAloneMuon(), isTrackerMuon(), and masterClone().

302 { return masterClone().template castTo<Ref>(); }
const reco::CandidateBaseRef & masterClone() const override
Vector pat::PackedGenParticle::momentum ( ) const
inlineoverridevirtual

spatial momentum vector

Implements reco::Candidate.

Definition at line 156 of file PackedGenParticle.h.

References p4c_, and unpack().

156 { if (!p4c_) unpack(); return p4c_.load()->Vect(); }
std::atomic< LorentzVector * > p4c_
const reco::Candidate * pat::PackedGenParticle::mother ( size_type  ) const
overridevirtual

return mother at a given position (throws an exception)

Implements reco::Candidate.

Definition at line 101 of file PackedGenParticle.cc.

References edm::Ref< C, T, F >::get(), and motherRef().

Referenced by operator=().

101  {
102  return motherRef().get();
103 }
reco::GenParticleRef motherRef() const
direct access to the mother reference (may be null)
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:245
reco::GenParticleRef pat::PackedGenParticle::motherRef ( ) const
inline

direct access to the mother reference (may be null)

Definition at line 113 of file PackedGenParticle.h.

References edm::Ref< C, T, F >::isAvailable(), edm::Ref< C, T, F >::isNonnull(), and mother_.

Referenced by mother(), and numberOfMothers().

113  {
114  if(mother_.isNonnull() && mother_.isAvailable()&& mother_->status()==1 ){ //if pointing to the pruned version of myself
115  if(mother_->numberOfMothers() > 0)
116  return mother_->motherRef(0); // return my mother's (that is actually myself) mother
117  else
118  return edm::Ref<reco::GenParticleCollection>(); // return null ref
119  } else {
120  return mother_; //the stored ref is really my mother, or null, return that
121  }
122  }
bool isAvailable() const
Definition: Ref.h:577
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:253
reco::GenParticleRef mother_
Ref to first mother.
double pat::PackedGenParticle::mt ( ) const
inlineoverridevirtual

transverse mass

Implements reco::Candidate.

Definition at line 174 of file PackedGenParticle.h.

References p4_, p4c_, and unpack().

174 { if (!p4c_) unpack(); return p4_.load()->Mt(); }
std::atomic< LorentzVector * > p4c_
std::atomic< PolarLorentzVector * > p4_
the four vector
double pat::PackedGenParticle::mtSqr ( ) const
inlineoverridevirtual

transverse mass squared

Implements reco::Candidate.

Definition at line 176 of file PackedGenParticle.h.

References p4_, p4c_, and unpack().

176 { if (!p4c_) unpack(); return p4_.load()->Mt2(); }
std::atomic< LorentzVector * > p4c_
std::atomic< PolarLorentzVector * > p4_
the four vector
size_t pat::PackedGenParticle::numberOfDaughters ( ) const
overridevirtual

number of daughters

Implements reco::Candidate.

Definition at line 83 of file PackedGenParticle.cc.

Referenced by operator=().

83  {
84  return 0;
85 }
size_t pat::PackedGenParticle::numberOfMothers ( ) const
overridevirtual

number of mothers

Implements reco::Candidate.

Definition at line 87 of file PackedGenParticle.cc.

References motherRef().

Referenced by operator=().

87  {
88  if(motherRef().isNonnull()) return 1;
89  return 0;
90 }
reco::GenParticleRef motherRef() const
direct access to the mother reference (may be null)
size_t pat::PackedGenParticle::numberOfSourceCandidatePtrs ( ) const
inlineoverridevirtual

return the number of source Candidates ( the candidates used to construct this Candidate)

Implements reco::Candidate.

Definition at line 134 of file PackedGenParticle.h.

134 {return 0;}
PackedGenParticle& pat::PackedGenParticle::operator= ( PackedGenParticle &&  iOther)
inline

Definition at line 71 of file PackedGenParticle.h.

References charge_, dphi_, dxy_, dz_, mother_, eostools::move(), p4_, p4c_, packedM_, packedPhi_, packedPt_, packedY_, pdgId_, statusFlags_, and vertex_.

71  {
72  if(this != &iOther) {
73  packedPt_ = iOther.packedPt_;
74  packedY_ = iOther.packedY_;
75  packedPhi_ = iOther.packedPhi_;
76  packedM_ = iOther.packedM_;
77  if(p4c_) {
78  delete p4_.exchange(iOther.p4_.exchange(nullptr));
79  delete p4c_.exchange(iOther.p4c_.exchange(nullptr)) ;
80  } else {
81  delete p4_.exchange(nullptr);
82  delete p4c_.exchange(nullptr);
83  }
84  vertex_=std::move(iOther.vertex_);
85  dxy_ = iOther.dxy_;
86  dz_ = iOther.dz_;
87  dphi_ = iOther.dphi_;
88  pdgId_ = iOther.pdgId_;
89  charge_ = iOther.charge_;
90  mother_ = std::move(iOther.mother_);
91  statusFlags_ = iOther.statusFlags_;
92  }
93  return *this;
94  }
Point vertex_
vertex position
int pdgId_
PDG identifier.
std::atomic< LorentzVector * > p4c_
reco::GenParticleRef mother_
Ref to first mother.
std::atomic< PolarLorentzVector * > p4_
the four vector
reco::GenStatusFlags statusFlags_
def move(src, dest)
Definition: eostools.py:510
PackedGenParticle& pat::PackedGenParticle::operator= ( PackedGenParticle const &  iOther)
inline

Definition at line 96 of file PackedGenParticle.h.

References EnergyCorrector::c, daughter(), mother(), eostools::move(), numberOfDaughters(), numberOfMothers(), and ~PackedGenParticle().

96  {
97  PackedGenParticle c(iOther);
98  *this = std::move(c);
99  return *this;
100  }
PackedGenParticle()
default constructor
def move(src, dest)
Definition: eostools.py:510
bool pat::PackedGenParticle::overlap ( const reco::Candidate o) const
overrideprotectedvirtual

check overlap with another Candidate

Implements reco::Candidate.

Definition at line 92 of file PackedGenParticle.cc.

References reco::Candidate::charge(), charge(), reco::Candidate::p4(), p4(), reco::Candidate::vertex(), and vertex().

92  {
93  return p4() == o.p4() && vertex() == o.vertex() && charge() == o.charge();
94 // return p4() == o.p4() && charge() == o.charge();
95 }
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
const LorentzVector & p4() const override
four-momentum Lorentz vecto r
int charge() const override
electric charge
const Point & vertex() const override
vertex position
virtual int charge() const =0
electric charge
virtual const Point & vertex() const =0
vertex position
double pat::PackedGenParticle::p ( ) const
inlineoverridevirtual

magnitude of momentum vector

Implements reco::Candidate.

Definition at line 161 of file PackedGenParticle.h.

References p4c_, and unpack().

Referenced by dz(), and Electron.Electron::ptErr().

161 { if (!p4c_) unpack(); return p4c_.load()->P(); }
std::atomic< LorentzVector * > p4c_
const LorentzVector& pat::PackedGenParticle::p4 ( ) const
inlineoverridevirtual

four-momentum Lorentz vecto r

Implements reco::Candidate.

Definition at line 152 of file PackedGenParticle.h.

References p4c_, and unpack().

Referenced by Tau.Tau::dxy_approx(), Tau.Tau::dz(), overlap(), Lepton.Lepton::p4WithFSR(), setP4(), and unpack().

152 { if (!p4c_) unpack(); return *p4c_; }
std::atomic< LorentzVector * > p4c_
void pat::PackedGenParticle::pack ( bool  unpackAfterwards = true)
protected

Definition at line 7 of file PackedGenParticle.cc.

References MiniFloatConverter::float32to16(), SiStripPI::max, p4_, p4c_, packedM_, packedPhi_, packedPt_, packedY_, and unpack().

Referenced by pyrootRender.interactiveRender::draw(), PackedGenParticle(), setMass(), setP4(), and setPz().

7  {
9  packedY_ = int16_t(p4_.load()->Rapidity()/6.0f*std::numeric_limits<int16_t>::max());
10  packedPhi_ = int16_t(p4_.load()->Phi()/3.2f*std::numeric_limits<int16_t>::max());
12  if (unpackAfterwards) {
13  delete p4_.exchange(nullptr);
14  delete p4c_.exchange(nullptr);
15  unpack(); // force the values to match with the packed ones
16  }
17 }
std::atomic< LorentzVector * > p4c_
static uint16_t float32to16(float x)
Definition: libminifloat.h:17
std::atomic< PolarLorentzVector * > p4_
the four vector
int pat::PackedGenParticle::pdgId ( ) const
inlineoverridevirtual

PDG identifier.

Implements reco::Candidate.

Definition at line 244 of file PackedGenParticle.h.

References pdgId_.

Referenced by Particle.Particle::__str__(), and setPdgId().

244 { return pdgId_; }
int pdgId_
PDG identifier.
double pat::PackedGenParticle::phi ( ) const
inlineoverridevirtual

momentum azimuthal angle

Implements reco::Candidate.

Definition at line 186 of file PackedGenParticle.h.

References p4_, p4c_, and unpack().

Referenced by Particle.Particle::__str__(), ntupleDataFormat.Track::phiPull(), and unpack().

186 { if (!p4c_) unpack(); return p4_.load()->Phi(); }
std::atomic< LorentzVector * > p4c_
std::atomic< PolarLorentzVector * > p4_
the four vector
const PolarLorentzVector& pat::PackedGenParticle::polarP4 ( ) const
inlineoverridevirtual

four-momentum Lorentz vector

Implements reco::Candidate.

Definition at line 154 of file PackedGenParticle.h.

References p4_, p4c_, and unpack().

154 { if (!p4c_) unpack(); return *p4_; }
std::atomic< LorentzVector * > p4c_
std::atomic< PolarLorentzVector * > p4_
the four vector
double pat::PackedGenParticle::pt ( ) const
inlineoverridevirtual
double pat::PackedGenParticle::px ( ) const
inlineoverridevirtual

x coordinate of momentum vector

Implements reco::Candidate.

Definition at line 178 of file PackedGenParticle.h.

References p4c_, and unpack().

178 { if (!p4c_) unpack(); return p4c_.load()->Px(); }
std::atomic< LorentzVector * > p4c_
double pat::PackedGenParticle::py ( ) const
inlineoverridevirtual

y coordinate of momentum vector

Implements reco::Candidate.

Definition at line 180 of file PackedGenParticle.h.

References p4c_, and unpack().

180 { if (!p4c_) unpack(); return p4c_.load()->Py(); }
std::atomic< LorentzVector * > p4c_
double pat::PackedGenParticle::pz ( ) const
inlineoverridevirtual

z coordinate of momentum vector

Implements reco::Candidate.

Definition at line 182 of file PackedGenParticle.h.

References p4c_, and unpack().

Referenced by setPz(), and unpack().

182 { if (!p4c_) unpack(); return p4c_.load()->Pz(); }
std::atomic< LorentzVector * > p4c_
double pat::PackedGenParticle::rapidity ( ) const
inlineoverridevirtual

rapidity

Implements reco::Candidate.

Definition at line 192 of file PackedGenParticle.h.

References p4_, p4c_, and unpack().

192 { if (!p4c_) unpack(); return p4_.load()->Rapidity(); }
std::atomic< LorentzVector * > p4c_
std::atomic< PolarLorentzVector * > p4_
the four vector
void pat::PackedGenParticle::setCharge ( int  charge)
inlineoverridevirtual

set electric charge

Implements reco::Candidate.

Definition at line 146 of file PackedGenParticle.h.

References charge(), and charge_.

146 {charge_=charge;}
int charge() const override
electric charge
void pat::PackedGenParticle::setLongLived ( )
inlineoverridevirtual

set long lived flag

Implements reco::Candidate.

Definition at line 254 of file PackedGenParticle.h.

References longLived().

254 {} /*FIXME*/
void pat::PackedGenParticle::setMass ( double  m)
inlineoverridevirtual

set particle mass

Implements reco::Candidate.

Definition at line 208 of file PackedGenParticle.h.

References funct::m, p4_, p4c_, pack(), and unpack().

208  {
209  if (!p4c_) unpack();
210  *p4_ = PolarLorentzVector(p4_.load()->Pt(), p4_.load()->Eta(), p4_.load()->Phi(), m);
211  pack();
212  }
std::atomic< LorentzVector * > p4c_
void pack(bool unpackAfterwards=true)
std::atomic< PolarLorentzVector * > p4_
the four vector
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
void pat::PackedGenParticle::setMassConstraint ( )
inlineoverridevirtual

set mass constraint flag

Implements reco::Candidate.

Definition at line 260 of file PackedGenParticle.h.

References massConstraint().

260 {} /*FIXME*/
void pat::PackedGenParticle::setP4 ( const LorentzVector p4)
inlineoverridevirtual

set 4-momentum

Implements reco::Candidate.

Definition at line 196 of file PackedGenParticle.h.

References p4_, pack(), and unpack().

Referenced by Jet.Jet::setCorrP4().

196  {
197  unpack(); // changing px,py,pz changes also mapping between dxy,dz and x,y,z
198  *p4_ = PolarLorentzVector(p4.Pt(), p4.Eta(), p4.Phi(), p4.M());
199  pack();
200  }
void pack(bool unpackAfterwards=true)
const LorentzVector & p4() const override
four-momentum Lorentz vecto r
std::atomic< PolarLorentzVector * > p4_
the four vector
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
void pat::PackedGenParticle::setP4 ( const PolarLorentzVector p4)
inlineoverride

set 4-momentum

Definition at line 202 of file PackedGenParticle.h.

References p4(), p4_, pack(), and unpack().

Referenced by Jet.Jet::setCorrP4().

202  {
203  unpack(); // changing px,py,pz changes also mapping between dxy,dz and x,y,z
204  *p4_ = p4;
205  pack();
206  }
void pack(bool unpackAfterwards=true)
const LorentzVector & p4() const override
four-momentum Lorentz vecto r
std::atomic< PolarLorentzVector * > p4_
the four vector
void pat::PackedGenParticle::setPdgId ( int  pdgId)
inlineoverridevirtual

Implements reco::Candidate.

Definition at line 246 of file PackedGenParticle.h.

References pdgId(), and pdgId_.

246 { pdgId_ = pdgId; }
int pdgId_
PDG identifier.
int pdgId() const override
PDG identifier.
void pat::PackedGenParticle::setPz ( double  pz)
inlineoverridevirtual

Implements reco::Candidate.

Definition at line 213 of file PackedGenParticle.h.

References p4_, p4c_, pack(), pz(), and unpack().

213  {
214  unpack(); // changing px,py,pz changes also mapping between dxy,dz and x,y,z
215  *p4c_ = LorentzVector(p4c_.load()->Px(), p4c_.load()->Py(), pz, p4c_.load()->E());
216  *p4_ = PolarLorentzVector(p4c_.load()->Pt(), p4c_.load()->Eta(), p4c_.load()->Phi(), p4c_.load()->M());
217  pack();
218  }
double pz() const override
z coordinate of momentum vector
std::atomic< LorentzVector * > p4c_
void pack(bool unpackAfterwards=true)
std::atomic< PolarLorentzVector * > p4_
the four vector
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
math::XYZTLorentzVector LorentzVector
Lorentz vector.
void pat::PackedGenParticle::setStatus ( int  status)
inlineoverridevirtual

set status word

Implements reco::Candidate.

Definition at line 250 of file PackedGenParticle.h.

250 {} /*FIXME*/
void pat::PackedGenParticle::setThreeCharge ( int  threecharge)
inlineoverridevirtual

set electric charge

Implements reco::Candidate.

Definition at line 150 of file PackedGenParticle.h.

150 {}
void pat::PackedGenParticle::setVertex ( const Point vertex)
inlineoverride

set vertex

Definition at line 228 of file PackedGenParticle.h.

References vertex(), and vertex_.

228 { vertex_ = vertex; }
Point vertex_
vertex position
const Point & vertex() const override
vertex position
reco::CandidatePtr pat::PackedGenParticle::sourceCandidatePtr ( size_type  i) const
inlineoverridevirtual

return a Ptr to one of the source Candidates ( the candidates used to construct this Candidate)

Reimplemented from reco::Candidate.

Definition at line 137 of file PackedGenParticle.h.

137  {
138  return reco::CandidatePtr();
139  }
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
Definition: CandidateFwd.h:25
int pat::PackedGenParticle::status ( ) const
inlineoverridevirtual
const reco::GenStatusFlags& pat::PackedGenParticle::statusFlags ( ) const
inline

Definition at line 315 of file PackedGenParticle.h.

References statusFlags_.

315 { return statusFlags_; }
reco::GenStatusFlags statusFlags_
reco::GenStatusFlags& pat::PackedGenParticle::statusFlags ( )
inline

Definition at line 316 of file PackedGenParticle.h.

References statusFlags_.

316 { return statusFlags_; }
reco::GenStatusFlags statusFlags_
double pat::PackedGenParticle::theta ( ) const
inlineoverridevirtual

momentum polar angle

Implements reco::Candidate.

Definition at line 188 of file PackedGenParticle.h.

References p4_, p4c_, and unpack().

Referenced by Tau.Tau::zImpact().

188 { if (!p4c_) unpack(); return p4_.load()->Theta(); }
std::atomic< LorentzVector * > p4c_
std::atomic< PolarLorentzVector * > p4_
the four vector
int pat::PackedGenParticle::threeCharge ( ) const
inlineoverridevirtual

electric charge

Implements reco::Candidate.

Definition at line 148 of file PackedGenParticle.h.

References charge().

148 {return charge()*3;}
int charge() const override
electric charge
void pat::PackedGenParticle::unpack ( ) const
protected

Definition at line 20 of file PackedGenParticle.cc.

References eta(), MiniFloatConverter::float16to32(), createfilelist::int, funct::m, SiStripPI::max, p4(), p4_, p4c_, packedM_, packedPhi_, packedPt_, packedY_, phi(), pt(), pz(), edm::shift, Validation_hcalonly_cfi::sign, mathSSE::sqrt(), and y().

Referenced by boostToCM(), dxy(), dz(), energy(), eta(), mass(), massSqr(), momentum(), mt(), mtSqr(), p(), p4(), pack(), phi(), polarP4(), pt(), px(), py(), pz(), rapidity(), setMass(), setP4(), setPz(), theta(), and y().

20  {
21  float y = int16_t(packedY_)*6.0f/std::numeric_limits<int16_t>::max();
24  float pz = std::tanh(y)*std::sqrt((m*m+pt*pt)/(1.-std::tanh(y)*std::tanh(y)));
25  float eta = 0;
26  if(pt != 0.) {
27  eta = std::asinh(pz/pt);
28  }
29  double shift = (pt<1. ? 0.1*pt : 0.1/pt); // shift particle phi to break degeneracies in angular separations
30  double sign = ( ( int(pt*10) % 2 == 0 ) ? 1 : -1 ); // introduce a pseudo-random sign of the shift
31  double phi = int16_t(packedPhi_)*3.2f/std::numeric_limits<int16_t>::max() + sign*shift*3.2/std::numeric_limits<int16_t>::max();
32  auto p4 = std::make_unique<PolarLorentzVector>(pt,eta,phi,m);
33  PolarLorentzVector* expectp4 = nullptr;
34  if(p4_.compare_exchange_strong(expectp4,p4.get())) {
35  p4.release();
36  }
37  auto p4c = std::make_unique<LorentzVector>(*p4_);
38  LorentzVector* expectp4c = nullptr;
39  if(p4c_.compare_exchange_strong(expectp4c,p4c.get())) {
40  p4c.release();
41  }
42 }
double eta() const override
momentum pseudorapidity
double pz() const override
z coordinate of momentum vector
static float float16to32(uint16_t h)
Definition: libminifloat.h:12
std::atomic< LorentzVector * > p4c_
double pt() const override
transverse momentum
T sqrt(T t)
Definition: SSEVec.h:18
math::XYZTLorentzVector LorentzVector
const LorentzVector & p4() const override
four-momentum Lorentz vecto r
std::atomic< PolarLorentzVector * > p4_
the four vector
static unsigned int const shift
double phi() const override
momentum azimuthal angle
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
double y() const override
rapidity
const Point& pat::PackedGenParticle::vertex ( ) const
inlineoverridevirtual

vertex position

Implements reco::Candidate.

Definition at line 220 of file PackedGenParticle.h.

References vertex_.

Referenced by Tau.Tau::dxy(), overlap(), and setVertex().

220 { return vertex_; }//{ if (fromPV_) return Point(0,0,0); else return Point(0,0,100); }
Point vertex_
vertex position
double pat::PackedGenParticle::vertexChi2 ( ) const
overridevirtual

chi-squares

Implements reco::Candidate.

Definition at line 123 of file PackedGenParticle.cc.

Referenced by clone().

123  {
124  return 0;
125 }
double pat::PackedGenParticle::vertexCovariance ( int  i,
int  j 
) const
overridevirtual

(i, j)-th element of error matrix, i, j = 0, ... 2

Implements reco::Candidate.

Definition at line 135 of file PackedGenParticle.cc.

References Exception, and edm::errors::UnimplementedFeature.

135  {
137  << "reco::ConcreteCandidate does not implement vertex covariant matrix.\n";
138 }
CovarianceMatrix pat::PackedGenParticle::vertexCovariance ( ) const
inlineoverridevirtual

return SMatrix

Reimplemented from reco::Candidate.

Definition at line 283 of file PackedGenParticle.h.

References fillVertexCovariance(), hasMasterClone(), hasMasterClonePtr(), funct::m, masterClone(), masterClonePtr(), and findQualityFiles::v.

Referenced by clone().

283 { CovarianceMatrix m; fillVertexCovariance(m); return m; }
void fillVertexCovariance(CovarianceMatrix &v) const override
fill SMatrix
double pat::PackedGenParticle::vertexNdof ( ) const
overridevirtual

Number of degrees of freedom Meant to be Double32_t for soft-assignment fitters: tracks may contribute to the vertex with fractional weights. The ndof is then = to the sum of the track weights. see e.g. CMS NOTE-2006/032, CMS NOTE-2004/002

Implements reco::Candidate.

Definition at line 127 of file PackedGenParticle.cc.

Referenced by clone().

127  {
128  return 0;
129 }
double pat::PackedGenParticle::vertexNormalizedChi2 ( ) const
overridevirtual

chi-squared divided by n.d.o.f.

Implements reco::Candidate.

Definition at line 131 of file PackedGenParticle.cc.

Referenced by clone().

131  {
132  return 0;
133 }
double pat::PackedGenParticle::vx ( ) const
inlineoverridevirtual

x coordinate of vertex position

Implements reco::Candidate.

Definition at line 222 of file PackedGenParticle.h.

References vertex_.

222 { return vertex_.X(); }//{ return 0; }
Point vertex_
vertex position
double pat::PackedGenParticle::vy ( ) const
inlineoverridevirtual

y coordinate of vertex position

Implements reco::Candidate.

Definition at line 224 of file PackedGenParticle.h.

References vertex_.

224 { return vertex_.Y(); }//{ return 0; }
Point vertex_
vertex position
double pat::PackedGenParticle::vz ( ) const
inlineoverridevirtual

z coordinate of vertex position

Implements reco::Candidate.

Definition at line 226 of file PackedGenParticle.h.

References vertex_.

226 { return vertex_.Z(); }//{ if (fromPV_) return 0; else return 100; }
Point vertex_
vertex position
double pat::PackedGenParticle::y ( ) const
inlineoverridevirtual

Friends And Related Function Documentation

friend class ::OverlapChecker
friend

Definition at line 373 of file PackedGenParticle.h.

friend class ::testPackedGenParticle
friend

Definition at line 21 of file PackedGenParticle.h.

template<typename , typename , typename >
friend struct component
friend

Definition at line 372 of file PackedGenParticle.h.

friend class ShallowCloneCandidate
friend

Definition at line 374 of file PackedGenParticle.h.

friend class ShallowClonePtrCandidate
friend

Definition at line 375 of file PackedGenParticle.h.

Member Data Documentation

int8_t pat::PackedGenParticle::charge_
protected

Charge.

Definition at line 364 of file PackedGenParticle.h.

Referenced by charge(), operator=(), and setCharge().

float pat::PackedGenParticle::dphi_
protected

Definition at line 360 of file PackedGenParticle.h.

Referenced by operator=().

float pat::PackedGenParticle::dxy_
protected

Definition at line 360 of file PackedGenParticle.h.

Referenced by dxy(), and operator=().

float pat::PackedGenParticle::dz_
protected

Definition at line 360 of file PackedGenParticle.h.

Referenced by dz(), and operator=().

const unsigned int pat::PackedGenParticle::longLivedTag = 0
static

long lived flag

Definition at line 252 of file PackedGenParticle.h.

const unsigned int pat::PackedGenParticle::massConstraintTag = 0
static

do mass constraint flag

Definition at line 258 of file PackedGenParticle.h.

reco::GenParticleRef pat::PackedGenParticle::mother_
protected

Ref to first mother.

Definition at line 366 of file PackedGenParticle.h.

Referenced by lastPrunedRef(), motherRef(), and operator=().

std::atomic<PolarLorentzVector*> pat::PackedGenParticle::p4_
mutableprotected
std::atomic<LorentzVector*> pat::PackedGenParticle::p4c_
mutableprotected
uint16_t pat::PackedGenParticle::packedM_
protected

Definition at line 351 of file PackedGenParticle.h.

Referenced by operator=(), pack(), and unpack().

uint16_t pat::PackedGenParticle::packedPhi_
protected

Definition at line 351 of file PackedGenParticle.h.

Referenced by operator=(), pack(), and unpack().

uint16_t pat::PackedGenParticle::packedPt_
protected

Definition at line 351 of file PackedGenParticle.h.

Referenced by operator=(), pack(), and unpack().

uint16_t pat::PackedGenParticle::packedY_
protected

Definition at line 351 of file PackedGenParticle.h.

Referenced by operator=(), pack(), and unpack().

int pat::PackedGenParticle::pdgId_
protected

PDG identifier.

Definition at line 362 of file PackedGenParticle.h.

Referenced by operator=(), pdgId(), and setPdgId().

reco::GenStatusFlags pat::PackedGenParticle::statusFlags_
protected
Point pat::PackedGenParticle::vertex_
protected

vertex position

Definition at line 359 of file PackedGenParticle.h.

Referenced by dxy(), dz(), operator=(), setVertex(), vertex(), vx(), vy(), and vz().