Go to the documentation of this file.
3 #ifndef EICD_VectorXYZT_H
4 #define EICD_VectorXYZT_H
21 VectorXYZT(
double xx,
double yy,
double zz,
double tt) :
x{xx},
y{yy},
z{zz},
t{tt} {}
23 const double&
operator[](
unsigned i)
const {
return *(&
x + i);}
24 double mag()
const {
return std::hypot(
x,
y,
z);}
25 double r()
const {
return mag();}
27 double phi()
const {
return atan2(
y,
x);}
28 double eta()
const {
return -log(tan(0.5*
theta()));}
double energy()
const {
return t;}
30 operator std::tuple<double, double, double, double>() {
return {
x,
y,
z,
t};}
std::ostream & operator<<(std::ostream &o, const ConstBasicParticle &value)
Definition: BasicParticle.cc:102
double t
[ns] or [GeV]
Definition: VectorXYZT.h:18
double mag() const
Definition: VectorXYZT.h:24
double theta() const
Definition: VectorXYZT.h:26
double x
[mm] or [GeV]
Definition: VectorXYZT.h:15
Definition: BasicParticle.cc:13
double energy() const
Definition: VectorXYZT.h:28
Definition: VectorXYZT.h:13
const double & operator[](unsigned i) const
Definition: VectorXYZT.h:23
double y
Definition: VectorXYZT.h:16
double dot(const VectorXYZT &rhs) const
Definition: VectorXYZT.h:31
VectorXYZT scale(double f) const
Definition: VectorXYZT.h:34
double z
Definition: VectorXYZT.h:17
double r() const
Definition: VectorXYZT.h:25
double & operator[](unsigned i)
Definition: VectorXYZT.h:22
VectorXYZT add(const VectorXYZT &rhs) const
Definition: VectorXYZT.h:32
VectorXYZT()
Definition: VectorXYZT.h:20
double mass() const
Definition: VectorXYZT.h:29
double eta() const
Definition: VectorXYZT.h:28
double phi() const
Definition: VectorXYZT.h:27
VectorXYZT(double xx, double yy, double zz, double tt)
Definition: VectorXYZT.h:21
VectorXYZT subtract(const VectorXYZT &rhs) const
Definition: VectorXYZT.h:33