LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
geo::PlaneBase< Vector > Class Template Reference

A base for a plane in space. More...

#include "Decomposer.h"

Public Types

using Vector_t = Vector
 Type for the vector in space. More...
 

Public Member Functions

 PlaneBase (Vector_t const &main, Vector_t const &secondary)
 Constructor: assigns the axes. More...
 
Vector_t const & MainDir () const
 Returns the main axis direction. More...
 
Vector_t const & SecondaryDir () const
 Returns the secondary axis direction. More...
 
Vector_t const & NormalDir () const
 Returns the axis normal to the plane. More...
 
void SetMainDir (Vector_t const &dir)
 Change the main direction of the projection base. More...
 
void SetSecondaryDir (Vector_t const &dir)
 Change the secondary direction of the projection base. More...
 

Static Public Member Functions

static Vector_t PastorizeUnitVector (Vector_t dir)
 Normalizes and rounds a direction vector. More...
 

Static Public Attributes

static constexpr double RoundingTol = 1e-4
 Rounding threshold for vectors. More...
 

Private Member Functions

Vector_t ComputeNormal () const
 Computes the normal to the plane. More...
 
void ResetNormal ()
 Reset normal to the plane. More...
 

Private Attributes

Vector_t fMain
 Main axis on the plane. More...
 
Vector_t fSecondary
 Secondary axis on the plane. More...
 
Vector_t fNormal
 Axis normal to the plane. More...
 

Detailed Description

template<typename Vector>
class geo::PlaneBase< Vector >

A base for a plane in space.


The base contains the two axes, a "main" one ( $ \hat{u} $) and a "secondary" one ( $ \hat{v} $). It also defines a normal ( $ \hat{n} $) to the plane so that the base is positive defined (( $ \hat{u} \times \hat{v} \cdot \hat{m} = +1 $).

Definition at line 38 of file Decomposer.h.

Member Typedef Documentation

template<typename Vector>
using geo::PlaneBase< Vector >::Vector_t = Vector

Type for the vector in space.

Definition at line 40 of file Decomposer.h.

Constructor & Destructor Documentation

template<typename Vector>
geo::PlaneBase< Vector >::PlaneBase ( Vector_t const &  main,
Vector_t const &  secondary 
)
inline

Constructor: assigns the axes.

Definition at line 46 of file Decomposer.h.

48  , fSecondary(PastorizeUnitVector(secondary))
50  {}
Vector_t fSecondary
Secondary axis on the plane.
Definition: Decomposer.h:83
Vector_t fNormal
Axis normal to the plane.
Definition: Decomposer.h:84
int main()
Definition: example_main.cc:17
static Vector_t PastorizeUnitVector(Vector_t dir)
Normalizes and rounds a direction vector.
Definition: Decomposer.h:76
Vector_t ComputeNormal() const
Computes the normal to the plane.
Definition: Decomposer.h:87
Vector_t fMain
Main axis on the plane.
Definition: Decomposer.h:82

Member Function Documentation

template<typename Vector>
Vector_t geo::PlaneBase< Vector >::ComputeNormal ( ) const
inlineprivate

Computes the normal to the plane.

Definition at line 87 of file Decomposer.h.

Referenced by geo::PlaneBase< geo::Vector_t >::ResetNormal().

87 { return PastorizeUnitVector(MainDir().Cross(SecondaryDir())); }
Vector_t const & MainDir() const
Returns the main axis direction.
Definition: Decomposer.h:53
static Vector_t PastorizeUnitVector(Vector_t dir)
Normalizes and rounds a direction vector.
Definition: Decomposer.h:76
Vector_t const & SecondaryDir() const
Returns the secondary axis direction.
Definition: Decomposer.h:56
template<typename Vector>
Vector_t const& geo::PlaneBase< Vector >::MainDir ( ) const
inline
template<typename Vector>
Vector_t const& geo::PlaneBase< Vector >::NormalDir ( ) const
inline

Returns the axis normal to the plane.

Definition at line 59 of file Decomposer.h.

Referenced by geo::Decomposer< Direction_t, Position_t, Projection_t >::ComposeVector(), and geo::Decomposer< Direction_t, Position_t, Projection_t >::VectorNormalComponent().

59 { return fNormal; }
Vector_t fNormal
Axis normal to the plane.
Definition: Decomposer.h:84
template<typename Vector>
static Vector_t geo::PlaneBase< Vector >::PastorizeUnitVector ( Vector_t  dir)
inlinestatic

Normalizes and rounds a direction vector.

Definition at line 76 of file Decomposer.h.

Referenced by geo::PlaneBase< geo::Vector_t >::ComputeNormal().

77  {
79  }
Vector rounded01(Vector const &v, Scalar tol)
Returns a vector with all components rounded if close to 0, -1 or +1.
TDirectory * dir
Definition: macro.C:5
static constexpr double RoundingTol
Rounding threshold for vectors.
Definition: Decomposer.h:43
Vector normalize(Vector const &v)
Returns a vector parallel to v and with norm 1.
template<typename Vector>
void geo::PlaneBase< Vector >::ResetNormal ( )
inlineprivate

Reset normal to the plane.

Definition at line 90 of file Decomposer.h.

Referenced by geo::PlaneBase< geo::Vector_t >::SetMainDir(), and geo::PlaneBase< geo::Vector_t >::SetSecondaryDir().

90 { fNormal = ComputeNormal(); }
Vector_t fNormal
Axis normal to the plane.
Definition: Decomposer.h:84
Vector_t ComputeNormal() const
Computes the normal to the plane.
Definition: Decomposer.h:87
template<typename Vector>
Vector_t const& geo::PlaneBase< Vector >::SecondaryDir ( ) const
inline
template<typename Vector>
void geo::PlaneBase< Vector >::SetMainDir ( Vector_t const &  dir)
inline

Change the main direction of the projection base.

Definition at line 62 of file Decomposer.h.

63  {
64  fMain = dir;
65  ResetNormal();
66  }
void ResetNormal()
Reset normal to the plane.
Definition: Decomposer.h:90
TDirectory * dir
Definition: macro.C:5
Vector_t fMain
Main axis on the plane.
Definition: Decomposer.h:82
template<typename Vector>
void geo::PlaneBase< Vector >::SetSecondaryDir ( Vector_t const &  dir)
inline

Change the secondary direction of the projection base.

Definition at line 69 of file Decomposer.h.

70  {
71  fSecondary = dir;
72  ResetNormal();
73  }
Vector_t fSecondary
Secondary axis on the plane.
Definition: Decomposer.h:83
void ResetNormal()
Reset normal to the plane.
Definition: Decomposer.h:90
TDirectory * dir
Definition: macro.C:5

Member Data Documentation

template<typename Vector>
Vector_t geo::PlaneBase< Vector >::fMain
private

Main axis on the plane.

Definition at line 82 of file Decomposer.h.

Referenced by geo::PlaneBase< geo::Vector_t >::MainDir(), and geo::PlaneBase< geo::Vector_t >::SetMainDir().

template<typename Vector>
Vector_t geo::PlaneBase< Vector >::fNormal
private

Axis normal to the plane.

Definition at line 84 of file Decomposer.h.

Referenced by geo::PlaneBase< geo::Vector_t >::NormalDir().

template<typename Vector>
Vector_t geo::PlaneBase< Vector >::fSecondary
private

Secondary axis on the plane.

Definition at line 83 of file Decomposer.h.

Referenced by geo::PlaneBase< geo::Vector_t >::SecondaryDir(), and geo::PlaneBase< geo::Vector_t >::SetSecondaryDir().

template<typename Vector>
constexpr double geo::PlaneBase< Vector >::RoundingTol = 1e-4
static

Rounding threshold for vectors.

Definition at line 43 of file Decomposer.h.


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