ATLAS Offline Software
P4PxPyPzE.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef FOURMOM_P4PXPYPZE_H
6 #define FOURMOM_P4PXPYPZE_H
7 
9 
10 // CLHEP includes
11 #include "CLHEP/Units/SystemOfUnits.h"
12 #include "CLHEP/Vector/LorentzVector.h"
13 
14 #include <cmath>
15 
16 
28 class P4PxPyPzE : public virtual P4PxPyPzEBase
29 {
30 
31  public:
32 
34  P4PxPyPzE(const double px,const double py,const double pz,const double e);
36  P4PxPyPzE(const CLHEP::HepLorentzVector & theHlv);
38  P4PxPyPzE(const I4Momentum & theI4M );
40  P4PxPyPzE(const I4Momentum * const theI4M );
41 
43  P4PxPyPzE();
44 
46  virtual double px() const;
48  virtual double py() const;
50  virtual double pz() const;
52  virtual double e() const;
53 
55  virtual void setPx(double thePx) ;
57  virtual void setPy(double thePy) ;
59  virtual void setPz(double thePz) ;
61  virtual void setE(double theE) ;
62 
64  virtual void set4Mom (const I4Momentum & theI4Mom );
66  virtual void set4Mom (const I4Momentum * const theI4Mom );
68  virtual void set4Mom (const CLHEP::HepLorentzVector & theHlv );
69 
70  virtual const I4MomentumError* errors() const;
71 
73  double pxi() const;
75  double pyi() const;
77  double pzi() const;
79  double ei() const;
81  double pti() const;
82 
83 
84  protected:
85 
86 
87 
88 
89  double m_px;
90  double m_py;
91  double m_pz;
92  double m_e;
93 
94 };
95 
97  P4PxPyPzEBase( ),
98  m_px ( 0.*CLHEP::GeV ),
99  m_py ( 0.*CLHEP::GeV ),
100  m_pz ( 0.*CLHEP::GeV ),
101  m_e ( 0.*CLHEP::GeV )
102 {}
103 
104 inline P4PxPyPzE::P4PxPyPzE(const double px, const double py, const double pz, const double e):
105  m_px(px),m_py(py),m_pz(pz),m_e(e)
106 {
107 }
108 
109 inline P4PxPyPzE::P4PxPyPzE(const CLHEP::HepLorentzVector & theHlv)
110 {
111  this->set4Mom(theHlv);
112 }
113 
114 inline P4PxPyPzE::P4PxPyPzE(const I4Momentum & theI4Mom )
115 {this->set4Mom(theI4Mom); }
116 
117 inline P4PxPyPzE::P4PxPyPzE(const I4Momentum * const theI4Mom )
118 {this->set4Mom(*theI4Mom); }
119 
120 
121 
122 inline double P4PxPyPzE::px() const
123 { return m_px;}
124 
125 
126 inline double P4PxPyPzE::py() const
127 { return m_py;}
128 
129 inline double P4PxPyPzE::pz() const
130 { return m_pz;}
131 
132 inline double P4PxPyPzE::e() const
133 { return m_e;}
134 
135 inline void P4PxPyPzE::setPx(double thePx)
136 { m_px=thePx;}
137 
138 inline void P4PxPyPzE::setPy(double thePy)
139 { m_py=thePy;}
140 
141 inline void P4PxPyPzE::setPz(double thePz)
142 { m_pz=thePz;}
143 
144 inline void P4PxPyPzE::setE(double theE)
145 { m_e=theE;}
146 
147 inline void P4PxPyPzE::set4Mom(const I4Momentum & theI4Mom )
148 {
149  m_px=theI4Mom.px();
150  m_py=theI4Mom.py();
151  m_pz=theI4Mom.pz();
152  m_e=theI4Mom.e();
153 }
154 
155 inline void P4PxPyPzE::set4Mom(const I4Momentum * const theI4Mom )
156 {
157  this->set4Mom(*theI4Mom);
158 }
159 
160 
161 inline void P4PxPyPzE::set4Mom(const CLHEP::HepLorentzVector & theHlv)
162 {
163  m_px=theHlv.px();
164  m_py=theHlv.py();
165  m_pz=theHlv.pz();
166  m_e=theHlv.e();
167 }
168 
169 
170  inline double P4PxPyPzE::pxi() const
171 { return m_px;}
172 
173 inline double P4PxPyPzE::pyi() const
174 { return m_py;}
175 
176 inline double P4PxPyPzE::pzi() const
177 { return m_pz;}
178 
179 inline double P4PxPyPzE::ei() const
180 { return m_e;}
181 
182 inline double P4PxPyPzE::pti() const
183 { const double thePx=pxi();
184  const double thePy=pyi();
185  return sqrt(thePx*thePx+thePy*thePy);}
186 
187 
188 #endif
I4Momentum::py
virtual double py() const =0
y component of momentum
I4Momentum
Definition: I4Momentum.h:31
test_pyathena.px
px
Definition: test_pyathena.py:18
P4PxPyPzE::e
virtual double e() const
get energy data member
Definition: P4PxPyPzE.h:132
P4PxPyPzE::py
virtual double py() const
get py data member
Definition: P4PxPyPzE.h:126
P4PxPyPzE::errors
virtual const I4MomentumError * errors() const
Access to errors, if available; returns 0 if no errors.
Definition: P4PxPyPzE.cxx:7
P4PxPyPzE::pzi
double pzi() const
Experimental : inlined function to get pz without going through virtual inheritance.
Definition: P4PxPyPzE.h:176
P4PxPyPzE::pz
virtual double pz() const
get pz data member
Definition: P4PxPyPzE.h:129
P4PxPyPzE::setE
virtual void setE(double theE)
set energy data member
Definition: P4PxPyPzE.h:144
P4PxPyPzE::m_py
double m_py
Definition: P4PxPyPzE.h:90
P4PxPyPzE::m_pz
double m_pz
Definition: P4PxPyPzE.h:91
P4PxPyPzE::pxi
double pxi() const
Experimental : inlined function to get px without going through virtual inheritance.
Definition: P4PxPyPzE.h:170
P4PxPyPzE::pti
double pti() const
Experimental : inlined function to get pt without going through virtual inheritance.
Definition: P4PxPyPzE.h:182
I4Momentum::pz
virtual double pz() const =0
z component of momentum
P4PxPyPzE::m_px
double m_px
Definition: P4PxPyPzE.h:89
P4PxPyPzE::setPx
virtual void setPx(double thePx)
set Px data member
Definition: P4PxPyPzE.h:135
I4MomentumError
Definition: I4MomentumError.h:28
I4Momentum::e
virtual double e() const =0
energy
CLHEP
STD'S.
Definition: IAtRndmGenSvc.h:19
Amg::pz
@ pz
Definition: GeoPrimitives.h:40
P4PxPyPzEBase.h
P4PxPyPzEBase
Definition: P4PxPyPzEBase.h:26
P4PxPyPzE::P4PxPyPzE
P4PxPyPzE()
default constructor
Definition: P4PxPyPzE.h:96
Amg::py
@ py
Definition: GeoPrimitives.h:39
P4PxPyPzE::m_e
double m_e
Definition: P4PxPyPzE.h:92
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
P4PxPyPzE
Definition: P4PxPyPzE.h:29
P4PxPyPzE::px
virtual double px() const
get px data member
Definition: P4PxPyPzE.h:122
P4PxPyPzE::setPz
virtual void setPz(double thePz)
set Pz data member
Definition: P4PxPyPzE.h:141
P4PxPyPzE::setPy
virtual void setPy(double thePy)
set Py data member
Definition: P4PxPyPzE.h:138
P4PxPyPzE::set4Mom
virtual void set4Mom(const I4Momentum &theI4Mom)
set all 4-mom from another I4Momentum reference
Definition: P4PxPyPzE.h:147
P4PxPyPzE::pyi
double pyi() const
Experimental : inlined function to get py without going through virtual inheritance.
Definition: P4PxPyPzE.h:173
GeV
#define GeV
Definition: CaloTransverseBalanceVecMon.cxx:30
I4Momentum::px
virtual double px() const =0
x component of momentum
P4PxPyPzE::ei
double ei() const
Experimental : inlined function to get e without going through virtual inheritance.
Definition: P4PxPyPzE.h:179