18 #ifndef ROOT_Math_GenVector_PxPyPzE4D
19 #define ROOT_Math_GenVector_PxPyPzE4D 1
21 #ifndef ROOT_Math_GenVector_eta
25 #ifndef ROOT_Math_GenVector_GenVector_exception
45 template <
class ScalarType =
double>
63 PxPyPzE4D(Scalar px, Scalar py, Scalar pz, Scalar e) :
71 template <
class CoordSystem>
98 {
fX=src[0];
fY=src[1];
fZ=src[2];
fT=src[3]; }
104 { dest[0] =
fX; dest[1] =
fY; dest[2] =
fZ; dest[3] =
fT; }
122 Scalar
Px()
const {
return fX;}
123 Scalar
Py()
const {
return fY;}
124 Scalar
Pz()
const {
return fZ;}
125 Scalar
E()
const {
return fT;}
127 Scalar
X()
const {
return fX;}
128 Scalar
Y()
const {
return fY;}
129 Scalar
Z()
const {
return fZ;}
130 Scalar
T()
const {
return fT;}
143 Scalar
R()
const {
return P(); }
160 " P^2 > E^2 so the mass would be imaginary");
164 Scalar
Mag()
const {
return M(); }
193 " Pz^2 > E^2 so the transverse mass would be imaginary");
204 return pt2 == 0 ? 0 :
fT*
fT * pt2/( pt2 +
fZ*
fZ );
297 template <
class AnyCoordSystem>
319 Scalar
x()
const {
return fX; }
320 Scalar
y()
const {
return fY; }
321 Scalar
z()
const {
return fZ; }
322 Scalar
t()
const {
return fT; }
326 #if defined(__MAKECINT__) || defined(G__DICTIONARY)
330 void SetPt(Scalar pt);
332 void SetEta(Scalar eta);
334 void SetPhi(Scalar phi);
358 #if defined(__MAKECINT__) || defined(G__DICTIONARY)
361 #ifndef ROOT_Math_GenVector_PtEtaPhiE4D
364 #ifndef ROOT_Math_GenVector_PtEtaPhiM4D
376 template <
class ScalarType>
377 void PxPyPzE4D<ScalarType>::SetPt(
Scalar pt) {
378 GenVector_exception e(
"PxPyPzE4D::SetPt() is not supposed to be called");
380 PtEtaPhiE4D<Scalar>
v(*
this); v.SetPt(pt); *
this = PxPyPzE4D<Scalar>(
v);
382 template <
class ScalarType>
383 void PxPyPzE4D<ScalarType>::SetEta(
Scalar eta) {
384 GenVector_exception e(
"PxPyPzE4D::SetEta() is not supposed to be called");
386 PtEtaPhiE4D<Scalar>
v(*
this);
v.SetEta(eta); *
this = PxPyPzE4D<Scalar>(
v);
388 template <
class ScalarType>
389 void PxPyPzE4D<ScalarType>::SetPhi(
Scalar phi) {
390 GenVector_exception e(
"PxPyPzE4D::SetPhi() is not supposed to be called");
392 PtEtaPhiE4D<Scalar>
v(*
this);
v.SetPhi(phi); *
this = PxPyPzE4D<Scalar>(
v);
395 template <
class ScalarType>
396 void PxPyPzE4D<ScalarType>::SetM(
Scalar m) {
397 GenVector_exception e(
"PxPyPzE4D::SetM() is not supposed to be called");
399 PtEtaPhiM4D<Scalar>
v(*
this);
v.SetM(m);
400 *
this = PxPyPzE4D<Scalar>(
v);
408 #endif // endif __MAKE__CINT || G__DICTIONARY
411 #endif // ROOT_Math_GenVector_PxPyPzE4D
void GetCoordinates(Scalar &px, Scalar &py, Scalar &pz, Scalar &e) const
get internal data into 4 Scalar numbers
PxPyPzE4D()
Default constructor with x=y=z=t=0.
Namespace for new ROOT classes and functions.
void SetCoordinates(const Scalar src[])
Set internal data based on an array of 4 Scalar numbers.
Scalar Mt() const
transverse mass
Scalar Eta() const
pseudorapidity
ScalarType fX
(contigous) data containing the coordinate values x,y,z,t
PxPyPzE4D(const PxPyPzE4D &v)
copy constructor
void SetPx(Scalar px)
set X value
Class describing a 4D cartesian coordinate system (x, y, z, t coordinates) or momentum-energy vectors...
Scalar M2() const
vector magnitude squared (or mass squared)
void GetCoordinates(Scalar dest[]) const
get internal data into an array of 4 Scalar numbers
void SetPxPyPzE(Scalar px, Scalar py, Scalar pz, Scalar e)
set all values using cartesian coordinates
Scalar P() const
magnitude of spatial components (magnitude of 3-momentum)
Scalar Pt2() const
transverse spatial component squared
Scalar M() const
invariant mass
Scalar Mt2() const
transverse mass squared
PxPyPzE4D & operator=(const PxPyPzE4D &v)
assignment operator
PxPyPzE4D(const CoordSystem &v)
construct from any vector or coordinate system class implementing x(), y() and z() and t() ...
void Throw(const char *)
function throwing exception, by creating internally a GenVector_exception only when needed ...
void Scale(const Scalar &a)
scale coordinate values by a scalar quantity a
Scalar Phi() const
azimuthal angle
void SetPz(Scalar pz)
set Z value
void SetPy(Scalar py)
set Y value
bool operator!=(const PxPyPzE4D &rhs) const
Scalar Pt() const
Transverse spatial component (P_perp or rho)
Scalar Eta_FromRhoZ(Scalar rho, Scalar z)
Calculate eta given rho and zeta.
PxPyPzE4D(Scalar px, Scalar py, Scalar pz, Scalar e)
Constructor from x, y , z , t values.
bool operator==(const PxPyPzE4D &rhs) const
Exact equality.
double atan2(double, double)
void Negate()
negate the 4-vector
Namespace for new Math classes and functions.
Scalar Theta() const
polar angle
#define dest(otri, vertexptr)
Scalar Et() const
transverse energy
Scalar Et2() const
transverse energy squared
Scalar P2() const
squared magnitude of spatial components
void SetCoordinates(Scalar px, Scalar py, Scalar pz, Scalar e)
Set internal data based on 4 Scalar numbers.
void SetE(Scalar e)
set T value