Belle II Software  release-08-01-10
XHitFilterFactory< PointType > Class Template Reference

The factory serves as an interface between all x-hit-filters and a user only knowing their name (in string), but not their type. More...

#include <XHitFilterFactory.h>

Collaboration diagram for XHitFilterFactory< PointType >:

Public Types

typedef FilterID::filterTypes XHitFilterType
 constructor where nothing has been passed More...
 
using TwoHitFunction = typename std::function< double(const PointType &, const PointType &)>
 typedef for more readable function-type - to be used for 2-hit-selectionVariables.
 
using ThreeHitFunction = typename std::function< double(const PointType &, const PointType &, const PointType &)>
 typedef for more readable function-type - to be used for 3-hit-selectionVariables.
 
using FourHitFunction = typename std::function< double(const PointType &, const PointType &, const PointType &, const PointType &)>
 typedef for more readable function-type - to be used for 4-hit-selectionVariables.
 

Public Member Functions

 XHitFilterFactory (double x=0, double y=0, double z=0, double mField=1.5)
 constructor where virtual IP has been passed
 
TwoHitFunction get2HitInterface (std::string variableName)
 For given name of a variableType a function for the corresponding Filter is returned.
 
TwoHitFunction get2HitInterface (XHitFilterType variableType)
 For given name of a variableType a function for the corresponding Filter is returned. More...
 
ThreeHitFunction get3HitInterface (std::string variableName)
 For given name of a variableType a function for the corresponding Filter is returned.
 
ThreeHitFunction get3HitInterface (XHitFilterType variableType)
 For given name of a variableType a function for the corresponding Filter is returned. More...
 
FourHitFunction get4HitInterface (std::string variableName)
 For given name of a variableType a function for the corresponding Filter is returned.
 
FourHitFunction get4HitInterface (XHitFilterType variableType)
 For given name of a variableType a function for the corresponding Filter is returned. More...
 

Protected Attributes

TwoHitFilters m_twoHit
 contains all 2-hit-filters.
 
ThreeHitFilters m_threeHit
 contains all 3-hit-filters.
 
FourHitFilters m_fourHit
 contains all 4-hit-filters.
 
B2Vector3D m_virtualIP
 contains global coordinates of virtual interaction point.
 

Detailed Description

template<class PointType>
class Belle2::XHitFilterFactory< PointType >

The factory serves as an interface between all x-hit-filters and a user only knowing their name (in string), but not their type.

Definition at line 36 of file XHitFilterFactory.h.

Member Typedef Documentation

◆ XHitFilterType

constructor where nothing has been passed

shortCut for better readability.

Definition at line 55 of file XHitFilterFactory.h.

Member Function Documentation

◆ get2HitInterface()

TwoHitFunction get2HitInterface ( XHitFilterType  variableType)
inline

For given name of a variableType a function for the corresponding Filter is returned.

2-hit:

2+1-hit:

Definition at line 78 of file XHitFilterFactory.h.

79  {
80  // prepare stuff for 2-hit-filters:
81  auto prepareStuff = [ = ](const PointType & outerHit, const PointType & innerHit) -> void {
82  B2Vector3D tOuterHit(outerHit.X(), outerHit.Y(), outerHit.Z());
83  B2Vector3D tInnerHit(innerHit.X(), innerHit.Y(), innerHit.Z());
84  m_twoHit.resetValues(tOuterHit, tInnerHit);
85  };
86 
88  if (variableType == FilterID::distance3D) {
89  return [ = ](const PointType & outerHit, const PointType & innerHit) -> double {
90  prepareStuff(outerHit, innerHit);
91  return m_twoHit.calcDist3D();
92  };
93  }
94 
95  if (variableType == FilterID::distanceXY) {
96  return [ = ](const PointType & outerHit, const PointType & innerHit) -> double {
97  prepareStuff(outerHit, innerHit);
98  return m_twoHit.calcDistXY();
99  };
100  }
101 
102  if (variableType == FilterID::distanceZ) {
103  return [ = ](const PointType & outerHit, const PointType & innerHit) -> double {
104  prepareStuff(outerHit, innerHit);
105  return m_twoHit.calcDistZ();
106  };
107  }
108 
109  if (variableType == FilterID::slopeRZ) {
110  return [ = ](const PointType & outerHit, const PointType & innerHit) -> double {
111  prepareStuff(outerHit, innerHit);
112  return m_twoHit.calcSlopeRZ();
113  };
114  }
115 
116  if (variableType == FilterID::normedDistance3D) {
117  return [ = ](const PointType & outerHit, const PointType & innerHit) -> double {
118  prepareStuff(outerHit, innerHit);
119  return m_twoHit.calcNormedDist3D();
120  };
121  }
122 
123  // prepare stuff for 2+1-hit-filters
124  auto prepareStuffHiOc = [ = ](const PointType & outerHit, const PointType & innerHit) -> void {
125  B2Vector3D tOuterHit(outerHit.X(), outerHit.Y(), outerHit.Z());
126  B2Vector3D tInnerHit(innerHit.X(), innerHit.Y(), innerHit.Z());
127  m_threeHit.resetValues(tOuterHit, tInnerHit, m_virtualIP);
128  };
129 
130 
132  if (variableType == FilterID::anglesHighOccupancy3D) {
133  return [ = ](const PointType & outerHit, const PointType & innerHit) -> double {
134  prepareStuffHiOc(outerHit, innerHit);
135  return m_threeHit.calcAngle3D();
136  };
137  }
138 
139  if (variableType == FilterID::anglesHighOccupancyXY) {
140  return [ = ](const PointType & outerHit, const PointType & innerHit) -> double {
141  prepareStuffHiOc(outerHit, innerHit);
142  return m_threeHit.calcAngleXY();
143  };
144  }
145 
146  if (variableType == FilterID::anglesHighOccupancyRZ) {
147  return [ = ](const PointType & outerHit, const PointType & innerHit) -> double {
148  prepareStuffHiOc(outerHit, innerHit);
149  return m_threeHit.calcAngleRZ();
150  };
151  }
152 
153  if (variableType == FilterID::distanceHighOccupancy2IP) {
154  return [ = ](const PointType & outerHit, const PointType & innerHit) -> double {
155  prepareStuffHiOc(outerHit, innerHit);
156  return m_threeHit.calcCircleDist2IP();
157  };
158  }
159 
160  if (variableType == FilterID::deltaSlopeHighOccupancyRZ) {
161  return [ = ](const PointType & outerHit, const PointType & innerHit) -> double {
162  prepareStuffHiOc(outerHit, innerHit);
163  return m_threeHit.calcDeltaSlopeRZ();
164  };
165  }
166 
167  if (variableType == FilterID::pTHighOccupancy) {
168  return [ = ](const PointType & outerHit, const PointType & innerHit) -> double {
169  prepareStuffHiOc(outerHit, innerHit);
170  return m_threeHit.calcPt();
171  };
172  }
173 
174  if (variableType == FilterID::helixParameterHighOccupancyFit) {
175  return [ = ](const PointType & outerHit, const PointType & innerHit) -> double {
176  prepareStuffHiOc(outerHit, innerHit);
178  };
179  }
180 
181 
182 
183  B2ERROR(" XHitFilterAdapter-2Hit: given name (raw/full): " << variableType <<
184  "/" << FilterID::getTypeName(variableType) <<
185  " is not known, returning dummy function with 0.0 as a result instead!");
186 
187  return [&](const PointType&, const PointType&) -> double { return 0.0; };
188  }
static std::string getTypeName(filterTypes filterType)
returns name of given type, needed for compatibility with other modules
Definition: FilterID.cc:434
@ distanceHighOccupancy2IP
string name of filter d2IP high occupancy
Definition: FilterID.h:44
@ deltaSlopeHighOccupancyRZ
string name of filter dslopeRZ high occupancy
Definition: FilterID.h:45
@ anglesHighOccupancy3D
string name of filter a3D high occupancy
Definition: FilterID.h:41
@ distanceXY
string name of filter dXY
Definition: FilterID.h:34
@ normedDistance3D
string name of filter nd3D
Definition: FilterID.h:37
@ slopeRZ
string name of filter slopeRZ
Definition: FilterID.h:36
@ distance3D
string name of filter d3D
Definition: FilterID.h:33
@ anglesHighOccupancyXY
string name of filter aXY high occupancy
Definition: FilterID.h:42
@ helixParameterHighOccupancyFit
string name of filter hFit high occupancy
Definition: FilterID.h:47
@ pTHighOccupancy
string name of filter pT high occupancy
Definition: FilterID.h:46
@ distanceZ
string name of filter dZ
Definition: FilterID.h:35
@ anglesHighOccupancyRZ
string name of filter aRZ high occupancy
Definition: FilterID.h:43
double calcAngle3D()
calculates the angle between the hits/vectors (3D), returning unit: none (calculation for degrees is ...
void resetValues(const B2Vector3D &outerHit, const B2Vector3D &centerHit, const B2Vector3D &innerHit)
Overrides Constructor-Setup.
double calcPt()
calculates the estimation of the transverse momentum of the 3-hit-tracklet, returning unit: GeV/c
double calcDeltaSlopeRZ()
calculates deviations in the slope of the inner segment and the outer segment, returning unit: none
double calcAngleRZ()
calculates the angle between the hits/vectors (RZ), returning unit: none (calculation for degrees is ...
double calcCircleDist2IP()
calculates the distance of the point of closest approach of circle to the IP, returning unit: cm
double calcHelixParameterFit()
calculates the helixparameter describing the deviation in z per unit angle, returning unit: none
double calcAngleXY()
calculates the angle between the hits/vectors (XY), returning unit: none (calculation for degrees is ...
double calcNormedDist3D() const
calculates the normed distance between the hits (3D), return unit: none
Definition: TwoHitFilters.h:81
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 calcSlopeRZ() const
calculates the angle of the slope of the hits in RZ, returnValue = theta = atan(r/z)
Definition: TwoHitFilters.h:70
double calcDistZ() const
calculates the distance between the hits (Z only), returning unit: cm
Definition: TwoHitFilters.h:67
void resetValues(const B2Vector3D &outerHit, const B2Vector3D &innerHit)
Overrides Constructor-Setup.
Definition: TwoHitFilters.h:46
B2Vector3D m_virtualIP
contains global coordinates of virtual interaction point.
ThreeHitFilters m_threeHit
contains all 3-hit-filters.
TwoHitFilters m_twoHit
contains all 2-hit-filters.
B2Vector3< double > B2Vector3D
typedef for common usage with double
Definition: B2Vector3.h:516

◆ get3HitInterface()

ThreeHitFunction get3HitInterface ( XHitFilterType  variableType)
inline

For given name of a variableType a function for the corresponding Filter is returned.

3-hit:

3+1hit:

Definition at line 202 of file XHitFilterFactory.h.

◆ get4HitInterface()

FourHitFunction get4HitInterface ( XHitFilterType  variableType)
inline

For given name of a variableType a function for the corresponding Filter is returned.

4-hit:

Definition at line 321 of file XHitFilterFactory.h.


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