12 #ifndef BASIC_VECTOR3D_H
13 #define BASIC_VECTOR3D_H
61 v_[0] = v.
x();
v_[1] = v.
y();
v_[2] = v.
z();
74 operator T * () {
return v_; }
78 operator const T * ()
const {
return v_; }
94 v_[0] = v.
v_[0];
v_[1] = v.
v_[1];
v_[2] = v.
v_[2];
return *
this;
99 v_[0] += v.
v_[0];
v_[1] += v.
v_[1];
v_[2] += v.
v_[2];
return *
this;
104 v_[0] -= v.
v_[0];
v_[1] -= v.
v_[1];
v_[2] -= v.
v_[2];
return *
this;
109 v_[0] *=
a;
v_[1] *=
a;
v_[2] *=
a;
return *
this;
114 v_[0] /=
a;
v_[1] /=
a;
v_[2] /=
a;
return *
this;
141 T
x()
const {
return v_[0]; }
144 T
y()
const {
return v_[1]; }
147 T
z()
const {
return v_[2]; }
182 factor = rh/factor;
v_[0] *= factor;
v_[1] *= factor;
202 return x() == 0 &&
y() == 0 ? 0 : std::atan2(
y(),
x());
207 return x() == 0 &&
y() == 0 &&
z() == 0 ? 0 : std::atan2(
perp(),
z());
228 factor = ma/factor;
v_[0] *= factor;
v_[1] *= factor;
v_[2] *= factor;
242 set(ma*std::sin(th)*std::cos(ph), ma*std::sin(th)*std::sin(ph), ma*std::cos(th));
270 return x()*v.
x()+
y()*v.
y()+
z()*v.
z();
278 x()*v.
y()-v.
x()*
y());
291 return std::sqrt(
perp2(v));
313 T dx =
x() < 0 ? -
x() :
x();
314 T dy =
y() < 0 ? -
y() :
y();
315 T dz =
z() < 0 ? -
z() :
z();
354 operator<<(std::ostream &, const BasicVector3D<float> &);
361 operator>>(std::istream &, BasicVector3D<float> &);
367 inline BasicVector3D<float>
439 return (a.
x()==b.
x() && a.
y()==b.
y() && a.
z()==b.
z());
448 return (a.
x()!=b.
x() || a.
y()!=b.
y() || a.
z()!=b.
z());
462 operator<<(std::ostream &, const BasicVector3D<double> &);
548 return (a.
x()==b.
x() && a.
y()==b.
y() && a.
z()==b.
z());
558 return (a.
x()!=b.
x() || a.
y()!=b.
y() || a.
z()!=b.
z());
T operator[](int i) const
BasicVector3D< double > operator+(const BasicVector3D< double > &a, const BasicVector3D< double > &b)
BasicVector3D< double > operator/(const BasicVector3D< double > &v, double a)
BasicVector3D< T > & rotateZ(T a)
T perp(const BasicVector3D< T > &v) const
T operator()(int i) const
std::vector< ExP01TrackerHit * > a
BasicVector3D< T > & operator/=(double a)
BasicVector3D< float > operator+(const BasicVector3D< float > &a, const BasicVector3D< float > &b)
Float_t y1[n_points_granero]
BasicVector3D< T > & operator+=(const BasicVector3D< T > &v)
BasicVector3D(T x1, T y1, T z1)
Float_t x1[n_points_granero]
BasicVector3D< T > unit() const
BasicVector3D< T > orthogonal() const
BasicVector3D< T > cross(const BasicVector3D< T > &v) const
T angle(const BasicVector3D< T > &v) const
BasicVector3D(const BasicVector3D< float > &v)
BasicVector3D< float > operator*(const BasicVector3D< float > &v, double a)
T perp2(const BasicVector3D< T > &v) const
BasicVector3D< float > operator+(const BasicVector3D< float > &v)
BasicVector3D< float > operator-(const BasicVector3D< float > &a, const BasicVector3D< float > &b)
BasicVector3D< float > operator*(double a, const BasicVector3D< float > &v)
float operator*(const BasicVector3D< float > &a, const BasicVector3D< float > &b)
std::istream & operator>>(std::istream &is, BasicVector3D< float > &a)
T dot(const BasicVector3D< T > &v) const
double operator*(const BasicVector3D< double > &a, const BasicVector3D< double > &b)
BasicVector3D< double > operator*(const BasicVector3D< double > &v, double a)
bool operator==(const BasicVector3D< double > &a, const BasicVector3D< double > &b)
BasicVector3D< T > & rotate(T a, const BasicVector3D< T > &v)
bool operator!=(const BasicVector3D< double > &a, const BasicVector3D< double > &b)
BasicVector3D< double > operator*(double a, const BasicVector3D< double > &v)
BasicVector3D< T > & operator=(const BasicVector3D< T > &v)
bool operator!=(const BasicVector3D< float > &a, const BasicVector3D< float > &b)
BasicVector3D< double > operator+(const BasicVector3D< double > &v)
void set(T x1, T y1, T z1)
bool operator==(const BasicVector3D< float > &a, const BasicVector3D< float > &b)
BasicVector3D< double > operator-(const BasicVector3D< double > &a, const BasicVector3D< double > &b)
BasicVector3D< float > operator/(const BasicVector3D< float > &v, double a)
BasicVector3D< T > & operator-=(const BasicVector3D< T > &v)
BasicVector3D< T > & rotateX(T a)
BasicVector3D< T > & rotateY(T a)
BasicVector3D< T > & operator*=(double a)
BasicVector3D< double > operator-(const BasicVector3D< double > &v)
BasicVector3D< float > operator-(const BasicVector3D< float > &v)