Belle II Software  release-08-01-10
Belle2::TOP::func Namespace Reference

commonly used functions More...

Functions

double unfold (double x, int nx, double A)
 unfold a coordinate. More...
 
double unfold (double kx, int nx)
 unfold a direction. More...
 
void fold (double xu, double A, double &x, double &kx, int &nx)
 fold a coordinate (inverse of unfold). More...
 
double clip (double x, int Nx, double A, double xmi, double xma)
 Performs a clip on x w.r.t xmi and xma. More...
 
int getNumOfEven (int j1, int j2)
 Returns number of even numbers in the range given by arguments. More...
 
double within2PI (double angle)
 Returns angle within 0 and 2PI. More...
 
void rotateUz (ROOT::Math::XYZVector &vec, const ROOT::Math::XYZVector &z_Axis)
 Replacement for a function TVector3::RotateUz which is not implemented in GenVector classes. More...
 

Detailed Description

commonly used functions

Function Documentation

◆ clip()

double Belle2::TOP::func::clip ( double  x,
int  Nx,
double  A,
double  xmi,
double  xma 
)
inline

Performs a clip on x w.r.t xmi and xma.

Parameters
xtrue coordinate
Nxsigned number of reflections
Asize for folding/unfolding
xmilower limit on unfolded coordinate x
xmaupper limit on unfolded coordinate x
Returns
clipped x

Definition at line 78 of file func.h.

79  {
80  x = unfold(x, Nx, A);
81  x = std::max(std::min(x, xma), xmi) - Nx * A;
82  if (Nx % 2 != 0) x = -x;
83  return x;
84  }
double unfold(double x, int nx, double A)
unfold a coordinate.
Definition: func.h:31

◆ fold()

void Belle2::TOP::func::fold ( double  xu,
double  A,
double &  x,
double &  kx,
int &  nx 
)
inline

fold a coordinate (inverse of unfold).

Parameters
xuunfolded coordinate (position of image)
Asize for folding
xtrue position [out]
kxtrue direction component [in/out]
nxsigned number of reflections [out]

Definition at line 59 of file func.h.

◆ getNumOfEven()

int Belle2::TOP::func::getNumOfEven ( int  j1,
int  j2 
)
inline

Returns number of even numbers in the range given by arguments.

Parameters
j1first number
j2last number (exclusive)
Returns
number of even numbers

Definition at line 92 of file func.h.

◆ rotateUz()

void Belle2::TOP::func::rotateUz ( ROOT::Math::XYZVector &  vec,
const ROOT::Math::XYZVector &  z_Axis 
)
inline

Replacement for a function TVector3::RotateUz which is not implemented in GenVector classes.

Parameters
vecvector to be rotated from frame S' [in] to frame S [out]
z_Axisvector representing z-axis of the frame S' expressed in the coordinates of frame S

Definition at line 114 of file func.h.

◆ unfold() [1/2]

double Belle2::TOP::func::unfold ( double  kx,
int  nx 
)
inline

unfold a direction.

Parameters
kxtrue direction component
nxsigned number of reflections
Returns
unfolded direction component

Definition at line 44 of file func.h.

◆ unfold() [2/2]

double Belle2::TOP::func::unfold ( double  x,
int  nx,
double  A 
)
inline

unfold a coordinate.

Parameters
xtrue position
nxsigned number of reflections
Asize for unfolding
Returns
unfolded coordinate (position of image)

Definition at line 31 of file func.h.

◆ within2PI()

double Belle2::TOP::func::within2PI ( double  angle)
inline

Returns angle within 0 and 2PI.

Parameters
angleangle
Returns
angle within 0 and 2PI

Definition at line 102 of file func.h.