Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
HepGeom::Point3D< float > Class Reference

#include <Point3D.h>

Inheritance diagram for HepGeom::Point3D< float >:

Public Member Functions

 Point3D ()=default
 Point3D (float x1, float y1, float z1)
 Point3D (const float *a)
 Point3D (const Point3D< float > &)=default
 Point3D (Point3D< float > &&)=default
 Point3D (const BasicVector3D< float > &v)
 ~Point3D ()=default
Point3D< float > & operator= (const Point3D< float > &)=default
Point3D< float > & operator= (const BasicVector3D< float > &v)
Point3D< float > & operator= (Point3D< float > &&)=default
float distance2 () const
float distance2 (const Point3D< float > &p) const
float distance () const
float distance (const Point3D< float > &p) const
Point3D< float > & transform (const Transform3D &m)
Public Member Functions inherited from HepGeom::BasicVector3D< float >
float pseudoRapidity () const
void setEta (float a)
float angle (const BasicVector3D< float > &v) const
BasicVector3D< float > & rotateX (float a)
BasicVector3D< float > & rotateY (float a)
BasicVector3D< float > & rotateZ (float a)
BasicVector3D< float > & rotate (float a, const BasicVector3D< float > &v)
double pseudoRapidity () const
void setEta (double a)
double angle (const BasicVector3D< double > &v) const
BasicVector3D< double > & rotateX (double a)
BasicVector3D< double > & rotateY (double a)
BasicVector3D< double > & rotateZ (double a)
BasicVector3D< double > & rotate (double a, const BasicVector3D< double > &v)
virtual ~BasicVector3D ()=default
 operator float * ()
 operator const float * () const
 operator CLHEP::Hep3Vector () const
BasicVector3D< float > & operator= (const BasicVector3D< float > &)=default
BasicVector3D< float > & operator+= (const BasicVector3D< float > &v)
BasicVector3D< float > & operator-= (const BasicVector3D< float > &v)
BasicVector3D< float > & operator*= (double a)
BasicVector3D< float > & operator/= (double a)
float operator() (int i) const
float operator[] (int i) const
float x () const
float y () const
float z () const
void setX (float a)
void setY (float a)
void setZ (float a)
void set (float x1, float y1, float z1)
float perp2 () const
float perp () const
float rho () const
void setPerp (float rh)
float mag2 () const
float mag () const
float r () const
float phi () const
float theta () const
float cosTheta () const
float getR () const
float getPhi () const
float getTheta () const
void setMag (float ma)
void setR (float ma)
void setPhi (float ph)
void setTheta (float th)
float eta () const
float getEta () const
float dot (const BasicVector3D< float > &v) const
BasicVector3D< float > cross (const BasicVector3D< float > &v) const
BasicVector3D< float > unit () const
BasicVector3D< float > orthogonal () const

(Note that these are not member symbols.)

Point3D< float > operator* (const Transform3D &m, const Point3D< float > &p)
Point3D< double > operator* (const Transform3D &m, const Point3D< double > &p)

Additional Inherited Members

Public Types inherited from HepGeom::BasicVector3D< float >
enum  
Protected Member Functions inherited from HepGeom::BasicVector3D< float >
 BasicVector3D ()
Protected Attributes inherited from HepGeom::BasicVector3D< float >
float v_ [3]

Detailed Description

Geometrical 3D Point with components of float type.

Author
Evgeni Chernyaev Evgue.nosp@m.ni.T.nosp@m.chern.nosp@m.iaev.nosp@m.@cern.nosp@m..ch

Definition at line 42 of file Point3D.h.

Constructor & Destructor Documentation

◆ Point3D() [1/6]

HepGeom::Point3D< float >::Point3D ( )
default

Default constructor.

Referenced by distance(), distance2(), operator=(), operator=(), operator=(), Point3D(), Point3D(), and transform().

◆ Point3D() [2/6]

HepGeom::Point3D< float >::Point3D ( float x1,
float y1,
float z1 )
inline

Constructor from three numbers.

Definition at line 50 of file Point3D.h.

◆ Point3D() [3/6]

HepGeom::Point3D< float >::Point3D ( const float * a)
inlineexplicit

Constructor from array of floats.

Definition at line 54 of file Point3D.h.

55 : BasicVector3D<float>(a[0],a[1],a[2]) {}

◆ Point3D() [4/6]

HepGeom::Point3D< float >::Point3D ( const Point3D< float > & )
default

Copy constructor.

◆ Point3D() [5/6]

HepGeom::Point3D< float >::Point3D ( Point3D< float > && )
default

Move constructor.

◆ Point3D() [6/6]

HepGeom::Point3D< float >::Point3D ( const BasicVector3D< float > & v)
inline

Constructor from BasicVector3D<float>.

Definition at line 67 of file Point3D.h.

◆ ~Point3D()

HepGeom::Point3D< float >::~Point3D ( )
default

Destructor.

Member Function Documentation

◆ distance() [1/2]

float HepGeom::Point3D< float >::distance ( ) const
inline

Returns distance to the origin.

Definition at line 101 of file Point3D.h.

101{ return std::sqrt(distance2()); }
float distance2() const
Definition Point3D.h:90

◆ distance() [2/2]

float HepGeom::Point3D< float >::distance ( const Point3D< float > & p) const
inline

Returns distance to the point.

Definition at line 105 of file Point3D.h.

105 {
106 return std::sqrt(distance2(p));
107 }

◆ distance2() [1/2]

float HepGeom::Point3D< float >::distance2 ( ) const
inline

Returns distance to the origin squared.

Definition at line 90 of file Point3D.h.

90{ return mag2(); }

Referenced by distance(), and distance().

◆ distance2() [2/2]

float HepGeom::Point3D< float >::distance2 ( const Point3D< float > & p) const
inline

Returns distance to the point squared.

Definition at line 94 of file Point3D.h.

94 {
95 float dx = p.x()-x(), dy = p.y()-y(), dz = p.z()-z();
96 return dx*dx + dy*dy + dz*dz;
97 }

◆ operator=() [1/3]

Point3D< float > & HepGeom::Point3D< float >::operator= ( const BasicVector3D< float > & v)
inline

Assignment from BasicVector3D<float>.

Definition at line 79 of file Point3D.h.

79 {
81 return *this;
82 }
BasicVector3D< T > & operator=(const BasicVector3D< T > &)=default

◆ operator=() [2/3]

Point3D< float > & HepGeom::Point3D< float >::operator= ( const Point3D< float > & )
default

Assignment.

◆ operator=() [3/3]

Point3D< float > & HepGeom::Point3D< float >::operator= ( Point3D< float > && )
default

Move assignment.

◆ transform()

Point3D< float > & HepGeom::Point3D< float >::transform ( const Transform3D & m)

Transformation by Transform3D.

Definition at line 10 of file Point3D.cc.

10 {
11 double vx = x(), vy = y(), vz = z();
12 set(m.xx()*vx + m.xy()*vy + m.xz()*vz + m.dx(),
13 m.yx()*vx + m.yy()*vy + m.yz()*vz + m.dy(),
14 m.zx()*vx + m.zy()*vy + m.zz()*vz + m.dz());
15 return *this;
16 }
void set(float x1, float y1, float z1)

◆ operator*() [1/2]

Point3D< double > operator* ( const Transform3D & m,
const Point3D< double > & p )
related

Transformation of Point3D<double> by Transform3D.

Definition at line 236 of file Point3D.cc.

40 {
41 double vx = v.x(), vy = v.y(), vz = v.z();
42 return Point3D<double>
43 (m.xx()*vx + m.xy()*vy + m.xz()*vz + m.dx(),
44 m.yx()*vx + m.yy()*vy + m.yz()*vz + m.dy(),
45 m.zx()*vx + m.zy()*vy + m.zz()*vz + m.dz());
46 }

◆ operator*() [2/2]

Point3D< float > operator* ( const Transform3D & m,
const Point3D< float > & p )
related

Transformation of Point3D<float> by Transform3D.

Definition at line 119 of file Point3D.cc.

20 {
21 double vx = v.x(), vy = v.y(), vz = v.z();
22 return Point3D<float>
23 (m.xx()*vx + m.xy()*vy + m.xz()*vz + m.dx(),
24 m.yx()*vx + m.yy()*vy + m.yz()*vz + m.dy(),
25 m.zx()*vx + m.zy()*vy + m.zz()*vz + m.dz());
26 }

The documentation for this class was generated from the following files: