14 #ifndef BASICTOOL_GEOVECTOR_H 15 #define BASICTOOL_GEOVECTOR_H 19 #include "TLorentzVector.h" 50 Vector(
double const x,
double const y);
51 Vector(
double const x,
double const y,
double const z);
53 Vector(TLorentzVector
const& pt);
77 void RotateX(
double const& theta);
78 void RotateY(
double const& theta);
79 void RotateZ(
double const& theta);
99 for (
size_t i = 0; i <
size(); ++i)
100 (*
this)[i] += rhs[i];
106 for (
size_t i = 0; i <
size(); ++i)
107 (*
this)[i] -= rhs[i];
113 for (
auto& v : *
this)
120 for (
auto& v : *
this)
127 this->resize(rhs.size());
128 for (
size_t i = 0; i < rhs.size(); ++i)
150 for (
size_t i = 0; i <
size(); ++i)
151 res += (*
this)[i] * rhs[i];
172 for (
size_t i = 0; i <
size(); ++i)
173 if ((*
this)[i] < rhs[i])
return true;
182 for (
size_t i = 0; i <
size(); ++i)
183 if ((*
this)[i] != rhs[i])
return false;
194 for (
auto const& v : a)
214 return (*lhs) < (*rhs);
bool operator<(double const &rhs) const
Vector operator*(double const &rhs) const
void RotateX(double const &theta)
rotation operations
double operator*(Vector const &rhs) const
void compat(Vector const &obj) const
Dimensional check for a compatibility.
Algorithm to compute various geometrical relation among geometrical objects. In particular functions ...
Vector & operator-=(Vector const &rhs)
void RotateZ(double const &theta)
double Dot(Vector const &obj) const
Representation of a simple 3D line segment Defines a finite 3D straight line by having the start and ...
double Phi() const
Compute the angle Phi.
static double const kINVALID_DOUBLE
Vector & operator=(Vector const &rhs)
bool operator==(Vector const &rhs) const
void RotateY(double const &theta)
Vector operator/(double const &rhs) const
void Normalize()
Normalize itself.
double SqLength() const
Compute the squared length of the vector.
Vector(const std::vector< double > &obj)
Default ctor w/ a bare std::vector<double>
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Vector(size_t n)
Ctor to instantiate with invalid value.
double Angle(Vector const &obj) const
Compute a cross product of two vectors.
double Dist(Vector const &obj) const
Compute the distance to another vector.
double Length() const
Compute the length of the vector.
bool operator!=(Vector const &rhs) const
double SqDist(Vector const &obj) const
Compute the squared distance to another vector.
bool IsValid() const
Check if point is valid.
double _SqDist_(Vector const &obj) const
Compute the squared-distance to another vector w/o dimension check.
Vector operator+(Vector const &rhs) const
double _Dot_(Vector const &obj) const
Compute a dot product w/o dimention check.
Vector & operator+=(Vector const &rhs)
Vector _Cross_(Vector const &obj) const
Compute a cross product w/o dimension check.
TLorentzVector ToTLorentzVector() const
Compute an opening angle w.r.t. the given vector.
Representation of a 3D semi-infinite line. Defines a semi-infinite 3D line by having a start point (P...
Vector Dir() const
Return a direction unit vector.
double _Angle_(Vector const &obj) const
Compute the angle in degrees between 2 vectors w/o dimension check.
Vector operator-(Vector const &rhs) const
Vector Vector_t
Point has same feature as Vector.
double _Dist_(Vector const &obj) const
Compute the distance to another vector w/o dimension check.
double Theta() const
Compute the angle theta.
Vector & operator*=(double const rhs)
bool operator<(Vector const &rhs) const
bool operator()(const geoalgo::Vector *lhs, const geoalgo::Vector *rhs)
Vector Cross(Vector const &obj) const
Compute a dot product of two vectors.
Vector & operator/=(double const rhs)
friend std::ostream & operator<<(std::ostream &o,::geoalgo::Vector const &a)
Streamer.