commonly used functions
More...
|
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...
|
|
◆ 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
-
x | true coordinate |
Nx | signed number of reflections |
A | size for folding/unfolding |
xmi | lower limit on unfolded coordinate x |
xma | upper limit on unfolded coordinate x |
- Returns
- clipped x
Definition at line 78 of file func.h.
81 x = std::max(std::min(x, xma), xmi) - Nx * A;
82 if (Nx % 2 != 0) x = -x;
double unfold(double x, int nx, double A)
unfold a coordinate.
◆ fold()
void Belle2::TOP::func::fold |
( |
double |
xu, |
|
|
double |
A, |
|
|
double & |
x, |
|
|
double & |
kx, |
|
|
int & |
nx |
|
) |
| |
|
inline |
fold a coordinate (inverse of unfold).
- Parameters
-
xu | unfolded coordinate (position of image) |
A | size for folding |
x | true position [out] |
kx | true direction component [in/out] |
nx | signed 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
-
j1 | first number |
j2 | last 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
-
vec | vector to be rotated from frame S' [in] to frame S [out] |
z_Axis | vector 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
-
kx | true direction component |
nx | signed 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
-
x | true position |
nx | signed number of reflections |
A | size 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
-
- Returns
- angle within 0 and 2PI
Definition at line 102 of file func.h.