ATLAS Offline Software
Loading...
Searching...
No Matches
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
26
27
28class 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
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
104inline 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
109inline P4PxPyPzE::P4PxPyPzE(const CLHEP::HepLorentzVector & theHlv)
110{
111 this->set4Mom(theHlv);
112}
113
114inline P4PxPyPzE::P4PxPyPzE(const I4Momentum & theI4Mom )
115{this->set4Mom(theI4Mom); }
116
117inline P4PxPyPzE::P4PxPyPzE(const I4Momentum * const theI4Mom )
118{this->set4Mom(*theI4Mom); }
119
120
121
122inline double P4PxPyPzE::px() const
123{ return m_px;}
124
125
126inline double P4PxPyPzE::py() const
127{ return m_py;}
128
129inline double P4PxPyPzE::pz() const
130{ return m_pz;}
131
132inline double P4PxPyPzE::e() const
133{ return m_e;}
134
135inline void P4PxPyPzE::setPx(double thePx)
136{ m_px=thePx;}
137
138inline void P4PxPyPzE::setPy(double thePy)
139{ m_py=thePy;}
140
141inline void P4PxPyPzE::setPz(double thePz)
142{ m_pz=thePz;}
143
144inline void P4PxPyPzE::setE(double theE)
145{ m_e=theE;}
146
147inline 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
155inline void P4PxPyPzE::set4Mom(const I4Momentum * const theI4Mom )
156{
157 this->set4Mom(*theI4Mom);
158}
159
160
161inline 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
173inline double P4PxPyPzE::pyi() const
174{ return m_py;}
175
176inline double P4PxPyPzE::pzi() const
177{ return m_pz;}
178
179inline double P4PxPyPzE::ei() const
180{ return m_e;}
181
182inline 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 is an abstract base class providing 4-momentum behavior.
Definition I4Momentum.h:31
virtual double pz() const =0
z component of momentum
virtual double px() const =0
x component of momentum
virtual double e() const =0
energy
virtual double py() const =0
y component of momentum
P4PxPyPzEBase is a base class for classes with 4-momentum behavior, for which Px, Py,...
virtual double e() const
get energy data member
Definition P4PxPyPzE.h:132
virtual void setE(double theE)
set energy data member
Definition P4PxPyPzE.h:144
double m_e
Definition P4PxPyPzE.h:92
double m_pz
Definition P4PxPyPzE.h:91
virtual void setPz(double thePz)
set Pz data member
Definition P4PxPyPzE.h:141
virtual void setPx(double thePx)
set Px data member
Definition P4PxPyPzE.h:135
double m_px
Definition P4PxPyPzE.h:89
double pzi() const
Experimental : inlined function to get pz without going through virtual inheritance.
Definition P4PxPyPzE.h:176
double pyi() const
Experimental : inlined function to get py without going through virtual inheritance.
Definition P4PxPyPzE.h:173
virtual void set4Mom(const I4Momentum &theI4Mom)
set all 4-mom from another I4Momentum reference
Definition P4PxPyPzE.h:147
virtual void setPy(double thePy)
set Py data member
Definition P4PxPyPzE.h:138
double m_py
Definition P4PxPyPzE.h:90
double pti() const
Experimental : inlined function to get pt without going through virtual inheritance.
Definition P4PxPyPzE.h:182
virtual double px() const
get px data member
Definition P4PxPyPzE.h:122
P4PxPyPzE(const double px, const double py, const double pz, const double e)
constructor with all data members
Definition P4PxPyPzE.h:104
double pxi() const
Experimental : inlined function to get px without going through virtual inheritance.
Definition P4PxPyPzE.h:170
virtual double py() const
get py data member
Definition P4PxPyPzE.h:126
virtual double pz() const
get pz data member
Definition P4PxPyPzE.h:129
double ei() const
Experimental : inlined function to get e without going through virtual inheritance.
Definition P4PxPyPzE.h:179
virtual const I4MomentumError * errors() const
Access to errors, if available; returns 0 if no errors.
Definition P4PxPyPzE.cxx:7
P4PxPyPzE()
default constructor
Definition P4PxPyPzE.h:96