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

#include <P4BaseIPtCotThPhiM.h>

Inheritance diagram for P4BaseIPtCotThPhiM:
Collaboration diagram for P4BaseIPtCotThPhiM:

Public Member Functions

virtual ~P4BaseIPtCotThPhiM ()
 virtual destructor needed for inheritance More...
 
double px () const
 {@ a la I4Momentum -like interface More...
 
double py () const
 
double pz () const
 
virtual double m () const =0
 
double m2 () const
 
double p () const
 
double p2 () const
 
double eta () const
 
virtual double phi () const =0
 
double e () const
 
double et () const
 
double pt () const
 
virtual double iPt () const =0
 
double rapidity () const
 
double cosPhi () const
 
double sinPhi () const
 
double tanTh () const
 
double cosTh () const
 
double sinTh () const
 
virtual double cotTh () const =0
 
CLHEP::HepLorentzVector hlv () const
 
std::ostream & dump (std::ostream &out) const
 Print I4Momentum content. More...
 

Detailed Description

P4BaseIPtCotThPhiM 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
Sebastien Binet binet.nosp@m.@cer.nosp@m.n.ch

Definition at line 32 of file P4BaseIPtCotThPhiM.h.

Constructor & Destructor Documentation

◆ ~P4BaseIPtCotThPhiM()

P4BaseIPtCotThPhiM::~P4BaseIPtCotThPhiM ( )
inlinevirtual

virtual destructor needed for inheritance

Definition at line 84 of file P4BaseIPtCotThPhiM.h.

85 {}

Member Function Documentation

◆ cosPhi()

double P4BaseIPtCotThPhiM::cosPhi ( ) const
inline

Definition at line 212 of file P4BaseIPtCotThPhiM.h.

213 {
214  return std::cos(this->phi());
215 }

◆ cosTh()

double P4BaseIPtCotThPhiM::cosTh ( ) const
inline

Definition at line 190 of file P4BaseIPtCotThPhiM.h.

191 {
192  const double theCotTh = this->cotTh();
193  const double theCotTh2 = theCotTh*theCotTh;
194  const double theCosTh = std::sqrt(theCotTh2/(1.+theCotTh2));
195  if ( theCotTh >= 0. ) {
196  return theCosTh;
197  } else{
198  return -theCosTh;
199  }
200 }

◆ cotTh()

virtual double P4BaseIPtCotThPhiM::cotTh ( ) const
pure virtual

Implemented in P4ImplIPtCotThPhiM.

◆ dump()

std::ostream & P4BaseIPtCotThPhiM::dump ( std::ostream &  out) const
inline

Print I4Momentum content.

Definition at line 243 of file P4BaseIPtCotThPhiM.h.

244 {
245  std::stringstream s;
246  s << "[ipt,cotTh,phi,m] ="
247  << std::right << std::scientific << std::setprecision(8)
248  << std::setw(16) << this->iPt()
249  << std::setw(16) << this->cotTh()
250  << std::setw(16) << this->phi()
251  << std::setw(16) << this->m();
252 
253  out << s.str();
254 
255  return out;
256 }

◆ e()

double P4BaseIPtCotThPhiM::e ( ) const
inline

Definition at line 154 of file P4BaseIPtCotThPhiM.h.

155 {
156  const double theM = this->m();
157  const double theP = this->p();
158  if ( theM == 0. ) {
159  return theP;
160  } else {
161  return std::sqrt( theP*theP + theM*theM );
162  }
163 }

◆ et()

double P4BaseIPtCotThPhiM::et ( ) const
inline

Definition at line 167 of file P4BaseIPtCotThPhiM.h.

168 {
169  const double theE = this->e();
170  const double theCotTh = this->cotTh();
171  return theE / std::sqrt( 1 + theCotTh*theCotTh );
172 }

◆ eta()

double P4BaseIPtCotThPhiM::eta ( ) const
inline

Definition at line 135 of file P4BaseIPtCotThPhiM.h.

136 {
137  const double theCotTh = this->cotTh();
138  const double aux = std::sqrt(1+theCotTh*theCotTh);
139  return -0.5 * std::log( (aux-theCotTh) / (aux+theCotTh) );
140 }

◆ hlv()

CLHEP::HepLorentzVector P4BaseIPtCotThPhiM::hlv ( ) const
inline

Definition at line 226 of file P4BaseIPtCotThPhiM.h.

227 {
228  //minimize the number of calculation and dereference
229  const double thePt = this->pt();
230  const double theM = this->m();
231  const double thePx = thePt*this->cosPhi();
232  const double thePy = thePt*this->sinPhi();
233  const double thePz = thePt * this->cotTh();
234  const double theE = std::sqrt( thePt * thePt
235  + thePz * thePz
236  + theM * theM );
237 
238  return CLHEP::HepLorentzVector( thePx, thePy, thePz, theE );
239 }

◆ iPt()

virtual double P4BaseIPtCotThPhiM::iPt ( ) const
pure virtual

Implemented in P4ImplIPtCotThPhiM.

◆ m()

virtual double P4BaseIPtCotThPhiM::m ( ) const
pure virtual

Implemented in P4ImplIPtCotThPhiM.

◆ m2()

double P4BaseIPtCotThPhiM::m2 ( ) const
inline

Definition at line 110 of file P4BaseIPtCotThPhiM.h.

111 {
112  const double mass = this->m();
113  return mass*mass;
114 }

◆ p()

double P4BaseIPtCotThPhiM::p ( ) const
inline

Definition at line 118 of file P4BaseIPtCotThPhiM.h.

119 {
120  const double theCotTh = this->cotTh();
121  return std::sqrt( 1 + theCotTh*theCotTh ) / this->iPt() ;
122 }

◆ p2()

double P4BaseIPtCotThPhiM::p2 ( ) const
inline

Definition at line 126 of file P4BaseIPtCotThPhiM.h.

127 {
128  const double cotTh = this->cotTh();
129  const double iPt = this->iPt();
130  return ( 1 + cotTh*cotTh ) / (iPt*iPt) ;
131 }

◆ phi()

virtual double P4BaseIPtCotThPhiM::phi ( ) const
pure virtual

Implemented in P4ImplIPtCotThPhiM.

◆ pt()

double P4BaseIPtCotThPhiM::pt ( ) const
inline

Definition at line 176 of file P4BaseIPtCotThPhiM.h.

177 {
178  return 1./this->iPt();
179 }

◆ px()

double P4BaseIPtCotThPhiM::px ( ) const
inline

{@ a la I4Momentum -like interface

Definition at line 89 of file P4BaseIPtCotThPhiM.h.

90 {
91  return std::cos(this->phi())/this->iPt();
92 }

◆ py()

double P4BaseIPtCotThPhiM::py ( ) const
inline

Definition at line 96 of file P4BaseIPtCotThPhiM.h.

97 {
98  return std::sin(this->phi())/this->iPt();
99 }

◆ pz()

double P4BaseIPtCotThPhiM::pz ( ) const
inline

Definition at line 103 of file P4BaseIPtCotThPhiM.h.

104 {
105  return this->cotTh()/this->iPt();
106 }

◆ rapidity()

double P4BaseIPtCotThPhiM::rapidity ( ) const
inline

Definition at line 144 of file P4BaseIPtCotThPhiM.h.

145 {
146  const double theE=this->e();
147  const double thePz=this->pz();
148  return 0.5*std::log((theE+thePz)/(theE-thePz));
149 }

◆ sinPhi()

double P4BaseIPtCotThPhiM::sinPhi ( ) const
inline

Definition at line 219 of file P4BaseIPtCotThPhiM.h.

220 {
221  return std::sin(this->phi());
222 }

◆ sinTh()

double P4BaseIPtCotThPhiM::sinTh ( ) const
inline

Definition at line 204 of file P4BaseIPtCotThPhiM.h.

205 {
206  const double theCotTh = this->cotTh();
207  return 1. / std::sqrt( 1 + theCotTh*theCotTh );
208 }

◆ tanTh()

double P4BaseIPtCotThPhiM::tanTh ( ) const
inline

Definition at line 183 of file P4BaseIPtCotThPhiM.h.

184 {
185  return 1./this->cotTh() ;
186 }

The documentation for this class was generated from the following file:
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
P4BaseIPtCotThPhiM::pz
double pz() const
Definition: P4BaseIPtCotThPhiM.h:103
Base_Fragment.mass
mass
Definition: Sherpa_i/share/common/Base_Fragment.py:59
P4BaseIPtCotThPhiM::cotTh
virtual double cotTh() const =0
P4BaseIPtCotThPhiM::pt
double pt() const
Definition: P4BaseIPtCotThPhiM.h:176
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
P4BaseIPtCotThPhiM::iPt
virtual double iPt() const =0
P4BaseIPtCotThPhiM::p
double p() const
Definition: P4BaseIPtCotThPhiM.h:118
P4BaseIPtCotThPhiM::m
virtual double m() const =0
P4BaseIPtCotThPhiM::cosPhi
double cosPhi() const
Definition: P4BaseIPtCotThPhiM.h:212
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
P4BaseIPtCotThPhiM::phi
virtual double phi() const =0
P4BaseIPtCotThPhiM::sinPhi
double sinPhi() const
Definition: P4BaseIPtCotThPhiM.h:219
P4BaseIPtCotThPhiM::e
double e() const
Definition: P4BaseIPtCotThPhiM.h:154