ATLAS Offline Software
Loading...
Searching...
No Matches
P4IPtCotThPhiM Class Reference

P4IPtCotThPhiM is a concrete class with 4-momentum behavior for which 1/Pt, cottan(tehta), phi and M are data members. More...

#include <P4IPtCotThPhiM.h>

Inheritance diagram for P4IPtCotThPhiM:
Collaboration diagram for P4IPtCotThPhiM:

Public Types

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

Public Member Functions

 P4IPtCotThPhiM (const double iPt, const double cotTh, const double phi, const double m)
 constructor with all data members
 P4IPtCotThPhiM ()
 default constructor
 P4IPtCotThPhiM (const CLHEP::HepLorentzVector &theHlv)
 constructor from hlv to allow conversion from hlv
 P4IPtCotThPhiM (const I4Momentum &theI4M)
 constructor from any I4Momentum reference
 P4IPtCotThPhiM (const I4Momentum *const pI4M)
 constructor from any I4Momentum pointer
virtual double iPt () const
 get inverse pT data member
virtual double cotTh () const
 get cot(theta) data member
virtual double phi () const
 get phi data member
virtual double m () const
 get m data member
virtual void setIPt (double theIPt)
 set inverse pT data member
virtual void setCotTh (double theCotTh)
 set cot(theta) data member
virtual void setPhi (double thePhi)
 set phi data member
virtual void setM (double theM)
 set m data member
virtual void set4Mom (const I4Momentum &theI4Mom)
 set all 4-mom from another I4Momentum reference
virtual void set4Mom (const I4Momentum *const theI4Mom)
 set all 4-mom from another I4Momentum pointer
virtual void set4Mom (const CLHEP::HepLorentzVector &theHlv)
 set all 4-mom from CLHEP HepLorentzVector
virtual const I4MomentumErrorerrors () const
 Access to errors, if available; returns 0 if no errors.
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.
I4Momentum::Kind kind () const
 tells what kind of P4XYZT this is
virtual std::ostream & dump (std::ostream &out) const
 Print I4Momentum content.

Protected Attributes

double m_iPt
double m_cotTh
double m_phi
double m_m

Detailed Description

P4IPtCotThPhiM is a concrete class with 4-momentum behavior for which 1/Pt, cottan(tehta), phi and M are data members.

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

Definition at line 25 of file P4IPtCotThPhiM.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

◆ P4IPtCotThPhiM() [1/5]

P4IPtCotThPhiM::P4IPtCotThPhiM ( const double iPt,
const double cotTh,
const double phi,
const double m )

constructor with all data members

Definition at line 7 of file P4IPtCotThPhiM.cxx.

7 :
9{
10 //inverse pT is unsigned. I put std::fabs there just for safety
11 m_iPt=std::fabs(iPt);
12
13
14 // could enforce phi range convention there
15 // const double twopi =2.*M_PI;
16 // const double threepi=3.*M_PI;
17 // m_phi=fmod(phi+threepi,twopi)-M_PI;
18}
virtual double m() const
get m data member
virtual double cotTh() const
get cot(theta) data member
virtual double phi() const
get phi data member
virtual double iPt() const
get inverse pT data member

◆ P4IPtCotThPhiM() [2/5]

P4IPtCotThPhiM::P4IPtCotThPhiM ( )
inline

default constructor

Definition at line 80 of file P4IPtCotThPhiM.h.

80 :
81 P4IPtCotThPhiMBase( ),
82 m_iPt ( 0./CLHEP::GeV ),
83 m_cotTh ( 0. ),
84 m_phi ( 0. ),
85 m_m ( 0.*CLHEP::GeV )
86{}

◆ P4IPtCotThPhiM() [3/5]

P4IPtCotThPhiM::P4IPtCotThPhiM ( const CLHEP::HepLorentzVector & theHlv)
inline

constructor from hlv to allow conversion from hlv

Definition at line 88 of file P4IPtCotThPhiM.h.

89{
90 this->set4Mom(theHlv);
91}
virtual void set4Mom(const I4Momentum &theI4Mom)
set all 4-mom from another I4Momentum reference

◆ P4IPtCotThPhiM() [4/5]

P4IPtCotThPhiM::P4IPtCotThPhiM ( const I4Momentum & theI4M)
inline

constructor from any I4Momentum reference

Definition at line 93 of file P4IPtCotThPhiM.h.

94{this->set4Mom(theI4Mom); }

◆ P4IPtCotThPhiM() [5/5]

P4IPtCotThPhiM::P4IPtCotThPhiM ( const I4Momentum *const pI4M)
inline

constructor from any I4Momentum pointer

Definition at line 96 of file P4IPtCotThPhiM.h.

97{this->set4Mom(*theI4Mom); }

Member Function Documentation

◆ cosPhi()

double P4IPtCotThPhiMBase::cosPhi ( ) const
virtualinherited

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
virtualinherited

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()

double P4IPtCotThPhiM::cotTh ( ) const
inlinevirtual

get cot(theta) data member

Implements I4Momentum.

Definition at line 103 of file P4IPtCotThPhiM.h.

104{ return m_cotTh;}

◆ dump()

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

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
virtualinherited

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 * P4IPtCotThPhiM::errors ( ) const
virtual

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

Reimplemented from P4IPtCotThPhiMBase.

Definition at line 20 of file P4IPtCotThPhiM.cxx.

21{
22 return 0;
23}

◆ et()

double P4IPtCotThPhiMBase::et ( ) const
virtualinherited

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
virtualinherited

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
virtualinherited

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()

double P4IPtCotThPhiM::iPt ( ) const
inlinevirtual

get inverse pT data member

Implements I4Momentum.

Definition at line 100 of file P4IPtCotThPhiM.h.

101{ return m_iPt;}

◆ kind()

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

tells what kind of P4XYZT this is

Implements I4Momentum.

Definition at line 60 of file P4IPtCotThPhiMBase.h.

◆ m()

double P4IPtCotThPhiM::m ( void ) const
inlinevirtual

get m data member

Implements I4Momentum.

Definition at line 109 of file P4IPtCotThPhiM.h.

110{ return m_m;}

◆ m2()

double P4IPtCotThPhiMBase::m2 ( ) const
virtualinherited

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
virtualinherited

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
virtualinherited

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()

double P4IPtCotThPhiM::phi ( void ) const
inlinevirtual

get phi data member

Implements I4Momentum.

Definition at line 106 of file P4IPtCotThPhiM.h.

107{ return m_phi;}

◆ pt()

double P4IPtCotThPhiMBase::pt ( ) const
virtualinherited

transverse momentum

Implements I4Momentum.

Definition at line 12 of file P4IPtCotThPhiMBase.cxx.

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

◆ px()

double P4IPtCotThPhiMBase::px ( ) const
virtualinherited

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
virtualinherited

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
virtualinherited

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
virtualinherited

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 P4IPtCotThPhiM::set4Mom ( const CLHEP::HepLorentzVector & theHlv)
inlinevirtual

set all 4-mom from CLHEP HepLorentzVector

Reimplemented from P4IPtCotThPhiMBase.

Definition at line 139 of file P4IPtCotThPhiM.h.

140{
141 m_iPt=1./theHlv.perp();
142 m_cotTh=theHlv.pz()*m_iPt;
143 m_phi=theHlv.phi();
144 m_m=theHlv.m();
145}

◆ set4Mom() [2/3]

void P4IPtCotThPhiM::set4Mom ( const I4Momentum & theI4Mom)
inlinevirtual

set all 4-mom from another I4Momentum reference

Reimplemented from P4IPtCotThPhiMBase.

Definition at line 125 of file P4IPtCotThPhiM.h.

126{
127 m_iPt=theI4Mom.iPt();
128 m_cotTh=theI4Mom.cotTh();
129 m_phi=theI4Mom.phi();
130 m_m=theI4Mom.m();
131}

◆ set4Mom() [3/3]

void P4IPtCotThPhiM::set4Mom ( const I4Momentum *const theI4Mom)
inlinevirtual

set all 4-mom from another I4Momentum pointer

Reimplemented from P4IPtCotThPhiMBase.

Definition at line 133 of file P4IPtCotThPhiM.h.

134{
135 this->set4Mom(*theI4Mom);
136}

◆ setCotTh()

void P4IPtCotThPhiM::setCotTh ( double theCotTh)
inlinevirtual

set cot(theta) data member

Definition at line 115 of file P4IPtCotThPhiM.h.

116{ m_cotTh=theCotTh;}

◆ setIPt()

void P4IPtCotThPhiM::setIPt ( double theIPt)
inlinevirtual

set inverse pT data member

Definition at line 112 of file P4IPtCotThPhiM.h.

113{ m_iPt=theIPt;}

◆ setM()

void P4IPtCotThPhiM::setM ( double theM)
inlinevirtual

set m data member

Definition at line 121 of file P4IPtCotThPhiM.h.

122{ m_m=theM;}

◆ setPhi()

void P4IPtCotThPhiM::setPhi ( double thePhi)
inlinevirtual

set phi data member

Definition at line 118 of file P4IPtCotThPhiM.h.

119{ m_phi=thePhi;}

◆ sinPhi()

double P4IPtCotThPhiMBase::sinPhi ( ) const
virtualinherited

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
virtualinherited

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
virtualinherited

tan theta

Implements I4Momentum.

Definition at line 36 of file P4IPtCotThPhiMBase.cxx.

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

Member Data Documentation

◆ m_cotTh

double P4IPtCotThPhiM::m_cotTh
protected

Definition at line 74 of file P4IPtCotThPhiM.h.

◆ m_iPt

double P4IPtCotThPhiM::m_iPt
protected

Definition at line 73 of file P4IPtCotThPhiM.h.

◆ m_m

double P4IPtCotThPhiM::m_m
protected

Definition at line 76 of file P4IPtCotThPhiM.h.

◆ m_phi

double P4IPtCotThPhiM::m_phi
protected

Definition at line 75 of file P4IPtCotThPhiM.h.


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