Geant4  10.07
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Hep2Vector Class Reference

Public Types

enum  { X =0, Y =1, NUM_COORDINATES =2, SIZE =NUM_COORDINATES }
 
enum  { ZMpvToleranceTicks = 100 }
 

Public Member Functions

 Hep2Vector (double x=0.0, double y=0.0)
 
 Hep2Vector (const Hep2Vector &p)
 
 Hep2Vector (Hep2Vector &&p)=default
 
 Hep2Vector (const Hep3Vector &)
 
 ~Hep2Vector ()
 
double x () const
 
double y () const
 
double operator() (int i) const
 
double operator[] (int i) const
 
double & operator() (int i)
 
double & operator[] (int i)
 
void setX (double x)
 
void setY (double y)
 
void set (double x, double y)
 
double phi () const
 
double mag2 () const
 
double mag () const
 
double r () const
 
void setPhi (double phi)
 
void setMag (double r)
 
void setR (double r)
 
void setPolar (double r, double phi)
 
Hep2Vectoroperator= (const Hep2Vector &p)
 
Hep2Vectoroperator= (Hep2Vector &&p)=default
 
bool operator== (const Hep2Vector &v) const
 
bool operator!= (const Hep2Vector &v) const
 
int compare (const Hep2Vector &v) const
 
bool operator> (const Hep2Vector &v) const
 
bool operator< (const Hep2Vector &v) const
 
bool operator>= (const Hep2Vector &v) const
 
bool operator<= (const Hep2Vector &v) const
 
double howNear (const Hep2Vector &p) const
 
bool isNear (const Hep2Vector &p, double epsilon=tolerance) const
 
double howParallel (const Hep2Vector &p) const
 
bool isParallel (const Hep2Vector &p, double epsilon=tolerance) const
 
double howOrthogonal (const Hep2Vector &p) const
 
bool isOrthogonal (const Hep2Vector &p, double epsilon=tolerance) const
 
Hep2Vectoroperator+= (const Hep2Vector &p)
 
Hep2Vectoroperator-= (const Hep2Vector &p)
 
Hep2Vector operator- () const
 
Hep2Vectoroperator*= (double a)
 
Hep2Vector unit () const
 
Hep2Vector orthogonal () const
 
double dot (const Hep2Vector &p) const
 
double angle (const Hep2Vector &) const
 
void rotate (double)
 
 operator Hep3Vector () const
 

Static Public Member Functions

static double getTolerance ()
 
static double setTolerance (double tol)
 

Private Attributes

double dx
 
double dy
 

Static Private Attributes

static double tolerance
 

Friends

std::ostream & operator<< (std::ostream &, const Hep2Vector &)
 
double operator* (const Hep2Vector &a, const Hep2Vector &b)
 
Hep2Vector operator* (const Hep2Vector &p, double a)
 
Hep2Vector operator* (double a, const Hep2Vector &p)
 
Hep2Vector operator/ (const Hep2Vector &p, double a)
 
Hep2Vector operator+ (const Hep2Vector &a, const Hep2Vector &b)
 
Hep2Vector operator- (const Hep2Vector &a, const Hep2Vector &b)
 

Detailed Description

Author

Member Enumeration Documentation

anonymous enum
Enumerator
NUM_COORDINATES 
SIZE 
anonymous enum
Enumerator
ZMpvToleranceTicks 

Constructor & Destructor Documentation

Hep2Vector ( double  x = 0.0,
double  y = 0.0 
)
Hep2Vector ( Hep2Vector &&  p)
default
Hep2Vector ( const Hep3Vector )
explicit
~Hep2Vector ( )

Member Function Documentation

double x ( ) const
double y ( ) const
double operator() ( int  i) const
double operator[] ( int  i) const
double& operator() ( int  i)
double& operator[] ( int  i)
void setX ( double  x)
void setY ( double  y)
void set ( double  x,
double  y 
)
double phi ( ) const
double mag2 ( ) const
double mag ( ) const
double r ( ) const
void setPhi ( double  phi)
void setMag ( double  r)
void setR ( double  r)
void setPolar ( double  r,
double  phi 
)
Hep2Vector& operator= ( const Hep2Vector p)
Hep2Vector& operator= ( Hep2Vector &&  p)
default
bool operator== ( const Hep2Vector v) const
bool operator!= ( const Hep2Vector v) const
int compare ( const Hep2Vector v) const
bool operator> ( const Hep2Vector v) const
bool operator< ( const Hep2Vector v) const
bool operator>= ( const Hep2Vector v) const
bool operator<= ( const Hep2Vector v) const
static double getTolerance ( )
static
static double setTolerance ( double  tol)
static
double howNear ( const Hep2Vector p) const
bool isNear ( const Hep2Vector p,
double  epsilon = tolerance 
) const
double howParallel ( const Hep2Vector p) const
bool isParallel ( const Hep2Vector p,
double  epsilon = tolerance 
) const
double howOrthogonal ( const Hep2Vector p) const
bool isOrthogonal ( const Hep2Vector p,
double  epsilon = tolerance 
) const
Hep2Vector& operator+= ( const Hep2Vector p)
Hep2Vector& operator-= ( const Hep2Vector p)
Hep2Vector operator- ( ) const
Hep2Vector& operator*= ( double  a)
Hep2Vector unit ( ) const
Hep2Vector orthogonal ( ) const
double dot ( const Hep2Vector p) const
double angle ( const Hep2Vector ) const
void rotate ( double  )
operator Hep3Vector ( ) const

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  ,
const Hep2Vector  
)
friend
double operator* ( const Hep2Vector a,
const Hep2Vector b 
)
friend
Hep2Vector operator* ( const Hep2Vector p,
double  a 
)
friend
Hep2Vector operator* ( double  a,
const Hep2Vector p 
)
friend
Hep2Vector operator/ ( const Hep2Vector p,
double  a 
)
friend
Hep2Vector operator+ ( const Hep2Vector a,
const Hep2Vector b 
)
friend
Hep2Vector operator- ( const Hep2Vector a,
const Hep2Vector b 
)
friend

Member Data Documentation

double dx
private
double dy
private
double tolerance
staticprivate