Belle II Software development
SLOPERZ_NAME< PointType > Class Template Reference

This is the specialization for SpacePoints with returning floats, where value calculates the slope in R-Z for a given pair of hits. More...

#include <SlopeRZ.h>

Inheritance diagram for SLOPERZ_NAME< PointType >:
SelectionVariable< PointType, 2, double >

Public Types

typedef double variableType
 Type of the returned object.
 
typedef PointType argumentType
 Type of the argument object.
 
typedef FunctionOf< Nargs, variableType, constargumentType & >::functionType functionType
 Type of the function returning the value.
 

Public Member Functions

 PUT_NAME_FUNCTION (SLOPERZ_NAME)
 is replaced by "static const std:string name(void)" frunction which returns name of the Class
 

Static Public Member Functions

static double value (const PointType &outerHit, const PointType &innerHit)
 value calculates the slope in R-Z for a given pair of hits.
 

Static Public Attributes

static const size_t c_Nargs
 Number of arguments.
 

Detailed Description

template<typename PointType>
class Belle2::SLOPERZ_NAME< PointType >

This is the specialization for SpacePoints with returning floats, where value calculates the slope in R-Z for a given pair of hits.

WARNING: this filter returns 0 if no valid value could be found!

Definition at line 27 of file SlopeRZ.h.

Member Typedef Documentation

◆ argumentType

typedef PointType argumentType
inherited

Type of the argument object.

Needed for SFINAE in Filter.hh

Definition at line 84 of file SelectionVariable.h.

◆ functionType

typedef FunctionOf<Nargs,variableType,constargumentType&>::functionType functionType
inherited

Type of the function returning the value.

Needed for the automated training

Definition at line 88 of file SelectionVariable.h.

◆ variableType

typedef double variableType
inherited

Type of the returned object.

Needed for SFINAE in Filter.hh

Definition at line 81 of file SelectionVariable.h.

Member Function Documentation

◆ value()

static double value ( const PointType &  outerHit,
const PointType &  innerHit 
)
inlinestatic

value calculates the slope in R-Z for a given pair of hits.

Definition at line 34 of file SlopeRZ.h.

35 {
36 double result = atan(
37 sqrt(std::pow(double(outerHit.X() - innerHit.X()), 2)
38 + std::pow(double(outerHit.Y() - innerHit.Y()), 2)
39 ) / double(outerHit.Z() - innerHit.Z())
40 );
41 // atan also returns negative angles, so map back to [0,Pi] otherwise one get two peaks at +/-Pi/2 for 90 degree angles
42 if (result < 0.0) result += M_PI;
43
44 // TODO: check if 0 is a good default return value in the case z_i==z_o!
45 return (std::isnan(result) || std::isinf(result)) ? double(0) : result;
46 }
DataType Z() const
access variable Z (= .at(2) without boundary check)
Definition: B2Vector3.h:435
DataType X() const
access variable X (= .at(0) without boundary check)
Definition: B2Vector3.h:431
DataType Y() const
access variable Y (= .at(1) without boundary check)
Definition: B2Vector3.h:433
double atan(double a)
atan for double
Definition: beamHelpers.h:34
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28
B2Vector3D outerHit(0, 0, 0)
testing out of range behavior

Member Data Documentation

◆ c_Nargs

const size_t c_Nargs
staticinherited

Number of arguments.

Definition at line 91 of file SelectionVariable.h.


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