Belle II Software development
SelVarHelper< PointType, DataType > Struct Template Reference

contains a collection of functions and related stuff needed for SelectionVariables implementing 2-, 3- and 4-hitfilters. More...

#include <SelectionVariableHelper.h>

Static Public Member Functions

static void resetMagneticField (DataType magneticFieldStrength=1.5)
 Overrides standard-Setup for magnetic field.
 
static DataType calcPerp2 (const PointType &aHit)
 returns the perpendicular magnitude squared of given pointType.
 
static DataType calcPerp (const PointType &aHit)
 returns the perpendicular magnitude of given pointType.
 
static DataType calcMag2 (const PointType &aHit)
 returns the magnitude squared of given pointType.
 
static DataType calcMag (const PointType &aHit)
 returns the magnitude of given pointType.
 
static DataType calcDot (const PointType &aHit, const PointType &bHit)
 returns scalar product of given two pointTypes.
 
static DataType calcPt (DataType radius, DataType field=SelVarHelper::s_MagneticFieldFactor)
 calculates the estimation of the transverse momentum of given radius using defined strength of magnetic field, returning unit: GeV/c.
 

Static Public Attributes

static DataType s_MagneticFieldFactor
 is factor containing speed of light (c), the magnetic field (b) and the scaling factor s for conversion of meter in cm : c*b/100 = c*b*s.
 

Detailed Description

template<class PointType, class DataType>
struct Belle2::SelVarHelper< PointType, DataType >

contains a collection of functions and related stuff needed for SelectionVariables implementing 2-, 3- and 4-hitfilters.

Template PointType expects a class having the functions X(), Y() and Z() returning Datatype. Template DataType should behave like a primitive like double or float.

Definition at line 21 of file SelectionVariableHelper.h.

Member Function Documentation

◆ calcDot()

template<class PointType, class DataType>
static DataType calcDot ( const PointType & aHit,
const PointType & bHit )
inlinestatic

returns scalar product of given two pointTypes.

Definition at line 59 of file SelectionVariableHelper.h.

60 { return (aHit.X() * bHit.X() + aHit.Y() * bHit.Y() + aHit.Z() * bHit.Z()); }

◆ calcMag()

template<class PointType, class DataType>
static DataType calcMag ( const PointType & aHit)
inlinestatic

returns the magnitude of given pointType.

Definition at line 55 of file SelectionVariableHelper.h.

55{ return sqrt(calcMag2(aHit)); }
double sqrt(double a)
sqrt for double
Definition beamHelpers.h:28

◆ calcMag2()

template<class PointType, class DataType>
static DataType calcMag2 ( const PointType & aHit)
inlinestatic

returns the magnitude squared of given pointType.

Definition at line 50 of file SelectionVariableHelper.h.

51 { return (aHit.X() * aHit.X() + aHit.Y() * aHit.Y() + aHit.Z() * aHit.Z()); }

◆ calcPerp()

template<class PointType, class DataType>
static DataType calcPerp ( const PointType & aHit)
inlinestatic

returns the perpendicular magnitude of given pointType.

Definition at line 46 of file SelectionVariableHelper.h.

46{ return sqrt(calcPerp2(aHit)); }

◆ calcPerp2()

template<class PointType, class DataType>
static DataType calcPerp2 ( const PointType & aHit)
inlinestatic

returns the perpendicular magnitude squared of given pointType.

Definition at line 41 of file SelectionVariableHelper.h.

42 { return (aHit.X() * aHit.X() + aHit.Y() * aHit.Y()); }

◆ calcPt()

template<class PointType, class DataType>
static DataType calcPt ( DataType radius,
DataType field = SelVarHelper< PointType, DataType >::s_MagneticFieldFactor )
inlinestatic

calculates the estimation of the transverse momentum of given radius using defined strength of magnetic field, returning unit: GeV/c.

Definition at line 63 of file SelectionVariableHelper.h.

64 {
65 // TODO WARNING hardcoded value, is there a quasi-global value for such cases (this case, minimal accepted radius)
66 // if (fabs(radius) < 0.0000001) { throw (Circle_too_small() << radius << 0.0000001); }
67
68 //WARNING: does not care for negative radius!!
69 return field * radius;
70 } // return unit: GeV/c

◆ resetMagneticField()

template<class PointType, class DataType>
static void resetMagneticField ( DataType magneticFieldStrength = 1.5)
inlinestatic

Overrides standard-Setup for magnetic field.

If no value is given, magnetic field is assumed to be Belle2-Detector standard of 1.5T. pT[GeV/c] = 0.299710*B[T]*r[m] = 0.299710*B[T]*r[cm]/100 = 0.00299710B[T]*r[cm].

Definition at line 37 of file SelectionVariableHelper.h.

37{ SelVarHelper::s_MagneticFieldFactor = magneticFieldStrength * 0.00299710; }

Member Data Documentation

◆ s_MagneticFieldFactor

template<class PointType, class DataType>
DataType s_MagneticFieldFactor
static

is factor containing speed of light (c), the magnetic field (b) and the scaling factor s for conversion of meter in cm : c*b/100 = c*b*s.

The standard value assumes a magnetic field of 1.5 Tesla. Value can be changed using the resetMagneticField-Function, where a new value for the magnetic field in Tesla has to be passed. TODO WARNING hardcoded value!

Definition at line 29 of file SelectionVariableHelper.h.


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