![]() |
![]() |
#include <Basic2DVector.h>
Public Types | |
typedef Geom::Polar2Cartesian< T > | Polar |
typedef T | ScalarType |
Public Member Functions | |
T | barePhi () const |
Basic2DVector (const Basic2DVector &p) | |
Copy constructor from same type. Should not be needed but for gcc bug 12685. | |
Basic2DVector (const T &x, const T &y) | |
construct from cartesian coordinates | |
template<typename U > | |
Basic2DVector (mathSSE::Vec2< U > const &iv) | |
Basic2DVector () | |
template<class Other > | |
Basic2DVector (const Other &p) | |
template<typename U > | |
Basic2DVector (mathSSE::Vec4< U > const &iv) | |
template<class U > | |
PreciseFloatType< T, U >::Type | dot (const Basic2DVector< U > &v) const |
T | dot (const Basic2DVector &v) const |
Scalar product, or "dot" product, with a vector of same type. | |
T | mag () const |
The vector magnitude. Equivalent to sqrt(vec.mag2()) | |
T | mag2 () const |
The vector magnitude squared. Equivalent to vec.dot(vec) | |
Basic2DVector & | operator*= (const T &t) |
Scaling by a scalar value (multiplication) | |
template<class U > | |
Basic2DVector & | operator+= (const Basic2DVector< U > &p) |
Basic2DVector | operator- () const |
Unary minus, returns a vector with components (-x(),-y(),-z()) | |
template<class U > | |
Basic2DVector & | operator-= (const Basic2DVector< U > &p) |
Basic2DVector & | operator/= (const T &t) |
Scaling by a scalar value (division) | |
Geom::Phi< T > | phi () const |
T | r () const |
Radius, same as mag() | |
Basic2DVector | unit () const |
T | x () const |
Cartesian x coordinate. | |
T | y () const |
Cartesian y coordinate. | |
Private Attributes | |
T | theX |
T | theY |
Definition at line 20 of file Basic2DVector.h.
typedef Geom::Polar2Cartesian<T> Basic2DVector< T >::Polar |
Definition at line 24 of file Basic2DVector.h.
typedef T Basic2DVector< T >::ScalarType |
Definition at line 23 of file Basic2DVector.h.
Basic2DVector< T >::Basic2DVector | ( | ) | [inline] |
default constructor uses default constructor of T to initialize the components. For built-in floating-point types this means initialization to zero
Definition at line 30 of file Basic2DVector.h.
Referenced by Basic2DVector< TmpType >::operator-().
Basic2DVector< T >::Basic2DVector | ( | const Basic2DVector< T > & | p | ) | [inline] |
Basic2DVector< T >::Basic2DVector | ( | const Other & | p | ) | [inline, explicit] |
Explicit constructor from other (possibly unrelated) vector classes The only constraint on the argument type is that it has methods x() and y(), and that these methods return a type convertible to T. Examples of use are
construction from a Basic2DVector with different precision
construction from a coordinate system converter
Definition at line 44 of file Basic2DVector.h.
Basic2DVector< T >::Basic2DVector | ( | const T & | x, |
const T & | y | ||
) | [inline] |
Basic2DVector< T >::Basic2DVector | ( | mathSSE::Vec2< U > const & | iv | ) | [inline] |
Definition at line 53 of file Basic2DVector.h.
Basic2DVector< T >::Basic2DVector | ( | mathSSE::Vec4< U > const & | iv | ) | [inline] |
Definition at line 56 of file Basic2DVector.h.
T Basic2DVector< T >::barePhi | ( | ) | const [inline] |
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 80 of file Basic2DVector.h.
Referenced by PV2DBase< double, PointTag, LocalTag >::barePhi().
T Basic2DVector< T >::dot | ( | const Basic2DVector< T > & | v | ) | const [inline] |
Scalar product, or "dot" product, with a vector of same type.
Definition at line 127 of file Basic2DVector.h.
Referenced by Vector2DBase< float, GlobalTag >::dot(), operator*(), and InnerDeltaPhi::phiRange().
PreciseFloatType<T,U>::Type Basic2DVector< T >::dot | ( | const Basic2DVector< U > & | v | ) | const [inline] |
T Basic2DVector< T >::mag | ( | ) | const [inline] |
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition at line 71 of file Basic2DVector.h.
Referenced by HelixBarrelCylinderCrossing::HelixBarrelCylinderCrossing(), ThirdHitPredictionFromCircle::invCenterOnAxis(), PV2DBase< double, PointTag, LocalTag >::mag(), HelixBarrelPlaneCrossingByCircle::pathLength(), InnerDeltaPhi::phiRange(), Basic2DVector< TmpType >::r(), TrackFitter::run(), PixelFitterByHelixProjections::run(), and Basic2DVector< TmpType >::unit().
T Basic2DVector< T >::mag2 | ( | ) | const [inline] |
The vector magnitude squared. Equivalent to vec.dot(vec)
Definition at line 68 of file Basic2DVector.h.
Referenced by ThirdHitPredictionFromCircle::angle(), HelixBarrelCylinderCrossing::chooseSolution(), HelixBarrelPlaneCrossingByCircle::chooseSolution(), CircleFromThreePoints::init(), Basic2DVector< TmpType >::mag(), PV2DBase< double, PointTag, LocalTag >::mag2(), ConformalMappingFit::MappedPoint< T >::MappedPoint(), ThirdHitPredictionFromInvParabola::MappedPoint< double >::MappedPoint(), ThirdHitPredictionFromInvLine::MappedPoint< T >::MappedPoint(), ThirdHitPredictionFromCircle::phi(), and ThirdHitPredictionFromCircle::HelixRZ::zAtR().
Basic2DVector& Basic2DVector< T >::operator*= | ( | const T & | t | ) | [inline] |
Basic2DVector& Basic2DVector< T >::operator+= | ( | const Basic2DVector< U > & | p | ) | [inline] |
Operator += with a Basic2DVector of possibly different precision.
Definition at line 94 of file Basic2DVector.h.
Basic2DVector Basic2DVector< T >::operator- | ( | ) | const [inline] |
Unary minus, returns a vector with components (-x(),-y(),-z())
Definition at line 110 of file Basic2DVector.h.
{ return Basic2DVector(-x(),-y());}
Basic2DVector& Basic2DVector< T >::operator-= | ( | const Basic2DVector< U > & | p | ) | [inline] |
Operator -= with a Basic2DVector of possibly different precision.
Definition at line 103 of file Basic2DVector.h.
Basic2DVector& Basic2DVector< T >::operator/= | ( | const T & | t | ) | [inline] |
Geom::Phi<T> Basic2DVector< T >::phi | ( | ) | const [inline] |
Definition at line 81 of file Basic2DVector.h.
Referenced by ThirdHitPredictionFromCircle::phi(), PV2DBase< double, PointTag, LocalTag >::phi(), InnerDeltaPhi::phiRange(), ThirdHitPredictionFromInvParabola::rangeRPhi(), and ThirdHitPredictionFromInvParabola::rangeRPhiSlow().
{return Geom::Phi<T>(atan2(theY,theX));}
T Basic2DVector< T >::r | ( | ) | const [inline] |
Radius, same as mag()
Definition at line 74 of file Basic2DVector.h.
Referenced by PixelTripletLargeTipGenerator::hitTriplets(), and PV2DBase< double, PointTag, LocalTag >::r().
{ return mag();}
Basic2DVector Basic2DVector< T >::unit | ( | ) | const [inline] |
Unit vector parallel to this. If mag() is zero, a zero vector is returned.
Definition at line 86 of file Basic2DVector.h.
Referenced by InnerDeltaPhi::phiRange().
{ T my_mag = mag(); return my_mag == 0 ? *this : *this / my_mag; }
T Basic2DVector< T >::x | ( | ) | const [inline] |
Cartesian x coordinate.
Definition at line 62 of file Basic2DVector.h.
Referenced by HelixBarrelCylinderCrossing::chooseSolution(), HelixBarrelPlaneCrossingByCircle::chooseSolution(), ThirdHitPredictionFromInvLine::crossing(), ThirdHitPredictionFromCircle::curvature(), Basic2DVector< TmpType >::dot(), ConformalMappingFit::findRot(), HelixBarrelCylinderCrossing::HelixBarrelCylinderCrossing(), HelixBarrelPlaneCrossing2OrderLocal::HelixBarrelPlaneCrossing2OrderLocal(), CircleFromThreePoints::init(), ThirdHitPredictionFromCircle::invCenterOnAxis(), TkRotation< align::Scalar >::multiplyInverse(), operator*(), TkRotation< align::Scalar >::operator*(), operator+(), Basic2DVector< TmpType >::operator+=(), operator-(), Basic2DVector< TmpType >::operator-(), Basic2DVector< TmpType >::operator-=(), operator/(), CurvilinearState::position(), HelixBarrelPlaneCrossingByCircle::position(), ThirdHitPredictionFromCircle::HelixRZ::rAtZ(), TrackFitter::run(), PixelFitterByHelixProjections::run(), and PV2DBase< double, PointTag, LocalTag >::x().
{ return theX;}
T Basic2DVector< T >::y | ( | ) | const [inline] |
Cartesian y coordinate.
Definition at line 65 of file Basic2DVector.h.
Referenced by HelixBarrelCylinderCrossing::chooseSolution(), HelixBarrelPlaneCrossingByCircle::chooseSolution(), ThirdHitPredictionFromInvLine::crossing(), ThirdHitPredictionFromCircle::curvature(), Basic2DVector< TmpType >::dot(), ConformalMappingFit::findRot(), HelixBarrelCylinderCrossing::HelixBarrelCylinderCrossing(), HelixBarrelPlaneCrossing2OrderLocal::HelixBarrelPlaneCrossing2OrderLocal(), CircleFromThreePoints::init(), ThirdHitPredictionFromCircle::invCenterOnAxis(), TkRotation< align::Scalar >::multiplyInverse(), operator*(), TkRotation< align::Scalar >::operator*(), operator+(), Basic2DVector< TmpType >::operator+=(), operator-(), Basic2DVector< TmpType >::operator-(), Basic2DVector< TmpType >::operator-=(), operator/(), CurvilinearState::position(), HelixBarrelPlaneCrossingByCircle::position(), ThirdHitPredictionFromCircle::HelixRZ::rAtZ(), TrackFitter::run(), PixelFitterByHelixProjections::run(), and PV2DBase< double, PointTag, LocalTag >::y().
{ return theY;}
T Basic2DVector< T >::theX [private] |
Definition at line 140 of file Basic2DVector.h.
Referenced by Basic2DVector< TmpType >::barePhi(), Basic2DVector< TmpType >::mag2(), Basic2DVector< TmpType >::operator*=(), Basic2DVector< TmpType >::operator+=(), Basic2DVector< TmpType >::operator-=(), Basic2DVector< TmpType >::operator/=(), Basic2DVector< TmpType >::phi(), and Basic2DVector< TmpType >::x().
T Basic2DVector< T >::theY [private] |
Definition at line 141 of file Basic2DVector.h.
Referenced by Basic2DVector< TmpType >::barePhi(), Basic2DVector< TmpType >::mag2(), Basic2DVector< TmpType >::operator*=(), Basic2DVector< TmpType >::operator+=(), Basic2DVector< TmpType >::operator-=(), Basic2DVector< TmpType >::operator/=(), Basic2DVector< TmpType >::phi(), and Basic2DVector< TmpType >::y().