Belle II Software development
TwoHitFilters Class Reference

The class 'TwoHitFilters' bundles filter methods using 2 hits which are stored in B2Vector3Ds. More...

#include <TwoHitFilters.h>

Public Member Functions

 TwoHitFilters ()
 Empty constructor.
 
 TwoHitFilters (const B2Vector3D &outerHit, const B2Vector3D &innerHit)
 Constructor.
 
 ~TwoHitFilters ()
 Destructor.
 
void resetValues (const B2Vector3D &outerHit, const B2Vector3D &innerHit)
 Overrides Constructor-Setup.
 
double calcDist3D () const
 calculates the distance between the hits (3D), returning unit: cm^2 for speed optimization
 
double fullDist3D () const
 calculates the real distance between the hits (3D), returning unit: cm
 
double calcDistXY () const
 calculates the distance between the hits (XY), returning unit: cm^2 for speed optimization
 
double fullDistXY () const
 calculates the real distance between the hits (XY), returning unit: cm
 
double calcDistZ () const
 calculates the distance between the hits (Z only), returning unit: cm
 
double calcSlopeRZ () const
 calculates the angle of the slope of the hits in RZ, returnValue = theta = atan(r/z)
 
double fullSlopeRZ () const
 calculates the angle of the slope of the hits in RZ, returnValue = theta = atan(r/z)
 
double calcNormedDist3D () const
 calculates the normed distance between the hits (3D), return unit: none
 
double filterNan (double value) const
 nice little nanChecker returns 0 if value was nan or inf, else returns value itself
 

Protected Member Functions

void initializeMe (const B2Vector3D &outerHit, const B2Vector3D &innerHit)
 initializer function, sets values
 

Protected Attributes

B2Vector3D m_hitA
 outer hit (position relevant for useful filter calculation, e.g.
 
B2Vector3D m_hitB
 inner hit (position relevant for useful filter calculation, e.g.
 
double m_x2
 internal intermediate value storing x^2, no enduser-relevance
 
double m_y2
 internal intermediate value storing y^2, no enduser-relevance
 
double m_z2
 internal intermediate value storing z^2, no enduser-relevance
 
double m_dz
 internal intermediate value storing distance in z, no enduser-relevance
 

Detailed Description

The class 'TwoHitFilters' bundles filter methods using 2 hits which are stored in B2Vector3Ds.

Definition at line 22 of file TwoHitFilters.h.

Constructor & Destructor Documentation

◆ TwoHitFilters() [1/2]

TwoHitFilters ( )
inline

Empty constructor.

For pre-inizialisation only, an object generated this way is useless unless resetValues(a, b) is called at least once

Definition at line 26 of file TwoHitFilters.h.

26 :
27 m_x2(0.),
28 m_y2(0.),
29 m_z2(0.),
30 m_dz(0.)
31 {
32 m_hitA.SetXYZ(0., 0., 0.);
33 m_hitB.SetXYZ(0., 0., 0.);
34 }
void SetXYZ(DataType x, DataType y, DataType z)
set all coordinates using data type
Definition: B2Vector3.h:464
double m_x2
internal intermediate value storing x^2, no enduser-relevance
double m_dz
internal intermediate value storing distance in z, no enduser-relevance
B2Vector3D m_hitB
inner hit (position relevant for useful filter calculation, e.g.
double m_y2
internal intermediate value storing y^2, no enduser-relevance
double m_z2
internal intermediate value storing z^2, no enduser-relevance
B2Vector3D m_hitA
outer hit (position relevant for useful filter calculation, e.g.

◆ TwoHitFilters() [2/2]

TwoHitFilters ( const B2Vector3D outerHit,
const B2Vector3D innerHit 
)
inline

Constructor.

needs the first parameter is outer hit, second is inner hit. Parameters in B2Vector3D-format

Definition at line 37 of file TwoHitFilters.h.

37 :
39 m_hitB(innerHit) { initializeMe(outerHit, innerHit); }
void initializeMe(const B2Vector3D &outerHit, const B2Vector3D &innerHit)
initializer function, sets values
Definition: TwoHitFilters.h:93
B2Vector3D outerHit(0, 0, 0)
testing out of range behavior

◆ ~TwoHitFilters()

~TwoHitFilters ( )
inline

Destructor.

Definition at line 43 of file TwoHitFilters.h.

43{}

Member Function Documentation

◆ calcDist3D()

double calcDist3D ( ) const
inline

calculates the distance between the hits (3D), returning unit: cm^2 for speed optimization

Definition at line 55 of file TwoHitFilters.h.

55{ return (m_x2 + m_y2 + m_z2); } // return unit: cm^2

◆ calcDistXY()

double calcDistXY ( ) const
inline

calculates the distance between the hits (XY), returning unit: cm^2 for speed optimization

Definition at line 61 of file TwoHitFilters.h.

61{ return (m_x2 + m_y2); } // return unit: cm^2

◆ calcDistZ()

double calcDistZ ( ) const
inline

calculates the distance between the hits (Z only), returning unit: cm

Definition at line 67 of file TwoHitFilters.h.

67{ return m_dz; } // return unit: cm

◆ calcNormedDist3D()

double calcNormedDist3D ( ) const
inline

calculates the normed distance between the hits (3D), return unit: none

Definition at line 81 of file TwoHitFilters.h.

82 {
83 double normedVal = calcDistXY() / calcDist3D();
84 return filterNan(normedVal);
85 } // return unit: none
double calcDist3D() const
calculates the distance between the hits (3D), returning unit: cm^2 for speed optimization
Definition: TwoHitFilters.h:55
double calcDistXY() const
calculates the distance between the hits (XY), returning unit: cm^2 for speed optimization
Definition: TwoHitFilters.h:61
double filterNan(double value) const
nice little nanChecker returns 0 if value was nan or inf, else returns value itself

◆ calcSlopeRZ()

double calcSlopeRZ ( ) const
inline

calculates the angle of the slope of the hits in RZ, returnValue = theta = atan(r/z)

Definition at line 70 of file TwoHitFilters.h.

71 {
72 //double slope = atan (calcDistXY() / m_dz) ;
73 double slope = atan(fullDistXY() / m_dz) ; //since calcDistXY() returns cm ^2
74 return filterNan(slope);
75 } // return unit: radians
double fullDistXY() const
calculates the real distance between the hits (XY), returning unit: cm
Definition: TwoHitFilters.h:64
double atan(double a)
atan for double
Definition: beamHelpers.h:34

◆ filterNan()

double filterNan ( double  value) const

nice little nanChecker returns 0 if value was nan or inf, else returns value itself

Definition at line 14 of file TwoHitFilters.cc.

15{
16 if (std::isnan(value) == true) { return 0; }
17 if (std::isinf(value) == true) { return 0; }
18 return value;
19}

◆ fullDist3D()

double fullDist3D ( ) const
inline

calculates the real distance between the hits (3D), returning unit: cm

Definition at line 58 of file TwoHitFilters.h.

58{ return sqrt(calcDist3D()); } // return unit: cm
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28

◆ fullDistXY()

double fullDistXY ( ) const
inline

calculates the real distance between the hits (XY), returning unit: cm

Definition at line 64 of file TwoHitFilters.h.

64{ return sqrt(calcDistXY()); } // return unit: cm

◆ fullSlopeRZ()

double fullSlopeRZ ( ) const
inline

calculates the angle of the slope of the hits in RZ, returnValue = theta = atan(r/z)

Definition at line 78 of file TwoHitFilters.h.

78{ return calcSlopeRZ(); }
double calcSlopeRZ() const
calculates the angle of the slope of the hits in RZ, returnValue = theta = atan(r/z)
Definition: TwoHitFilters.h:70

◆ initializeMe()

void initializeMe ( const B2Vector3D outerHit,
const B2Vector3D innerHit 
)
inlineprotected

initializer function, sets values

Definition at line 93 of file TwoHitFilters.h.

94 {
95 m_x2 = outerHit[0] - innerHit[0]; // not x2 yet, reusing member
96 m_y2 = outerHit[1] - innerHit[1];
97 m_dz = outerHit[2] - innerHit[2];
98
99 m_x2 *= m_x2; // now it's x2...
100 m_y2 *= m_y2;
101 m_z2 = m_dz * m_dz;
102 }

◆ resetValues()

void resetValues ( const B2Vector3D outerHit,
const B2Vector3D innerHit 
)
inline

Overrides Constructor-Setup.

Needed if you want to reuse the instance instead of recreating one

Definition at line 46 of file TwoHitFilters.h.

47 {
49 m_hitB = innerHit;
50
51 initializeMe(outerHit, innerHit);
52 }

Member Data Documentation

◆ m_dz

double m_dz
protected

internal intermediate value storing distance in z, no enduser-relevance

Definition at line 111 of file TwoHitFilters.h.

◆ m_hitA

B2Vector3D m_hitA
protected

outer hit (position relevant for useful filter calculation, e.g.

calcDist3D) used for the filter calculation

Definition at line 105 of file TwoHitFilters.h.

◆ m_hitB

B2Vector3D m_hitB
protected

inner hit (position relevant for useful filter calculation, e.g.

calcDist3D) used for the filter calculation

Definition at line 107 of file TwoHitFilters.h.

◆ m_x2

double m_x2
protected

internal intermediate value storing x^2, no enduser-relevance

Definition at line 108 of file TwoHitFilters.h.

◆ m_y2

double m_y2
protected

internal intermediate value storing y^2, no enduser-relevance

Definition at line 109 of file TwoHitFilters.h.

◆ m_z2

double m_z2
protected

internal intermediate value storing z^2, no enduser-relevance

Definition at line 110 of file TwoHitFilters.h.


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