Go to the documentation of this file.
12 #ifndef BASIC_VECTOR3D_H
13 #define BASIC_VECTOR3D_H
17 #include "CLHEP/Vector/ThreeVector.h"
62 v_[0] =
v.x();
v_[1] =
v.y();
v_[2] =
v.z();
75 operator T * () {
return v_; }
79 operator const T * ()
const {
return v_; }
95 v_[0] =
v.v_[0];
v_[1] =
v.v_[1];
v_[2] =
v.v_[2];
return *
this;
100 v_[0] +=
v.v_[0];
v_[1] +=
v.v_[1];
v_[2] +=
v.v_[2];
return *
this;
105 v_[0] -=
v.v_[0];
v_[1] -=
v.v_[1];
v_[2] -=
v.v_[2];
return *
this;
110 v_[0] *=
a;
v_[1] *=
a;
v_[2] *=
a;
return *
this;
115 v_[0] /=
a;
v_[1] /=
a;
v_[2] /=
a;
return *
this;
142 T
x()
const {
return v_[0]; }
145 T
y()
const {
return v_[1]; }
148 T
z()
const {
return v_[2]; }
162 void set(T x1, T y1, T z1) {
v_[0] = x1;
v_[1] = y1;
v_[2] = z1; }
183 factor = rh/factor;
v_[0] *= factor;
v_[1] *= factor;
203 return x() == 0 &&
y() == 0 ? 0 : std::atan2(
y(),
x());
208 return x() == 0 &&
y() == 0 &&
z() == 0 ? 0 : std::atan2(
perp(),
z());
229 factor = ma/factor;
v_[0] *= factor;
v_[1] *= factor;
v_[2] *= factor;
243 set(ma*std::sin(th)*std::cos(ph), ma*std::sin(th)*std::sin(ph), ma*std::cos(th));
271 return x()*
v.x()+
y()*
v.y()+
z()*
v.z();
279 x()*
v.y()-
v.x()*
y());
285 T tot =
v.mag2(),
s =
dot(
v);
292 return std::sqrt(
perp2(
v));
314 T dx =
x() < 0 ? -
x() :
x();
315 T dy =
y() < 0 ? -
y() :
y();
316 T dz =
z() < 0 ? -
z() :
z();
355 operator<<(std::ostream &,
const BasicVector3D<float> &);
362 operator>>(std::istream &, BasicVector3D<float> &);
368 inline BasicVector3D<float>
440 return (
a.x()==
b.x() &&
a.y()==
b.y() &&
a.z()==
b.z());
449 return (
a.x()!=
b.x() ||
a.y()!=
b.y() ||
a.z()!=
b.z());
549 return (
a.x()==
b.x() &&
a.y()==
b.y() &&
a.z()==
b.z());
559 return (
a.x()!=
b.x() ||
a.y()!=
b.y() ||
a.z()!=
b.z());
563 #ifdef ENABLE_BACKWARDS_COMPATIBILITY
BasicVector3D< double > operator+(const BasicVector3D< double > &v)
BasicVector3D< T > & operator-=(const BasicVector3D< T > &v)
BasicVector3D< T > cross(const BasicVector3D< T > &v) const
BasicVector3D< double > operator*(const BasicVector3D< double > &v, double a)
BasicVector3D< float > operator+(const BasicVector3D< float > &v)
T perp2(const BasicVector3D< T > &v) const
BasicVector3D(T x1, T y1, T z1)
bool operator!=(const BasicVector3D< float > &a, const BasicVector3D< float > &b)
BasicVector3D< double > operator+(const BasicVector3D< double > &a, const BasicVector3D< double > &b)
bool operator==(const BasicVector3D< float > &a, const BasicVector3D< float > &b)
BasicVector3D< float > operator-(const BasicVector3D< float > &a, const BasicVector3D< float > &b)
BasicVector3D< float > operator/(const BasicVector3D< float > &v, double a)
T perp(const BasicVector3D< T > &v) const
float operator*(const BasicVector3D< float > &a, const BasicVector3D< float > &b)
T dot(const BasicVector3D< T > &v) const
BasicVector3D(const BasicVector3D< float > &v)
bool operator==(const BasicVector3D< double > &a, const BasicVector3D< double > &b)
BasicVector3D< double > operator*(double a, const BasicVector3D< double > &v)
BasicVector3D< double > operator/(const BasicVector3D< double > &v, double a)
BasicVector3D< T > & rotate(T a, const BasicVector3D< T > &v)
BasicVector3D< T > & operator/=(double a)
they are gone ZOOM Features Discontinued The following features of the ZOOM package were felt to be extreme overkill These have been after checking that no existing user code was utilizing as in SpaceVector v
BasicVector3D< T > & operator=(const BasicVector3D< T > &v)
bool operator!=(const BasicVector3D< double > &a, const BasicVector3D< double > &b)
Issues Concerning the PhysicsVectors CLHEP Vector Merge The merge of ZOOM PhysicsVdectors and the CLHEP Vector package is completed The purpose of this document is to list the major issues that affected the merge of these and where relevant describe the resolutions More detailed documents describe more minor issues General Approach As agreed at the June CLHEP the approach is to combine the features of each ZOOM class with the corresponding CLHEP class expanding the interface to create a single lingua franca of what a Hep3Vector(for example) means. We are not forming SpaceVector as an class derived from Hep3Vector and enhancing it in that way. Another rule imposed by the agreement is to avoid using the Exceptions package(even though that will later go into CLHEP for other uses). A desirable goal is to avoid cluttering the interface and enlarging the code linked in when ordinary CLHEP Vector functionallity is used. To this end
BasicVector3D< T > & operator*=(double a)
BasicVector3D< T > & operator+=(const BasicVector3D< T > &v)
BasicVector3D< double > operator-(const BasicVector3D< double > &a, const BasicVector3D< double > &b)
void set(T x1, T y1, T z1)
T operator()(int i) const
std::istream & operator>>(std::istream &is, BasicVector3D< float > &a)
Methods applicble to containers of as in std::list< LorentzVector > s
BasicVector3D< float > operator*(const BasicVector3D< float > &v, double a)
BasicVector3D< float > operator-(const BasicVector3D< float > &v)
BasicVector3D< T > & rotateZ(T a)
T angle(const BasicVector3D< T > &v) const
BasicVector3D< float > operator*(double a, const BasicVector3D< float > &v)
BasicVector3D< double > operator-(const BasicVector3D< double > &v)
BasicVector3D< T > & rotateX(T a)
BasicVector3D< T > orthogonal() const
std::ostream & operator<<(std::ostream &os, const BasicVector3D< float > &a)
BasicVector3D< T > & rotateY(T a)
T operator[](int i) const
BasicVector3D< T > unit() const
double operator*(const BasicVector3D< double > &a, const BasicVector3D< double > &b)
BasicVector3D< float > operator+(const BasicVector3D< float > &a, const BasicVector3D< float > &b)