11 #ifndef FOURMOM_P4BASEPXPYPZE_H
12 #define FOURMOM_P4BASEPXPYPZE_H
22 #include "CLHEP/Vector/LorentzVector.h"
23 #include "CLHEP/Units/SystemOfUnits.h"
46 virtual double px()
const = 0;
47 virtual double py()
const = 0;
48 virtual double pz()
const = 0;
56 virtual double e()
const = 0;
66 CLHEP::HepLorentzVector
hlv()
const;
69 std::ostream&
dump( std::ostream&
out )
const;
94 const double m2 = this->
m2();
95 return m2 < 0. ? -std::sqrt(-
m2) : std::sqrt(
m2);
100 const double px = this->
px();
101 const double py = this->
py();
102 const double pz = this->
pz();
103 const double e = this->
e();
111 return std::sqrt( this->
p2() );
116 const double px = this->
px();
117 const double py = this->
py();
118 const double pz = this->
pz();
125 const double px=this->
px();
126 const double py=this->
py();
127 const double pz=this->
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();
140 if ( this->
px() == 0 && this->
py() ==0 )
142 return this->
px()/this->
pt();
147 if ( this->
px() == 0 && this->
py() ==0 )
149 return this->
py()/this->
pt();
154 const double px=this->
px();
155 const double py=this->
py();
158 return std::atan2(
py,
px);
164 if ( this->
e() == 0 )
166 return this->
e()*this->
sinTh();
171 const double px=this->
px();
172 const double py=this->
py();
179 const double pt = this->
pt();
181 return std::numeric_limits<double>::infinity();
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();
197 if ( this->
p() == 0 )
return 0;
198 return this->
pz()/this->
p();
203 if ( this->
p() == 0 )
return 0;
204 return this->
pt()/this->
p();
209 if ( this->
pz() == 0 )
return 0;
210 return this->
pt()/this->
pz();
215 if ( this->
pt() == 0 )
return 0;
216 return this->
pz()/this->
pt();
221 return CLHEP::HepLorentzVector(this->
px(),this->
py(),this->
pz(),this->
e());
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();
238 #endif //> FOURMOM_P4BASEPXPYPZE_H