CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Types | 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

virtual const_iterator begin () const
 first daughter const_iterator More...
 
virtual iterator begin ()
 first daughter iterator More...
 
virtual Vector boostToCM () const
 
virtual int charge () const
 electric charge More...
 
virtual PackedGenParticleclone () const
 returns a clone of the Candidate object More...
 
virtual const reco::Candidatedaughter (size_type) const
 return daughter at a given position (throws an exception) More...
 
virtual reco::Candidatedaughter (size_type)
 return daughter at a given position (throws an exception) More...
 
virtual reco::Candidatedaughter (const std::string &s)
 return daughter with a specified role name More...
 
virtual const reco::Candidatedaughter (const std::string &s) const
 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...
 
virtual const_iterator end () const
 last daughter const_iterator More...
 
virtual iterator end ()
 last daughter iterator More...
 
virtual double energy () const
 energy More...
 
virtual double et () const
 transverse energy More...
 
virtual float eta () const
 momentum pseudorapidity More...
 
virtual void fillVertexCovariance (CovarianceMatrix &v) const
 fill SMatrix More...
 
virtual bool hasMasterClone () const
 
virtual bool hasMasterClonePtr () const
 
virtual bool isCaloMuon () const
 
virtual bool isConvertedPhoton () const
 
virtual bool isElectron () const
 get a component More...
 
virtual bool isGlobalMuon () const
 
virtual bool isJet () const
 
virtual bool isMuon () const
 
virtual bool isPhoton () const
 
virtual bool isStandAloneMuon () const
 
virtual bool isTrackerMuon () const
 
virtual bool longLived () const
 is long lived? More...
 
virtual float mass () const
 mass More...
 
virtual bool massConstraint () const
 do mass constraint? More...
 
virtual float massSqr () const
 mass squared More...
 
virtual const
reco::CandidateBaseRef
masterClone () const
 
virtual const reco::CandidatePtrmasterClonePtr () const
 
template<typename Ref >
Ref masterRef () const
 cast master clone reference to a concrete type More...
 
virtual Vector momentum () const
 spatial momentum vector More...
 
virtual const reco::Candidatemother (size_type) const
 return mother at a given position (throws an exception) More...
 
virtual double mt () const
 transverse mass More...
 
virtual double mtSqr () const
 transverse mass squared More...
 
virtual size_t numberOfDaughters () const
 number of daughters More...
 
virtual size_t numberOfMothers () const
 number of mothers More...
 
virtual size_t numberOfSourceCandidatePtrs () const
 
virtual double p () const
 magnitude of momentum vector More...
 
virtual const LorentzVectorp4 () const
 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)
 
virtual int pdgId () const
 PDG identifier. More...
 
virtual float phi () const
 momentum azimuthal angle More...
 
virtual const PolarLorentzVectorpolarP4 () const
 four-momentum Lorentz vector More...
 
virtual float pt () const
 transverse momentum More...
 
virtual double px () const
 x coordinate of momentum vector More...
 
virtual double py () const
 y coordinate of momentum vector More...
 
virtual double pz () const
 z coordinate of momentum vector More...
 
virtual double rapidity () const
 rapidity More...
 
virtual void setCharge (int charge)
 set electric charge More...
 
virtual void setLongLived ()
 set long lived flag More...
 
virtual void setMass (double m)
 set particle mass More...
 
virtual void setMassConstraint ()
 set mass constraint flag More...
 
virtual void setP4 (const LorentzVector &p4)
 set 4-momentum More...
 
virtual void setP4 (const PolarLorentzVector &p4)
 set 4-momentum More...
 
virtual void setPdgId (int pdgId)
 
virtual void setPz (double pz)
 
virtual void setStatus (int status)
 set status word More...
 
virtual void setThreeCharge (int threecharge)
 set electric charge More...
 
virtual void setVertex (const Point &vertex)
 set vertex More...
 
virtual reco::CandidatePtr sourceCandidatePtr (size_type i) const
 
virtual int status () const
 status word More...
 
virtual double theta () const
 momentum polar angle More...
 
virtual int threeCharge () const
 electric charge More...
 
virtual const Pointvertex () const
 vertex position More...
 
virtual double vertexChi2 () const
 chi-squares More...
 
virtual double vertexCovariance (int i, int j) const
 (i, j)-th element of error matrix, i, j = 0, ... 2 More...
 
CovarianceMatrix vertexCovariance () const
 return SMatrix More...
 
virtual double vertexNdof () const
 
virtual double vertexNormalizedChi2 () const
 chi-squared divided by n.d.o.f. More...
 
virtual double vx () const
 x coordinate of vertex position More...
 
virtual double vy () const
 y coordinate of vertex position More...
 
virtual double vz () const
 z coordinate of vertex position More...
 
virtual double y () const
 rapidity More...
 
virtual ~PackedGenParticle ()
 destructor More...
 
- Public Member Functions inherited from reco::Candidate
template<typename S >
daughter_iterator< S >::type beginFilter (const S &s) const
 
 Candidate ()
 default constructor More...
 
template<typename S >
daughter_iterator< S >::type endFilter (const S &s) const
 
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

virtual bool overlap (const reco::Candidate &) const
 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...
 
PolarLorentzVector p4_
 the four vector More...
 
LorentzVector p4c_
 
uint16_t packedEta_
 
uint16_t packedM_
 
uint16_t packedPhi_
 
uint16_t packedPt_
 
int pdgId_
 PDG identifier. More...
 
bool unpacked_
 
Point vertex_
 vertex position More...
 

Private Types

typedef
reco::candidate::const_iterator_imp_specific
< daughters
const_iterator_imp_specific
 
typedef
reco::candidate::iterator_imp_specific
< daughters
iterator_imp_specific
 

Friends

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

Detailed Description

Definition at line 17 of file PackedGenParticle.h.

Member Typedef Documentation

Definition at line 320 of file PackedGenParticle.h.

collection of daughter candidates

Definition at line 20 of file PackedGenParticle.h.

typedef unsigned int pat::PackedGenParticle::index

Definition at line 30 of file PackedGenParticle.h.

Definition at line 322 of file PackedGenParticle.h.

Lorentz vector.

Definition at line 22 of file PackedGenParticle.h.

point in the space

Definition at line 26 of file PackedGenParticle.h.

Lorentz vector.

Definition at line 24 of file PackedGenParticle.h.

point in the space

Definition at line 28 of file PackedGenParticle.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

pat::PackedGenParticle::PackedGenParticle ( )
inline

default constructor

Definition at line 33 of file PackedGenParticle.h.

Referenced by clone().

34  : p4_(0,0,0,0), p4c_(0,0,0,0), vertex_(0,0,0), pdgId_(0), charge_(0), unpacked_(false) { }
Point vertex_
vertex position
int pdgId_
PDG identifier.
PolarLorentzVector p4_
the four vector
pat::PackedGenParticle::PackedGenParticle ( const reco::GenParticle c)
inlineexplicit

Definition at line 35 of file PackedGenParticle.h.

References pack().

36  : p4_(c.pt(), c.eta(), c.phi(), c.mass()), p4c_(p4_), vertex_(0,0,0), pdgId_(c.pdgId()), charge_(c.charge()), mother_(c.motherRef(0)), unpacked_(true) { pack(); }
Point vertex_
vertex position
virtual int pdgId() const GCC11_FINAL
PDG identifier.
int pdgId_
PDG identifier.
PolarLorentzVector p4_
the four vector
void pack(bool unpackAfterwards=true)
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
reco::GenParticleRef mother_
Ref to first mother.
daughters::value_type motherRef(size_type i=0) const
reference to mother at given position
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
virtual float mass() const GCC11_FINAL
mass
virtual int charge() const GCC11_FINAL
electric charge
virtual float pt() const GCC11_FINAL
transverse momentum
pat::PackedGenParticle::PackedGenParticle ( const reco::GenParticle c,
const edm::Ref< reco::GenParticleCollection > &  mother 
)
inlineexplicit

Definition at line 37 of file PackedGenParticle.h.

References pack().

38  : p4_(c.pt(), c.eta(), c.phi(), c.mass()), p4c_(p4_), vertex_(0,0,0), pdgId_(c.pdgId()), charge_(c.charge()), mother_(mother), unpacked_(true) { pack(); }
Point vertex_
vertex position
virtual int pdgId() const GCC11_FINAL
PDG identifier.
int pdgId_
PDG identifier.
PolarLorentzVector p4_
the four vector
void pack(bool unpackAfterwards=true)
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
reco::GenParticleRef mother_
Ref to first mother.
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
virtual float mass() const GCC11_FINAL
mass
virtual int charge() const GCC11_FINAL
electric charge
virtual float pt() const GCC11_FINAL
transverse momentum
pat::PackedGenParticle::~PackedGenParticle ( )
virtual

destructor

Definition at line 25 of file PackedGenParticle.cc.

25 { }

Member Function Documentation

pat::PackedGenParticle::const_iterator pat::PackedGenParticle::begin ( void  ) const
virtual

first daughter const_iterator

Implements reco::Candidate.

Definition at line 40 of file PackedGenParticle.cc.

40  {
42 }
candidate::const_iterator const_iterator
Definition: Candidate.h:35
reco::candidate::const_iterator_imp_specific< daughters > const_iterator_imp_specific
pat::PackedGenParticle::iterator pat::PackedGenParticle::begin ( void  )
virtual

first daughter iterator

Implements reco::Candidate.

Definition at line 48 of file PackedGenParticle.cc.

48  {
49  return iterator( new iterator_imp_specific );
50 }
reco::candidate::iterator_imp_specific< daughters > iterator_imp_specific
candidate::iterator iterator
Definition: Candidate.h:36
virtual Vector pat::PackedGenParticle::boostToCM ( ) const
inlinevirtual

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

Implements reco::Candidate.

Definition at line 92 of file PackedGenParticle.h.

References p4c_, unpack(), and unpacked_.

92 { if (!unpacked_) unpack(); return p4c_.BoostToCM(); }
virtual int pat::PackedGenParticle::charge ( ) const
inlinevirtual

electric charge

Implements reco::Candidate.

Definition at line 75 of file PackedGenParticle.h.

References charge_.

Referenced by setCharge(), and threeCharge().

75  {
76  return charge_;
77  }
virtual PackedGenParticle* pat::PackedGenParticle::clone ( void  ) const
inlinevirtual

returns a clone of the Candidate object

Implements reco::Candidate.

Definition at line 196 of file PackedGenParticle.h.

References PackedGenParticle().

196  {
197  return new PackedGenParticle( *this );
198  }
PackedGenParticle()
default constructor
const reco::Candidate * pat::PackedGenParticle::daughter ( size_type  ) const
virtual

return daughter at a given position (throws an exception)

Implements reco::Candidate.

Definition at line 90 of file PackedGenParticle.cc.

90  {
91  return 0;
92 }
reco::Candidate * pat::PackedGenParticle::daughter ( size_type  )
virtual

return daughter at a given position (throws an exception)

Implements reco::Candidate.

Definition at line 112 of file PackedGenParticle.cc.

112  {
113  return 0;
114 }
reco::Candidate * pat::PackedGenParticle::daughter ( const std::string &  s)
virtual

return daughter with a specified role name

Implements reco::Candidate.

Definition at line 104 of file PackedGenParticle.cc.

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

104  {
106  << "This Candidate type does not implement daughter(std::string). "
107  << "Please use CompositeCandidate or NamedCompositeCandidate.\n";
108 }
const reco::Candidate * pat::PackedGenParticle::daughter ( const std::string &  s) const
virtual

return daughter with a specified role name

Implements reco::Candidate.

Definition at line 98 of file PackedGenParticle.cc.

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

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

dxy with respect to the PV ref

Definition at line 165 of file PackedGenParticle.h.

References dxy_, and unpack().

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

dxy with respect to another point

Definition at line 28 of file PackedGenParticle.cc.

References funct::cos(), funct::sin(), and timeUnitHelper::unpack().

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

dz with respect to the PV ref

Definition at line 167 of file PackedGenParticle.h.

References dz_, and unpack().

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

dz with respect to another point

Definition at line 32 of file PackedGenParticle.cc.

References funct::cos(), funct::sin(), and timeUnitHelper::unpack().

32  {
33  unpack();
34  return (vertex_.Z()-p.X()) - ((vertex_.X()-p.X()) * std::cos(float(p4_.Phi())) + (vertex_.Y()-p.Y()) * std::sin(float(p4_.Phi()))) * p4_.Pz()/p4_.Pt();
35 }
Point vertex_
vertex position
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
PolarLorentzVector p4_
the four vector
virtual double p() const
magnitude of momentum vector
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
pat::PackedGenParticle::const_iterator pat::PackedGenParticle::end ( void  ) const
virtual

last daughter const_iterator

Implements reco::Candidate.

Definition at line 44 of file PackedGenParticle.cc.

Referenced by Types.LuminosityBlockRange::cppID(), and Types.EventRange::cppID().

44  {
46 }
candidate::const_iterator const_iterator
Definition: Candidate.h:35
reco::candidate::const_iterator_imp_specific< daughters > const_iterator_imp_specific
pat::PackedGenParticle::iterator pat::PackedGenParticle::end ( void  )
virtual

last daughter iterator

Implements reco::Candidate.

Definition at line 52 of file PackedGenParticle.cc.

Referenced by Types.LuminosityBlockRange::cppID(), and Types.EventRange::cppID().

52  {
53  return iterator( new iterator_imp_specific );
54 }
reco::candidate::iterator_imp_specific< daughters > iterator_imp_specific
candidate::iterator iterator
Definition: Candidate.h:36
virtual double pat::PackedGenParticle::energy ( ) const
inlinevirtual

energy

Implements reco::Candidate.

Definition at line 96 of file PackedGenParticle.h.

References p4c_, unpack(), and unpacked_.

96 { if (!unpacked_) unpack(); return p4c_.E(); }
virtual double pat::PackedGenParticle::et ( ) const
inlinevirtual

transverse energy

Implements reco::Candidate.

Definition at line 98 of file PackedGenParticle.h.

References p4_, unpack(), and unpacked_.

98 { if (!unpacked_) unpack(); return p4_.Et(); }
PolarLorentzVector p4_
the four vector
virtual float pat::PackedGenParticle::eta ( ) const
inlinevirtual

momentum pseudorapidity

Implements reco::Candidate.

Definition at line 121 of file PackedGenParticle.h.

References p4_, unpack(), and unpacked_.

121 { if (!unpacked_) unpack(); return p4_.Eta(); }
PolarLorentzVector p4_
the four vector
void pat::PackedGenParticle::fillVertexCovariance ( CovarianceMatrix v) const
virtual

fill SMatrix

Implements reco::Candidate.

Definition at line 133 of file PackedGenParticle.cc.

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

Referenced by vertexCovariance().

133  {
135  << "reco::ConcreteCandidate does not implement vertex covariant matrix.\n";
136 }
bool pat::PackedGenParticle::hasMasterClone ( ) const
virtual

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 62 of file PackedGenParticle.cc.

62  {
63  return false;
64 }
bool pat::PackedGenParticle::hasMasterClonePtr ( ) const
virtual

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 66 of file PackedGenParticle.cc.

66  {
67  return false;
68 }
bool pat::PackedGenParticle::isCaloMuon ( ) const
virtual

Implements reco::Candidate.

Definition at line 148 of file PackedGenParticle.cc.

148 { return false; }
bool pat::PackedGenParticle::isConvertedPhoton ( ) const
virtual

Implements reco::Candidate.

Definition at line 152 of file PackedGenParticle.cc.

152 { return false; }
bool pat::PackedGenParticle::isElectron ( ) const
virtual

get a component

Implements reco::Candidate.

Definition at line 138 of file PackedGenParticle.cc.

138 { return false; }
bool pat::PackedGenParticle::isGlobalMuon ( ) const
virtual

Implements reco::Candidate.

Definition at line 142 of file PackedGenParticle.cc.

142 { return false; }
bool pat::PackedGenParticle::isJet ( ) const
virtual

Implements reco::Candidate.

Definition at line 154 of file PackedGenParticle.cc.

154 { return false; }
bool pat::PackedGenParticle::isMuon ( ) const
virtual

Implements reco::Candidate.

Definition at line 140 of file PackedGenParticle.cc.

140 { return false; }
bool pat::PackedGenParticle::isPhoton ( ) const
virtual

Implements reco::Candidate.

Definition at line 150 of file PackedGenParticle.cc.

150 { return false; }
bool pat::PackedGenParticle::isStandAloneMuon ( ) const
virtual

Implements reco::Candidate.

Definition at line 144 of file PackedGenParticle.cc.

144 { return false; }
bool pat::PackedGenParticle::isTrackerMuon ( ) const
virtual

Implements reco::Candidate.

Definition at line 146 of file PackedGenParticle.cc.

146 { return false; }
bool pat::PackedGenParticle::longLived ( ) const
virtual

is long lived?

Implements reco::Candidate.

Definition at line 156 of file PackedGenParticle.cc.

156 {return false;}
virtual float pat::PackedGenParticle::mass ( ) const
inlinevirtual

mass

Implements reco::Candidate.

Definition at line 100 of file PackedGenParticle.h.

References p4_, unpack(), and unpacked_.

100 { if (!unpacked_) unpack(); return p4_.M(); }
PolarLorentzVector p4_
the four vector
bool pat::PackedGenParticle::massConstraint ( ) const
virtual

do mass constraint?

Implements reco::Candidate.

Definition at line 158 of file PackedGenParticle.cc.

158 {return false;}
virtual float pat::PackedGenParticle::massSqr ( ) const
inlinevirtual

mass squared

Implements reco::Candidate.

Definition at line 102 of file PackedGenParticle.h.

References p4_, unpack(), and unpacked_.

102 { if (!unpacked_) unpack(); return p4_.M()*p4_.M(); }
PolarLorentzVector p4_
the four vector
const reco::CandidateBaseRef & pat::PackedGenParticle::masterClone ( ) const
virtual

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

Implements reco::Candidate.

Definition at line 56 of file PackedGenParticle.cc.

References edm::hlt::Exception.

Referenced by masterRef().

56  {
57  throw cms::Exception("Invalid Reference")
58  << "this Candidate has no master clone reference."
59  << "Can't call masterClone() method.\n";
60 }
const reco::CandidatePtr & pat::PackedGenParticle::masterClonePtr ( ) const
virtual

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

Implements reco::Candidate.

Definition at line 71 of file PackedGenParticle.cc.

References edm::hlt::Exception.

71  {
72  throw cms::Exception("Invalid Reference")
73  << "this Candidate has no master clone ptr."
74  << "Can't call masterClonePtr() method.\n";
75 }
template<typename Ref >
Ref pat::PackedGenParticle::masterRef ( ) const
inline

cast master clone reference to a concrete type

Definition at line 233 of file PackedGenParticle.h.

References masterClone().

233 { return masterClone().template castTo<Ref>(); }
virtual const reco::CandidateBaseRef & masterClone() const
virtual Vector pat::PackedGenParticle::momentum ( ) const
inlinevirtual

spatial momentum vector

Implements reco::Candidate.

Definition at line 89 of file PackedGenParticle.h.

References p4c_, unpack(), and unpacked_.

89 { if (!unpacked_) unpack(); return p4c_.Vect(); }
const reco::Candidate * pat::PackedGenParticle::mother ( size_type  ) const
virtual

return mother at a given position (throws an exception)

Implements reco::Candidate.

Definition at line 94 of file PackedGenParticle.cc.

References reco::Candidate::get().

94  {
95  return mother_.get();
96 }
reco::GenParticleRef mother_
Ref to first mother.
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:242
virtual double pat::PackedGenParticle::mt ( ) const
inlinevirtual

transverse mass

Implements reco::Candidate.

Definition at line 105 of file PackedGenParticle.h.

References p4_, unpack(), and unpacked_.

105 { if (!unpacked_) unpack(); return p4_.Mt(); }
PolarLorentzVector p4_
the four vector
virtual double pat::PackedGenParticle::mtSqr ( ) const
inlinevirtual

transverse mass squared

Implements reco::Candidate.

Definition at line 107 of file PackedGenParticle.h.

References p4_, unpack(), and unpacked_.

107 { if (!unpacked_) unpack(); return p4_.Mt2(); }
PolarLorentzVector p4_
the four vector
size_t pat::PackedGenParticle::numberOfDaughters ( ) const
virtual

number of daughters

Implements reco::Candidate.

Definition at line 77 of file PackedGenParticle.cc.

77  {
78  return 0;
79 }
size_t pat::PackedGenParticle::numberOfMothers ( ) const
virtual

number of mothers

Implements reco::Candidate.

Definition at line 81 of file PackedGenParticle.cc.

81  {
82  return 0;
83 }
virtual size_t pat::PackedGenParticle::numberOfSourceCandidatePtrs ( ) const
inlinevirtual

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

Implements reco::Candidate.

Definition at line 67 of file PackedGenParticle.h.

67 {return 0;}
bool pat::PackedGenParticle::overlap ( const reco::Candidate o) const
protectedvirtual

check overlap with another Candidate

Implements reco::Candidate.

Definition at line 85 of file PackedGenParticle.cc.

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

85  {
86  return p4() == o.p4() && vertex() == o.vertex() && charge() == o.charge();
87 // return p4() == o.p4() && charge() == o.charge();
88 }
virtual const Point & vertex() const
vertex position
virtual const LorentzVector & p4() const
four-momentum Lorentz vecto r
virtual const Point & vertex() const =0
vertex position
virtual int charge() const =0
electric charge
virtual int charge() const
electric charge
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
virtual double pat::PackedGenParticle::p ( ) const
inlinevirtual

magnitude of momentum vector

Implements reco::Candidate.

Definition at line 94 of file PackedGenParticle.h.

References p4c_, unpack(), and unpacked_.

94 { if (!unpacked_) unpack(); return p4c_.P(); }
virtual const LorentzVector& pat::PackedGenParticle::p4 ( ) const
inlinevirtual

four-momentum Lorentz vecto r

Implements reco::Candidate.

Definition at line 85 of file PackedGenParticle.h.

References p4c_, unpack(), and unpacked_.

Referenced by setP4().

85 { if (!unpacked_) unpack(); return p4c_; }
void pat::PackedGenParticle::pack ( bool  unpackAfterwards = true)
protected

Definition at line 7 of file PackedGenParticle.cc.

References MiniFloatConverter::float32to16(), max(), p4_, packedEta_, packedM_, packedPhi_, packedPt_, and unpack().

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

7  {
9  packedEta_ = int16_t(p4_.Eta()/6.0f*std::numeric_limits<int16_t>::max());
10  packedPhi_ = int16_t(p4_.Phi()/3.2f*std::numeric_limits<int16_t>::max());
12  if (unpackAfterwards) unpack(); // force the values to match with the packed ones
13 }
PolarLorentzVector p4_
the four vector
const T & max(const T &a, const T &b)
static uint16_t float32to16(float x)
Definition: libminifloat.h:15
virtual int pat::PackedGenParticle::pdgId ( ) const
inlinevirtual

PDG identifier.

Implements reco::Candidate.

Definition at line 175 of file PackedGenParticle.h.

References pdgId_.

Referenced by setPdgId().

175 { return pdgId_; }
int pdgId_
PDG identifier.
virtual float pat::PackedGenParticle::phi ( ) const
inlinevirtual

momentum azimuthal angle

Implements reco::Candidate.

Definition at line 117 of file PackedGenParticle.h.

References p4_, unpack(), and unpacked_.

117 { if (!unpacked_) unpack(); return p4_.Phi(); }
PolarLorentzVector p4_
the four vector
virtual const PolarLorentzVector& pat::PackedGenParticle::polarP4 ( ) const
inlinevirtual

four-momentum Lorentz vector

Implements reco::Candidate.

Definition at line 87 of file PackedGenParticle.h.

References p4_, unpack(), and unpacked_.

87 { if (!unpacked_) unpack(); return p4_; }
PolarLorentzVector p4_
the four vector
virtual float pat::PackedGenParticle::pt ( ) const
inlinevirtual

transverse momentum

Implements reco::Candidate.

Definition at line 115 of file PackedGenParticle.h.

References p4_, unpack(), and unpacked_.

115 { if (!unpacked_) unpack(); return p4_.Pt();}
PolarLorentzVector p4_
the four vector
virtual double pat::PackedGenParticle::px ( ) const
inlinevirtual

x coordinate of momentum vector

Implements reco::Candidate.

Definition at line 109 of file PackedGenParticle.h.

References p4c_, unpack(), and unpacked_.

109 { if (!unpacked_) unpack(); return p4c_.Px(); }
virtual double pat::PackedGenParticle::py ( ) const
inlinevirtual

y coordinate of momentum vector

Implements reco::Candidate.

Definition at line 111 of file PackedGenParticle.h.

References p4c_, unpack(), and unpacked_.

111 { if (!unpacked_) unpack(); return p4c_.Py(); }
virtual double pat::PackedGenParticle::pz ( ) const
inlinevirtual

z coordinate of momentum vector

Implements reco::Candidate.

Definition at line 113 of file PackedGenParticle.h.

References p4c_, unpack(), and unpacked_.

Referenced by setPz().

113 { if (!unpacked_) unpack(); return p4c_.Pz(); }
virtual double pat::PackedGenParticle::rapidity ( ) const
inlinevirtual

rapidity

Implements reco::Candidate.

Definition at line 123 of file PackedGenParticle.h.

References p4_, unpack(), and unpacked_.

123 { if (!unpacked_) unpack(); return p4_.Rapidity(); }
PolarLorentzVector p4_
the four vector
virtual void pat::PackedGenParticle::setCharge ( int  charge)
inlinevirtual

set electric charge

Implements reco::Candidate.

Definition at line 79 of file PackedGenParticle.h.

References charge(), and charge_.

79 {charge_=charge;}
virtual int charge() const
electric charge
virtual void pat::PackedGenParticle::setLongLived ( )
inlinevirtual

set long lived flag

Implements reco::Candidate.

Definition at line 185 of file PackedGenParticle.h.

185 {} /*FIXME*/
virtual void pat::PackedGenParticle::setMass ( double  m)
inlinevirtual

set particle mass

Implements reco::Candidate.

Definition at line 139 of file PackedGenParticle.h.

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

139  {
140  if (!unpacked_) unpack();
141  p4_ = PolarLorentzVector(p4_.Pt(), p4_.Eta(), p4_.Phi(), m);
142  pack();
143  }
PolarLorentzVector p4_
the four vector
void pack(bool unpackAfterwards=true)
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
virtual void pat::PackedGenParticle::setMassConstraint ( )
inlinevirtual

set mass constraint flag

Implements reco::Candidate.

Definition at line 191 of file PackedGenParticle.h.

191 {} /*FIXME*/
virtual void pat::PackedGenParticle::setP4 ( const LorentzVector p4)
inlinevirtual

set 4-momentum

Implements reco::Candidate.

Definition at line 127 of file PackedGenParticle.h.

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

127  {
128  unpack(); // changing px,py,pz changes also mapping between dxy,dz and x,y,z
129  p4_ = PolarLorentzVector(p4.Pt(), p4.Eta(), p4.Phi(), p4.M());
130  pack();
131  }
PolarLorentzVector p4_
the four vector
void pack(bool unpackAfterwards=true)
virtual const LorentzVector & p4() const
four-momentum Lorentz vecto r
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
virtual void pat::PackedGenParticle::setP4 ( const PolarLorentzVector p4)
inlinevirtual

set 4-momentum

Definition at line 133 of file PackedGenParticle.h.

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

133  {
134  unpack(); // changing px,py,pz changes also mapping between dxy,dz and x,y,z
135  p4_ = p4;
136  pack();
137  }
PolarLorentzVector p4_
the four vector
void pack(bool unpackAfterwards=true)
virtual const LorentzVector & p4() const
four-momentum Lorentz vecto r
virtual void pat::PackedGenParticle::setPdgId ( int  pdgId)
inlinevirtual

Implements reco::Candidate.

Definition at line 177 of file PackedGenParticle.h.

References pdgId(), and pdgId_.

177 { pdgId_ = pdgId; }
int pdgId_
PDG identifier.
virtual int pdgId() const
PDG identifier.
virtual void pat::PackedGenParticle::setPz ( double  pz)
inlinevirtual

Implements reco::Candidate.

Definition at line 144 of file PackedGenParticle.h.

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

144  {
145  unpack(); // changing px,py,pz changes also mapping between dxy,dz and x,y,z
146  p4c_ = LorentzVector(p4c_.Px(), p4c_.Py(), pz, p4c_.E());
147  p4_ = PolarLorentzVector(p4c_.Pt(), p4c_.Eta(), p4c_.Phi(), p4c_.M());
148  pack();
149  }
virtual double pz() const
z coordinate of momentum vector
PolarLorentzVector p4_
the four vector
void pack(bool unpackAfterwards=true)
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
math::XYZTLorentzVector LorentzVector
Lorentz vector.
virtual void pat::PackedGenParticle::setStatus ( int  status)
inlinevirtual

set status word

Implements reco::Candidate.

Definition at line 181 of file PackedGenParticle.h.

181 {} /*FIXME*/
virtual void pat::PackedGenParticle::setThreeCharge ( int  threecharge)
inlinevirtual

set electric charge

Implements reco::Candidate.

Definition at line 83 of file PackedGenParticle.h.

83 {}
virtual void pat::PackedGenParticle::setVertex ( const Point vertex)
inlinevirtual

set vertex

Definition at line 159 of file PackedGenParticle.h.

References vertex(), and vertex_.

159 { vertex_ = vertex; }
Point vertex_
vertex position
virtual const Point & vertex() const
vertex position
virtual reco::CandidatePtr pat::PackedGenParticle::sourceCandidatePtr ( size_type  i) const
inlinevirtual

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

Reimplemented from reco::Candidate.

Definition at line 70 of file PackedGenParticle.h.

70  {
71  return reco::CandidatePtr();
72  }
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
Definition: CandidateFwd.h:25
virtual int pat::PackedGenParticle::status ( ) const
inlinevirtual

status word

Implements reco::Candidate.

Definition at line 179 of file PackedGenParticle.h.

179 { return 1; } /*FIXME*/
virtual double pat::PackedGenParticle::theta ( ) const
inlinevirtual

momentum polar angle

Implements reco::Candidate.

Definition at line 119 of file PackedGenParticle.h.

References p4_, unpack(), and unpacked_.

119 { if (!unpacked_) unpack(); return p4_.Theta(); }
PolarLorentzVector p4_
the four vector
virtual int pat::PackedGenParticle::threeCharge ( ) const
inlinevirtual

electric charge

Implements reco::Candidate.

Definition at line 81 of file PackedGenParticle.h.

References charge().

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

Definition at line 16 of file PackedGenParticle.cc.

References f, MiniFloatConverter::float16to32(), and max().

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

16  {
21  p4c_ = p4_;
22  unpacked_ = true;
23 }
static float float16to32(uint16_t h)
Definition: libminifloat.h:10
PolarLorentzVector p4_
the four vector
const T & max(const T &a, const T &b)
double f[11][100]
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
virtual const Point& pat::PackedGenParticle::vertex ( ) const
inlinevirtual

vertex position

Implements reco::Candidate.

Definition at line 151 of file PackedGenParticle.h.

References vertex_.

Referenced by setVertex().

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

chi-squares

Implements reco::Candidate.

Definition at line 116 of file PackedGenParticle.cc.

116  {
117  return 0;
118 }
double pat::PackedGenParticle::vertexCovariance ( int  i,
int  j 
) const
virtual

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

Implements reco::Candidate.

Definition at line 128 of file PackedGenParticle.cc.

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

128  {
130  << "reco::ConcreteCandidate does not implement vertex covariant matrix.\n";
131 }
CovarianceMatrix pat::PackedGenParticle::vertexCovariance ( ) const
inlinevirtual

return SMatrix

Reimplemented from reco::Candidate.

Definition at line 214 of file PackedGenParticle.h.

References fillVertexCovariance(), and m.

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

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 120 of file PackedGenParticle.cc.

120  {
121  return 0;
122 }
double pat::PackedGenParticle::vertexNormalizedChi2 ( ) const
virtual

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

Implements reco::Candidate.

Definition at line 124 of file PackedGenParticle.cc.

124  {
125  return 0;
126 }
virtual double pat::PackedGenParticle::vx ( ) const
inlinevirtual

x coordinate of vertex position

Implements reco::Candidate.

Definition at line 153 of file PackedGenParticle.h.

References vertex_.

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

y coordinate of vertex position

Implements reco::Candidate.

Definition at line 155 of file PackedGenParticle.h.

References vertex_.

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

z coordinate of vertex position

Implements reco::Candidate.

Definition at line 157 of file PackedGenParticle.h.

References vertex_.

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

Friends And Related Function Documentation

friend class ::OverlapChecker
friend

Definition at line 314 of file PackedGenParticle.h.

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

Definition at line 313 of file PackedGenParticle.h.

friend class ShallowCloneCandidate
friend

Definition at line 315 of file PackedGenParticle.h.

friend class ShallowClonePtrCandidate
friend

Definition at line 316 of file PackedGenParticle.h.

Member Data Documentation

int8_t pat::PackedGenParticle::charge_
protected

Charge.

Definition at line 305 of file PackedGenParticle.h.

Referenced by charge(), and setCharge().

float pat::PackedGenParticle::dphi_
mutableprotected

Definition at line 301 of file PackedGenParticle.h.

float pat::PackedGenParticle::dxy_
mutableprotected

Definition at line 301 of file PackedGenParticle.h.

Referenced by dxy().

float pat::PackedGenParticle::dz_
mutableprotected

Definition at line 301 of file PackedGenParticle.h.

Referenced by dz().

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

long lived flag

Definition at line 183 of file PackedGenParticle.h.

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

do mass constraint flag

Definition at line 189 of file PackedGenParticle.h.

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

Ref to first mother.

Definition at line 307 of file PackedGenParticle.h.

PolarLorentzVector pat::PackedGenParticle::p4_
mutableprotected

the four vector

Definition at line 297 of file PackedGenParticle.h.

Referenced by et(), eta(), mass(), massSqr(), mt(), mtSqr(), pack(), phi(), polarP4(), pt(), rapidity(), setMass(), setP4(), setPz(), theta(), and y().

LorentzVector pat::PackedGenParticle::p4c_
mutableprotected

Definition at line 298 of file PackedGenParticle.h.

Referenced by boostToCM(), energy(), momentum(), p(), p4(), px(), py(), pz(), and setPz().

uint16_t pat::PackedGenParticle::packedEta_
protected

Definition at line 292 of file PackedGenParticle.h.

Referenced by pack().

uint16_t pat::PackedGenParticle::packedM_
protected

Definition at line 292 of file PackedGenParticle.h.

Referenced by pack().

uint16_t pat::PackedGenParticle::packedPhi_
protected

Definition at line 292 of file PackedGenParticle.h.

Referenced by pack().

uint16_t pat::PackedGenParticle::packedPt_
protected

Definition at line 292 of file PackedGenParticle.h.

Referenced by pack().

int pat::PackedGenParticle::pdgId_
protected

PDG identifier.

Definition at line 303 of file PackedGenParticle.h.

Referenced by pdgId(), and setPdgId().

bool pat::PackedGenParticle::unpacked_
mutableprotected
Point pat::PackedGenParticle::vertex_
mutableprotected

vertex position

Definition at line 300 of file PackedGenParticle.h.

Referenced by setVertex(), vertex(), vx(), vy(), and vz().