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

#include <P4BasePxPyPzE.h>

Inheritance diagram for P4BasePxPyPzE:
Collaboration diagram for P4BasePxPyPzE:

Public Member Functions

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

Detailed Description

Definition at line 27 of file P4BasePxPyPzE.h.

Constructor & Destructor Documentation

◆ ~P4BasePxPyPzE()

P4BasePxPyPzE::~P4BasePxPyPzE ( )
inlinevirtual

Destructor:

Definition at line 89 of file P4BasePxPyPzE.h.

90{}

Member Function Documentation

◆ cosPhi()

double P4BasePxPyPzE::cosPhi ( ) const
inline

Definition at line 138 of file P4BasePxPyPzE.h.

139{
140 if ( this->px() == 0 && this->py() ==0 )
141 return 0;
142 return this->px()/this->pt();
143}
double pt() const
virtual double px() const =0
{@ a la I4Momentum -like interface
virtual double py() const =0

◆ cosTh()

double P4BasePxPyPzE::cosTh ( ) const
inline

Definition at line 195 of file P4BasePxPyPzE.h.

196{
197 if ( this->p() == 0 ) return 0;
198 return this->pz()/this->p();
199}
double p() const
virtual double pz() const =0

◆ cotTh()

double P4BasePxPyPzE::cotTh ( ) const
inline

Definition at line 213 of file P4BasePxPyPzE.h.

214{
215 if ( this->pt() == 0 ) return 0;
216 return this->pz()/this->pt();
217}

◆ dump()

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

Print I4Momentum content.

Definition at line 224 of file P4BasePxPyPzE.h.

225{
226 std::stringstream s;
227 s << "[px,py,pz,e] ="
228 << std::right << std::scientific << std::setprecision(8)
229 << std::setw(16) << this->px()
230 << std::setw(16) << this->py()
231 << std::setw(16) << this->pz()
232 << std::setw(16) << this->e();
233
234 out << s.str();
235 return out;
236}
virtual double e() const =0

◆ e()

◆ et()

double P4BasePxPyPzE::et ( ) const
inline

Definition at line 162 of file P4BasePxPyPzE.h.

163{
164 if ( this->e() == 0 )
165 return 0;
166 return this->e()*this->sinTh();
167}
double sinTh() const

◆ eta()

double P4BasePxPyPzE::eta ( void ) const
inline

Definition at line 123 of file P4BasePxPyPzE.h.

124{
125 const double px=this->px();
126 const double py=this->py();
127 const double pz=this->pz();
128 // FIXME: should we use a more underflow-friendly formula:
129 // sqrt(a**2 + b**2)
130 // => y.sqrt(1+(x/y)**2) where y=max(|a|,|b|) and x=min(|a|,|b|)
131 const double p =std::sqrt (px*px + py*py + pz*pz);
132 if (p==0.0) return 0.0;
133 if (p==+pz) return +std::numeric_limits<double>::infinity();
134 if (p==-pz) return -std::numeric_limits<double>::infinity();
135 return 0.5*log((p+pz)/(p-pz));
136}

◆ hlv()

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

Definition at line 219 of file P4BasePxPyPzE.h.

220{
221 return CLHEP::HepLorentzVector(this->px(),this->py(),this->pz(),this->e());
222}

◆ iPt()

double P4BasePxPyPzE::iPt ( ) const
inline

Definition at line 177 of file P4BasePxPyPzE.h.

178{
179 const double pt = this->pt();
180 if ( pt == 0 )
181 return std::numeric_limits<double>::infinity();
182 return 1./pt;
183}

◆ m()

double P4BasePxPyPzE::m ( void ) const
inline

Definition at line 92 of file P4BasePxPyPzE.h.

93{
94 const double m2 = this->m2();
95 return m2 < 0. ? -std::sqrt(-m2) : std::sqrt(m2);
96}
double m2() const

◆ m2()

double P4BasePxPyPzE::m2 ( ) const
inline

Definition at line 98 of file P4BasePxPyPzE.h.

99{
100 const double px = this->px();
101 const double py = this->py();
102 const double pz = this->pz();
103 const double e = this->e();
104
105 const double m2 = e*e - ( px*px + py*py + pz*pz );
106 return m2;
107}

◆ p()

double P4BasePxPyPzE::p ( ) const
inline

Definition at line 109 of file P4BasePxPyPzE.h.

110{
111 return std::sqrt( this->p2() );
112}
double p2() const

◆ p2()

double P4BasePxPyPzE::p2 ( ) const
inline

Definition at line 114 of file P4BasePxPyPzE.h.

115{
116 const double px = this->px();
117 const double py = this->py();
118 const double pz = this->pz();
119
120 return px*px + py*py + pz*pz;
121}

◆ phi()

double P4BasePxPyPzE::phi ( void ) const
inline

Definition at line 152 of file P4BasePxPyPzE.h.

153{
154 const double px=this->px();
155 const double py=this->py();
156 // return px == 0.0 && py == 0.0 ? 0.0 : std::atan2(py,px);
157 // AFAIK, atan2 is doing exactly this
158 return std::atan2(py,px);
159}

◆ pt()

double P4BasePxPyPzE::pt ( void ) const
inline

Definition at line 169 of file P4BasePxPyPzE.h.

170{
171 const double px=this->px();
172 const double py=this->py();
173
174 return std::sqrt(px*px + py*py);
175}

◆ px()

◆ py()

◆ pz()

◆ rapidity()

double P4BasePxPyPzE::rapidity ( ) const
inline

Definition at line 185 of file P4BasePxPyPzE.h.

186{
187 const double e =this->e();
188 const double pz=this->pz();
189 if (e==0.0) return 0.0;
190 if (e==+pz) return +std::numeric_limits<double>::infinity();
191 if (e==-pz) return -std::numeric_limits<double>::infinity();
192 return 0.5*std::log((e+pz)/(e-pz));
193}

◆ sinPhi()

double P4BasePxPyPzE::sinPhi ( ) const
inline

Definition at line 145 of file P4BasePxPyPzE.h.

146{
147 if ( this->px() == 0 && this->py() ==0 )
148 return 0;
149 return this->py()/this->pt();
150}

◆ sinTh()

double P4BasePxPyPzE::sinTh ( ) const
inline

Definition at line 201 of file P4BasePxPyPzE.h.

202{
203 if ( this->p() == 0 ) return 0;
204 return this->pt()/this->p();
205}

◆ tanTh()

double P4BasePxPyPzE::tanTh ( ) const
inline

Definition at line 207 of file P4BasePxPyPzE.h.

208{
209 if ( this->pz() == 0 ) return 0;
210 return this->pt()/this->pz();
211}

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