Public Member Functions | Public Attributes | List of all members
caf::SRVector3D Class Reference

A 3-vector with more efficient storage than TVector3. More...

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-11-25/StandardRecord/SRVector3D.h"

Public Member Functions

 SRVector3D ()
 
 SRVector3D (float x, float y, float z)
 
 SRVector3D (const TVector3 &v)
 Easy conversion from TVector3. More...
 
virtual ~SRVector3D ()
 
void SetXYZ (float x, float y, float z)
 
 operator TVector3 () const
 Easy conversion back to TVector3. More...
 
void SetX (float _x)
 
void SetY (float _y)
 
void SetZ (float _z)
 
float X () const
 
float Y () const
 
float Z () const
 
float Mag2 () const
 
float Mag () const
 
float Dot (const SRVector3D &v) const
 
SRVector3D Unit () const
 

Public Attributes

float x
 
float y
 
float z
 

Detailed Description

A 3-vector with more efficient storage than TVector3.

Definition at line 14 of file SRVector3D.h.

Constructor & Destructor Documentation

caf::SRVector3D::SRVector3D ( )

Definition at line 10 of file SRVector3D.cxx.

Referenced by Unit().

10  :
11  x(std::numeric_limits<float>::signaling_NaN()),
12  y(std::numeric_limits<float>::signaling_NaN()),
13  z(std::numeric_limits<float>::signaling_NaN())
14  {
15  }
caf::SRVector3D::SRVector3D ( float  x,
float  y,
float  z 
)

Definition at line 17 of file SRVector3D.cxx.

17  :
18  x(_x), y(_y), z(_z)
19  {
20  }
caf::SRVector3D::SRVector3D ( const TVector3 &  v)

Easy conversion from TVector3.

Definition at line 22 of file SRVector3D.cxx.

22  :
23  x(v.X()), y(v.Y()), z(v.Z())
24  {
25  }
caf::SRVector3D::~SRVector3D ( )
virtual

Definition at line 27 of file SRVector3D.cxx.

28  {
29  }

Member Function Documentation

float caf::SRVector3D::Dot ( const SRVector3D v) const
inline

Definition at line 41 of file SRVector3D.h.

References x, y, and z.

41 {return x*v.x + y*v.y + z*v.z;}
float caf::SRVector3D::Mag ( ) const
inline

Definition at line 40 of file SRVector3D.h.

References Mag2(), and std::sqrt().

Referenced by Unit().

40 {return sqrt(Mag2());}
float Mag2() const
Definition: SRVector3D.h:39
T sqrt(T number)
Definition: d0nt_math.hpp:156
float caf::SRVector3D::Mag2 ( ) const
inline

Definition at line 39 of file SRVector3D.h.

References z.

Referenced by Mag().

39 {return x*x+y*y+z*z;}
caf::SRVector3D::operator TVector3 ( ) const

Easy conversion back to TVector3.

Definition at line 38 of file SRVector3D.cxx.

References x, y, and z.

39  {
40  return TVector3(x, y, z);
41  }
void caf::SRVector3D::SetX ( float  _x)
inline

Definition at line 28 of file SRVector3D.h.

Referenced by caf::FillHadClustVars(), and caf::FillTrackVarsBpfFitSum().

28 {x = _x;}
void caf::SRVector3D::SetXYZ ( float  x,
float  y,
float  z 
)

Definition at line 31 of file SRVector3D.cxx.

References x, y, and z.

Referenced by caf::AddCosmicTruthToVec(), caf::SRVertex::setDefault(), caf::SRHoughVertex::setDefault(), caf::SRElastic::setDefault(), and caf::SRMRCCParent::setDefault().

32  {
33  x = _x;
34  y = _y;
35  z = _z;
36  }
void caf::SRVector3D::SetY ( float  _y)
inline

Definition at line 29 of file SRVector3D.h.

Referenced by caf::FillHadClustVars(), and caf::FillTrackVarsBpfFitSum().

29 {y = _y;}
void caf::SRVector3D::SetZ ( float  _z)
inline

Definition at line 30 of file SRVector3D.h.

Referenced by caf::BlindThisSlice(), and caf::FillTrackVarsBpfFitSum().

30 {z = _z;}
SRVector3D caf::SRVector3D::Unit ( ) const
inline

Definition at line 42 of file SRVector3D.h.

References m, Mag(), and SRVector3D().

43  {
44  const float m = Mag();
45  return SRVector3D(x/m, y/m, z/m);
46  }
float Mag() const
Definition: SRVector3D.h:40
float caf::SRVector3D::X ( ) const
inline
float caf::SRVector3D::Y ( ) const
inline
float caf::SRVector3D::Z ( ) const
inline

Member Data Documentation

float caf::SRVector3D::x
float caf::SRVector3D::y
float caf::SRVector3D::z

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