7 #ifndef FOURMOM_P4BASEPTETAPHIM_H
8 #define FOURMOM_P4BASEPTETAPHIM_H
17 #include "CLHEP/Vector/LorentzVector.h"
18 #include "CLHEP/Units/SystemOfUnits.h"
49 virtual double m()
const = 0;
53 virtual double eta()
const = 0;
54 virtual double phi()
const = 0;
57 virtual double pt()
const = 0;
66 CLHEP::HepLorentzVector
hlv()
const;
69 std::ostream&
dump( std::ostream&
out )
const;
107 return this->
pt()/this->
tanTh();
112 const double mass = this->
m();
118 const double thePt = this->
pt();
119 const double thePz = this->
pz();
125 const double eSign = (thePt >= 0.) ? +1. : -1.;
126 return eSign * std::sqrt( thePt*thePt + thePz*thePz );
135 const double pt = this->
pt();
136 const double pz = this->
pz();
143 const double theMass = this->
m();
144 const double thePt = this->
pt();
145 const double thePz = this->
pz();
151 const double eSign = (thePt >= 0.) ? +1. : -1.;
152 return eSign * std::sqrt( thePt*thePt + thePz*thePz + theMass*theMass);
157 return this->
e()*this->
sinTh();
162 return 1./this->
pt();
167 const double theE=this->
e();
168 const double thePz=this->
pz();
169 return 0.5*
std::log((theE+thePz)/(theE-thePz));
186 return std::tanh(this->
eta());
193 double aEta=std::abs(this->
eta());
198 return 1./std::cosh(aEta);
203 return std::sinh(this->
eta());
208 return 1./std::sinh(this->
eta());
220 const double theM = this->
m();
222 const double thePt = this->
pt();
225 const double thePx = thePt*this->
cosPhi();
226 const double thePy = thePt*this->
sinPhi();
228 const double thePz = thePt*this->
cotTh();
230 const double theE=std::sqrt(thePt*thePt+thePz*thePz+theM*theM);
233 return CLHEP::HepLorentzVector( thePx, thePy, thePz, theE );
239 s <<
"[pt,eta,phi,m] ="
240 << std::right << std::scientific << std::setprecision(8)
241 << std::setw(16) << this->
pt()
242 << std::setw(16) << this->
eta()
243 << std::setw(16) << this->
phi()
244 << std::setw(16) << this->
m();