P4PtEtaPhiM is a class with 4-momentum behavior, for which Pt, Eta, Phi and M are data members.
More...
#include <P4PtEtaPhiM.h>
P4PtEtaPhiM is a class with 4-momentum behavior, for which Pt, Eta, Phi and M are data members.
- Author
- Olga Igonkina olya@.nosp@m.cern.nosp@m..ch
Definition at line 24 of file P4PtEtaPhiM.h.
◆ Kind
| Enumerator |
|---|
| P4EETAPHIM | |
| P4IPTCOTTHPHIM | |
| P4PTETAPHIM | |
| P4PXPYPZE | |
| UNKNOWN | |
Definition at line 33 of file I4Momentum.h.
◆ P4PtEtaPhiM() [1/5]
constructor with all data members
Definition at line 29 of file P4PtEtaPhiM.h.
virtual double pt() const
get pt data member
virtual double eta() const
get eta data member
virtual double m() const
get mass data member
virtual double phi() const
get phi data member
◆ P4PtEtaPhiM() [2/5]
| P4PtEtaPhiM::P4PtEtaPhiM |
( |
| ) |
|
|
inline |
default constructor
Definition at line 83 of file P4PtEtaPhiM.h.
83 :
84 P4PtEtaPhiMBase( ),
85 m_pt ( 0.*CLHEP::GeV ),
89{}
◆ P4PtEtaPhiM() [3/5]
| P4PtEtaPhiM::P4PtEtaPhiM |
( |
const CLHEP::HepLorentzVector & | theHlv | ) |
|
|
inline |
constructor from hlv to allow conversion from hlv
Definition at line 91 of file P4PtEtaPhiM.h.
92{
94}
virtual void set4Mom(const I4Momentum &theI4Mom)
set all 4-mom from another I4Momentum reference
◆ P4PtEtaPhiM() [4/5]
constructor from any 4Momentum reference
Definition at line 96 of file P4PtEtaPhiM.h.
◆ P4PtEtaPhiM() [5/5]
constructor from any 4Momentum pointer
Definition at line 99 of file P4PtEtaPhiM.h.
◆ cosPhi()
| double P4PtEtaPhiMBase::cosPhi |
( |
| ) |
const |
|
virtualinherited |
cosinus phi
Implements I4Momentum.
Definition at line 55 of file P4PtEtaPhiMBase.cxx.
56{
57 return std::cos(this->
phi());
58}
virtual double phi() const =0
phi in [-pi,pi[
◆ cosTh()
| double P4PtEtaPhiMBase::cosTh |
( |
| ) |
const |
|
virtualinherited |
cosinus theta
Implements I4Momentum.
Definition at line 70 of file P4PtEtaPhiMBase.cxx.
71{
72 return std::tanh(this->
eta());
73}
virtual double eta() const =0
pseudo rapidity
◆ cotTh()
| double P4PtEtaPhiMBase::cotTh |
( |
| ) |
const |
|
virtualinherited |
◆ dump()
| std::ostream & P4PtEtaPhiMBase::dump |
( |
std::ostream & | out | ) |
const |
|
virtualinherited |
Print I4Momentum content.
Implements I4Momentum.
Definition at line 147 of file P4PtEtaPhiMBase.cxx.
148{
149 std::stringstream outx;
150 outx << "[pt,eta,phi,m] ="
151 << std::right << std::scientific << std::setprecision(8)
152 << std::setw(16) << this->
pt()
153 << std::setw(16) << this->
eta()
154 << std::setw(16) << this->
phi()
155 << std::setw(16) << this->
m();
157
159
160}
virtual double m() const =0
mass
virtual double pt() const =0
transverse momentum
◆ e()
| double P4PtEtaPhiMBase::e |
( |
| ) |
const |
|
virtualinherited |
energy
Implements I4Momentum.
Definition at line 13 of file P4PtEtaPhiMBase.cxx.
14{
15 const double theMass = this->
m();
16 const double thePt = this->
pt();
17 const double thePz = this->
pz();
18
19
20
21
22
23 double eSign = (thePt >= 0.) ? +1. : -1.;
24 return eSign*std::sqrt(thePt*thePt + thePz*thePz + theMass*theMass);
25}
virtual double pz() const
z component of momentum
◆ errors()
◆ et()
| double P4PtEtaPhiMBase::et |
( |
| ) |
const |
|
virtualinherited |
transverse energy defined to be e*sin(theta)
Implements I4Momentum.
Definition at line 101 of file P4PtEtaPhiMBase.cxx.
102 {
103 return this->
e()*this->
sinTh();
104 }
virtual double sinTh() const
sinus theta
virtual double e() const
energy
◆ eta()
| double P4PtEtaPhiM::eta |
( |
void | | ) |
const |
|
inlinevirtual |
◆ hlv()
| CLHEP::HepLorentzVector P4PtEtaPhiMBase::hlv |
( |
| ) |
const |
|
virtualinherited |
HepLorentzVector Special implementation from Frank Paige : if negative energy, points in opposite direction but eta and phi still the same.
Implements I4Momentum.
Definition at line 128 of file P4PtEtaPhiMBase.cxx.
129{
130
131 const double theM = this->
m();
132
133 const double thePt = this->
pt();
134
135
136 const double thePx = thePt*this->
cosPhi();
137 const double thePy = thePt*this->
sinPhi();
138
139 const double thePz = thePt*this->
cotTh();
140
141 const double theE=std::sqrt(thePt*thePt+thePz*thePz+theM*theM);
142
143
144 return CLHEP::HepLorentzVector( thePx, thePy, thePz, theE );
145}
virtual double sinPhi() const
sinus phi
virtual double cotTh() const
cottan theta
virtual double cosPhi() const
cosinus phi
◆ iPt()
| double P4PtEtaPhiMBase::iPt |
( |
| ) |
const |
|
virtualinherited |
◆ kind()
◆ m()
| double P4PtEtaPhiM::m |
( |
void | | ) |
const |
|
inlinevirtual |
◆ m2()
| double P4PtEtaPhiMBase::m2 |
( |
| ) |
const |
|
virtualinherited |
◆ p()
| double P4PtEtaPhiMBase::p |
( |
| ) |
const |
|
virtualinherited |
magnitude of 3-momentum.
Special implementation from Frank Paige : if negative energy p is negative but eta and phi still the same.
Implements I4Momentum.
Definition at line 27 of file P4PtEtaPhiMBase.cxx.
28{
29 const double thePt = this->
pt();
30 const double thePz = this->
pz();
31
32
33
34
35
36 double eSign = (thePt >= 0.) ? +1. : -1.;
37 return eSign*std::sqrt(thePt*thePt + thePz*thePz);
38}
◆ p2()
| double P4PtEtaPhiMBase::p2 |
( |
| ) |
const |
|
virtualinherited |
square of momentum magnitude
Implements I4Momentum.
Definition at line 40 of file P4PtEtaPhiMBase.cxx.
41{
42
43
44 const double thePt = this->
pt();
45 const double thePz = this->
pz();
46
47 return thePt*thePt + thePz*thePz;
48}
◆ phi()
| double P4PtEtaPhiM::phi |
( |
void | | ) |
const |
|
inlinevirtual |
◆ pt()
| double P4PtEtaPhiM::pt |
( |
void | | ) |
const |
|
inlinevirtual |
◆ px()
| double P4PtEtaPhiMBase::px |
( |
| ) |
const |
|
virtualinherited |
◆ py()
| double P4PtEtaPhiMBase::py |
( |
| ) |
const |
|
virtualinherited |
◆ pz()
| double P4PtEtaPhiMBase::pz |
( |
| ) |
const |
|
virtualinherited |
◆ rapidity()
| double P4PtEtaPhiMBase::rapidity |
( |
| ) |
const |
|
virtualinherited |
rapidity
Implements I4Momentum.
Definition at line 110 of file P4PtEtaPhiMBase.cxx.
111 {
112 const double theE=this->
e();
113 const double thePz=this->
pz();
114 return 0.5*std::log((theE+thePz)/(theE-thePz));
115 }
◆ set4Mom() [1/3]
| void P4PtEtaPhiM::set4Mom |
( |
const CLHEP::HepLorentzVector & | theHlv | ) |
|
|
inlinevirtual |
◆ set4Mom() [2/3]
◆ set4Mom() [3/3]
◆ setEta()
| void P4PtEtaPhiM::setEta |
( |
double | theEta | ) |
|
|
inlinevirtual |
◆ setM()
| void P4PtEtaPhiM::setM |
( |
double | theM | ) |
|
|
inlinevirtual |
◆ setPhi()
| void P4PtEtaPhiM::setPhi |
( |
double | thePhi | ) |
|
|
inlinevirtual |
◆ setPt()
| void P4PtEtaPhiM::setPt |
( |
double | thePt | ) |
|
|
inlinevirtual |
◆ sinPhi()
| double P4PtEtaPhiMBase::sinPhi |
( |
| ) |
const |
|
virtualinherited |
◆ sinTh()
| double P4PtEtaPhiMBase::sinTh |
( |
| ) |
const |
|
virtualinherited |
sinus theta
Implements I4Momentum.
Definition at line 75 of file P4PtEtaPhiMBase.cxx.
76{
77
78
79 double aEta=std::abs(this->
eta());
80 if ( aEta>710) {
81 aEta=710;
82 }
83
84 return 1./std::cosh(aEta);
85}
◆ tanTh()
| double P4PtEtaPhiMBase::tanTh |
( |
| ) |
const |
|
virtualinherited |
tan theta
Implements I4Momentum.
Definition at line 87 of file P4PtEtaPhiMBase.cxx.
88{
89
90
91 double theEta=this->
eta();
92 if ( std::abs(theEta)>710) {
93 theEta=theEta>0 ? 710 : -710;
94 return 1./std::sinh(theEta);
95 }
96
97 return 1./std::sinh(this->
eta());
98}
◆ m_eta
| double P4PtEtaPhiM::m_eta |
|
protected |
◆ m_m
◆ m_phi
| double P4PtEtaPhiM::m_phi |
|
protected |
◆ m_pt
The documentation for this class was generated from the following files: