ATLAS Offline Software
Public Types | Public Member Functions | Protected Attributes | List of all members
P4IPtCotThPhiM Class Reference

#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 More...
 
 P4IPtCotThPhiM ()
 default constructor More...
 
 P4IPtCotThPhiM (const CLHEP::HepLorentzVector &theHlv)
 constructor from hlv to allow conversion from hlv More...
 
 P4IPtCotThPhiM (const I4Momentum &theI4M)
 constructor from any I4Momentum reference More...
 
 P4IPtCotThPhiM (const I4Momentum *const pI4M)
 constructor from any I4Momentum pointer More...
 
virtual double iPt () const
 get inverse pT data member
More...
 
virtual double cotTh () const
 get cot(theta) data member
More...
 
virtual double phi () const
 get phi data member
More...
 
virtual double m () const
 get m data member
More...
 
virtual void setIPt (double theIPt)
 set inverse pT data member
More...
 
virtual void setCotTh (double theCotTh)
 set cot(theta) data member
More...
 
virtual void setPhi (double thePhi)
 set phi data member
More...
 
virtual void setM (double theM)
 set m data member
More...
 
virtual void set4Mom (const I4Momentum &theI4Mom)
 set all 4-mom from another I4Momentum reference
More...
 
virtual void set4Mom (const I4Momentum *const theI4Mom)
 set all 4-mom from another I4Momentum pointer
More...
 
virtual void set4Mom (const CLHEP::HepLorentzVector &theHlv)
 set all 4-mom from CLHEP HepLorentzVector
More...
 
virtual const I4MomentumErrorerrors () const
 Access to errors, if available; returns 0 if no errors. More...
 
virtual double e () const
 energy More...
 
virtual double eta () const
 pseudo rapidity More...
 
virtual double px () const
 x component of momentum More...
 
virtual double py () const
 y component of momentum More...
 
virtual double pz () const
 z component of momentum More...
 
virtual double et () const
 transverse energy defined to be e*sin(theta) More...
 
virtual double m2 () const
 mass squared More...
 
virtual double p () const
 momentum magnitude More...
 
virtual double p2 () const
 square of momentum magnitude More...
 
virtual double pt () const
 transverse momentum More...
 
virtual double rapidity () const
 rapidity More...
 
virtual double cosPhi () const
 cosinus phi More...
 
virtual double sinPhi () const
 sinus phi More...
 
virtual double tanTh () const
 tan theta More...
 
virtual double cosTh () const
 cosinus theta More...
 
virtual double sinTh () const
 sinus theta More...
 
virtual CLHEP::HepLorentzVector hlv () const
 CLHEP HepLorentzVector. More...
 
I4Momentum::Kind kind () const
 tells what kind of P4XYZT this is More...
 
virtual std::ostream & dump (std::ostream &out) const
 Print I4Momentum content. More...
 

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 }

◆ P4IPtCotThPhiM() [2/5]

P4IPtCotThPhiM::P4IPtCotThPhiM ( )
inline

default constructor

Definition at line 80 of file P4IPtCotThPhiM.h.

80  :
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 }

◆ 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 }

◆ 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 }

◆ 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 }

◆ 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 }

◆ 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 }

◆ 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 }

◆ 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.

60 { return I4Momentum::P4IPTCOTTHPHIM; };

◆ m()

double P4IPtCotThPhiM::m ( ) 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 ( ) 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  }

◆ 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:
P4IPtCotThPhiMBase::sinPhi
virtual double sinPhi() const
sinus phi
Definition: P4IPtCotThPhiMBase.cxx:108
P4IPtCotThPhiMBase
Definition: P4IPtCotThPhiMBase.h:28
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
P4IPtCotThPhiM::set4Mom
virtual void set4Mom(const I4Momentum &theI4Mom)
set all 4-mom from another I4Momentum reference
Definition: P4IPtCotThPhiM.h:125
P4IPtCotThPhiMBase::pz
virtual double pz() const
z component of momentum
Definition: P4IPtCotThPhiMBase.cxx:99
I4Momentum::P4IPTCOTTHPHIM
@ P4IPTCOTTHPHIM
Definition: I4Momentum.h:33
P4IPtCotThPhiM::m_phi
double m_phi
Definition: P4IPtCotThPhiM.h:75
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
P4IPtCotThPhiM::m_cotTh
double m_cotTh
Definition: P4IPtCotThPhiM.h:74
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
I4Momentum::cotTh
virtual double cotTh() const =0
cottan theta
P4IPtCotThPhiMBase::p
virtual double p() const
momentum magnitude
Definition: P4IPtCotThPhiMBase.cxx:18
P4IPtCotThPhiM::m_m
double m_m
Definition: P4IPtCotThPhiM.h:76
P4IPtCotThPhiMBase::e
virtual double e() const
energy
Definition: P4IPtCotThPhiMBase.cxx:61
P4IPtCotThPhiM::m_iPt
double m_iPt
Definition: P4IPtCotThPhiM.h:73
I4Momentum::phi
virtual double phi() const =0
phi in [-pi,pi[
P4IPtCotThPhiM::phi
virtual double phi() const
get phi data member
Definition: P4IPtCotThPhiM.h:106
I4Momentum::P4PTETAPHIM
@ P4PTETAPHIM
Definition: I4Momentum.h:33
I4Momentum::UNKNOWN
@ UNKNOWN
Definition: I4Momentum.h:33
P4IPtCotThPhiMBase::cosPhi
virtual double cosPhi() const
cosinus phi
Definition: P4IPtCotThPhiMBase.cxx:103
I4Momentum::m
virtual double m() const =0
mass
P4IPtCotThPhiM::m
virtual double m() const
get m data member
Definition: P4IPtCotThPhiM.h:109
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
P4IPtCotThPhiM::iPt
virtual double iPt() const
get inverse pT data member
Definition: P4IPtCotThPhiM.h:100
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
I4Momentum::P4EETAPHIM
@ P4EETAPHIM
Definition: I4Momentum.h:33
I4Momentum::iPt
virtual double iPt() const =0
inverse of transverse momentum
P4IPtCotThPhiMBase::pt
virtual double pt() const
transverse momentum
Definition: P4IPtCotThPhiMBase.cxx:12
I4Momentum::P4PXPYPZE
@ P4PXPYPZE
Definition: I4Momentum.h:33
P4IPtCotThPhiM::cotTh
virtual double cotTh() const
get cot(theta) data member
Definition: P4IPtCotThPhiM.h:103