g4tools  5.4.0
Public Member Functions | Protected Attributes | List of all members
tools::rdir3< FLAT, REAL > Class Template Reference

Public Member Functions

 rdir3 (FLAT &a_flat)
 
virtual ~rdir3 ()
 
 rdir3 (const rdir3 &a_from)
 
rdir3operator= (const rdir3 &)
 
void shoot (REAL &a_x, REAL &a_y, REAL &a_z, REAL(*a_sqrt)(REAL)) const
 
FLAT & flat ()
 
void set_seed (unsigned int a_seed)
 

Protected Attributes

FLAT & m_flat
 

Detailed Description

template<class FLAT, class REAL>
class tools::rdir3< FLAT, REAL >

Definition at line 123 of file randT.

Constructor & Destructor Documentation

◆ rdir3() [1/2]

template<class FLAT , class REAL >
tools::rdir3< FLAT, REAL >::rdir3 ( FLAT &  a_flat)
inline

Definition at line 125 of file randT.

125 :m_flat(a_flat){}

◆ ~rdir3()

template<class FLAT , class REAL >
virtual tools::rdir3< FLAT, REAL >::~rdir3 ( )
inlinevirtual

Definition at line 126 of file randT.

126 {}

◆ rdir3() [2/2]

template<class FLAT , class REAL >
tools::rdir3< FLAT, REAL >::rdir3 ( const rdir3< FLAT, REAL > &  a_from)
inline

Definition at line 128 of file randT.

128 :m_flat(a_from.m_flat){}

Member Function Documentation

◆ flat()

template<class FLAT , class REAL >
FLAT& tools::rdir3< FLAT, REAL >::flat ( )
inline

Definition at line 145 of file randT.

145 {return m_flat;}

◆ operator=()

template<class FLAT , class REAL >
rdir3& tools::rdir3< FLAT, REAL >::operator= ( const rdir3< FLAT, REAL > &  )
inline

Definition at line 129 of file randT.

129 {return *this;}

◆ set_seed()

template<class FLAT , class REAL >
void tools::rdir3< FLAT, REAL >::set_seed ( unsigned int  a_seed)
inline

Definition at line 146 of file randT.

146 {m_flat.set_seed(a_seed);}

◆ shoot()

template<class FLAT , class REAL >
void tools::rdir3< FLAT, REAL >::shoot ( REAL &  a_x,
REAL &  a_y,
REAL &  a_z,
REAL(*)(REAL)  a_sqrt 
) const
inline

Definition at line 131 of file randT.

131  {
132  // from gsl_ran_dir_3d.
133  REAL s;
134  do {
135  a_x = REAL(2) * m_flat.shoot() - REAL(1);
136  a_y = REAL(2) * m_flat.shoot() - REAL(1);
137  s = (a_x) * (a_x) + (a_y) * (a_y);
138  }
139  while (s > REAL(1));
140  a_z = REAL(2) * s - REAL(1);
141  REAL a = REAL(2) * a_sqrt(REAL(1) - s);
142  a_x *= a;
143  a_y *= a;
144  }

Member Data Documentation

◆ m_flat

template<class FLAT , class REAL >
FLAT& tools::rdir3< FLAT, REAL >::m_flat
protected

Definition at line 148 of file randT.


The documentation for this class was generated from the following file:
tools::rdir3::m_flat
FLAT & m_flat
Definition: randT:148