4 #ifndef HEPMC_SIMPLEVECTOR_H
5 #define HEPMC_SIMPLEVECTOR_H
26 #include "HepMC/enable_if.h"
27 #include "HepMC/is_arithmetic.h"
47 FourVector(
double xin,
double yin,
double zin,
double tin=0)
48 : m_x(xin), m_y(yin), m_z(zin), m_t(tin) {}
52 : m_x(0), m_y(0), m_z(0), m_t(tin) {}
55 : m_x(0), m_y(0), m_z(0), m_t(0) {}
62 : m_x(v.
x()), m_y(v.
y()), m_z(v.
z()), m_t(v.
t()) {}
66 : m_x(v.
x()), m_y(v.
y()), m_z(v.
z()), m_t(v.
t()) {}
70 double px()
const {
return m_x; }
71 double py()
const {
return m_y; }
72 double pz()
const {
return m_z; }
73 double e()
const {
return m_t; }
75 double x()
const {
return m_x; }
76 double y()
const {
return m_y; }
77 double z()
const {
return m_z; }
78 double t()
const {
return m_t; }
100 void set (
double x,
double y,
double z,
double t);
102 void setX(
double xin) { m_x=xin; }
103 void setY(
double yin) { m_y=yin; }
104 void setZ(
double zin) { m_z=zin; }
105 void setT(
double tin) { m_t=tin; }
110 void setE(
double tin) { m_t=tin; }
137 : m_x(xin), m_y(yin), m_z(zin) {}
140 : m_x(0), m_y(0), m_z(0) {}
147 : m_x(v.
x()), m_y(v.
y()), m_z(v.
z()) {}
151 : m_x(v.
x()), m_y(v.
y()), m_z(v.
z()) {}
155 double x()
const {
return m_x; }
156 double y()
const {
return m_y; }
157 double z()
const {
return m_z; }
159 void setX(
double xin) { m_x=xin; }
160 void setY(
double yin) { m_y=yin; }
161 void setZ(
double zin) { m_z=zin; }
162 void set(
double x,
double y,
double z);
165 double theta()
const;
171 double perp2()
const;
190 #include "HepMC/SimpleVector.icc"
192 #endif // HEPMC_SIMPLEVECTOR_H
double z() const
return z
void setT(double tin)
set t
bool operator==(const FourVector &) const
equality
FourVector & operator=(const FourVector &)
make a copy
double perp() const
The transverse component (rho in cylindrical coordinate system).
FourVector(double xin, double yin, double zin, double tin=0)
constructor requiring at least x, y, and z
double theta() const
The polar angle.
void setPz(double zin)
set pz
double r() const
The magnitude.
bool operator==(const ThreeVector &) const
equality
double x() const
return x
double z() const
return z
bool operator!=(const FourVector &) const
inequality
void setY(double yin)
set y
ThreeVector(const T &v, typename detail::disable_if< detail::is_arithmetic< T >::value, void >::type *=0)
double theta() const
The polar angle.
double e() const
return E
double m() const
Invariant mass. If m2() is negative then -sqrt(-m2()) is returned.
double y() const
return y
double px() const
return px
double y() const
return y
double rho() const
spatial vector component magnitude
ThreeVector(double xin, double yin=0, double zin=0)
construct using x, y, and z (only x is required)
double phi() const
The azimuth angle.
void swap(FourVector &other)
swap
double pz() const
return pz
void setPhi(double)
Set phi keeping magnitude and theta constant (BaBar).
void setX(double xin)
set x
FourVector(const T &v, typename detail::disable_if< detail::is_arithmetic< T >::value, void >::type *=0)
bool operator!=(const ThreeVector &) const
inequality
ThreeVector is a simple representation of a position or displacement 3 vector.
ThreeVector(const ThreeVector &v)
copy constructor
double x() const
return x
void set(double x, double y, double z, double t)
set x, y, z, and t
double phi() const
The azimuth angle.
internal - used by SimpleVector to decide if a class is arithmetic
ThreeVector & operator=(const ThreeVector &)
make a copy
double eta() const
Pseudorapidity (of the space part)
void setZ(double zin)
set z
FourVector(const FourVector &v)
copy constructor
double perp() const
Transverse component of the spatial vector (R in cylindrical system).
undefined and therefore non-arithmetic
void setY(double yin)
set y
FourVector(double tin)
constructor requiring only t
FourVector is a simple representation of a physics 4 vector.
double m2() const
Invariant mass squared.
double perp2() const
Transverse component of the spatial vector squared.
void setE(double tin)
set E
void setPx(double xin)
set px
void setX(double xin)
set x
void setPy(double yin)
set py
double py() const
return py
double pseudoRapidity() const
Returns the pseudo-rapidity, i.e. -ln(tan(theta/2))
void swap(ThreeVector &other)
swap
double perp2() const
The transverse component squared (rho^2 in cylindrical coordinate system).
double t() const
return t
void setTheta(double)
Set theta keeping magnitude and phi constant (BaBar).
void setZ(double zin)
set z
void set(double x, double y, double z)
set x, y, and z