Belle II Software development
GeneralVector< T > Struct Template Reference

3-vector with members of arbitrary type, especially members can be dual numbers More...

#include <beamHelpers.h>

Public Member Functions

 GeneralVector (T x, T y, T z)
 constructor allowing to set the components of vector

 
norm2 () const
 L2 norm of the vector squared

 
angleX () const
 angle in the XZ projection of the vector

 
angleY () const
 angle in the YZ projection of the vector

 

Public Attributes

el [3]
 elements of the vector
 

Detailed Description

template<typename T>
struct Belle2::GeneralVector< T >

3-vector with members of arbitrary type, especially members can be dual numbers

Definition at line 136 of file beamHelpers.h.

Constructor & Destructor Documentation

◆ GeneralVector()

GeneralVector ( x,
y,
z 
)
inline

constructor allowing to set the components of vector

Definition at line 140 of file beamHelpers.h.

140{ el[0] = x; el[1] = y; el[2] = z; }
T el[3]
elements of the vector
Definition: beamHelpers.h:137

Member Function Documentation

◆ angleX()

T angleX ( ) const
inline

angle in the XZ projection of the vector

Definition at line 146 of file beamHelpers.h.

146{ return atan(el[0] / el[2]); }
double atan(double a)
atan for double
Definition: beamHelpers.h:34

◆ angleY()

T angleY ( ) const
inline

angle in the YZ projection of the vector

Definition at line 149 of file beamHelpers.h.

149{ return atan(el[1] / el[2]); }

◆ norm2()

T norm2 ( ) const
inline

L2 norm of the vector squared

Definition at line 143 of file beamHelpers.h.

143{ return (el[0] * el[0] + el[1] * el[1] + el[2] * el[2]); }

Member Data Documentation

◆ el

T el[3]

elements of the vector

Definition at line 137 of file beamHelpers.h.


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