P4BaseEEtaPhiM is a base class for classes with 4-momentum behavior, for which E, eta, phi and M are natural parameters, which is typically the case for a calorimeter object.
More...
#include <P4BaseEEtaPhiM.h>
|
| virtual | ~P4BaseEEtaPhiM () |
| | virtual destructor needed for inheritance
|
| double | px () const |
| | {@ a la I4Momentum -like interface
|
| double | py () const |
| double | pz () const |
| virtual double | m () const =0 |
| double | m2 () const |
| double | rapidity () const |
| double | p () const |
| double | p2 () const |
| virtual double | eta () const =0 |
| virtual double | phi () const =0 |
| virtual double | e () const =0 |
| double | et () const |
| double | pt () const |
| double | iPt () const |
| double | sinPhi () const |
| double | cosPhi () const |
| double | tanTh () const |
| double | cosTh () const |
| double | sinTh () const |
| double | cotTh () const |
| CLHEP::HepLorentzVector | hlv () const |
| std::ostream & | dump (std::ostream &out) const |
| | Print I4Momentum content.
|
P4BaseEEtaPhiM is a base class for classes with 4-momentum behavior, for which E, eta, phi and M are natural parameters, which is typically the case for a calorimeter object.
Any class deriving from it should implement e(), eta(), phi(), m().
- Author
- David Rousseau rouss.nosp@m.eau@.nosp@m.lal.i.nosp@m.n2p3.nosp@m..fr
Definition at line 32 of file P4BaseEEtaPhiM.h.
◆ ~P4BaseEEtaPhiM()
| P4BaseEEtaPhiM::~P4BaseEEtaPhiM |
( |
| ) |
|
|
inlinevirtual |
◆ cosPhi()
| double P4BaseEEtaPhiM::cosPhi |
( |
| ) |
const |
|
inline |
Definition at line 166 of file P4BaseEEtaPhiM.h.
167{
168 return std::cos(this->
phi());
169}
virtual double phi() const =0
◆ cosTh()
| double P4BaseEEtaPhiM::cosTh |
( |
| ) |
const |
|
inline |
Definition at line 187 of file P4BaseEEtaPhiM.h.
188{
189 return std::tanh(this->
eta());
190}
virtual double eta() const =0
◆ cotTh()
| double P4BaseEEtaPhiM::cotTh |
( |
| ) |
const |
|
inline |
◆ dump()
| std::ostream & P4BaseEEtaPhiM::dump |
( |
std::ostream & | out | ) |
const |
|
inline |
Print I4Momentum content.
Definition at line 231 of file P4BaseEEtaPhiM.h.
232{
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();
240
243
244}
virtual double m() const =0
virtual double e() const =0
◆ e()
| virtual double P4BaseEEtaPhiM::e |
( |
| ) |
const |
|
pure virtual |
◆ et()
| double P4BaseEEtaPhiM::et |
( |
| ) |
const |
|
inline |
◆ eta()
| virtual double P4BaseEEtaPhiM::eta |
( |
| ) |
const |
|
pure virtual |
◆ hlv()
| CLHEP::HepLorentzVector P4BaseEEtaPhiM::hlv |
( |
| ) |
const |
|
inline |
Definition at line 209 of file P4BaseEEtaPhiM.h.
210{
211
212 const double theE = this->
e();
213 const double theCosTh = this->
cosTh();
214
215
216
217
218
219
220 const double theP = this->
p();
221
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;
227
228 return CLHEP::HepLorentzVector(thePx,thePy,thePz,theE);
229}
◆ iPt()
| double P4BaseEEtaPhiM::iPt |
( |
| ) |
const |
|
inline |
◆ m()
| virtual double P4BaseEEtaPhiM::m |
( |
| ) |
const |
|
pure virtual |
◆ m2()
| double P4BaseEEtaPhiM::m2 |
( |
| ) |
const |
|
inline |
◆ p()
| double P4BaseEEtaPhiM::p |
( |
| ) |
const |
|
inline |
Definition at line 111 of file P4BaseEEtaPhiM.h.
112{
113 const double theM=this->
m();
114 const double theE=this->
e();
115
116
117
118
119
120 if (theM==0.) {
121 return theE;
122 } else {
123 double eSign = (theE >= 0.) ? +1. : -1.;
124 return eSign*std::sqrt(theE*theE-theM*theM);
125 }
126
127}
◆ p2()
| double P4BaseEEtaPhiM::p2 |
( |
| ) |
const |
|
inline |
This p2() implementaion is derived from the (somewhat unusual) Frank Paige implementation used to calculate p() above. What we do is look at what would happen if we were to square the answer returned by Frank's algorithm:
(1) The "eSign" would square to +1 and disappear, (2) The sqrt would disappear leaving theE*theE-theM*theM (3) In the event that theM==0, this theE*theE would indeed still equal theE*theE-theM*theM, so we simply return this quantity.
Definition at line 129 of file P4BaseEEtaPhiM.h.
130{
138 const double mass = this->
m();
139 const double ene = this->
e();
140
142}
◆ phi()
| virtual double P4BaseEEtaPhiM::phi |
( |
| ) |
const |
|
pure virtual |
◆ pt()
| double P4BaseEEtaPhiM::pt |
( |
void | | ) |
const |
|
inline |
◆ px()
| double P4BaseEEtaPhiM::px |
( |
| ) |
const |
|
inline |
◆ py()
| double P4BaseEEtaPhiM::py |
( |
| ) |
const |
|
inline |
◆ pz()
| double P4BaseEEtaPhiM::pz |
( |
| ) |
const |
|
inline |
◆ rapidity()
| double P4BaseEEtaPhiM::rapidity |
( |
| ) |
const |
|
inline |
Definition at line 149 of file P4BaseEEtaPhiM.h.
150 {
151 const double theE=this->
e();
152 const double thePz=this->
pz();
153 return 0.5*std::log((theE+thePz)/(theE-thePz));
154 }
◆ sinPhi()
| double P4BaseEEtaPhiM::sinPhi |
( |
| ) |
const |
|
inline |
◆ sinTh()
| double P4BaseEEtaPhiM::sinTh |
( |
| ) |
const |
|
inline |
Definition at line 192 of file P4BaseEEtaPhiM.h.
193{
194
195
196 double aEta=std::abs(this->
eta());
197 if ( aEta>710) {
198 aEta=710;
199 }
200
201 return 1./std::cosh(aEta);
202}
◆ tanTh()
| double P4BaseEEtaPhiM::tanTh |
( |
| ) |
const |
|
inline |
Definition at line 177 of file P4BaseEEtaPhiM.h.
178{
179 double theEta=this->
eta();
180 if ( std::abs(theEta)>710) {
181 theEta=theEta>0 ? 710 : -710;
182 return 1./std::sinh(theEta);
183 }
184 return 1./this->
cotTh();
185}
The documentation for this class was generated from the following file: