#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>
#include "Basic3DVectorLD.h"
Go to the source code of this file.
Classes | |
class | Basic3DVector< T > |
Namespaces | |
namespace | detailsBasic3DVector |
namespace | geometryDetails |
Typedefs | |
typedef Basic3DVector< double > | Basic3DVectorD |
typedef Basic3DVector< float > | Basic3DVectorF |
typedef Geom::Cylindrical2Cartesian< T > | Cylindrical |
typedef mathSSE::Vec4< T > | MathVector |
typedef Spherical | Polar |
typedef T | ScalarType |
typedef Geom::Spherical2Cartesian< T > | Spherical |
typedef mathSSE::Vec4< T > | VectorType |
Functions | |
float | detailsBasic3DVector::__attribute__ ((always_inline)) __attribute__((pure)) eta(float x |
template<typename T > | |
class Basic3DVector | __attribute__ ((aligned(16))) |
T | barePhi () const |
T | bareTheta () const |
Basic3DVector (const Basic3DVector &p) | |
Copy constructor from same type. Should not be needed but for gcc bug 12685. | |
template<class U > | |
Basic3DVector (mathSSE::Vec4< U > const &iv) | |
Basic3DVector (const T &x, const T &y, const T &z, const T &w=0) | |
construct from cartesian coordinates | |
template<class U > | |
Basic3DVector (const Basic3DVector< U > &p) | |
Copy constructor and implicit conversion from Basic3DVector of different precision. | |
template<typename U > | |
Basic3DVector (const Geom::Theta< U > &theta, const Geom::Phi< U > &phi, const T &r) | |
Basic3DVector (const Basic2DVector< T > &p) | |
constructor from 2D vector (X and Y from 2D vector, z set to zero) | |
Basic3DVector () | |
template<class OtherPoint > | |
Basic3DVector (const OtherPoint &p) | |
Basic3DVector | cross (const Basic3DVector &lh) const |
Vector product, or "cross" product, with a vector of same type. | |
template<class U > | |
Basic3DVector< typename PreciseFloatType< T, U >::Type > | cross (const Basic3DVector< U > &lh) const |
T | dot (const Basic3DVector &rh) const |
Scalar product, or "dot" product, with a vector of same type. | |
template<class U > | |
PreciseFloatType< T, U >::Type | dot (const Basic3DVector< U > &lh) const |
T | eta () const |
T | mag () const |
The vector magnitude. Equivalent to sqrt(vec.mag2()) | |
T | mag2 () const |
The vector magnitude squared. Equivalent to vec.dot(vec) | |
MathVector const & | mathVector () const |
template<class T > | |
Basic3DVector< T > | operator* (const Basic3DVector< T > &v, T t) |
template<class T > | |
T | operator* (const Basic3DVector< T > &v1, const Basic3DVector< T > &v2) |
scalar product of vectors of same precision | |
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 | |
template<class T > | |
Basic3DVector< T > | operator* (T t, const Basic3DVector< T > &v) |
Same as operator*( Vector, Scalar) | |
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) |
Basic3DVector & | operator*= (T t) |
Scaling by a scalar value (multiplication) | |
template<class T > | |
Basic3DVector< T > | operator+ (const Basic3DVector< T > &a, const Basic3DVector< T > &b) |
vector sum and subtraction of vectors of possibly different precision | |
template<class T , class U > | |
Basic3DVector< typename PreciseFloatType< T, U >::Type > | operator+ (const Basic3DVector< T > &a, const Basic3DVector< U > &b) |
template<class U > | |
Basic3DVector & | operator+= (const Basic3DVector< U > &p) |
Basic3DVector | operator- () const |
Unary minus, returns a vector with components (-x(),-y(),-z()) | |
template<class T , class U > | |
Basic3DVector< typename PreciseFloatType< T, U >::Type > | operator- (const Basic3DVector< T > &a, const Basic3DVector< U > &b) |
template<class T > | |
Basic3DVector< T > | operator- (const Basic3DVector< T > &a, const Basic3DVector< T > &b) |
template<class U > | |
Basic3DVector & | operator-= (const Basic3DVector< U > &p) |
template<class T > | |
Basic3DVector< T > | operator/ (const Basic3DVector< T > &v, T t) |
template<class T , typename S > | |
Basic3DVector< T > | operator/ (const Basic3DVector< T > &v, S s) |
Basic3DVector & | operator/= (T t) |
Scaling by a scalar value (division) | |
template<class T > | |
std::ostream & | operator<< (std::ostream &s, const Basic3DVector< T > &v) |
simple text output to standard streams | |
bool | operator== (const Basic3DVector &rh) const |
T | operator[] (int i) const |
T | perp () const |
Magnitude of transverse component. | |
T | perp2 () const |
Squared magnitude of transverse component. | |
Geom::Phi< T > | phi () const |
std::ostream & | geometryDetails::print3D (std::ostream &s, double x, double y, double z) |
Geom::Theta< T > | theta () const |
T | transverse () const |
Another name for perp() | |
Basic3DVector | unit () const |
T | w () const |
T | x () const |
Cartesian x coordinate. | |
Basic2DVector< T > | xy () const |
T | y () const |
Cartesian y coordinate. | |
T | z () const |
Cartesian z coordinate. | |
Variables | |
mathSSE::Vec4< T > | v |
typedef Basic3DVector<double> Basic3DVectorD |
Definition at line 320 of file sseBasic3DVector.h.
typedef Basic3DVector<float> Basic3DVectorF |
Definition at line 319 of file sseBasic3DVector.h.
typedef Geom::Cylindrical2Cartesian<T> Cylindrical |
Definition at line 229 of file sseBasic3DVector.h.
typedef mathSSE::Vec4<T> MathVector |
Definition at line 228 of file sseBasic3DVector.h.
Definition at line 231 of file sseBasic3DVector.h.
typedef T ScalarType |
Definition at line 226 of file sseBasic3DVector.h.
typedef Geom::Spherical2Cartesian<T> Spherical |
Definition at line 230 of file sseBasic3DVector.h.
typedef mathSSE::Vec4<T> VectorType |
Definition at line 227 of file sseBasic3DVector.h.
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 329 of file sseBasic3DVector.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 336 of file sseBasic3DVector.h.
__attribute__::Basic3DVector | ( | const Basic3DVector & | p | ) |
Copy constructor from same type. Should not be needed but for gcc bug 12685.
Definition at line 240 of file sseBasic3DVector.h.
__attribute__::Basic3DVector | ( | mathSSE::Vec4< U > const & | iv | ) |
Definition at line 269 of file sseBasic3DVector.h.
construct from cartesian coordinates
Definition at line 272 of file sseBasic3DVector.h.
References Basic3DVector< T >::dot().
{
return v1.dot(v2);
__attribute__::Basic3DVector | ( | const Basic3DVector< U > & | p | ) |
Copy constructor and implicit conversion from Basic3DVector of different precision.
Definition at line 245 of file sseBasic3DVector.h.
__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 280 of file sseBasic3DVector.h.
__attribute__::Basic3DVector | ( | const Basic2DVector< T > & | p | ) |
constructor from 2D vector (X and Y from 2D vector, z set to zero)
Definition at line 250 of file sseBasic3DVector.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 237 of file sseBasic3DVector.h.
{
__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 263 of file sseBasic3DVector.h.
{
Basic3DVector __attribute__::cross | ( | const Basic3DVector & | lh | ) | const |
Vector product, or "cross" product, with a vector of same type.
Definition at line 403 of file sseBasic3DVector.h.
Basic3DVector<typename PreciseFloatType<T,U>::Type> __attribute__::cross | ( | const Basic3DVector< U > & | lh | ) | 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 415 of file sseBasic3DVector.h.
T __attribute__::dot | ( | const Basic3DVector & | rh | ) | const |
Scalar product, or "dot" product, with a vector of same type.
Definition at line 387 of file sseBasic3DVector.h.
PreciseFloatType<T,U>::Type __attribute__::dot | ( | const Basic3DVector< U > & | lh | ) | 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 397 of file sseBasic3DVector.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 344 of file sseBasic3DVector.h.
T __attribute__::mag | ( | ) | const |
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition at line 314 of file sseBasic3DVector.h.
T __attribute__::mag2 | ( | ) | const |
The vector magnitude squared. Equivalent to vec.dot(vec)
Definition at line 311 of file sseBasic3DVector.h.
{
MathVector & mathVector | ( | ) | const |
Definition at line 286 of file sseBasic3DVector.h.
{
Basic3DVector<T> operator* | ( | const Basic3DVector< T > & | v, |
T | 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 280 of file sseBasic3DVector.h.
References lumiQTWidget::t, and Basic3DVector< T >::v.
T operator* | ( | const Basic3DVector< T > & | v1, |
const Basic3DVector< T > & | v2 | ||
) | [inline] |
scalar product of vectors of same precision
Definition at line 265 of file sseBasic3DVector.h.
References Basic3DVector< T >::dot().
{ return v1.dot(v2); }
PreciseFloatType<T,U>::Type operator* | ( | const Basic3DVector< T > & | v1, |
const Basic3DVector< U > & | v2 | ||
) | [inline] |
scalar product of vectors of different precision
Definition at line 271 of file sseBasic3DVector.h.
{ return v1.dot(v2); }
Basic3DVector<T> operator* | ( | T | t, |
const Basic3DVector< T > & | v | ||
) | [inline] |
Same as operator*( Vector, Scalar)
Definition at line 286 of file sseBasic3DVector.h.
References lumiQTWidget::t, and Basic3DVector< T >::v.
Basic3DVector<T> operator* | ( | S | t, |
const Basic3DVector< T > & | v | ||
) | [inline] |
Definition at line 293 of file sseBasic3DVector.h.
Basic3DVector<T> operator* | ( | const Basic3DVector< T > & | v, |
S | t | ||
) | [inline] |
Definition at line 298 of file sseBasic3DVector.h.
Basic3DVector& __attribute__::operator*= | ( | T | t | ) |
Scaling by a scalar value (multiplication)
Definition at line 374 of file sseBasic3DVector.h.
Basic3DVector<T> operator+ | ( | const Basic3DVector< T > & | a, |
const Basic3DVector< T > & | b | ||
) | [inline] |
vector sum and subtraction of vectors of possibly different precision
Definition at line 240 of file sseBasic3DVector.h.
References Basic3DVector< T >::v.
Basic3DVector<typename PreciseFloatType<T,U>::Type> operator+ | ( | const Basic3DVector< T > & | a, |
const Basic3DVector< U > & | b | ||
) | [inline] |
Definition at line 251 of file sseBasic3DVector.h.
References Basic3DVector< T >::v.
{ typedef Basic3DVector<typename PreciseFloatType<T,U>::Type> RT; return RT(a).v+RT(b).v; }
Basic3DVector& __attribute__::operator+= | ( | const Basic3DVector< U > & | p | ) |
Operator += with a Basic3DVector of possibly different precision.
Definition at line 357 of file sseBasic3DVector.h.
Basic3DVector __attribute__::operator- | ( | ) | const |
Unary minus, returns a vector with components (-x(),-y(),-z())
Definition at line 371 of file sseBasic3DVector.h.
Basic3DVector<typename PreciseFloatType<T,U>::Type> operator- | ( | const Basic3DVector< T > & | a, |
const Basic3DVector< U > & | b | ||
) | [inline] |
Definition at line 258 of file sseBasic3DVector.h.
References Basic3DVector< T >::v.
{ typedef Basic3DVector<typename PreciseFloatType<T,U>::Type> RT; return RT(a).v-RT(b).v; }
Basic3DVector<T> operator- | ( | const Basic3DVector< T > & | a, |
const Basic3DVector< T > & | b | ||
) | [inline] |
Definition at line 245 of file sseBasic3DVector.h.
References Basic3DVector< T >::v.
Basic3DVector& __attribute__::operator-= | ( | const Basic3DVector< U > & | p | ) |
Operator -= with a Basic3DVector of possibly different precision.
Definition at line 365 of file sseBasic3DVector.h.
Basic3DVector<T> operator/ | ( | const Basic3DVector< T > & | v, |
T | t | ||
) | [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 307 of file sseBasic3DVector.h.
References lumiQTWidget::t, and Basic3DVector< T >::v.
Basic3DVector<T> operator/ | ( | const Basic3DVector< T > & | v, |
S | s | ||
) | [inline] |
Basic3DVector& __attribute__::operator/= | ( | T | t | ) |
Scaling by a scalar value (division)
Definition at line 380 of file sseBasic3DVector.h.
std::ostream& operator<< | ( | std::ostream & | s, |
const Basic3DVector< T > & | v | ||
) | [inline] |
simple text output to standard streams
Definition at line 232 of file sseBasic3DVector.h.
References geometryDetails::print3D(), alignCSCRings::s, and findQualityFiles::v.
{ return geometryDetails::print3D(s, v.x(),v.y(), v.z()); }
bool __attribute__::operator== | ( | const Basic3DVector & | rh | ) | const |
Definition at line 306 of file sseBasic3DVector.h.
T __attribute__::operator[] | ( | int | i | ) | const |
Definition at line 289 of file sseBasic3DVector.h.
{
T __attribute__::perp | ( | ) | const |
Magnitude of transverse component.
Definition at line 320 of file sseBasic3DVector.h.
T __attribute__::perp2 | ( | ) | const |
Squared magnitude of transverse component.
Definition at line 317 of file sseBasic3DVector.h.
Definition at line 330 of file sseBasic3DVector.h.
Geom::Theta<T> __attribute__::theta | ( | ) | const |
Definition at line 337 of file sseBasic3DVector.h.
T __attribute__::transverse | ( | ) | const |
Another name for perp()
Definition at line 323 of file sseBasic3DVector.h.
Basic3DVector __attribute__::unit | ( | ) | const |
Unit vector parallel to this. If mag() is zero, a zero vector is returned.
Definition at line 349 of file sseBasic3DVector.h.
T __attribute__::w | ( | ) | const |
Definition at line 301 of file sseBasic3DVector.h.
{
T __attribute__::x | ( | ) | const |
Cartesian x coordinate.
Definition at line 293 of file sseBasic3DVector.h.
References lumiQTWidget::t.
{
Basic2DVector<T> __attribute__::xy | ( | ) | const |
Definition at line 303 of file sseBasic3DVector.h.
{
T __attribute__::y | ( | ) | const |
T __attribute__::z | ( | ) | const |
Definition at line 421 of file sseBasic3DVector.h.