CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Namespaces | Typedefs | Functions | Variables
oldBasic3DVector.h File Reference
#include "DataFormats/GeometryVector/interface/Basic2DVector.h"
#include "DataFormats/GeometryVector/interface/Theta.h"
#include "DataFormats/GeometryVector/interface/Phi.h"
#include "DataFormats/GeometryVector/interface/PreciseFloatType.h"
#include "DataFormats/GeometryVector/interface/CoordinateSets.h"
#include "DataFormats/Math/interface/SSEVec.h"
#include <iosfwd>
#include <cmath>

Go to the source code of this file.

Classes

class  Basic3DVector< T >
 

Namespaces

 geometryDetails
 

Typedefs

typedef Basic3DVector< double > Basic3DVectorD
 
typedef Basic3DVector< float > Basic3DVectorF
 
typedef
Geom::Cylindrical2Cartesian< T > 
Cylindrical
 
typedef Spherical Polar
 
typedef T ScalarType
 
typedef
Geom::Spherical2Cartesian< T > 
Spherical
 

Functions

template<typename T >
class Basic3DVector __attribute__ ((aligned(16)))
 
barePhi () const
 
bareTheta () const
 
 Basic3DVector ()
 
 Basic3DVector (const Basic3DVector &p)
 Copy constructor from same type. Should not be needed but for gcc bug 12685. More...
 
template<class U >
 Basic3DVector (const Basic3DVector< U > &p)
 Copy constructor and implicit conversion from Basic3DVector of different precision. More...
 
 Basic3DVector (const Basic2DVector< T > &p)
 constructor from 2D vector (X and Y from 2D vector, z set to zero) More...
 
template<class OtherPoint >
 Basic3DVector (const OtherPoint &p)
 
template<typename U >
 Basic3DVector (mathSSE::Vec4< U > const &iv)
 
 Basic3DVector (const T &x, const T &y, const T &z)
 construct from cartesian coordinates More...
 
template<typename U >
 Basic3DVector (const Geom::Theta< U > &theta, const Geom::Phi< U > &phi, const T &r)
 
Basic3DVector cross (const Basic3DVector &v) const
 Vector product, or "cross" product, with a vector of same type. More...
 
template<class U >
Basic3DVector< typename
PreciseFloatType< T, U >::Type > 
cross (const Basic3DVector< U > &v) const
 
dot (const Basic3DVector &v) const
 Scalar product, or "dot" product, with a vector of same type. More...
 
template<class U >
PreciseFloatType< T, U >::Type dot (const Basic3DVector< U > &v) const
 
eta () const
 
mag () const
 The vector magnitude. Equivalent to sqrt(vec.mag2()) More...
 
mag2 () const
 The vector magnitude squared. Equivalent to vec.dot(vec) More...
 
template<class T >
operator* (const Basic3DVector< T > &v1, const Basic3DVector< T > &v2)
 scalar product of vectors of same precision More...
 
template<class T , class U >
PreciseFloatType< T, U >::Type operator* (const Basic3DVector< T > &v1, const Basic3DVector< U > &v2)
 scalar product of vectors of different precision More...
 
template<class T >
Basic3DVector< T > operator* (const Basic3DVector< T > &v, T t)
 
template<class T >
Basic3DVector< T > operator* (T t, const Basic3DVector< T > &v)
 Same as operator*( Vector, Scalar) More...
 
template<class T , typename S >
Basic3DVector< T > operator* (S t, const Basic3DVector< T > &v)
 
template<class T , typename S >
Basic3DVector< T > operator* (const Basic3DVector< T > &v, S t)
 
Basic3DVectoroperator*= (T t)
 Scaling by a scalar value (multiplication) More...
 
template<class T , class U >
Basic3DVector< typename
PreciseFloatType< T, U >::Type > 
operator+ (const Basic3DVector< T > &a, const Basic3DVector< U > &b)
 vector sum and subtraction of vectors of possibly different precision More...
 
template<class U >
Basic3DVectoroperator+= (const Basic3DVector< U > &p)
 
template<class T , class U >
Basic3DVector< typename
PreciseFloatType< T, U >::Type > 
operator- (const Basic3DVector< T > &a, const Basic3DVector< U > &b)
 
Basic3DVector operator- () const
 Unary minus, returns a vector with components (-x(),-y(),-z()) More...
 
template<class U >
Basic3DVectoroperator-= (const Basic3DVector< U > &p)
 
template<class T , typename S >
Basic3DVector< T > operator/ (const Basic3DVector< T > &v, S s)
 
Basic3DVectoroperator/= (T t)
 Scaling by a scalar value (division) More...
 
template<class T >
std::ostream & operator<< (std::ostream &s, const Basic3DVector< T > &v)
 simple text output to standard streams More...
 
bool operator== (const Basic3DVector &rh) const
 
perp () const
 Magnitude of transverse component. More...
 
perp2 () const
 Squared magnitude of transverse component. More...
 
Geom::Phi< T > phi () const
 
std::ostream & geometryDetails::print3D (std::ostream &s, double x, double y, double z)
 
Geom::Theta< T > theta () const
 
transverse () const
 Another name for perp() More...
 
Basic3DVector unit () const
 
x () const
 Cartesian x coordinate. More...
 
Basic2DVector< T > xy () const
 
y () const
 Cartesian y coordinate. More...
 
z () const
 Cartesian z coordinate. More...
 

Variables

theW
 
theX
 
theY
 
theZ
 

Typedef Documentation

typedef Basic3DVector<double> Basic3DVectorD

Definition at line 306 of file oldBasic3DVector.h.

typedef Basic3DVector<float> Basic3DVectorF

Definition at line 305 of file oldBasic3DVector.h.

Definition at line 221 of file oldBasic3DVector.h.

typedef Spherical Polar

Definition at line 223 of file oldBasic3DVector.h.

typedef T ScalarType

Definition at line 220 of file oldBasic3DVector.h.

Definition at line 222 of file oldBasic3DVector.h.

Function Documentation

template<typename T >
class Basic3DVector __attribute__ ( (aligned(16))  )
T __attribute__::barePhi ( ) const

Azimuthal angle. The value is returned in radians, in the range (-pi,pi]. Same precision as the system atan2(x,y) function. The return type is Geom::Phi<T>, see it's documentation.

Definition at line 315 of file oldBasic3DVector.h.

T __attribute__::bareTheta ( ) const

Polar angle. The value is returned in radians, in the range [0,pi] Same precision as the system atan2(x,y) function. The return type is Geom::Phi<T>, see it's documentation.

Definition at line 322 of file oldBasic3DVector.h.

__attribute__::Basic3DVector ( )

default constructor uses default constructor of T to initialize the components. For built-in floating-point types this means initialization to zero??? (force init to 0)

Definition at line 229 of file oldBasic3DVector.h.

231 {
__attribute__::Basic3DVector ( const Basic3DVector p)

Copy constructor from same type. Should not be needed but for gcc bug 12685.

Definition at line 232 of file oldBasic3DVector.h.

template<class U >
__attribute__::Basic3DVector ( const Basic3DVector< U > &  p)

Copy constructor and implicit conversion from Basic3DVector of different precision.

Definition at line 237 of file oldBasic3DVector.h.

237  {
238  return geometryDetails::print3D(s, v.x(),v.y(), v.z());
string s
Definition: asciidump.py:422
std::ostream & print3D(std::ostream &s, double x, double y, double z)
Definition: print.cc:5
mathSSE::Vec4< T > v
__attribute__::Basic3DVector ( const Basic2DVector< T > &  p)

constructor from 2D vector (X and Y from 2D vector, z set to zero)

Definition at line 241 of file oldBasic3DVector.h.

template<class OtherPoint >
__attribute__::Basic3DVector ( const OtherPoint &  p)
explicit

Explicit constructor from other (possibly unrelated) vector classes The only constraint on the argument type is that it has methods x(), y() and z(), and that these methods return a type convertible to T. Examples of use are
construction from a Basic3DVector with different precision
construction from a Hep3Vector
construction from a coordinate system converter

Definition at line 253 of file oldBasic3DVector.h.

259  {
template<typename U >
__attribute__::Basic3DVector ( mathSSE::Vec4< U > const &  iv)

Definition at line 260 of file oldBasic3DVector.h.

__attribute__::Basic3DVector ( const T &  x,
const T &  y,
const T &  z 
)

construct from cartesian coordinates

Definition at line 265 of file oldBasic3DVector.h.

266  {
template<typename U >
__attribute__::Basic3DVector ( const Geom::Theta< U > &  theta,
const Geom::Phi< U > &  phi,
const T &  r 
)

Deprecated construct from polar coordinates, use
Basic3DVector<T>( Basic3DVector<T>::Polar( theta, phi, r)) instead.

Definition at line 273 of file oldBasic3DVector.h.

274  {
275  return Basic3DVector<T>(v.x()*t, v.y()*t, v.z()*t);
276 }
277 
mathSSE::Vec4< T > v
Basic3DVector __attribute__::cross ( const Basic3DVector v) const

Vector product, or "cross" product, with a vector of same type.

Definition at line 398 of file oldBasic3DVector.h.

template<class U >
Basic3DVector<typename PreciseFloatType<T,U>::Type> __attribute__::cross ( const Basic3DVector< U > &  v) const

Vector (or cross) product with a vector of different precision. The product is computed without loss of precision. The type of the returned vector is the more precise of the types of the two vectors.

Definition at line 412 of file oldBasic3DVector.h.

T __attribute__::dot ( const Basic3DVector v) const

Scalar product, or "dot" product, with a vector of same type.

Definition at line 383 of file oldBasic3DVector.h.

template<class U >
PreciseFloatType<T,U>::Type __attribute__::dot ( const Basic3DVector< U > &  v) const

Scalar (or dot) product with a vector of different precision. The product is computed without loss of precision. The type of the returned scalar is the more precise of the scalar types of the two vectors.

Definition at line 393 of file oldBasic3DVector.h.

T __attribute__::eta ( ) const

Pseudorapidity. Does not check for zero transverse component; in this case the behavior is as for divide-by zero, i.e. system-dependent.

Definition at line 330 of file oldBasic3DVector.h.

T __attribute__::mag ( ) const

The vector magnitude. Equivalent to sqrt(vec.mag2())

Definition at line 300 of file oldBasic3DVector.h.

T __attribute__::mag2 ( ) const

The vector magnitude squared. Equivalent to vec.dot(vec)

Definition at line 297 of file oldBasic3DVector.h.

299 {
template<class T >
T operator* ( const Basic3DVector< T > &  v1,
const Basic3DVector< T > &  v2 
)
inline

scalar product of vectors of same precision

Definition at line 259 of file oldBasic3DVector.h.

259  {
260  return v1.dot(v2);
261 }
T dot(const Basic3DVector &v) const
Scalar product, or &quot;dot&quot; product, with a vector of same type.
template<class T , class U >
PreciseFloatType<T,U>::Type operator* ( const Basic3DVector< T > &  v1,
const Basic3DVector< U > &  v2 
)
inline

scalar product of vectors of different precision

Definition at line 265 of file oldBasic3DVector.h.

References Basic3DVector< T >::x(), Basic3DVector< T >::y(), and Basic3DVector< T >::z().

266  {
267  return v1.x()*v2.x() + v1.y()*v2.y() + v1.z()*v2.z();
268 }
T y() const
Cartesian y coordinate.
T x() const
Cartesian x coordinate.
T z() const
Cartesian z coordinate.
template<class T >
Basic3DVector<T> operator* ( const Basic3DVector< T > &  v,
t 
)
inline

Multiplication by scalar, does not change the precision of the vector. The return type is the same as the type of the vector argument.

Definition at line 274 of file oldBasic3DVector.h.

References matplotRender::t, Basic3DVector< T >::x(), Basic3DVector< T >::y(), and Basic3DVector< T >::z().

274  {
275  return Basic3DVector<T>(v.x()*t, v.y()*t, v.z()*t);
276 }
T y() const
Cartesian y coordinate.
T x() const
Cartesian x coordinate.
T z() const
Cartesian z coordinate.
template<class T >
Basic3DVector<T> operator* ( t,
const Basic3DVector< T > &  v 
)
inline

Same as operator*( Vector, Scalar)

Definition at line 280 of file oldBasic3DVector.h.

280  {
281  return Basic3DVector<T>(v.x()*t, v.y()*t, v.z()*t);
282 }
T y() const
Cartesian y coordinate.
T x() const
Cartesian x coordinate.
T z() const
Cartesian z coordinate.
template<class T , typename S >
Basic3DVector<T> operator* ( t,
const Basic3DVector< T > &  v 
)
inline

Definition at line 285 of file oldBasic3DVector.h.

285  {
286  return static_cast<T>(t)*v;
287 }
template<class T , typename S >
Basic3DVector<T> operator* ( const Basic3DVector< T > &  v,
t 
)
inline

Definition at line 290 of file oldBasic3DVector.h.

References matplotRender::t.

290  {
291  return static_cast<T>(t)*v;
292 }
Basic3DVector& __attribute__::operator*= ( t)

Scaling by a scalar value (multiplication)

Definition at line 366 of file oldBasic3DVector.h.

template<class T , class U >
Basic3DVector<typename PreciseFloatType<T,U>::Type> operator+ ( const Basic3DVector< T > &  a,
const Basic3DVector< U > &  b 
)
inline

vector sum and subtraction of vectors of possibly different precision

Definition at line 245 of file oldBasic3DVector.h.

References Basic3DVector< T >::x(), Basic3DVector< T >::y(), and Basic3DVector< T >::z().

245  {
247  return RT(a.x()+b.x(), a.y()+b.y(), a.z()+b.z());
248 }
T y() const
Cartesian y coordinate.
T x() const
Cartesian x coordinate.
T z() const
Cartesian z coordinate.
template<class U >
Basic3DVector& __attribute__::operator+= ( const Basic3DVector< U > &  p)

Operator += with a Basic3DVector of possibly different precision.

Definition at line 345 of file oldBasic3DVector.h.

template<class T , class U >
Basic3DVector<typename PreciseFloatType<T,U>::Type> operator- ( const Basic3DVector< T > &  a,
const Basic3DVector< U > &  b 
)
inline

Definition at line 252 of file oldBasic3DVector.h.

252  {
254  return RT(a.x()-b.x(), a.y()-b.y(), a.z()-b.z());
255 }
T y() const
Cartesian y coordinate.
T x() const
Cartesian x coordinate.
T z() const
Cartesian z coordinate.
Basic3DVector __attribute__::operator- ( ) const

Unary minus, returns a vector with components (-x(),-y(),-z())

Definition at line 363 of file oldBasic3DVector.h.

template<class U >
Basic3DVector& __attribute__::operator-= ( const Basic3DVector< U > &  p)

Operator -= with a Basic3DVector of possibly different precision.

Definition at line 355 of file oldBasic3DVector.h.

template<class T , typename S >
Basic3DVector<T> operator/ ( const Basic3DVector< T > &  v,
s 
)
inline

Division by scalar, does not change the precision of the vector. The return type is the same as the type of the vector argument.

Definition at line 299 of file oldBasic3DVector.h.

299  {
300  T t = T(1)/s;
301  return v*t;
302 }
string s
Definition: asciidump.py:422
Basic3DVector& __attribute__::operator/= ( t)

Scaling by a scalar value (division)

Definition at line 374 of file oldBasic3DVector.h.

template<class T >
std::ostream& operator<< ( std::ostream &  s,
const Basic3DVector< T > &  v 
)
inline

simple text output to standard streams

Definition at line 237 of file oldBasic3DVector.h.

References geometryDetails::print3D(), asciidump::s, and v.

237  {
238  return geometryDetails::print3D(s, v.x(),v.y(), v.z());
239 }
T y() const
Cartesian y coordinate.
T x() const
Cartesian x coordinate.
T z() const
Cartesian z coordinate.
string s
Definition: asciidump.py:422
std::ostream & print3D(std::ostream &s, double x, double y, double z)
Definition: print.cc:5
bool __attribute__::operator== ( const Basic3DVector rh) const

Definition at line 292 of file oldBasic3DVector.h.

299  {
T __attribute__::perp ( ) const

Magnitude of transverse component.

Definition at line 306 of file oldBasic3DVector.h.

T __attribute__::perp2 ( ) const

Squared magnitude of transverse component.

Definition at line 303 of file oldBasic3DVector.h.

Geom::Phi<T> __attribute__::phi ( ) const

Definition at line 316 of file oldBasic3DVector.h.

Geom::Theta<T> __attribute__::theta ( ) const

Definition at line 323 of file oldBasic3DVector.h.

T __attribute__::transverse ( ) const

Another name for perp()

Definition at line 309 of file oldBasic3DVector.h.

Basic3DVector __attribute__::unit ( ) const

Unit vector parallel to this. If mag() is zero, a zero vector is returned.

Definition at line 335 of file oldBasic3DVector.h.

T __attribute__::x ( ) const

Cartesian x coordinate.

Definition at line 280 of file oldBasic3DVector.h.

References matplotRender::t, Basic3DVector< T >::x(), Basic3DVector< T >::y(), and Basic3DVector< T >::z().

280 {
Basic2DVector<T> __attribute__::xy ( ) const

Definition at line 288 of file oldBasic3DVector.h.

290 {
T __attribute__::y ( ) const

Cartesian y coordinate.

Definition at line 283 of file oldBasic3DVector.h.

285 {
T __attribute__::z ( ) const

Cartesian z coordinate.

Definition at line 286 of file oldBasic3DVector.h.

290 {

Variable Documentation

T theW

Definition at line 422 of file oldBasic3DVector.h.

Referenced by align::diffAlignables().

T theX

Definition at line 419 of file oldBasic3DVector.h.

T theY

Definition at line 420 of file oldBasic3DVector.h.

T theZ

Definition at line 421 of file oldBasic3DVector.h.

Referenced by LaserAlignment::testRoutine().