P4ImplEEtaPhiM 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 <P4ImplEEtaPhiM.h>
P4ImplEEtaPhiM 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
-
Sebastien Binet binet.nosp@m.@cer.nosp@m.n.ch
Definition at line 39 of file P4ImplEEtaPhiM.h.
◆ ErrorType
◆ P4ImplEEtaPhiM() [1/6]
| P4ImplEEtaPhiM::P4ImplEEtaPhiM |
( |
| ) |
|
|
inline |
Default constructor:
Definition at line 132 of file P4ImplEEtaPhiM.h.
132 :
133 P4BaseEEtaPhiM( ),
134 m_e ( 0.*CLHEP::GeV ),
137 m_m ( 0.*CLHEP::GeV ),
139{}
std::unique_ptr< ErrorType > m_error
◆ P4ImplEEtaPhiM() [2/6]
Copy constructor.
Definition at line 141 of file P4ImplEEtaPhiM.h.
141 :
142 P4BaseEEtaPhiM( ),
148{}
◆ P4ImplEEtaPhiM() [3/6]
| P4ImplEEtaPhiM::P4ImplEEtaPhiM |
( |
const double | e, |
|
|
const double | eta, |
|
|
const double | phi, |
|
|
const double | m ) |
|
inline |
constructor with all data members
Definition at line 150 of file P4ImplEEtaPhiM.h.
151 :
152 P4BaseEEtaPhiM( ),
158{
159
160
161
162
163}
double m() const
{@ a la I4Momentum -like interface
◆ P4ImplEEtaPhiM() [4/6]
| P4ImplEEtaPhiM::P4ImplEEtaPhiM |
( |
const CLHEP::HepLorentzVector & | hlv | ) |
|
|
inlineexplicit |
constructor from hlv to allow conversion from hlv
Definition at line 165 of file P4ImplEEtaPhiM.h.
165 :
166 P4BaseEEtaPhiM( ),
172{}
CLHEP::HepLorentzVector hlv() const
◆ P4ImplEEtaPhiM() [5/6]
| P4ImplEEtaPhiM::P4ImplEEtaPhiM |
( |
const I4Momentum & | theI4M | ) |
|
|
inlineexplicit |
◆ P4ImplEEtaPhiM() [6/6]
| P4ImplEEtaPhiM::P4ImplEEtaPhiM |
( |
const I4Momentum *const | theI4M | ) |
|
|
inlineexplicit |
◆ ~P4ImplEEtaPhiM()
| P4ImplEEtaPhiM::~P4ImplEEtaPhiM |
( |
| ) |
|
|
inlinevirtual |
◆ cosPhi()
| double P4BaseEEtaPhiM::cosPhi |
( |
| ) |
const |
|
inlineinherited |
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 |
|
inlineinherited |
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 |
|
inlineinherited |
◆ dump()
| std::ostream & P4BaseEEtaPhiM::dump |
( |
std::ostream & | out | ) |
const |
|
inlineinherited |
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()
| double P4ImplEEtaPhiM::e |
( |
| ) |
const |
|
inlinevirtual |
◆ errors()
◆ et()
| double P4BaseEEtaPhiM::et |
( |
| ) |
const |
|
inlineinherited |
◆ eta()
| double P4ImplEEtaPhiM::eta |
( |
void | | ) |
const |
|
inlinevirtual |
◆ hlv()
| CLHEP::HepLorentzVector P4BaseEEtaPhiM::hlv |
( |
| ) |
const |
|
inlineinherited |
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 |
|
inlineinherited |
◆ kind()
◆ m()
| double P4ImplEEtaPhiM::m |
( |
void | | ) |
const |
|
inlinevirtual |
◆ m2()
| double P4BaseEEtaPhiM::m2 |
( |
| ) |
const |
|
inlineinherited |
◆ operator=()
Assignment operator.
Definition at line 14 of file P4ImplEEtaPhiM.cxx.
15{
16 if ( this != &rhs ) {
21 }
22 return *this;
23}
◆ p()
| double P4BaseEEtaPhiM::p |
( |
| ) |
const |
|
inlineinherited |
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 |
|
inlineinherited |
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()
| double P4ImplEEtaPhiM::phi |
( |
void | | ) |
const |
|
inlinevirtual |
◆ pt()
| double P4BaseEEtaPhiM::pt |
( |
void | | ) |
const |
|
inlineinherited |
◆ px()
| double P4BaseEEtaPhiM::px |
( |
| ) |
const |
|
inlineinherited |
◆ py()
| double P4BaseEEtaPhiM::py |
( |
| ) |
const |
|
inlineinherited |
◆ pz()
| double P4BaseEEtaPhiM::pz |
( |
| ) |
const |
|
inlineinherited |
◆ rapidity()
| double P4BaseEEtaPhiM::rapidity |
( |
| ) |
const |
|
inlineinherited |
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 }
◆ set4Mom() [1/3]
| void P4ImplEEtaPhiM::set4Mom |
( |
const CLHEP::HepLorentzVector & | theHlv | ) |
|
|
inline |
set all 4-mom from CLHEP HepLorentzVector
Definition at line 254 of file P4ImplEEtaPhiM.h.
255{
258
259
260
261
262
263
266}
◆ set4Mom() [2/3]
| void P4ImplEEtaPhiM::set4Mom |
( |
const I4Momentum & | theI4Mom | ) |
|
|
inline |
set all 4-mom from another I4Momentum reference
Definition at line 241 of file P4ImplEEtaPhiM.h.
242{
247}
virtual double m() const =0
mass
virtual double phi() const =0
phi in [-pi,pi[
virtual double eta() const =0
pseudo rapidity
virtual double e() const =0
energy
◆ set4Mom() [3/3]
| void P4ImplEEtaPhiM::set4Mom |
( |
const I4Momentum *const | theI4Mom | ) |
|
|
inline |
set all 4-mom from another I4Momentum pointer
Definition at line 249 of file P4ImplEEtaPhiM.h.
250{
252}
void set4Mom(const I4Momentum &theI4Mom)
set all 4-mom from another I4Momentum reference
◆ setE()
| void P4ImplEEtaPhiM::setE |
( |
const double | theE | ) |
|
|
inline |
◆ setErrors()
set the errors
Definition at line 269 of file P4ImplEEtaPhiM.h.
270{
271
272
273
274
275 m_error = std::make_unique< ErrorType>(err, *
this);
276}
◆ setEta()
| void P4ImplEEtaPhiM::setEta |
( |
const double | theEta | ) |
|
|
inline |
◆ setM()
| void P4ImplEEtaPhiM::setM |
( |
const double | theM | ) |
|
|
inline |
◆ setPhi()
| void P4ImplEEtaPhiM::setPhi |
( |
const double | thePhi | ) |
|
|
inline |
◆ sinPhi()
| double P4BaseEEtaPhiM::sinPhi |
( |
| ) |
const |
|
inlineinherited |
◆ sinTh()
| double P4BaseEEtaPhiM::sinTh |
( |
| ) |
const |
|
inlineinherited |
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 |
|
inlineinherited |
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}
◆ P4ImplEEtaPhiMCnv_p1
◆ m_e
| double P4ImplEEtaPhiM::m_e |
|
private |
◆ m_error
| std::unique_ptr< ErrorType> P4ImplEEtaPhiM::m_error |
|
private |
◆ m_eta
| double P4ImplEEtaPhiM::m_eta |
|
private |
◆ m_m
| double P4ImplEEtaPhiM::m_m |
|
private |
◆ m_phi
| double P4ImplEEtaPhiM::m_phi |
|
private |
The documentation for this class was generated from the following files: