CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
hitfit::Lepjets_Event_Lep Class Reference

Represent a lepton in an instance of Lepjets_Event class. This class hold the following information: More...

#include <Lepjets_Event_Lep.h>

Inheritance diagram for hitfit::Lepjets_Event_Lep:
hitfit::Lepjets_Event_Jet

Public Member Functions

std::ostream & dump (std::ostream &s, bool full=false) const
 Print the content of this object. More...
 
double eta_sigma () const
 Return the uncertainty in pseudorapidity $\eta$. More...
 
 Lepjets_Event_Lep (const Fourvec &p, int type, const Vector_Resolution &res)
 Constructor, create a new instance of Lepjets_Event_Lep. More...
 
bool operator< (const Lepjets_Event_Lep &x) const
 Comparison operator for sorting purpose, based on $p_{T}$. More...
 
Fourvecp ()
 Return a reference to the four-momentum. More...
 
const Fourvecp () const
 Return a constant reference to the four-momentum. More...
 
double p_sigma () const
 Return the uncertainty in momentum $p$ or $p_{T}$ ( $1/p$ or $1/p_{T}$ if the lepton is a tracking object). More...
 
double phi_sigma () const
 Return the uncertainty in azimuthal angle $\phi$. More...
 
const Vector_Resolutionres () const
 Return a constant reference to the resolution. More...
 
Vector_Resolutionres ()
 Return a reference to the resolution. More...
 
void smear (CLHEP::HepRandomEngine &engine, bool smear_dir=false)
 Smear this object. More...
 
int & type ()
 Return a reference to the type code. More...
 
int type () const
 Return the type code. More...
 

Private Attributes

Fourvec _p
 
Vector_Resolution _res
 
int _type
 

Detailed Description

Represent a lepton in an instance of Lepjets_Event class. This class hold the following information:

Definition at line 64 of file Lepjets_Event_Lep.h.

Constructor & Destructor Documentation

◆ Lepjets_Event_Lep()

hitfit::Lepjets_Event_Lep::Lepjets_Event_Lep ( const Fourvec p,
int  type,
const Vector_Resolution res 
)

Constructor, create a new instance of Lepjets_Event_Lep.

Parameters
pThe four-momentum.
typeThe type code.
resThe resolution.

Definition at line 38 of file Lepjets_Event_Lep.cc.

47  : _p(p), _type(type), _res(res) {}
Definition: Electron.h:6
Fourvec & p()
Return a reference to the four-momentum.

Member Function Documentation

◆ dump()

std::ostream & hitfit::Lepjets_Event_Lep::dump ( std::ostream &  s,
bool  full = false 
) const

Print the content of this object.

Parameters
sThe output stream to which to write.
fullIf TRUE, print all information about this instance of Lepjets_Event_Lep.
If FALSE, print partial information about this instance of Lepjets_Event_Lep.

Definition at line 160 of file Lepjets_Event_Lep.cc.

References full, and alignCSCRings::s.

Referenced by hitfit::Lepjets_Event_Jet::dump().

171  {
172  s << "[" << _type << "] " << _p << "; pt: " << _p.perp() << ", eta: " << _p.eta() << ", phi: " << _p.phi();
173  if (full) {
174  s << "\n " << _res;
175  }
176  return s;
177  }
Definition: GenABIO.cc:168

◆ eta_sigma()

double hitfit::Lepjets_Event_Lep::eta_sigma ( ) const

Return the uncertainty in pseudorapidity $\eta$.

Definition at line 126 of file Lepjets_Event_Lep.cc.

References _p, _res, and hitfit::Vector_Resolution::eta_sigma().

133  {
134  return _res.eta_sigma(_p);
135  }
double eta_sigma(const Fourvec &v) const
Calculate the pseudorapidity resolution of a four-momentum.

◆ operator<()

bool hitfit::Lepjets_Event_Lep::operator< ( const Lepjets_Event_Lep x) const

Comparison operator for sorting purpose, based on $p_{T}$.

Parameters
xThe other instance of Lepjets_Event to be compared.

Definition at line 202 of file Lepjets_Event_Lep.cc.

References AlCaHLTBitMon_ParallelJobs::p, and x.

208  {
209  return p().perp2() < x.p().perp2();
210  }
Fourvec & p()
Return a reference to the four-momentum.

◆ p() [1/2]

Fourvec & hitfit::Lepjets_Event_Lep::p ( )

Return a reference to the four-momentum.

Definition at line 49 of file Lepjets_Event_Lep.cc.

References _p.

Referenced by TtSemiLepHitFitProducer< LeptonCollection >::produce(), and Electron.Electron::ptErr().

56  {
57  return _p;
58  }

◆ p() [2/2]

const Fourvec & hitfit::Lepjets_Event_Lep::p ( ) const

Return a constant reference to the four-momentum.

Definition at line 60 of file Lepjets_Event_Lep.cc.

References _p.

Referenced by Electron.Electron::ptErr().

67  {
68  return _p;
69  }

◆ p_sigma()

double hitfit::Lepjets_Event_Lep::p_sigma ( ) const

Return the uncertainty in momentum $p$ or $p_{T}$ ( $1/p$ or $1/p_{T}$ if the lepton is a tracking object).

Definition at line 115 of file Lepjets_Event_Lep.cc.

References _p, _res, and hitfit::Vector_Resolution::p_sigma().

122  {
123  return _res.p_sigma(_p);
124  }
double p_sigma(const Fourvec &v) const
Calculate the momentum resolution of a four-momentum.

◆ phi_sigma()

double hitfit::Lepjets_Event_Lep::phi_sigma ( ) const

Return the uncertainty in azimuthal angle $\phi$.

Definition at line 137 of file Lepjets_Event_Lep.cc.

References _p, _res, and hitfit::Vector_Resolution::phi_sigma().

144  {
145  return _res.phi_sigma(_p);
146  }
double phi_sigma(const Fourvec &v) const
Calculate the azimuthal angle resolution of a four-momentum.

◆ res() [1/2]

const Vector_Resolution & hitfit::Lepjets_Event_Lep::res ( ) const

Return a constant reference to the resolution.

Definition at line 93 of file Lepjets_Event_Lep.cc.

References _res.

100  {
101  return _res;
102  }

◆ res() [2/2]

Vector_Resolution & hitfit::Lepjets_Event_Lep::res ( )

Return a reference to the resolution.

Definition at line 104 of file Lepjets_Event_Lep.cc.

References _res.

111  {
112  return _res;
113  }

◆ smear()

void hitfit::Lepjets_Event_Lep::smear ( CLHEP::HepRandomEngine &  engine,
bool  smear_dir = false 
)

Smear this object.

Parameters
engineThe underlying random number generator.
smear_dirIf TRUE, also smear the object's direction.
If FALSE, then only smear the magnitude of three-momentum.

Definition at line 148 of file Lepjets_Event_Lep.cc.

References _p, _res, and hitfit::Vector_Resolution::smear().

156  {
157  _res.smear(_p, engine, smear_dir);
158  }
void smear(Fourvec &v, CLHEP::HepRandomEngine &engine, bool do_smear_dir=false) const
Smear a four-momentum according to the resolutions.

◆ type() [1/2]

int & hitfit::Lepjets_Event_Lep::type ( )

Return a reference to the type code.

Definition at line 71 of file Lepjets_Event_Lep.cc.

References _type.

Referenced by TtSemiLepHitFitProducer< LeptonCollection >::produce(), and hitfit::Lepjets_Event::set_jet_types().

78  {
79  return _type;
80  }

◆ type() [2/2]

int hitfit::Lepjets_Event_Lep::type ( ) const

Return the type code.

Definition at line 82 of file Lepjets_Event_Lep.cc.

References _type.

89  {
90  return _type;
91  }

Member Data Documentation

◆ _p

Fourvec hitfit::Lepjets_Event_Lep::_p
private

The four-momentum.

Definition at line 172 of file Lepjets_Event_Lep.h.

Referenced by eta_sigma(), p(), p_sigma(), phi_sigma(), and smear().

◆ _res

Vector_Resolution hitfit::Lepjets_Event_Lep::_res
private

The resolution.

Definition at line 182 of file Lepjets_Event_Lep.h.

Referenced by eta_sigma(), p_sigma(), phi_sigma(), res(), and smear().

◆ _type

int hitfit::Lepjets_Event_Lep::_type
private

The type code.

Definition at line 177 of file Lepjets_Event_Lep.h.

Referenced by type().