14 #ifndef BASICTOOL_GEOVECTOR_H
15 #define BASICTOOL_GEOVECTOR_H
20 #include <TLorentzVector.h>
55 Vector(
const double x,
const double y);
56 Vector(
const double x,
const double y,
const double z);
57 Vector(
const TVector3 &pt);
58 Vector(
const TLorentzVector &pt);
68 double Theta ()
const;
82 void RotateX(
const double& theta);
83 void RotateY(
const double& theta);
84 void RotateZ(
const double& theta);
86 std::string
dump()
const;
106 for(
size_t i=0; i<
size(); ++i) (*
this)[i] += rhs[i];
111 for(
size_t i=0; i<
size(); ++i) (*
this)[i] -= rhs[i];
116 for(
auto &v : *
this) v *= rhs;
121 for(
auto &v : *
this) v /= rhs;
126 this->resize(rhs.size());
127 for(
size_t i=0; i<rhs.size(); ++i) (*
this)[i]=rhs[i];
148 for(
size_t i=0; i<
size(); ++i) res += (*
this)[i] * rhs[i];
169 for(
size_t i=0; i<
size(); ++i)
170 if((*
this)[i] < rhs[i])
return true;
175 {
return Length() < rhs; }
180 for(
size_t i=0; i<
size(); ++i)
181 if((*
this)[i] != rhs[i])
return false;
186 {
return !(*
this == rhs); }
191 { o << a.
dump();
return o; }
205 class less<geoalgo::Vector*>
209 {
return (*lhs) < (*rhs); }
bool operator<(const Vector &rhs) const
process_name opflash particleana ie ie ie z
bool operator!=(const Vector &rhs) const
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
virtual ~Vector()
Default dtor.
process_name opflash particleana ie x
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.
double Phi() const
Compute the angle Phi.
std::size_t size(FixedBins< T, C > const &) noexcept
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 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.
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
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.
process_name opflash particleana ie ie y
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
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.