CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
reco::Particle Class Reference

#include <Particle.h>

Public Types

typedef int Charge
 electric charge type 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...
 
typedef math::XYZVector Vector
 point in the space More...
 

Public Member Functions

Vector boostToCM () const
 
int charge () const
 electric charge More...
 
void construct (int qx3, float pt, float eta, float phi, float mass, const Point &vtx, int pdgId, int status)
 
double energy () const
 energy More...
 
double et () const
 transverse energy More...
 
double et2 () const
 transverse energy squared (use this for cut!) More...
 
double eta () const
 momentum pseudorapidity More...
 
bool longLived () const
 is long lived? More...
 
double mass () const
 mass More...
 
bool massConstraint () const
 do mass constraint? More...
 
double massSqr () const
 mass squared More...
 
Vector momentum () const
 spatial momentum vector More...
 
double mt () const
 transverse mass More...
 
double mtSqr () const
 transverse mass squared More...
 
Particleoperator= (Particle &&)=default
 
Particleoperator= (Particle const &)=default
 
double p () const
 magnitude of momentum vector More...
 
const LorentzVectorp4 () const
 four-momentum Lorentz vector More...
 
template<typename... Args>
 Particle (Args &&... args)
 
 Particle (Particle &&)=default
 
 Particle (Particle &rh)
 
 Particle (Particle const &)=default
 
int pdgId () const
 PDG identifier. More...
 
double phi () const
 momentum azimuthal angle More...
 
const PolarLorentzVectorpolarP4 () const
 four-momentum Lorentz vector More...
 
double pt () const
 transverse momentum More...
 
double px () const
 x coordinate of momentum vector More...
 
double py () const
 y coordinate of momentum vector More...
 
double pz () const
 z coordinate of momentum vector More...
 
double rapidity () const
 rapidity More...
 
void setCharge (Charge q)
 set electric charge More...
 
void setLongLived ()
 
void setMass (double m)
 set particle mass More...
 
void setMassConstraint ()
 
void setP4 (const LorentzVector &p4)
 set 4-momentum More...
 
void setP4 (const PolarLorentzVector &p4)
 set 4-momentum More...
 
void setPdgId (int pdgId)
 
void setPz (double pz)
 
void setStatus (int status)
 set status word More...
 
void setThreeCharge (Charge qx3)
 set electric charge More...
 
void setVertex (const Point &vertex)
 set vertex More...
 
int status () const
 status word More...
 
double theta () const
 momentum polar angle More...
 
int threeCharge () const
 electric charge More...
 
const Pointvertex () const
 vertex position (overwritten by PF...) More...
 
double vx () const
 x coordinate of vertex position More...
 
double vy () const
 y coordinate of vertex position More...
 
double vz () const
 z coordinate of vertex position More...
 
double y () const
 rapidity More...
 
virtual ~Particle ()
 destructor More...
 

Private Attributes

ParticleState m_state
 

Detailed Description

Base class describing a generic reconstructed particle its main subclass is Candidate

Author
Luca Lista, INFN

Definition at line 16 of file Particle.h.

Member Typedef Documentation

◆ Charge

electric charge type

Definition at line 19 of file Particle.h.

◆ index

typedef unsigned int reco::Particle::index

Definition at line 29 of file Particle.h.

◆ LorentzVector

Lorentz vector.

Definition at line 21 of file Particle.h.

◆ Point

point in the space

Definition at line 25 of file Particle.h.

◆ PolarLorentzVector

Lorentz vector.

Definition at line 23 of file Particle.h.

◆ Vector

point in the space

Definition at line 27 of file Particle.h.

Constructor & Destructor Documentation

◆ Particle() [1/4]

template<typename... Args>
reco::Particle::Particle ( Args &&...  args)
inlineexplicit

Definition at line 33 of file Particle.h.

33 : m_state(std::forward<Args>(args)...) {}

◆ Particle() [2/4]

reco::Particle::Particle ( Particle rh)
inline

Definition at line 35 of file Particle.h.

35 : m_state(rh.m_state) {}

◆ Particle() [3/4]

reco::Particle::Particle ( Particle &&  )
default

◆ Particle() [4/4]

reco::Particle::Particle ( Particle const &  )
default

◆ ~Particle()

virtual reco::Particle::~Particle ( )
inlinevirtual

destructor

Definition at line 77 of file Particle.h.

77 {}

Member Function Documentation

◆ boostToCM()

Vector reco::Particle::boostToCM ( ) const
inline

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

Definition at line 95 of file Particle.h.

95 { return m_state.boostToCM(); }

References reco::ParticleState::boostToCM(), and m_state.

◆ charge()

int reco::Particle::charge ( ) const
inline

electric charge

Definition at line 80 of file Particle.h.

80 { return m_state.charge(); }

References reco::ParticleState::charge(), and m_state.

◆ construct()

void reco::Particle::construct ( int  qx3,
float  pt,
float  eta,
float  phi,
float  mass,
const Point vtx,
int  pdgId,
int  status 
)
inline

Definition at line 72 of file Particle.h.

72  {
73  m_state = ParticleState(qx3, PolarLorentzVector(pt, eta, phi, mass), vtx, pdgId, status, false);
74  }

References eta(), m_state, mass(), pdgId(), phi(), pt(), status(), and extraflags_cff::vtx.

◆ energy()

double reco::Particle::energy ( ) const
inline

energy

Definition at line 99 of file Particle.h.

99 { return m_state.energy(); }

References reco::ParticleState::energy(), and m_state.

Referenced by EmDQMReco::analyze(), and Jet.Jet::rawEnergy().

◆ et()

double reco::Particle::et ( ) const
inline

transverse energy

Definition at line 101 of file Particle.h.

101 { return m_state.et(); }

References reco::ParticleState::et(), and m_state.

◆ et2()

double reco::Particle::et2 ( ) const
inline

transverse energy squared (use this for cut!)

Definition at line 103 of file Particle.h.

103 { return m_state.et2(); }

References reco::ParticleState::et2(), and m_state.

◆ eta()

double reco::Particle::eta ( ) const
inline

momentum pseudorapidity

Definition at line 126 of file Particle.h.

126 { return m_state.eta(); }

References reco::ParticleState::eta(), and m_state.

Referenced by Particle.Particle::__str__(), DQMExample_Step1::analyze(), construct(), Jet.Jet::jetID(), and Jet.Jet::puJetId().

◆ longLived()

bool reco::Particle::longLived ( ) const
inline

is long lived?

Definition at line 161 of file Particle.h.

161 { return m_state.longLived(); }

References reco::ParticleState::longLived(), and m_state.

◆ mass()

double reco::Particle::mass ( ) const
inline

mass

Definition at line 105 of file Particle.h.

105 { return m_state.mass(); }

References m_state, and reco::ParticleState::mass().

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

◆ massConstraint()

bool reco::Particle::massConstraint ( ) const
inline

do mass constraint?

Definition at line 166 of file Particle.h.

166 { return m_state.massConstraint(); }

References m_state, and reco::ParticleState::massConstraint().

◆ massSqr()

double reco::Particle::massSqr ( ) const
inline

mass squared

Definition at line 107 of file Particle.h.

107 { return mass() * mass(); }

References mass().

◆ momentum()

Vector reco::Particle::momentum ( ) const
inline

spatial momentum vector

Definition at line 92 of file Particle.h.

92 { return m_state.momentum(); }

References m_state, and reco::ParticleState::momentum().

◆ mt()

double reco::Particle::mt ( ) const
inline

transverse mass

Definition at line 110 of file Particle.h.

110 { return m_state.mt(); }

References m_state, and reco::ParticleState::mt().

◆ mtSqr()

double reco::Particle::mtSqr ( ) const
inline

transverse mass squared

Definition at line 112 of file Particle.h.

112 { return m_state.mtSqr(); }

References m_state, and reco::ParticleState::mtSqr().

◆ operator=() [1/2]

Particle& reco::Particle::operator= ( Particle &&  )
default

◆ operator=() [2/2]

Particle& reco::Particle::operator= ( Particle const &  )
default

◆ p()

double reco::Particle::p ( ) const
inline

magnitude of momentum vector

Definition at line 97 of file Particle.h.

97 { return m_state.p(); }

References m_state, and reco::ParticleState::p().

Referenced by Electron.Electron::ptErr().

◆ p4()

const LorentzVector& reco::Particle::p4 ( ) const
inline

◆ pdgId()

int reco::Particle::pdgId ( ) const
inline

PDG identifier.

Definition at line 150 of file Particle.h.

150 { return m_state.pdgId(); }

References m_state, and reco::ParticleState::pdgId().

Referenced by Particle.Particle::__str__(), DQMExample_Step1::analyze(), construct(), and setPdgId().

◆ phi()

double reco::Particle::phi ( ) const
inline

momentum azimuthal angle

Definition at line 122 of file Particle.h.

122 { return m_state.phi(); }

References m_state, and reco::ParticleState::phi().

Referenced by Particle.Particle::__str__(), DQMExample_Step1::analyze(), construct(), and ntupleDataFormat.Track::phiPull().

◆ polarP4()

const PolarLorentzVector& reco::Particle::polarP4 ( ) const
inline

four-momentum Lorentz vector

Definition at line 90 of file Particle.h.

90 { return m_state.polarP4(); }

References m_state, and reco::ParticleState::polarP4().

◆ pt()

double reco::Particle::pt ( ) const
inline

◆ px()

double reco::Particle::px ( ) const
inline

x coordinate of momentum vector

Definition at line 114 of file Particle.h.

114 { return m_state.px(); }

References m_state, and reco::ParticleState::px().

◆ py()

double reco::Particle::py ( ) const
inline

y coordinate of momentum vector

Definition at line 116 of file Particle.h.

116 { return m_state.py(); }

References m_state, and reco::ParticleState::py().

◆ pz()

double reco::Particle::pz ( ) const
inline

z coordinate of momentum vector

Definition at line 118 of file Particle.h.

118 { return m_state.pz(); }

References m_state, and reco::ParticleState::pz().

Referenced by setPz().

◆ rapidity()

double reco::Particle::rapidity ( ) const
inline

rapidity

Definition at line 128 of file Particle.h.

128 { return m_state.rapidity(); }

References m_state, and reco::ParticleState::rapidity().

Referenced by y().

◆ setCharge()

void reco::Particle::setCharge ( Charge  q)
inline

set electric charge

Definition at line 82 of file Particle.h.

82 { m_state.setCharge(q); }

References m_state, submitPVResolutionJobs::q, and reco::ParticleState::setCharge().

◆ setLongLived()

void reco::Particle::setLongLived ( )
inline

long lived flag set long lived flag

Definition at line 159 of file Particle.h.

159 { m_state.setLongLived(); }

References m_state, and reco::ParticleState::setLongLived().

◆ setMass()

void reco::Particle::setMass ( double  m)
inline

set particle mass

Definition at line 136 of file Particle.h.

136 { m_state.setMass(m); }

References visualization-live-secondInstance_cfg::m, m_state, and reco::ParticleState::setMass().

◆ setMassConstraint()

void reco::Particle::setMassConstraint ( )
inline

do mass constraint flag set mass constraint flag

Definition at line 164 of file Particle.h.

References m_state, and reco::ParticleState::setMassConstraint().

◆ setP4() [1/2]

void reco::Particle::setP4 ( const LorentzVector p4)
inline

set 4-momentum

Definition at line 132 of file Particle.h.

132 { m_state.setP4(p4); }

References m_state, p4(), and reco::ParticleState::setP4().

Referenced by Jet.Jet::setCorrP4().

◆ setP4() [2/2]

void reco::Particle::setP4 ( const PolarLorentzVector p4)
inline

set 4-momentum

Definition at line 134 of file Particle.h.

134 { m_state.setP4(p4); }

References m_state, p4(), and reco::ParticleState::setP4().

Referenced by Jet.Jet::setCorrP4().

◆ setPdgId()

void reco::Particle::setPdgId ( int  pdgId)
inline

Definition at line 152 of file Particle.h.

152 { m_state.setPdgId(pdgId); }

References m_state, pdgId(), and reco::ParticleState::setPdgId().

◆ setPz()

void reco::Particle::setPz ( double  pz)
inline

Definition at line 137 of file Particle.h.

137 { m_state.setPz(pz); }

References m_state, pz(), and reco::ParticleState::setPz().

◆ setStatus()

void reco::Particle::setStatus ( int  status)
inline

set status word

Definition at line 156 of file Particle.h.

References m_state, reco::ParticleState::setStatus(), and status().

◆ setThreeCharge()

void reco::Particle::setThreeCharge ( Charge  qx3)
inline

set electric charge

Definition at line 86 of file Particle.h.

86 { m_state.setThreeCharge(qx3); }

References m_state, and reco::ParticleState::setThreeCharge().

◆ setVertex()

void reco::Particle::setVertex ( const Point vertex)
inline

set vertex

Definition at line 147 of file Particle.h.

References m_state, reco::ParticleState::setVertex(), and vertex().

◆ status()

int reco::Particle::status ( ) const
inline

status word

Definition at line 154 of file Particle.h.

154 { return m_state.status(); }

References m_state, and reco::ParticleState::status().

Referenced by construct(), and setStatus().

◆ theta()

double reco::Particle::theta ( ) const
inline

momentum polar angle

Definition at line 124 of file Particle.h.

124 { return m_state.theta(); }

References m_state, and reco::ParticleState::theta().

Referenced by Tau.Tau::zImpact().

◆ threeCharge()

int reco::Particle::threeCharge ( ) const
inline

electric charge

Definition at line 84 of file Particle.h.

84 { return m_state.threeCharge(); }

References m_state, and reco::ParticleState::threeCharge().

◆ vertex()

const Point& reco::Particle::vertex ( ) const
inline

vertex position (overwritten by PF...)

Definition at line 139 of file Particle.h.

139 { return m_state.vertex(); }

References m_state, and reco::ParticleState::vertex().

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

◆ vx()

double reco::Particle::vx ( ) const
inline

x coordinate of vertex position

Definition at line 141 of file Particle.h.

141 { return m_state.vx(); }

References m_state, and reco::ParticleState::vx().

◆ vy()

double reco::Particle::vy ( ) const
inline

y coordinate of vertex position

Definition at line 143 of file Particle.h.

143 { return m_state.vy(); }

References m_state, and reco::ParticleState::vy().

◆ vz()

double reco::Particle::vz ( ) const
inline

z coordinate of vertex position

Definition at line 145 of file Particle.h.

145 { return m_state.vz(); }

References m_state, and reco::ParticleState::vz().

◆ y()

double reco::Particle::y ( ) const
inline

Member Data Documentation

◆ m_state

ParticleState reco::Particle::m_state
private
reco::ParticleState::setCharge
void setCharge(Charge q)
set electric charge
Definition: ParticleState.h:100
reco::Particle::pdgId
int pdgId() const
PDG identifier.
Definition: Particle.h:150
reco::ParticleState::setP4
void setP4(const LorentzVector &p4)
set 4-momentum
Definition: ParticleState.h:149
writedatasetfile.args
args
Definition: writedatasetfile.py:18
reco::ParticleState::p
double p() const
magnitude of momentum vector
Definition: ParticleState.h:115
reco::ParticleState::et2
double et2() const
transverse energy squared (use this for cuts)!
Definition: ParticleState.h:121
reco::ParticleState::setThreeCharge
void setThreeCharge(Charge qx3)
set electric charge
Definition: ParticleState.h:104
reco::Particle::pt
double pt() const
transverse momentum
Definition: Particle.h:120
reco::ParticleState::rapidity
double rapidity() const
repidity
Definition: ParticleState.h:145
reco::ParticleState::mt
double mt() const
transverse mass
Definition: ParticleState.h:127
reco::Particle::vertex
const Point & vertex() const
vertex position (overwritten by PF...)
Definition: Particle.h:139
reco::ParticleState::setStatus
void setStatus(int status)
set status word
Definition: ParticleState.h:184
reco::ParticleState::longLived
bool longLived() const
is long lived?
Definition: ParticleState.h:188
reco::Particle::m_state
ParticleState m_state
Definition: Particle.h:169
reco::ParticleState::charge
int charge() const
electric charge
Definition: ParticleState.h:98
reco::ParticleState::mtSqr
double mtSqr() const
transverse mass squared
Definition: ParticleState.h:129
reco::ParticleState::vz
double vz() const
z coordinate of vertex position
Definition: ParticleState.h:174
reco::ParticleState::theta
double theta() const
momentum polar angle
Definition: ParticleState.h:141
reco::ParticleState::vx
double vx() const
x coordinate of vertex position
Definition: ParticleState.h:170
reco::Particle::mass
double mass() const
mass
Definition: Particle.h:105
reco::Particle::eta
double eta() const
momentum pseudorapidity
Definition: Particle.h:126
reco::ParticleState::setMass
void setMass(double m)
set particle mass
Definition: ParticleState.h:159
reco::ParticleState::polarP4
const PolarLorentzVector & polarP4() const
four-momentum Lorentz vector
Definition: ParticleState.h:108
reco::ParticleState::phi
double phi() const
momentum azimuthal angle
Definition: ParticleState.h:139
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
reco::ParticleState::setVertex
void setVertex(const Point &vertex)
set vertex
Definition: ParticleState.h:176
reco::ParticleState::status
int status() const
status word
Definition: ParticleState.h:182
reco::ParticleState::pz
double pz() const
z coordinate of momentum vector
Definition: ParticleState.h:135
reco::Particle::PolarLorentzVector
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Particle.h:23
reco::ParticleState::massConstraint
bool massConstraint() const
do mass constraint?
Definition: ParticleState.h:192
reco::Particle::status
int status() const
status word
Definition: Particle.h:154
reco::Particle::rapidity
double rapidity() const
rapidity
Definition: Particle.h:128
reco::ParticleState::eta
double eta() const
momentum pseudorapidity
Definition: ParticleState.h:143
reco::ParticleState::vy
double vy() const
y coordinate of vertex position
Definition: ParticleState.h:172
submitPVResolutionJobs.q
q
Definition: submitPVResolutionJobs.py:84
reco::ParticleState::et
double et() const
transverse energy
Definition: ParticleState.h:119
reco::ParticleState::py
double py() const
y coordinate of momentum vector
Definition: ParticleState.h:133
reco::Particle::p4
const LorentzVector & p4() const
four-momentum Lorentz vector
Definition: Particle.h:88
reco::ParticleState::setMassConstraint
void setMassConstraint()
set mass constraint flag
Definition: ParticleState.h:190
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:18
reco::ParticleState::setPdgId
void setPdgId(int pdgId)
Definition: ParticleState.h:180
reco::ParticleState::p4
const LorentzVector & p4() const
four-momentum Lorentz vector
Definition: ParticleState.h:106
reco::Particle::pz
double pz() const
z coordinate of momentum vector
Definition: Particle.h:118
reco::ParticleState::vertex
const Point & vertex() const
vertex position
Definition: ParticleState.h:168
reco::ParticleState::mass
double mass() const
mass
Definition: ParticleState.h:123
reco::Particle::phi
double phi() const
momentum azimuthal angle
Definition: Particle.h:122
reco::ParticleState::pdgId
int pdgId() const
PDG identifier.
Definition: ParticleState.h:178
reco::ParticleState::pt
double pt() const
transverse momentum
Definition: ParticleState.h:137
reco::ParticleState::threeCharge
int threeCharge() const
electric charge
Definition: ParticleState.h:102
reco::ParticleState::setLongLived
void setLongLived()
set long lived flag
Definition: ParticleState.h:186
reco::ParticleState::momentum
Vector momentum() const
spatial momentum vector
Definition: ParticleState.h:110
reco::ParticleState::setPz
void setPz(double pz)
Definition: ParticleState.h:163
reco::ParticleState::boostToCM
Vector boostToCM() const
Definition: ParticleState.h:113
reco::ParticleState::energy
double energy() const
energy
Definition: ParticleState.h:117
reco::ParticleState::px
double px() const
x coordinate of momentum vector
Definition: ParticleState.h:131