ATLAS Offline Software
Loading...
Searching...
No Matches
P4IPtCotThPhiMBase Class Referenceabstract

P4IPtCotThPhiMBase is a base class for classes with 4-momentum behavior, for which 1/Pt, cottan(tehta), phi and M are natural parameters, which is typically the case of some (not all!) tracking classes. More...

#include <P4IPtCotThPhiMBase.h>

Inheritance diagram for P4IPtCotThPhiMBase:
Collaboration diagram for P4IPtCotThPhiMBase:

Public Types

enum  Kind {
  P4EETAPHIM , P4IPTCOTTHPHIM , P4PTETAPHIM , P4PXPYPZE ,
  UNKNOWN
}

Public Member Functions

virtual ~P4IPtCotThPhiMBase ()
 virtual destructor needed by Pool
virtual double e () const
 energy
virtual double eta () const
 pseudo rapidity
virtual double px () const
 x component of momentum
virtual double py () const
 y component of momentum
virtual double pz () const
 z component of momentum
virtual double et () const
 transverse energy defined to be e*sin(theta)
virtual double m2 () const
 mass squared
virtual double p () const
 momentum magnitude
virtual double p2 () const
 square of momentum magnitude
virtual double pt () const
 transverse momentum
virtual double rapidity () const
 rapidity
virtual double cosPhi () const
 cosinus phi
virtual double sinPhi () const
 sinus phi
virtual double tanTh () const
 tan theta
virtual double cosTh () const
 cosinus theta
virtual double sinTh () const
 sinus theta
virtual CLHEP::HepLorentzVector hlv () const
 CLHEP HepLorentzVector.
virtual const I4MomentumErrorerrors () const
 Access to errors, if available; returns 0 if no errors.
virtual void set4Mom (const I4Momentum &theI4Mom)
 set all 4-mom from another I4Momentum reference DUMMY IMPLEMENTATION
virtual void set4Mom (const I4Momentum *const theI4Mom)
 set all 4-mom from another I4Momentum pointer DUMMY IMPLEMENTATION
virtual void set4Mom (const CLHEP::HepLorentzVector &theHlv)
 set all 4-mom from a CLHEP HepLorentzVector DUMMY IMPLEMENTATION
I4Momentum::Kind kind () const
 tells what kind of P4XYZT this is
virtual std::ostream & dump (std::ostream &out) const
 Print I4Momentum content.
virtual double m () const =0
 mass
virtual double phi () const =0
 phi in [-pi,pi[
virtual double iPt () const =0
 inverse of transverse momentum
virtual double cotTh () const =0
 cottan theta

Detailed Description

P4IPtCotThPhiMBase is a base class for classes with 4-momentum behavior, for which 1/Pt, cottan(tehta), phi and M are natural parameters, which is typically the case of some (not all!) tracking classes.

Any class deriving from it should implement iPt(), cotTh(), phi(), m()

Author
David Rousseau rouss.nosp@m.eau@.nosp@m.lal.i.nosp@m.n2p3.nosp@m..fr

Definition at line 27 of file P4IPtCotThPhiMBase.h.

Member Enumeration Documentation

◆ Kind

enum I4Momentum::Kind
inherited
Enumerator
P4EETAPHIM 
P4IPTCOTTHPHIM 
P4PTETAPHIM 
P4PXPYPZE 
UNKNOWN 

Definition at line 33 of file I4Momentum.h.

Constructor & Destructor Documentation

◆ ~P4IPtCotThPhiMBase()

P4IPtCotThPhiMBase::~P4IPtCotThPhiMBase ( )
virtual

virtual destructor needed by Pool

Definition at line 9 of file P4IPtCotThPhiMBase.cxx.

10{}

Member Function Documentation

◆ cosPhi()

double P4IPtCotThPhiMBase::cosPhi ( ) const
virtual

cosinus phi

Implements I4Momentum.

Definition at line 103 of file P4IPtCotThPhiMBase.cxx.

104{
105 return std::cos(this->phi());
106}
virtual double phi() const =0
phi in [-pi,pi[

◆ cosTh()

double P4IPtCotThPhiMBase::cosTh ( ) const
virtual

cosinus theta

Implements I4Momentum.

Definition at line 47 of file P4IPtCotThPhiMBase.cxx.

48{
49 const double theCotTh=this->cotTh();
50 const double theCotTh2=theCotTh*theCotTh;
51 const double theCosTh=std::sqrt(theCotTh2/(1.+theCotTh2));
52 if (theCotTh>=0) {
53 return theCosTh;
54 }
55 else{
56 return -theCosTh;
57 }
58}
virtual double cotTh() const =0
cottan theta

◆ cotTh()

virtual double I4Momentum::cotTh ( ) const
pure virtualinherited

cottan theta

Implemented in CaloCell, Nav4MomWrapper< Navigable_t, P4Momentum_t >, Nav4MomWrapper< Navigable< DataVector< INavigable4Momentum >, double, std::vector< std::pair< ElementLink< DataVector< INavigable4Momentum > >, double > > >, P4ImplPxPyPzE >, P4EEtaPhiMBase, P4Impl< P4Mom_t >, P4Impl< P4ImplEEtaPhiM >, P4Impl< P4ImplIPtCotThPhiM >, P4Impl< P4ImplPtEtaPhiM >, P4Impl< P4ImplPxPyPzE >, P4IPtCotThPhiM, P4PtEtaPhiMBase, P4PxPyPzEBase, ParticleImpl< INavigable_t, I4Momentum_t, IParticle_t >, ParticleImpl< ::Analysis::MuonNavigation, ::P4ImplIPtCotThPhiM >, ParticleImpl< ::Analysis::TauJetNavigation, ::P4ImplEEtaPhiM >, ParticleImpl< CompositeParticleNavigation, P4ImplPxPyPzE, ParticleEvent::Base >, ParticleImpl< egammaNavigation, P4ImplEEtaPhiM >, ParticleImpl< INavigable_t, I4Momentum_t, IParticle_t >, ParticleImpl< Navigable< DataVector< INavigable4Momentum >, double, std::vector< std::pair< ElementLink< DataVector< INavigable4Momentum > >, double > > >, P4ImplPxPyPzE, ParticleEvent::Base >, ParticleImpl< NavigableTerminalNode, P4ImplEEtaPhiM, ParticleEvent::Base >, ParticleImpl< NavigableTerminalNode, P4ImplIPtCotThPhiM, ParticleEvent::Base >, ParticleImpl< NavigableTerminalNode, P4ImplPxPyPzE, ParticleEvent::Base >, ParticleImpl< NavigableTerminalNode, P4PtEtaPhiM >, ParticleImpl< NeutrinoNavigation, P4ImplPxPyPzE >, ParticleImpl< TruthParticleNavigation, TruthParticleMomentum, TruthParticleBase >, ParticleSigStateImpl< INavigable_t, I4Momentum_t, IParticle_t >, ParticleSigStateImpl< INavigable_t, I4Momentum_t, IParticle_t >, ParticleSigStateImpl< Navigable< DataVector< INavigable4Momentum >, double, std::vector< std::pair< ElementLink< DataVector< INavigable4Momentum > >, double > > >, P4ImplPxPyPzE, ParticleEvent::Base >, ParticleSigStateImpl< Navigable< INavigable4MomentumCollection, double >, P4ImplPxPyPzE >, and ParticleSigStateImpl< Navigable< INavigable4MomentumCollection, double >, P4ImplPxPyPzE, ParticleEvent::Base >.

◆ dump()

std::ostream & P4IPtCotThPhiMBase::dump ( std::ostream & out) const
virtual

Print I4Momentum content.

Implements I4Momentum.

Definition at line 126 of file P4IPtCotThPhiMBase.cxx.

127{
128
129 std::stringstream outx;
130 outx << "[ipt,cotTh,phi,m] ="
131 << std::right << std::scientific << std::setprecision(8)
132 << std::setw(16) << this->iPt()
133 << std::setw(16) << this->cotTh()
134 << std::setw(16) << this->phi()
135 << std::setw(16) << this->m();
136
137 out<<outx.str();
138
139 return out;
140}
virtual double m() const =0
mass
virtual double iPt() const =0
inverse of transverse momentum

◆ e()

double P4IPtCotThPhiMBase::e ( ) const
virtual

energy

Implements I4Momentum.

Definition at line 61 of file P4IPtCotThPhiMBase.cxx.

62{
63 const double theM=this->m();
64 const double theP=this->p();
65 if (theM==0.) return theP ;
66 else return std::sqrt(theP*theP+theM*theM);
67}
virtual double p() const
momentum magnitude

◆ errors()

const I4MomentumError * P4IPtCotThPhiMBase::errors ( ) const
virtual

Access to errors, if available; returns 0 if no errors.

Implements I4Momentum.

Reimplemented in P4IPtCotThPhiM.

Definition at line 142 of file P4IPtCotThPhiMBase.cxx.

143{
144 return 0;
145}

◆ et()

double P4IPtCotThPhiMBase::et ( ) const
virtual

transverse energy defined to be e*sin(theta)

Implements I4Momentum.

Definition at line 69 of file P4IPtCotThPhiMBase.cxx.

70{
71 const double theCotTh=this->cotTh();
72 return this->e()/std::sqrt(1+theCotTh*theCotTh);
73}
virtual double e() const
energy

◆ eta()

double P4IPtCotThPhiMBase::eta ( ) const
virtual

pseudo rapidity

Implements I4Momentum.

Definition at line 76 of file P4IPtCotThPhiMBase.cxx.

77{
78 const double theCotTh=this->cotTh();
79 const double aux=std::sqrt(1+theCotTh*theCotTh);
80 return -0.5*log((aux-theCotTh)/(aux+theCotTh));
81 }

◆ hlv()

CLHEP::HepLorentzVector P4IPtCotThPhiMBase::hlv ( ) const
virtual

CLHEP HepLorentzVector.

Implements I4Momentum.

Definition at line 113 of file P4IPtCotThPhiMBase.cxx.

114{
115 //minimize the number of calculation and dereference
116 const double thePt=this->pt();
117 const double theM=this->m();
118 const double thePx=thePt*this->cosPhi();
119 const double thePy=thePt*this->sinPhi();
120 const double thePz=thePt*this->cotTh();
121 const double theE=std::sqrt(thePt*thePt+thePz*thePz+theM*theM);
122
123 return CLHEP::HepLorentzVector(thePx,thePy,thePz,theE);
124}
virtual double pt() const
transverse momentum
virtual double sinPhi() const
sinus phi
virtual double cosPhi() const
cosinus phi

◆ iPt()

virtual double I4Momentum::iPt ( ) const
pure virtualinherited

inverse of transverse momentum

Implemented in Nav4MomWrapper< Navigable_t, P4Momentum_t >, Nav4MomWrapper< Navigable< DataVector< INavigable4Momentum >, double, std::vector< std::pair< ElementLink< DataVector< INavigable4Momentum > >, double > > >, P4ImplPxPyPzE >, P4EEtaPhiMBase, P4Impl< P4Mom_t >, P4Impl< P4ImplEEtaPhiM >, P4Impl< P4ImplIPtCotThPhiM >, P4Impl< P4ImplPtEtaPhiM >, P4Impl< P4ImplPxPyPzE >, P4IPtCotThPhiM, P4PtEtaPhiMBase, P4PxPyPzEBase, ParticleImpl< INavigable_t, I4Momentum_t, IParticle_t >, ParticleImpl< ::Analysis::MuonNavigation, ::P4ImplIPtCotThPhiM >, ParticleImpl< ::Analysis::TauJetNavigation, ::P4ImplEEtaPhiM >, ParticleImpl< CompositeParticleNavigation, P4ImplPxPyPzE, ParticleEvent::Base >, ParticleImpl< egammaNavigation, P4ImplEEtaPhiM >, ParticleImpl< INavigable_t, I4Momentum_t, IParticle_t >, ParticleImpl< Navigable< DataVector< INavigable4Momentum >, double, std::vector< std::pair< ElementLink< DataVector< INavigable4Momentum > >, double > > >, P4ImplPxPyPzE, ParticleEvent::Base >, ParticleImpl< NavigableTerminalNode, P4ImplEEtaPhiM, ParticleEvent::Base >, ParticleImpl< NavigableTerminalNode, P4ImplIPtCotThPhiM, ParticleEvent::Base >, ParticleImpl< NavigableTerminalNode, P4ImplPxPyPzE, ParticleEvent::Base >, ParticleImpl< NavigableTerminalNode, P4PtEtaPhiM >, ParticleImpl< NeutrinoNavigation, P4ImplPxPyPzE >, ParticleImpl< TruthParticleNavigation, TruthParticleMomentum, TruthParticleBase >, ParticleSigStateImpl< INavigable_t, I4Momentum_t, IParticle_t >, ParticleSigStateImpl< INavigable_t, I4Momentum_t, IParticle_t >, ParticleSigStateImpl< Navigable< DataVector< INavigable4Momentum >, double, std::vector< std::pair< ElementLink< DataVector< INavigable4Momentum > >, double > > >, P4ImplPxPyPzE, ParticleEvent::Base >, ParticleSigStateImpl< Navigable< INavigable4MomentumCollection, double >, P4ImplPxPyPzE >, and ParticleSigStateImpl< Navigable< INavigable4MomentumCollection, double >, P4ImplPxPyPzE, ParticleEvent::Base >.

◆ kind()

I4Momentum::Kind P4IPtCotThPhiMBase::kind ( ) const
inlinevirtual

tells what kind of P4XYZT this is

Implements I4Momentum.

Definition at line 60 of file P4IPtCotThPhiMBase.h.

◆ m()

virtual double I4Momentum::m ( ) const
pure virtualinherited

mass

Implemented in CaloCell, CaloCluster, CaloTower, CaloVertexedCell, CombinedMuonFeature, EmTau_ROI, IsoMuonFeature, Jet_ROI, Muon_ROI, Nav4MomWrapper< Navigable_t, P4Momentum_t >, Nav4MomWrapper< Navigable< DataVector< INavigable4Momentum >, double, std::vector< std::pair< ElementLink< DataVector< INavigable4Momentum > >, double > > >, P4ImplPxPyPzE >, P4EEtaPhiM, P4Impl< P4Mom_t >, P4Impl< P4ImplEEtaPhiM >, P4Impl< P4ImplIPtCotThPhiM >, P4Impl< P4ImplPtEtaPhiM >, P4Impl< P4ImplPxPyPzE >, P4IPtCotThPhiM, P4PtEtaPhiM, P4PxPyPzEBase, ParticleImpl< INavigable_t, I4Momentum_t, IParticle_t >, ParticleImpl< ::Analysis::MuonNavigation, ::P4ImplIPtCotThPhiM >, ParticleImpl< ::Analysis::TauJetNavigation, ::P4ImplEEtaPhiM >, ParticleImpl< CompositeParticleNavigation, P4ImplPxPyPzE, ParticleEvent::Base >, ParticleImpl< egammaNavigation, P4ImplEEtaPhiM >, ParticleImpl< INavigable_t, I4Momentum_t, IParticle_t >, ParticleImpl< Navigable< DataVector< INavigable4Momentum >, double, std::vector< std::pair< ElementLink< DataVector< INavigable4Momentum > >, double > > >, P4ImplPxPyPzE, ParticleEvent::Base >, ParticleImpl< NavigableTerminalNode, P4ImplEEtaPhiM, ParticleEvent::Base >, ParticleImpl< NavigableTerminalNode, P4ImplIPtCotThPhiM, ParticleEvent::Base >, ParticleImpl< NavigableTerminalNode, P4ImplPxPyPzE, ParticleEvent::Base >, ParticleImpl< NavigableTerminalNode, P4PtEtaPhiM >, ParticleImpl< NeutrinoNavigation, P4ImplPxPyPzE >, ParticleImpl< TruthParticleNavigation, TruthParticleMomentum, TruthParticleBase >, ParticleSigStateImpl< INavigable_t, I4Momentum_t, IParticle_t >, ParticleSigStateImpl< INavigable_t, I4Momentum_t, IParticle_t >, ParticleSigStateImpl< Navigable< DataVector< INavigable4Momentum >, double, std::vector< std::pair< ElementLink< DataVector< INavigable4Momentum > >, double > > >, P4ImplPxPyPzE, ParticleEvent::Base >, ParticleSigStateImpl< Navigable< INavigable4MomentumCollection, double >, P4ImplPxPyPzE >, ParticleSigStateImpl< Navigable< INavigable4MomentumCollection, double >, P4ImplPxPyPzE, ParticleEvent::Base >, TileTrackMuFeature, TrigMuonClusterFeature, and TrigT2Jet.

◆ m2()

double P4IPtCotThPhiMBase::m2 ( ) const
virtual

mass squared

Implements I4Momentum.

Definition at line 31 of file P4IPtCotThPhiMBase.cxx.

31 {
32 const double theM = this->m();
33 return theM*theM;
34}

◆ p()

double P4IPtCotThPhiMBase::p ( ) const
virtual

momentum magnitude

Implements I4Momentum.

Definition at line 18 of file P4IPtCotThPhiMBase.cxx.

19{
20 const double theCotTh=this->cotTh();
21 return std::sqrt(1+theCotTh*theCotTh)/this->iPt() ;
22}

◆ p2()

double P4IPtCotThPhiMBase::p2 ( ) const
virtual

square of momentum magnitude

Implements I4Momentum.

Definition at line 24 of file P4IPtCotThPhiMBase.cxx.

25{
26 const double theCotTh=this->cotTh();
27 const double theI_Pt=this->iPt();
28 return (1+theCotTh*theCotTh)/(theI_Pt*theI_Pt) ;
29}

◆ phi()

virtual double I4Momentum::phi ( ) const
pure virtualinherited

phi in [-pi,pi[

Implemented in CaloCell, CaloCluster, CaloTower, CaloVertexedCell, CombinedMuonFeature, EmTau_ROI, IsoMuonFeature, Jet_ROI, Muon_ROI, Nav4MomWrapper< Navigable_t, P4Momentum_t >, Nav4MomWrapper< Navigable< DataVector< INavigable4Momentum >, double, std::vector< std::pair< ElementLink< DataVector< INavigable4Momentum > >, double > > >, P4ImplPxPyPzE >, P4EEtaPhiM, P4Impl< P4Mom_t >, P4Impl< P4ImplEEtaPhiM >, P4Impl< P4ImplIPtCotThPhiM >, P4Impl< P4ImplPtEtaPhiM >, P4Impl< P4ImplPxPyPzE >, P4IPtCotThPhiM, P4PtEtaPhiM, P4PxPyPzEBase, ParticleImpl< INavigable_t, I4Momentum_t, IParticle_t >, ParticleImpl< ::Analysis::MuonNavigation, ::P4ImplIPtCotThPhiM >, ParticleImpl< ::Analysis::TauJetNavigation, ::P4ImplEEtaPhiM >, ParticleImpl< CompositeParticleNavigation, P4ImplPxPyPzE, ParticleEvent::Base >, ParticleImpl< egammaNavigation, P4ImplEEtaPhiM >, ParticleImpl< INavigable_t, I4Momentum_t, IParticle_t >, ParticleImpl< Navigable< DataVector< INavigable4Momentum >, double, std::vector< std::pair< ElementLink< DataVector< INavigable4Momentum > >, double > > >, P4ImplPxPyPzE, ParticleEvent::Base >, ParticleImpl< NavigableTerminalNode, P4ImplEEtaPhiM, ParticleEvent::Base >, ParticleImpl< NavigableTerminalNode, P4ImplIPtCotThPhiM, ParticleEvent::Base >, ParticleImpl< NavigableTerminalNode, P4ImplPxPyPzE, ParticleEvent::Base >, ParticleImpl< NavigableTerminalNode, P4PtEtaPhiM >, ParticleImpl< NeutrinoNavigation, P4ImplPxPyPzE >, ParticleImpl< TruthParticleNavigation, TruthParticleMomentum, TruthParticleBase >, ParticleSigStateImpl< INavigable_t, I4Momentum_t, IParticle_t >, ParticleSigStateImpl< INavigable_t, I4Momentum_t, IParticle_t >, ParticleSigStateImpl< Navigable< DataVector< INavigable4Momentum >, double, std::vector< std::pair< ElementLink< DataVector< INavigable4Momentum > >, double > > >, P4ImplPxPyPzE, ParticleEvent::Base >, ParticleSigStateImpl< Navigable< INavigable4MomentumCollection, double >, P4ImplPxPyPzE >, ParticleSigStateImpl< Navigable< INavigable4MomentumCollection, double >, P4ImplPxPyPzE, ParticleEvent::Base >, TileTrackMuFeature, TrigMuonClusterFeature, and TrigT2Jet.

◆ pt()

double P4IPtCotThPhiMBase::pt ( ) const
virtual

transverse momentum

Implements I4Momentum.

Definition at line 12 of file P4IPtCotThPhiMBase.cxx.

13 {
14 return 1./this->iPt();
15 }

◆ px()

double P4IPtCotThPhiMBase::px ( ) const
virtual

x component of momentum

Implements I4Momentum.

Definition at line 91 of file P4IPtCotThPhiMBase.cxx.

92 { return this->cosPhi()/this->iPt();
93 }

◆ py()

double P4IPtCotThPhiMBase::py ( ) const
virtual

y component of momentum

Implements I4Momentum.

Definition at line 95 of file P4IPtCotThPhiMBase.cxx.

96 { return this->sinPhi()/this->iPt();
97 }

◆ pz()

double P4IPtCotThPhiMBase::pz ( ) const
virtual

z component of momentum

Implements I4Momentum.

Definition at line 99 of file P4IPtCotThPhiMBase.cxx.

100 { return this->cotTh()/this->iPt();
101 }

◆ rapidity()

double P4IPtCotThPhiMBase::rapidity ( ) const
virtual

rapidity

Implements I4Momentum.

Definition at line 84 of file P4IPtCotThPhiMBase.cxx.

85 {
86 const double theE=this->e();
87 const double thePz=this->pz();
88 return 0.5*std::log((theE+thePz)/(theE-thePz));
89 }
virtual double pz() const
z component of momentum

◆ set4Mom() [1/3]

void P4IPtCotThPhiMBase::set4Mom ( const CLHEP::HepLorentzVector & theHlv)
virtual

set all 4-mom from a CLHEP HepLorentzVector DUMMY IMPLEMENTATION

Implements I4Momentum.

Reimplemented in P4IPtCotThPhiM.

Definition at line 161 of file P4IPtCotThPhiMBase.cxx.

162{
163 std::cout << "FATAL ERROR dummy P4IPtCotThPhiMBase::set4Mom called " << std::endl ;
164 std::abort();
165}

◆ set4Mom() [2/3]

void P4IPtCotThPhiMBase::set4Mom ( const I4Momentum & theI4Mom)
virtual

set all 4-mom from another I4Momentum reference DUMMY IMPLEMENTATION

Implements I4Momentum.

Reimplemented in P4IPtCotThPhiM.

Definition at line 148 of file P4IPtCotThPhiMBase.cxx.

149{
150 std::cout << "FATAL ERROR dummy P4IPtCotThPhiMBase::set4Mom called " << std::endl ;
151 std::abort();
152}

◆ set4Mom() [3/3]

void P4IPtCotThPhiMBase::set4Mom ( const I4Momentum *const theI4Mom)
virtual

set all 4-mom from another I4Momentum pointer DUMMY IMPLEMENTATION

Implements I4Momentum.

Reimplemented in P4IPtCotThPhiM.

Definition at line 154 of file P4IPtCotThPhiMBase.cxx.

155{
156 std::cout << "FATAL ERROR dummy P4IPtCotThPhiMBase::set4Mom called " << std::endl ;
157 std::abort();
158
159}

◆ sinPhi()

double P4IPtCotThPhiMBase::sinPhi ( ) const
virtual

sinus phi

Implements I4Momentum.

Definition at line 108 of file P4IPtCotThPhiMBase.cxx.

109{
110 return std::sin(this->phi());
111}

◆ sinTh()

double P4IPtCotThPhiMBase::sinTh ( ) const
virtual

sinus theta

Implements I4Momentum.

Definition at line 41 of file P4IPtCotThPhiMBase.cxx.

42{
43 const double theCotTh=this->cotTh();
44 return 1./std::sqrt(1+theCotTh*theCotTh) ;
45}

◆ tanTh()

double P4IPtCotThPhiMBase::tanTh ( ) const
virtual

tan theta

Implements I4Momentum.

Definition at line 36 of file P4IPtCotThPhiMBase.cxx.

37{
38 return 1./this->cotTh() ;
39}

The documentation for this class was generated from the following files: