LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
#include "GeoVector.h"
Public Member Functions | |
Vector () | |
Default ctor. More... | |
Vector (size_t n) | |
Ctor to instantiate with invalid value. More... | |
Vector (const std::vector< double > &obj) | |
Default ctor w/ a bare std::vector<double> More... | |
Vector (const double x, const double y) | |
ctor w/ x & y More... | |
Vector (const double x, const double y, const double z) | |
ctor w/ x, y & z More... | |
Vector (const TVector3 &pt) | |
ctor w/ TVector3 More... | |
Vector (const TLorentzVector &pt) | |
ctor w/ TLorentzVector More... | |
void | Normalize () |
Normalize itself. More... | |
bool | IsValid () const |
Check if point is valid. More... | |
double | SqLength () const |
Compute the squared length of the vector. More... | |
double | Length () const |
Compute the length of the vector. More... | |
Vector | Dir () const |
Return a direction unit vector. More... | |
double | Phi () const |
Compute the angle Phi. More... | |
double | Theta () const |
Compute the angle theta. More... | |
double | SqDist (const Vector &obj) const |
Compute the squared distance to another vector. More... | |
double | Dist (const Vector &obj) const |
Compute the distance to another vector. More... | |
double | Dot (const Vector &obj) const |
Vector | Cross (const Vector &obj) const |
Compute a dot product of two vectors. More... | |
double | Angle (const Vector &obj) const |
Compute a cross product of two vectors. More... | |
TLorentzVector | ToTLorentzVector () const |
Compute an opening angle w.r.t. the given vector. More... | |
void | compat (const Vector &obj) const |
Dimensional check for a compatibility. More... | |
void | RotateX (const double &theta) |
rotation operations More... | |
void | RotateY (const double &theta) |
void | RotateZ (const double &theta) |
Vector & | operator+= (const Vector &rhs) |
Vector & | operator-= (const Vector &rhs) |
Vector & | operator*= (const double rhs) |
Vector & | operator/= (const double rhs) |
Vector & | operator= (const Vector &rhs) |
Vector | operator+ (const Vector &rhs) const |
Vector | operator- (const Vector &rhs) const |
double | operator* (const Vector &rhs) const |
Vector | operator* (const double &rhs) const |
Vector | operator/ (const double &rhs) const |
bool | operator< (const Vector &rhs) const |
bool | operator< (const double &rhs) const |
bool | operator== (const Vector &rhs) const |
bool | operator!= (const Vector &rhs) const |
Public Attributes | |
T | elements |
STL member. More... | |
Protected Member Functions | |
double | _SqDist_ (const Vector &obj) const |
Compute the squared-distance to another vector w/o dimension check. More... | |
double | _Dist_ (const Vector &obj) const |
Compute the distance to another vector w/o dimension check. More... | |
double | _Dot_ (const Vector &obj) const |
Compute a dot product w/o dimention check. More... | |
Vector | _Cross_ (const Vector &obj) const |
Compute a cross product w/o dimension check. More... | |
double | _Angle_ (const Vector &obj) const |
Compute the angle in degrees between 2 vectors w/o dimension check. More... | |
Friends | |
class | Trajectory |
class | HalfLine |
class | LineSegment |
class | Sphere |
class | GeoAlgo |
std::ostream & | operator<< (std::ostream &o,::geoalgo::Vector const &a) |
Streamer. More... | |
This class represents an n-dimensional vector
Definition at line 33 of file GeoVector.h.
|
inline |
|
inline |
|
inline |
Default ctor w/ a bare std::vector<double>
Definition at line 48 of file GeoVector.h.
References _Angle_(), _Cross_(), _Dist_(), _Dot_(), _SqDist_(), Angle(), compat(), Cross(), Dir(), Dist(), Dot(), IsValid(), Length(), Normalize(), Phi(), pt, RotateX(), RotateY(), RotateZ(), SqDist(), SqLength(), Theta(), ToTLorentzVector(), Vector(), x, y, and z.
geoalgo::Vector::Vector | ( | const double | x, |
const double | y | ||
) |
geoalgo::Vector::Vector | ( | const double | x, |
const double | y, | ||
const double | z | ||
) |
geoalgo::Vector::Vector | ( | const TVector3 & | pt | ) |
geoalgo::Vector::Vector | ( | const TLorentzVector & | pt | ) |
|
protected |
Compute the angle in degrees between 2 vectors w/o dimension check.
Definition at line 165 of file GeoVector.cxx.
References _Dot_(), and Length().
Referenced by Angle(), and Vector().
Compute a cross product w/o dimension check.
Definition at line 156 of file GeoVector.cxx.
Referenced by Cross(), and Vector().
|
protected |
Compute the distance to another vector w/o dimension check.
Definition at line 146 of file GeoVector.cxx.
References _SqDist_().
Referenced by geoalgo::Sphere::Contain(), and Vector().
|
protected |
Compute a dot product w/o dimention check.
Definition at line 151 of file GeoVector.cxx.
|
protected |
Compute the squared-distance to another vector w/o dimension check.
Definition at line 138 of file GeoVector.cxx.
References larg4::dist(), and util::size().
Referenced by _Dist_(), geoalgo::GeoAlgo::_SqDist_(), geoalgo::GeoAlgo::Intersection(), SqDist(), and Vector().
double geoalgo::Vector::Angle | ( | const Vector & | obj | ) | const |
Compute a cross product of two vectors.
Definition at line 101 of file GeoVector.cxx.
References _Angle_(), compat(), and util::size().
Referenced by geoalgo::Cylinder::Contain(), and Vector().
void geoalgo::Vector::compat | ( | const Vector & | obj | ) | const |
Dimensional check for a compatibility.
Definition at line 128 of file GeoVector.cxx.
References util::size().
Referenced by Angle(), geoalgo::GeoAlgo::ClosestPt(), geoalgo::GeoAlgo::commonOrigin(), geoalgo::Sphere::Contain(), Dot(), operator<(), operator==(), SqDist(), geoalgo::GeoAlgo::SqDist(), and Vector().
Compute a dot product of two vectors.
Definition at line 79 of file GeoVector.cxx.
References _Cross_(), and util::size().
Referenced by Vector().
Vector geoalgo::Vector::Dir | ( | ) | const |
Return a direction unit vector.
Definition at line 121 of file GeoVector.cxx.
References Length().
Referenced by Vector().
double geoalgo::Vector::Dist | ( | const Vector & | obj | ) | const |
Compute the distance to another vector.
Definition at line 68 of file GeoVector.cxx.
References SqDist().
Referenced by geoalgo::Sphere::Sphere(), and Vector().
double geoalgo::Vector::Dot | ( | const Vector & | obj | ) | const |
Definition at line 73 of file GeoVector.cxx.
References _Dot_(), and compat().
Referenced by geoalgo::GeoAlgo::_commonOrigin_(), geoalgo::Sphere::Sphere(), and Vector().
bool geoalgo::Vector::IsValid | ( | ) | const |
Check if point is valid.
Definition at line 37 of file GeoVector.cxx.
References geoalgo::kINVALID_DOUBLE.
Referenced by geoalgo::GeoAlgo::Intersection(), and Vector().
double geoalgo::Vector::Length | ( | ) | const |
Compute the length of the vector.
Definition at line 57 of file GeoVector.cxx.
References SqLength().
Referenced by _Angle_(), geoalgo::GeoAlgo::_ClosestPt_(), Dir(), Normalize(), geoalgo::HalfLine::Normalize(), operator<(), geoalgo::Sphere::Sphere(), and Vector().
void geoalgo::Vector::Normalize | ( | ) |
Normalize itself.
Definition at line 116 of file GeoVector.cxx.
References Length().
Referenced by geoalgo::GeoAlgo::_commonOrigin_(), geoalgo::GeoAlgo::_RemainingPoints_(), and Vector().
|
inline |
Definition at line 187 of file GeoVector.h.
|
inline |
Definition at line 147 of file GeoVector.h.
References util::size().
|
inline |
Definition at line 155 of file GeoVector.h.
|
inline |
Definition at line 111 of file GeoVector.h.
Definition at line 133 of file GeoVector.h.
Definition at line 97 of file GeoVector.h.
References util::size().
Definition at line 140 of file GeoVector.h.
Definition at line 104 of file GeoVector.h.
References util::size().
|
inline |
Definition at line 162 of file GeoVector.h.
|
inline |
Definition at line 118 of file GeoVector.h.
|
inline |
Definition at line 169 of file GeoVector.h.
References compat(), and util::size().
|
inline |
Definition at line 177 of file GeoVector.h.
References Length().
Definition at line 125 of file GeoVector.h.
|
inline |
Definition at line 179 of file GeoVector.h.
References compat(), and util::size().
double geoalgo::Vector::Phi | ( | ) | const |
void geoalgo::Vector::RotateX | ( | const double & | theta | ) |
void geoalgo::Vector::RotateY | ( | const double & | theta | ) |
Definition at line 185 of file GeoVector.cxx.
Referenced by Vector().
void geoalgo::Vector::RotateZ | ( | const double & | theta | ) |
Definition at line 200 of file GeoVector.cxx.
Referenced by Vector().
double geoalgo::Vector::SqDist | ( | const Vector & | obj | ) | const |
Compute the squared distance to another vector.
Definition at line 62 of file GeoVector.cxx.
References _SqDist_(), and compat().
Referenced by Dist(), and Vector().
double geoalgo::Vector::SqLength | ( | ) | const |
Compute the squared length of the vector.
Definition at line 49 of file GeoVector.cxx.
Referenced by geoalgo::GeoAlgo::_ClosestPt_(), geoalgo::GeoAlgo::_SqDist_(), Length(), and Vector().
double geoalgo::Vector::Theta | ( | ) | const |
Compute the angle theta.
Definition at line 94 of file GeoVector.cxx.
References util::size().
Referenced by Vector().
TLorentzVector geoalgo::Vector::ToTLorentzVector | ( | ) | const |
Compute an opening angle w.r.t. the given vector.
Convert geovector to TLorentzVector (with 4th element set equal to 0)
Definition at line 109 of file GeoVector.cxx.
References util::size().
Referenced by Vector().
|
friend |
Definition at line 38 of file GeoVector.h.
|
friend |
Definition at line 35 of file GeoVector.h.
|
friend |
Definition at line 36 of file GeoVector.h.
|
friend |
Streamer.
Definition at line 191 of file GeoVector.h.
|
friend |
Definition at line 37 of file GeoVector.h.
|
friend |
Definition at line 34 of file GeoVector.h.
|
inherited |
STL member.