CMS 3D CMS Logo

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

#include <ParticleState.h>

Public Types

typedef int Charge
 electric charge type More...
 
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...
 
double energy () const
 energy More...
 
double et () const
 transverse energy More...
 
double et2 () const
 transverse energy squared (use this for cuts)! 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...
 
double p () const
 magnitude of momentum vector More...
 
const LorentzVectorp4 () const
 four-momentum Lorentz vector More...
 
 ParticleState ()
 default constructor More...
 
 ParticleState (Charge q, const GlobalVector &p3, float iEnergy, float imass, const Point &vertex=Point(0, 0, 0), int pdgId=0, int status=0, bool integerCharge=true)
 
 ParticleState (Charge q, const LorentzVector &p4, const Point &vertex=Point(0, 0, 0), int pdgId=0, int status=0, bool integerCharge=true)
 constructor from values More...
 
 ParticleState (Charge q, const PolarLorentzVector &p4, const Point &vertex=Point(0, 0, 0), int pdgId=0, int status=0, bool integerCharge=true)
 constructor from values More...
 
 ParticleState (Charge q, const PtEtaPhiMass &p4, const Point &vertex=Point(0, 0, 0), int pdgId=0, int status=0, bool integerCharge=true)
 constructor from values More...
 
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
 repidity More...
 
void setCartesian ()
 set internal cache More...
 
void setCharge (Charge q)
 set electric charge More...
 
void setLongLived ()
 set long lived flag More...
 
void setMass (double m)
 set particle mass More...
 
void setMassConstraint ()
 set mass constraint flag More...
 
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 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
 repidity More...
 

Private Attributes

LorentzVector p4Cartesian_
 internal cache for p4 More...
 
PolarLorentzVector p4Polar_
 four-momentum Lorentz vector More...
 
int pdgId_
 PDG identifier. More...
 
Charge qx3_
 electric charge More...
 
int status_
 status word More...
 
Point vertex_
 vertex position More...
 

Static Private Attributes

static const unsigned int longLivedTag = 65536
 
static const unsigned int massConstraintTag = 131072
 

Detailed Description

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

Author
Luca Lista, INFN

Definition at line 22 of file ParticleState.h.

Member Typedef Documentation

◆ Charge

electric charge type

Definition at line 25 of file ParticleState.h.

◆ LorentzVector

Lorentz vector.

Definition at line 27 of file ParticleState.h.

◆ Point

point in the space

Definition at line 31 of file ParticleState.h.

◆ PolarLorentzVector

Lorentz vector.

Definition at line 29 of file ParticleState.h.

◆ Vector

point in the space

Definition at line 33 of file ParticleState.h.

Constructor & Destructor Documentation

◆ ParticleState() [1/5]

reco::ParticleState::ParticleState ( )
inline

default constructor

Definition at line 35 of file ParticleState.h.

35 : vertex_(0, 0, 0), qx3_(0), pdgId_(0), status_(0) {}

◆ ParticleState() [2/5]

reco::ParticleState::ParticleState ( Charge  q,
const PtEtaPhiMass p4,
const Point vertex = Point(0, 0, 0),
int  pdgId = 0,
int  status = 0,
bool  integerCharge = true 
)
inline

constructor from values

Definition at line 38 of file ParticleState.h.

44  : vertex_(vertex),
45  p4Polar_(p4.pt(), p4.eta(), p4.phi(), p4.mass()),
47  qx3_(integerCharge ? q * 3 : q),
48  pdgId_(pdgId),
49  status_(status) {}

◆ ParticleState() [3/5]

reco::ParticleState::ParticleState ( Charge  q,
const LorentzVector p4,
const Point vertex = Point(0, 0, 0),
int  pdgId = 0,
int  status = 0,
bool  integerCharge = true 
)
inline

constructor from values

Definition at line 52 of file ParticleState.h.

58  : vertex_(vertex),
59  p4Polar_(p4),
61  qx3_(integerCharge ? q * 3 : q),
62  pdgId_(pdgId),
63  status_(status) {}

◆ ParticleState() [4/5]

reco::ParticleState::ParticleState ( Charge  q,
const PolarLorentzVector p4,
const Point vertex = Point(0, 0, 0),
int  pdgId = 0,
int  status = 0,
bool  integerCharge = true 
)
inline

constructor from values

Definition at line 66 of file ParticleState.h.

72  : vertex_(vertex),
73  p4Polar_(p4),
75  qx3_(integerCharge ? q * 3 : q),
76  pdgId_(pdgId),
77  status_(status) {}

◆ ParticleState() [5/5]

reco::ParticleState::ParticleState ( Charge  q,
const GlobalVector p3,
float  iEnergy,
float  imass,
const Point vertex = Point(0, 0, 0),
int  pdgId = 0,
int  status = 0,
bool  integerCharge = true 
)
inline

Definition at line 79 of file ParticleState.h.

87  : vertex_(vertex),
88  p4Polar_(p3.perp(), p3.eta(), p3.phi(), imass),
89  p4Cartesian_(p3.x(), p3.y(), p3.z(), iEnergy),
90  qx3_(integerCharge ? q * 3 : q),
91  pdgId_(pdgId),
92  status_(status) {}

Member Function Documentation

◆ boostToCM()

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

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

Definition at line 113 of file ParticleState.h.

113 { return p4Cartesian_.BoostToCM(); }

References p4Cartesian_.

Referenced by reco::Particle::boostToCM(), and reco::LeafCandidate::boostToCM().

◆ charge()

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

electric charge

Definition at line 98 of file ParticleState.h.

98 { return qx3_ / 3; }

References qx3_.

Referenced by reco::Particle::charge(), and reco::LeafCandidate::charge().

◆ energy()

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

energy

Definition at line 117 of file ParticleState.h.

117 { return p4Cartesian_.E(); }

References p4Cartesian_.

Referenced by reco::Particle::energy(), reco::LeafCandidate::energy(), and Jet.Jet::rawEnergy().

◆ et()

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

transverse energy

Definition at line 119 of file ParticleState.h.

119 { return (pt() <= 0) ? 0 : p4Cartesian_.Et(); }

References p4Cartesian_, and pt().

Referenced by reco::Particle::et(), and reco::LeafCandidate::et().

◆ et2()

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

transverse energy squared (use this for cuts)!

Definition at line 121 of file ParticleState.h.

121 { return (pt() <= 0) ? 0 : p4Cartesian_.Et2(); }

References p4Cartesian_, and pt().

Referenced by reco::Particle::et2(), and reco::LeafCandidate::et2().

◆ eta()

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

momentum pseudorapidity

Definition at line 143 of file ParticleState.h.

143 { return p4Polar_.eta(); }

References p4Polar_.

Referenced by Particle.Particle::__str__(), reco::Particle::eta(), reco::LeafCandidate::eta(), Jet.Jet::jetID(), and Jet.Jet::puJetId().

◆ longLived()

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

is long lived?

Definition at line 188 of file ParticleState.h.

188 { return status_ & longLivedTag; }

References longLivedTag, and status_.

Referenced by reco::Particle::longLived(), and reco::LeafCandidate::longLived().

◆ mass()

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

mass

Definition at line 123 of file ParticleState.h.

123 { return p4Polar_.mass(); }

References p4Polar_.

Referenced by Particle.Particle::__str__(), DiObject.DiMuon::__str__(), reco::Particle::mass(), reco::LeafCandidate::mass(), and massSqr().

◆ massConstraint()

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

do mass constraint?

Definition at line 192 of file ParticleState.h.

192 { return status_ & massConstraintTag; }

References massConstraintTag, and status_.

Referenced by reco::Particle::massConstraint(), and reco::LeafCandidate::massConstraint().

◆ massSqr()

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

mass squared

Definition at line 125 of file ParticleState.h.

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

References mass().

◆ momentum()

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

spatial momentum vector

Definition at line 110 of file ParticleState.h.

110 { return p4Cartesian_.Vect(); }

References p4Cartesian_.

Referenced by reco::Particle::momentum(), and reco::LeafCandidate::momentum().

◆ mt()

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

transverse mass

Definition at line 127 of file ParticleState.h.

127 { return p4Polar_.Mt(); }

References p4Polar_.

Referenced by reco::Particle::mt(), and reco::LeafCandidate::mt().

◆ mtSqr()

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

transverse mass squared

Definition at line 129 of file ParticleState.h.

129 { return p4Polar_.Mt2(); }

References p4Polar_.

Referenced by reco::Particle::mtSqr(), and reco::LeafCandidate::mtSqr().

◆ p()

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

magnitude of momentum vector

Definition at line 115 of file ParticleState.h.

115 { return p4Cartesian_.P(); }

References p4Cartesian_.

Referenced by reco::Particle::p(), reco::LeafCandidate::p(), and Electron.Electron::ptErr().

◆ p4()

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

four-momentum Lorentz vector

Definition at line 106 of file ParticleState.h.

106 { return p4Cartesian_; }

References p4Cartesian_.

Referenced by Tau.Tau::dxy_approx(), Tau.Tau::dz(), reco::Particle::p4(), reco::LeafCandidate::p4(), Lepton.Lepton::p4WithFSR(), and setP4().

◆ pdgId()

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

PDG identifier.

Definition at line 178 of file ParticleState.h.

178 { return pdgId_; }

References pdgId_.

Referenced by Particle.Particle::__str__(), reco::Particle::pdgId(), reco::LeafCandidate::pdgId(), and setPdgId().

◆ phi()

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

momentum azimuthal angle

Definition at line 139 of file ParticleState.h.

139 { return p4Polar_.phi(); }

References p4Polar_.

Referenced by Particle.Particle::__str__(), reco::Particle::phi(), reco::LeafCandidate::phi(), and ntupleDataFormat.Track::phiPull().

◆ polarP4()

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

four-momentum Lorentz vector

Definition at line 108 of file ParticleState.h.

108 { return p4Polar_; }

References p4Polar_.

Referenced by reco::Particle::polarP4(), and reco::LeafCandidate::polarP4().

◆ pt()

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

◆ px()

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

x coordinate of momentum vector

Definition at line 131 of file ParticleState.h.

131 { return p4Cartesian_.Px(); }

References p4Cartesian_.

Referenced by reco::Particle::px(), and reco::LeafCandidate::px().

◆ py()

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

y coordinate of momentum vector

Definition at line 133 of file ParticleState.h.

133 { return p4Cartesian_.Py(); }

References p4Cartesian_.

Referenced by reco::Particle::py(), and reco::LeafCandidate::py().

◆ pz()

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

z coordinate of momentum vector

Definition at line 135 of file ParticleState.h.

135 { return p4Cartesian_.Pz(); }

References p4Cartesian_.

Referenced by reco::Particle::pz(), reco::LeafCandidate::pz(), and setPz().

◆ rapidity()

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

repidity

Definition at line 145 of file ParticleState.h.

145 { return p4Polar_.Rapidity(); }

References p4Polar_.

Referenced by reco::Particle::rapidity(), reco::LeafCandidate::rapidity(), and y().

◆ setCartesian()

void reco::ParticleState::setCartesian ( )
inline

set internal cache

Definition at line 95 of file ParticleState.h.

References p4Cartesian_, and p4Polar_.

Referenced by setMass().

◆ setCharge()

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

set electric charge

Definition at line 100 of file ParticleState.h.

100 { qx3_ = q * 3; }

References submitPVResolutionJobs::q, and qx3_.

Referenced by reco::Particle::setCharge(), and reco::LeafCandidate::setCharge().

◆ setLongLived()

void reco::ParticleState::setLongLived ( )
inline

set long lived flag

Definition at line 186 of file ParticleState.h.

186 { status_ |= longLivedTag; }

References longLivedTag, and status_.

Referenced by reco::Particle::setLongLived(), and reco::LeafCandidate::setLongLived().

◆ setMass()

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

set particle mass

Definition at line 159 of file ParticleState.h.

159  {
160  p4Polar_.SetM(m);
161  setCartesian();
162  }

References visualization-live-secondInstance_cfg::m, p4Polar_, and setCartesian().

Referenced by reco::Particle::setMass(), and reco::LeafCandidate::setMass().

◆ setMassConstraint()

void reco::ParticleState::setMassConstraint ( )
inline

set mass constraint flag

Definition at line 190 of file ParticleState.h.

References massConstraintTag, and status_.

Referenced by reco::Particle::setMassConstraint(), and reco::LeafCandidate::setMassConstraint().

◆ setP4() [1/2]

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

set 4-momentum

Definition at line 149 of file ParticleState.h.

149  {
150  p4Cartesian_ = p4;
151  p4Polar_ = p4;
152  }

References p4(), p4Cartesian_, and p4Polar_.

Referenced by Jet.Jet::setCorrP4(), reco::Particle::setP4(), and reco::LeafCandidate::setP4().

◆ setP4() [2/2]

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

set 4-momentum

Definition at line 154 of file ParticleState.h.

154  {
155  p4Polar_ = p4;
156  p4Cartesian_ = p4;
157  }

References p4(), p4Cartesian_, and p4Polar_.

Referenced by Jet.Jet::setCorrP4().

◆ setPdgId()

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

Definition at line 180 of file ParticleState.h.

180 { pdgId_ = pdgId; }

References pdgId(), and pdgId_.

Referenced by reco::Particle::setPdgId(), and reco::LeafCandidate::setPdgId().

◆ setPz()

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

Definition at line 163 of file ParticleState.h.

163  {
164  p4Cartesian_.SetPz(pz);
166  }

References p4Cartesian_, p4Polar_, and pz().

Referenced by reco::Particle::setPz(), and reco::LeafCandidate::setPz().

◆ setStatus()

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

set status word

Definition at line 184 of file ParticleState.h.

184 { status_ = status; }

References status(), and status_.

Referenced by reco::Particle::setStatus(), and reco::LeafCandidate::setStatus().

◆ setThreeCharge()

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

set electric charge

Definition at line 104 of file ParticleState.h.

104 { qx3_ = qx3; }

References qx3_.

Referenced by reco::Particle::setThreeCharge(), and reco::LeafCandidate::setThreeCharge().

◆ setVertex()

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

set vertex

Definition at line 176 of file ParticleState.h.

176 { vertex_ = vertex; }

References vertex(), and vertex_.

Referenced by reco::Particle::setVertex(), and reco::LeafCandidate::setVertex().

◆ status()

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

status word

Definition at line 182 of file ParticleState.h.

182 { return status_; }

References status_.

Referenced by setStatus(), reco::Particle::status(), and reco::LeafCandidate::status().

◆ theta()

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

momentum polar angle

Definition at line 141 of file ParticleState.h.

141 { return p4Cartesian_.Theta(); }

References p4Cartesian_.

Referenced by reco::Particle::theta(), reco::LeafCandidate::theta(), and Tau.Tau::zImpact().

◆ threeCharge()

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

electric charge

Definition at line 102 of file ParticleState.h.

102 { return qx3_; }

References qx3_.

Referenced by reco::Particle::threeCharge(), and reco::LeafCandidate::threeCharge().

◆ vertex()

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

vertex position

Definition at line 168 of file ParticleState.h.

168 { return vertex_; }

References vertex_.

Referenced by Tau.Tau::dxy(), setVertex(), reco::Particle::vertex(), and reco::LeafCandidate::vertex().

◆ vx()

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

x coordinate of vertex position

Definition at line 170 of file ParticleState.h.

170 { return vertex_.X(); }

References vertex_.

Referenced by reco::Particle::vx(), and reco::LeafCandidate::vx().

◆ vy()

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

y coordinate of vertex position

Definition at line 172 of file ParticleState.h.

172 { return vertex_.Y(); }

References vertex_.

Referenced by reco::Particle::vy(), and reco::LeafCandidate::vy().

◆ vz()

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

z coordinate of vertex position

Definition at line 174 of file ParticleState.h.

174 { return vertex_.Z(); }

References vertex_.

Referenced by reco::Particle::vz(), and reco::LeafCandidate::vz().

◆ y()

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

Member Data Documentation

◆ longLivedTag

const unsigned int reco::ParticleState::longLivedTag = 65536
staticprivate

Definition at line 195 of file ParticleState.h.

Referenced by longLived(), and setLongLived().

◆ massConstraintTag

const unsigned int reco::ParticleState::massConstraintTag = 131072
staticprivate

Definition at line 196 of file ParticleState.h.

Referenced by massConstraint(), and setMassConstraint().

◆ p4Cartesian_

LorentzVector reco::ParticleState::p4Cartesian_
private

internal cache for p4

Definition at line 205 of file ParticleState.h.

Referenced by boostToCM(), energy(), et(), et2(), momentum(), p(), p4(), px(), py(), pz(), setCartesian(), setP4(), setPz(), and theta().

◆ p4Polar_

PolarLorentzVector reco::ParticleState::p4Polar_
private

four-momentum Lorentz vector

Definition at line 203 of file ParticleState.h.

Referenced by eta(), mass(), mt(), mtSqr(), phi(), polarP4(), pt(), rapidity(), setCartesian(), setMass(), setP4(), and setPz().

◆ pdgId_

int reco::ParticleState::pdgId_
private

PDG identifier.

Definition at line 211 of file ParticleState.h.

Referenced by pdgId(), and setPdgId().

◆ qx3_

Charge reco::ParticleState::qx3_
private

electric charge

Definition at line 208 of file ParticleState.h.

Referenced by charge(), setCharge(), setThreeCharge(), and threeCharge().

◆ status_

int reco::ParticleState::status_
private

status word

Definition at line 213 of file ParticleState.h.

Referenced by longLived(), massConstraint(), setLongLived(), setMassConstraint(), setStatus(), and status().

◆ vertex_

Point reco::ParticleState::vertex_
private

vertex position

Definition at line 200 of file ParticleState.h.

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

reco::ParticleState::vertex_
Point vertex_
vertex position
Definition: ParticleState.h:200
reco::ParticleState::status_
int status_
status word
Definition: ParticleState.h:213
reco::ParticleState::rapidity
double rapidity() const
repidity
Definition: ParticleState.h:145
reco::ParticleState::p4Polar_
PolarLorentzVector p4Polar_
four-momentum Lorentz vector
Definition: ParticleState.h:203
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:78
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::ParticleState::longLivedTag
static const unsigned int longLivedTag
Definition: ParticleState.h:195
reco::ParticleState::pdgId_
int pdgId_
PDG identifier.
Definition: ParticleState.h:211
submitPVResolutionJobs.q
q
Definition: submitPVResolutionJobs.py:84
reco::ParticleState::p4
const LorentzVector & p4() const
four-momentum Lorentz vector
Definition: ParticleState.h:106
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::ParticleState::p4Cartesian_
LorentzVector p4Cartesian_
internal cache for p4
Definition: ParticleState.h:205
reco::ParticleState::pdgId
int pdgId() const
PDG identifier.
Definition: ParticleState.h:178
p3
double p3[4]
Definition: TauolaWrapper.h:91
reco::ParticleState::pt
double pt() const
transverse momentum
Definition: ParticleState.h:137
reco::ParticleState::massConstraintTag
static const unsigned int massConstraintTag
Definition: ParticleState.h:196
reco::ParticleState::qx3_
Charge qx3_
electric charge
Definition: ParticleState.h:208
reco::ParticleState::setCartesian
void setCartesian()
set internal cache
Definition: ParticleState.h:95