LArSoft
v07_13_02
Liquid Argon Software toolkit - http://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... | |
virtual | ~Vector () |
Default dtor. 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 35 of file GeoVector.h.
|
inline |
|
inline |
|
inline |
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 | ) |
|
inlinevirtual |
Default dtor.
Definition at line 60 of file GeoVector.h.
References _Angle_(), _Cross_(), _Dist_(), _Dot_(), _SqDist_(), Angle(), compat(), Cross(), Dir(), Dist(), Dot(), IsValid(), Length(), Normalize(), Phi(), RotateX(), RotateY(), RotateZ(), SqDist(), SqLength(), Theta(), and ToTLorentzVector().
|
protected |
Compute the angle in degrees between 2 vectors w/o dimension check.
Definition at line 134 of file GeoVector.cxx.
References _Dot_(), and Length().
Referenced by Angle(), and ~Vector().
Compute a cross product w/o dimension check.
Definition at line 125 of file GeoVector.cxx.
Referenced by Cross(), and ~Vector().
|
protected |
Compute the distance to another vector w/o dimension check.
Definition at line 119 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 122 of file GeoVector.cxx.
|
protected |
Compute the squared-distance to another vector w/o dimension check.
Definition at line 112 of file GeoVector.cxx.
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 80 of file GeoVector.cxx.
References _Angle_(), and compat().
Referenced by geoalgo::Cylinder::Contain(), and ~Vector().
void geoalgo::Vector::compat | ( | const Vector & | obj | ) | const |
Dimensional check for a compatibility.
Definition at line 101 of file GeoVector.cxx.
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 60 of file GeoVector.cxx.
References _Cross_().
Referenced by ~Vector().
Vector geoalgo::Vector::Dir | ( | ) | const |
Return a direction unit vector.
Definition at line 95 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 52 of file GeoVector.cxx.
References SqDist().
Referenced by geoalgo::Sphere::Sphere(), and ~Vector().
double geoalgo::Vector::Dot | ( | const Vector & | obj | ) | const |
Definition at line 55 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 26 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 44 of file GeoVector.cxx.
References SqLength().
Referenced by _Angle_(), geoalgo::GeoAlgo::_ClosestPt_(), Dir(), geoalgo::HalfLine::Normalize(), Normalize(), operator<(), geoalgo::Sphere::Sphere(), and ~Vector().
void geoalgo::Vector::Normalize | ( | ) |
Normalize itself.
Definition at line 93 of file GeoVector.cxx.
References Length().
Referenced by geoalgo::GeoAlgo::_commonOrigin_(), geoalgo::GeoAlgo::_RemainingPoints_(), and ~Vector().
|
inline |
Definition at line 184 of file GeoVector.h.
|
inline |
Definition at line 144 of file GeoVector.h.
|
inline |
Definition at line 151 of file GeoVector.h.
|
inline |
Definition at line 114 of file GeoVector.h.
Definition at line 130 of file GeoVector.h.
Definition at line 104 of file GeoVector.h.
Definition at line 137 of file GeoVector.h.
Definition at line 109 of file GeoVector.h.
|
inline |
Definition at line 158 of file GeoVector.h.
|
inline |
Definition at line 119 of file GeoVector.h.
|
inline |
Definition at line 165 of file GeoVector.h.
References compat().
|
inline |
Definition at line 173 of file GeoVector.h.
References Length().
Definition at line 124 of file GeoVector.h.
|
inline |
Definition at line 176 of file GeoVector.h.
References compat().
double geoalgo::Vector::Phi | ( | ) | const |
void geoalgo::Vector::RotateX | ( | const double & | theta | ) |
rotation operations
Definition at line 138 of file GeoVector.cxx.
References s.
Referenced by ~Vector().
void geoalgo::Vector::RotateY | ( | const double & | theta | ) |
void geoalgo::Vector::RotateZ | ( | const double & | theta | ) |
double geoalgo::Vector::SqDist | ( | const Vector & | obj | ) | const |
Compute the squared distance to another vector.
Definition at line 47 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 38 of file GeoVector.cxx.
Referenced by geoalgo::GeoAlgo::_ClosestPt_(), geoalgo::GeoAlgo::_SqDist_(), Length(), and ~Vector().
double geoalgo::Vector::Theta | ( | ) | const |
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 87 of file GeoVector.cxx.
Referenced by ~Vector().
|
friend |
Definition at line 40 of file GeoVector.h.
|
friend |
Definition at line 37 of file GeoVector.h.
|
friend |
Definition at line 38 of file GeoVector.h.
|
friend |
Streamer.
Definition at line 189 of file GeoVector.h.
|
friend |
Definition at line 39 of file GeoVector.h.
|
friend |
Definition at line 36 of file GeoVector.h.
|
inherited |
STL member.