7#ifndef FOURMOM_P4BASEIPTCOTTHPHIM_H
8#define FOURMOM_P4BASEIPTCOTTHPHIM_H
17#include "CLHEP/Vector/LorentzVector.h"
18#include "CLHEP/Units/SystemOfUnits.h"
49 virtual double m()
const = 0;
54 virtual double phi()
const = 0;
58 virtual double iPt()
const = 0;
65 virtual double cotTh()
const = 0;
66 CLHEP::HepLorentzVector
hlv()
const;
69 std::ostream&
dump( std::ostream& out )
const;
91 return std::cos(this->
phi())/this->
iPt();
98 return std::sin(this->
phi())/this->
iPt();
112 const double mass = this->
m();
120 const double theCotTh = this->
cotTh();
121 return std::sqrt( 1 + theCotTh*theCotTh ) / this->
iPt() ;
129 const double iPt = this->
iPt();
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) );
146 const double theE=this->
e();
147 const double thePz=this->
pz();
148 return 0.5*std::log((theE+thePz)/(theE-thePz));
156 const double theM = this->
m();
157 const double theP = this->
p();
161 return std::sqrt( theP*theP + theM*theM );
169 const double theE = this->
e();
170 const double theCotTh = this->
cotTh();
171 return theE / std::sqrt( 1 + theCotTh*theCotTh );
178 return 1./this->
iPt();
185 return 1./this->
cotTh() ;
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. ) {
206 const double theCotTh = this->
cotTh();
207 return 1. / std::sqrt( 1 + theCotTh*theCotTh );
214 return std::cos(this->
phi());
221 return std::sin(this->
phi());
225CLHEP::HepLorentzVector
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
238 return CLHEP::HepLorentzVector( thePx, thePy, thePz, theE );
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();
P4BaseIPtCotThPhiM is a base class for classes with 4-momentum behavior, for which 1/Pt,...
std::ostream & dump(std::ostream &out) const
Print I4Momentum content.
virtual double m() const =0
double px() const
{@ a la I4Momentum -like interface
virtual double iPt() const =0
virtual double cotTh() const =0
virtual ~P4BaseIPtCotThPhiM()
virtual destructor needed for inheritance
CLHEP::HepLorentzVector hlv() const
virtual double phi() const =0