14 #ifndef BASICTOOL_GEOVECTOR_H 15 #define BASICTOOL_GEOVECTOR_H 20 #include "TLorentzVector.h" 53 Vector(
const double x,
const double y);
54 Vector(
const double x,
const double y,
const double z);
55 Vector(
const TVector3 &pt);
56 Vector(
const TLorentzVector &pt);
65 double Theta ()
const;
80 void RotateY(
const double& theta);
81 void RotateZ(
const double& theta);
101 for(
size_t i=0; i<
size(); ++i) (*
this)[i] += rhs[i];
106 for(
size_t i=0; i<
size(); ++i) (*
this)[i] -= rhs[i];
111 for(
auto &v : *
this) v *= rhs;
116 for(
auto &v : *
this) v /= rhs;
122 for(
size_t i=0; i<rhs.size(); ++i) (*
this)[i]=rhs[i];
143 for(
size_t i=0; i<
size(); ++i) res += (*
this)[i] * rhs[i];
164 for(
size_t i=0; i<
size(); ++i)
165 if((*
this)[i] < rhs[i])
return true;
170 {
return Length() < rhs; }
175 for(
size_t i=0; i<
size(); ++i)
176 if((*
this)[i] != rhs[i])
return false;
181 {
return !(*
this == rhs); }
186 { o <<
"Vector (";
for(
auto const& v : a) o << v <<
" ";
206 {
return (*lhs) < (*rhs); }
bool operator<(const Vector &rhs) const
bool operator!=(const Vector &rhs) const
Algorithm to compute various geometrical relation among geometrical objects. In particular functions ...
double _Angle_(const Vector &obj) const
Compute the angle in degrees between 2 vectors w/o dimension check.
Vector & operator+=(const Vector &rhs)
Vector operator+(const Vector &rhs) const
double _Dot_(const Vector &obj) const
Compute a dot product w/o dimention check.
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.
void compat(const Vector &obj) const
Dimensional check for a compatibility.
double _SqDist_(const Vector &obj) const
Compute the squared-distance to another vector w/o dimension check.
double Dist(const Vector &obj) const
Compute the distance to another vector.
Vector & operator*=(const double rhs)
Vector operator*(const double &rhs) const
void resize(Vector< T > &vec1, Index n1, const V &val)
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>
Vector _Cross_(const Vector &obj) const
Compute a cross product w/o dimension check.
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Vector operator/(const double &rhs) const
Vector(size_t n)
Ctor to instantiate with invalid value.
double Length() const
Compute the length of the vector.
double Dot(const Vector &obj) const
bool IsValid() const
Check if point is valid.
Vector operator-(const Vector &rhs) const
Vector Cross(const Vector &obj) const
Compute a dot product of two vectors.
void RotateY(const double &theta)
double SqDist(const Vector &obj) const
Compute the squared distance to another vector.
TLorentzVector ToTLorentzVector() const
Compute an opening angle w.r.t. the given vector.
Vector & operator/=(const double rhs)
double operator*(const Vector &rhs) const
Representation of a 3D semi-infinite line. Defines a semi-infinite 3D line by having a start point (P...
void RotateX(const double &theta)
rotation operations
Vector Dir() const
Return a direction unit vector.
Vector & operator=(const Vector &rhs)
Vector Vector_t
Point has same feature as Vector.
double Theta() const
Compute the angle theta.
double _Dist_(const Vector &obj) const
Compute the distance to another vector w/o dimension check.
static const double kINVALID_DOUBLE
void RotateZ(const double &theta)
bool operator==(const Vector &rhs) const
bool operator()(const geoalgo::Vector *lhs, const geoalgo::Vector *rhs)
double Angle(const Vector &obj) const
Compute a cross product of two vectors.
Vector & operator-=(const Vector &rhs)
friend std::ostream & operator<<(std::ostream &o,::geoalgo::Vector const &a)
Streamer.