7 #ifndef FOURMOM_P4BASEEETAPHIM_H
8 #define FOURMOM_P4BASEEETAPHIM_H
17 #include "CLHEP/Vector/LorentzVector.h"
18 #include "CLHEP/Units/SystemOfUnits.h"
49 virtual double m()
const = 0;
54 virtual double eta()
const = 0;
55 virtual double phi()
const = 0;
56 virtual double e()
const = 0;
66 CLHEP::HepLorentzVector
hlv()
const;
69 std::ostream&
dump( std::ostream&
out )
const;
102 return this->
p()*this->
cosTh();
107 const double mass = this->
m();
113 const double theM=this->
m();
114 const double theE=this->
e();
123 double eSign = (theE >= 0.) ? +1. : -1.;
124 return eSign*std::sqrt(theE*theE-theM*theM);
138 const double mass = this->
m();
139 const double ene = this->
e();
146 return this->
e()*this->
sinTh();
151 const double theE=this->
e();
152 const double thePz=this->
pz();
153 return 0.5*
std::log((theE+thePz)/(theE-thePz));
158 return this->
p()*this->
sinTh();
163 return 1./this->
pt();
179 double theEta=this->
eta();
180 if ( std::abs(theEta)>710) {
181 theEta=theEta>0 ? 710 : -710;
182 return 1./std::sinh(theEta);
184 return 1./this->
cotTh();
189 return std::tanh(this->
eta());
196 double aEta=std::abs(this->
eta());
201 return 1./std::cosh(aEta);
206 return std::sinh(this->
eta());
212 const double theE = this->
e();
213 const double theCosTh = this->
cosTh();
220 const double theP = this->
p();
222 const double theSinTh = std::sqrt(1.-theCosTh*theCosTh);
223 const double thePt = theP*theSinTh;
224 const double thePx = thePt*this->
cosPhi();
225 const double thePy = thePt*this->
sinPhi();
226 const double thePz = theP*theCosTh;
228 return CLHEP::HepLorentzVector(thePx,thePy,thePz,theE);
234 s <<
"[e,eta,phi,m] ="
235 << std::right << std::scientific << std::setprecision(8)
236 << std::setw(16) << this->
e()
237 << std::setw(16) << this->
eta()
238 << std::setw(16) << this->
phi()
239 << std::setw(16) << this->
m();
247 #endif // FOURMOM_P4BASEEETAPHIM_H