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()

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()

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
static DataType calcMag2(const PointType &aHit)
returns the magnitude squared of given pointType.

◆ calcMag2()

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()

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)); }
static DataType calcPerp2(const PointType &aHit)
returns the perpendicular magnitude squared of given pointType.

◆ calcPerp2()

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()

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()

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; }
static DataType s_MagneticFieldFactor
is factor containing speed of light (c), the magnetic field (b) and the scaling factor s for conversi...

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