ATLAS Offline Software
Public Types | Public Member Functions | List of all members
P4IPtCotThPhiMBase Class Referenceabstract

#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 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...
 
virtual const I4MomentumErrorerrors () const
 Access to errors, if available; returns 0 if no errors. More...
 
virtual void set4Mom (const I4Momentum &theI4Mom)
 set all 4-mom from another I4Momentum reference DUMMY IMPLEMENTATION
More...
 
virtual void set4Mom (const I4Momentum *const theI4Mom)
 set all 4-mom from another I4Momentum pointer DUMMY IMPLEMENTATION More...
 
virtual void set4Mom (const CLHEP::HepLorentzVector &theHlv)
 set all 4-mom from a CLHEP HepLorentzVector DUMMY IMPLEMENTATION 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...
 
virtual double m () const =0
 mass More...
 
virtual double phi () const =0
 phi in [-pi,pi[ More...
 
virtual double iPt () const =0
 inverse of transverse momentum More...
 
virtual double cotTh () const =0
 cottan theta More...
 

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 }

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

◆ cotTh()

virtual double I4Momentum::cotTh ( ) const
pure virtualinherited

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

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

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

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

◆ iPt()

virtual double I4Momentum::iPt ( ) const
pure virtualinherited

◆ kind()

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

tells what kind of P4XYZT this is

Implements I4Momentum.

Definition at line 60 of file P4IPtCotThPhiMBase.h.

60 { return I4Momentum::P4IPTCOTTHPHIM; };

◆ m()

virtual double I4Momentum::m ( ) const
pure virtualinherited

◆ 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

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

◆ 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:
P4IPtCotThPhiMBase::sinPhi
virtual double sinPhi() const
sinus phi
Definition: P4IPtCotThPhiMBase.cxx:108
P4IPtCotThPhiMBase::pz
virtual double pz() const
z component of momentum
Definition: P4IPtCotThPhiMBase.cxx:99
I4Momentum::P4IPTCOTTHPHIM
@ P4IPTCOTTHPHIM
Definition: I4Momentum.h:33
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
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
P4IPtCotThPhiMBase::e
virtual double e() const
energy
Definition: P4IPtCotThPhiMBase.cxx:61
I4Momentum::phi
virtual double phi() const =0
phi in [-pi,pi[
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
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
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