CMS 3D CMS Logo

Classes | Namespaces | Typedefs | Functions

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/DataFormats/GeometryVector/interface/extBasic2DVector.h File Reference

#include "DataFormats/GeometryVector/interface/Phi.h"
#include "DataFormats/GeometryVector/interface/PreciseFloatType.h"
#include "DataFormats/GeometryVector/interface/CoordinateSets.h"
#include "DataFormats/Math/interface/ExtVec.h"
#include <cmath>
#include <iosfwd>

Go to the source code of this file.

Classes

class  Basic2DVector< T >

Namespaces

namespace  geometryDetails

Typedefs

typedef Basic2DVector< double > Basic2DVectorD
typedef Basic2DVector< float > Basic2DVectorF

Functions

template<class T >
T operator* (const Basic2DVector< T > &v1, const Basic2DVector< T > &v2)
template<class T , class U >
PreciseFloatType< T, U >::Type operator* (const Basic2DVector< T > &v1, const Basic2DVector< U > &v2)
 scalar product of vectors of different precision
template<class T >
Basic2DVector< Toperator* (const Basic2DVector< T > &v, T t)
template<class T >
Basic2DVector< Toperator* (T t, const Basic2DVector< T > &v)
 Same as operator*( Vector, Scalar)
template<class T , class Scalar >
Basic2DVector< Toperator* (const Basic2DVector< T > &v, const Scalar &s)
template<class T , class Scalar >
Basic2DVector< Toperator* (const Scalar &s, const Basic2DVector< T > &v)
 Same as operator*( Vector, Scalar)
template<class T , class U >
Basic2DVector< typename
PreciseFloatType< T, U >::Type
operator+ (const Basic2DVector< T > &a, const Basic2DVector< U > &b)
template<class T >
Basic2DVector< Toperator+ (const Basic2DVector< T > &a, const Basic2DVector< T > &b)
 vector sum and subtraction of vectors of possibly different precision
template<class T >
Basic2DVector< Toperator- (const Basic2DVector< T > &a, const Basic2DVector< T > &b)
template<class T , class U >
Basic2DVector< typename
PreciseFloatType< T, U >::Type
operator- (const Basic2DVector< T > &a, const Basic2DVector< U > &b)
template<class T , class Scalar >
Basic2DVector< Toperator/ (const Basic2DVector< T > &v, const Scalar &s)
template<class T >
Basic2DVector< Toperator/ (const Basic2DVector< T > &v, T t)
template<class T >
std::ostream & operator<< (std::ostream &s, const Basic2DVector< T > &v)
 simple text output to standard streams
std::ostream & geometryDetails::print2D (std::ostream &s, double x, double y)

Typedef Documentation

typedef Basic2DVector<double> Basic2DVectorD

Definition at line 261 of file extBasic2DVector.h.

typedef Basic2DVector<float> Basic2DVectorF

Definition at line 260 of file extBasic2DVector.h.


Function Documentation

template<class T >
T operator* ( const Basic2DVector< T > &  v1,
const Basic2DVector< T > &  v2 
) [inline]

Definition at line 204 of file extBasic2DVector.h.

References Basic2DVector< T >::dot().

                                                                            {
  return v1.dot(v2);
}
template<class T , class U >
PreciseFloatType<T,U>::Type operator* ( const Basic2DVector< T > &  v1,
const Basic2DVector< U > &  v2 
) [inline]

scalar product of vectors of different precision

Definition at line 210 of file extBasic2DVector.h.

References Basic2DVector< T >::dot().

                                                                                   {
  return v1.dot(v2);
}
template<class T >
Basic2DVector<T> operator* ( const Basic2DVector< 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 220 of file extBasic2DVector.h.

References lumiQTWidget::t, and Basic2DVector< T >::v.

                                                                   {
  return v.v*t;
}
template<class T >
Basic2DVector<T> operator* ( T  t,
const Basic2DVector< T > &  v 
) [inline]

Same as operator*( Vector, Scalar)

Definition at line 226 of file extBasic2DVector.h.

References lumiQTWidget::t, and Basic2DVector< T >::v.

                                                                  {
  return v.v*t;
}
template<class T , class Scalar >
Basic2DVector<T> operator* ( const Basic2DVector< T > &  v,
const Scalar &  s 
) [inline]

Definition at line 233 of file extBasic2DVector.h.

References alignCSCRings::s, and lumiQTWidget::t.

                                                                               {
  T t = static_cast<T>(s);
  return v*t;
}
template<class T , class Scalar >
Basic2DVector<T> operator* ( const Scalar &  s,
const Basic2DVector< T > &  v 
) [inline]

Same as operator*( Vector, Scalar)

Definition at line 240 of file extBasic2DVector.h.

References alignCSCRings::s, and lumiQTWidget::t.

                                                                               {
  T t = static_cast<T>(s);
  return v*t;
}
template<class T , class U >
Basic2DVector<typename PreciseFloatType<T,U>::Type> operator+ ( const Basic2DVector< T > &  a,
const Basic2DVector< U > &  b 
) [inline]

Definition at line 187 of file extBasic2DVector.h.

                                                                 {
  typedef Basic2DVector<typename PreciseFloatType<T,U>::Type> RT;
  return RT(a) + RT(b);
}
template<class T >
Basic2DVector<T> operator+ ( const Basic2DVector< T > &  a,
const Basic2DVector< T > &  b 
) [inline]

vector sum and subtraction of vectors of possibly different precision

Definition at line 176 of file extBasic2DVector.h.

References Basic2DVector< T >::v.

                                                                 {
  return a.v+b.v;
}
template<class T >
Basic2DVector<T> operator- ( const Basic2DVector< T > &  a,
const Basic2DVector< T > &  b 
) [inline]

Definition at line 181 of file extBasic2DVector.h.

References Basic2DVector< T >::v.

                                                                 {
  return a.v-b.v;
}
template<class T , class U >
Basic2DVector<typename PreciseFloatType<T,U>::Type> operator- ( const Basic2DVector< T > &  a,
const Basic2DVector< U > &  b 
) [inline]

Definition at line 194 of file extBasic2DVector.h.

                                                                 {
  typedef Basic2DVector<typename PreciseFloatType<T,U>::Type> RT;
  return RT(a)-RT(b);
}
template<class T , class Scalar >
Basic2DVector<T> operator/ ( const Basic2DVector< T > &  v,
const Scalar &  s 
) [inline]

Definition at line 254 of file extBasic2DVector.h.

References alignCSCRings::s, and lumiQTWidget::t.

                                                                               {
  //   T t = static_cast<T>(Scalar(1)/s); return v*t;
   T t = static_cast<T>(s);
  return v/t;
}
template<class T >
Basic2DVector<T> operator/ ( const Basic2DVector< 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 249 of file extBasic2DVector.h.

References lumiQTWidget::t, and Basic2DVector< T >::v.

                                                                  {
  return v.v/t;
}
template<class T >
std::ostream& operator<< ( std::ostream &  s,
const Basic2DVector< T > &  v 
) [inline]

simple text output to standard streams

Definition at line 168 of file extBasic2DVector.h.

References geometryDetails::print2D(), alignCSCRings::s, and Basic2DVector< T >::v.

                                                                          {
  return geometryDetails::print2D(s, v.x(),v.y());
}