Belle II Software  release-05-02-19
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.
 
TVector3 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 46 of file XHitFilterFactory.h.

Member Typedef Documentation

◆ XHitFilterType

constructor where nothing has been passed

shortCut for better readability.

Definition at line 65 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 88 of file XHitFilterFactory.h.

90  {
91  return [ = ](const PointType & outerHit, const PointType & innerHit) -> double {
92  prepareStuff(outerHit, innerHit);
93  return m_twoHit.calcDist3D();
94  };
95  }
96 
97  if (variableType == FilterID::distanceXY) {
98  return [ = ](const PointType & outerHit, const PointType & innerHit) -> double {
99  prepareStuff(outerHit, innerHit);
100  return m_twoHit.calcDistXY();
101  };
102  }
103 
104  if (variableType == FilterID::distanceZ) {
105  return [ = ](const PointType & outerHit, const PointType & innerHit) -> double {
106  prepareStuff(outerHit, innerHit);
107  return m_twoHit.calcDistZ();
108  };
109  }
110 
111  if (variableType == FilterID::slopeRZ) {
112  return [ = ](const PointType & outerHit, const PointType & innerHit) -> double {
113  prepareStuff(outerHit, innerHit);
114  return m_twoHit.calcSlopeRZ();
115  };
116  }
117 
118  if (variableType == FilterID::normedDistance3D) {
119  return [ = ](const PointType & outerHit, const PointType & innerHit) -> double {
120  prepareStuff(outerHit, innerHit);
121  return m_twoHit.calcNormedDist3D();
122  };
123  }
124 
125  // prepare stuff for 2+1-hit-filters
126  auto prepareStuffHiOc = [ = ](const PointType & outerHit, const PointType & innerHit) -> void {
127  TVector3 tOuterHit(outerHit.X(), outerHit.Y(), outerHit.Z());
128  TVector3 tInnerHit(innerHit.X(), innerHit.Y(), innerHit.Z());
129  m_threeHit.resetValues(tOuterHit, tInnerHit, m_virtualIP);
130  };
131 
132 
134  if (variableType == FilterID::anglesHighOccupancy3D) {
135  return [ = ](const PointType & outerHit, const PointType & innerHit) -> double {
136  prepareStuffHiOc(outerHit, innerHit);
137  return m_threeHit.calcAngle3D();
138  };
139  }
140 
141  if (variableType == FilterID::anglesHighOccupancyXY) {
142  return [ = ](const PointType & outerHit, const PointType & innerHit) -> double {
143  prepareStuffHiOc(outerHit, innerHit);
144  return m_threeHit.calcAngleXY();
145  };
146  }
147 
148  if (variableType == FilterID::anglesHighOccupancyRZ) {
149  return [ = ](const PointType & outerHit, const PointType & innerHit) -> double {
150  prepareStuffHiOc(outerHit, innerHit);
151  return m_threeHit.calcAngleRZ();
152  };
153  }
154 
155  if (variableType == FilterID::distanceHighOccupancy2IP) {
156  return [ = ](const PointType & outerHit, const PointType & innerHit) -> double {
157  prepareStuffHiOc(outerHit, innerHit);
158  return m_threeHit.calcCircleDist2IP();
159  };
160  }
161 
162  if (variableType == FilterID::deltaSlopeHighOccupancyRZ) {
163  return [ = ](const PointType & outerHit, const PointType & innerHit) -> double {
164  prepareStuffHiOc(outerHit, innerHit);
165  return m_threeHit.calcDeltaSlopeRZ();
166  };
167  }
168 
169  if (variableType == FilterID::pTHighOccupancy) {
170  return [ = ](const PointType & outerHit, const PointType & innerHit) -> double {
171  prepareStuffHiOc(outerHit, innerHit);
172  return m_threeHit.calcPt();
173  };
174  }
175 
176  if (variableType == FilterID::helixParameterHighOccupancyFit) {
177  return [ = ](const PointType & outerHit, const PointType & innerHit) -> double {
178  prepareStuffHiOc(outerHit, innerHit);
180  };
181  }
182 
183 
184 
185  B2ERROR(" XHitFilterAdapter-2Hit: given name (raw/full): " << variableType <<
186  "/" << FilterID::getTypeName(variableType) <<
187  " is not known, returning dummy function with 0.0 as a result instead!");
188 
189  return [&](const PointType&, const PointType&) -> double { return 0.0; };
190  }
191 
192 
193 
195  ThreeHitFunction get3HitInterface(std::string variableName)
196  {
197  XHitFilterType varType = FilterID::getTypeEnum(variableName);
198  return get3HitInterface(varType);

◆ 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 212 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 331 of file XHitFilterFactory.h.


The documentation for this class was generated from the following file:
Belle2::FilterID::distanceZ
@ distanceZ
string name of filter dZ
Definition: FilterID.h:45
Belle2::ThreeHitFilters::resetValues
void resetValues(TVector3 &outerHit, TVector3 &centerHit, TVector3 &innerHit)
Overrides Constructor-Setup.
Definition: ThreeHitFilters.h:75
Belle2::ThreeHitFilters::calcAngleRZ
double calcAngleRZ()
calculates the angle between the hits/vectors (RZ), returning unit: none (calculation for degrees is ...
Definition: ThreeHitFilters.h:152
Belle2::TwoHitFilters::calcDist3D
double calcDist3D() const
calculates the distance between the hits (3D), returning unit: cm^2 for speed optimization
Definition: TwoHitFilters.h:65
Belle2::FilterID::anglesHighOccupancy3D
@ anglesHighOccupancy3D
string name of filter a3D high occupancy
Definition: FilterID.h:51
Belle2::FilterID::normedDistance3D
@ normedDistance3D
string name of filter nd3D
Definition: FilterID.h:47
Belle2::XHitFilterFactory::m_twoHit
TwoHitFilters m_twoHit
contains all 2-hit-filters.
Definition: XHitFilterFactory.h:373
Belle2::ThreeHitFilters::calcCircleDist2IP
double calcCircleDist2IP()
calculates the distance of the point of closest approach of circle to the IP, returning unit: cm
Definition: ThreeHitFilters.h:174
Belle2::TwoHitFilters::calcNormedDist3D
double calcNormedDist3D() const
calculates the normed distance between the hits (3D), return unit: none
Definition: TwoHitFilters.h:91
Belle2::XHitFilterFactory::get3HitInterface
ThreeHitFunction get3HitInterface(std::string variableName)
For given name of a variableType a function for the corresponding Filter is returned.
Definition: XHitFilterFactory.h:203
Belle2::ThreeHitFilters::calcDeltaSlopeRZ
double calcDeltaSlopeRZ()
calculates deviations in the slope of the inner segment and the outer segment, returning unit: none
Definition: ThreeHitFilters.h:204
Belle2::TwoHitFilters::calcSlopeRZ
double calcSlopeRZ() const
calculates the angle of the slope of the hits in RZ, returnValue = theta = atan(r/z)
Definition: TwoHitFilters.h:80
Belle2::FilterID::slopeRZ
@ slopeRZ
string name of filter slopeRZ
Definition: FilterID.h:46
Belle2::TwoHitFilters::calcDistZ
double calcDistZ() const
calculates the distance between the hits (Z only), returning unit: cm
Definition: TwoHitFilters.h:77
Belle2::ThreeHitFilters::calcAngleXY
double calcAngleXY()
calculates the angle between the hits/vectors (XY), returning unit: none (calculation for degrees is ...
Definition: ThreeHitFilters.h:133
Belle2::FilterID::distanceXY
@ distanceXY
string name of filter dXY
Definition: FilterID.h:44
Belle2::FilterID::distanceHighOccupancy2IP
@ distanceHighOccupancy2IP
string name of filter d2IP high occupancy
Definition: FilterID.h:54
Belle2::ThreeHitFilters::calcAngle3D
double calcAngle3D()
calculates the angle between the hits/vectors (3D), returning unit: none (calculation for degrees is ...
Definition: ThreeHitFilters.h:113
Belle2::XHitFilterFactory::m_threeHit
ThreeHitFilters m_threeHit
contains all 3-hit-filters.
Definition: XHitFilterFactory.h:374
Belle2::FilterID::pTHighOccupancy
@ pTHighOccupancy
string name of filter pT high occupancy
Definition: FilterID.h:56
Belle2::FilterID::anglesHighOccupancyXY
@ anglesHighOccupancyXY
string name of filter aXY high occupancy
Definition: FilterID.h:52
Belle2::FilterID::getTypeName
static std::string getTypeName(filterTypes filterType)
returns name of given type, needed for compatibility with other modules
Definition: FilterID.cc:437
Belle2::XHitFilterFactory::m_virtualIP
TVector3 m_virtualIP
contains global coordinates of virtual interaction point.
Definition: XHitFilterFactory.h:377
Belle2::ThreeHitFilters::calcHelixParameterFit
double calcHelixParameterFit()
calculates the helixparameter describing the deviation in z per unit angle, returning unit: none
Definition: ThreeHitFilters.h:253
Belle2::FilterID::getTypeEnum
static filterTypes getTypeEnum(const std::string &filterString)
returns type of given name, needed for compatibility with other modules.
Definition: FilterID.h:250
Belle2::TwoHitFilters::calcDistXY
double calcDistXY() const
calculates the distance between the hits (XY), returning unit: cm^2 for speed optimization
Definition: TwoHitFilters.h:71
Belle2::XHitFilterFactory::XHitFilterType
FilterID::filterTypes XHitFilterType
constructor where nothing has been passed
Definition: XHitFilterFactory.h:65
Belle2::XHitFilterFactory::ThreeHitFunction
typename std::function< double(const PointType &, const PointType &, const PointType &)> ThreeHitFunction
typedef for more readable function-type - to be used for 3-hit-selectionVariables.
Definition: XHitFilterFactory.h:71
Belle2::FilterID::anglesHighOccupancyRZ
@ anglesHighOccupancyRZ
string name of filter aRZ high occupancy
Definition: FilterID.h:53
Belle2::FilterID::helixParameterHighOccupancyFit
@ helixParameterHighOccupancyFit
string name of filter hFit high occupancy
Definition: FilterID.h:57
Belle2::ThreeHitFilters::calcPt
double calcPt()
calculates the estimation of the transverse momentum of the 3-hit-tracklet, returning unit: GeV/c
Definition: ThreeHitFilters.h:184
Belle2::FilterID::deltaSlopeHighOccupancyRZ
@ deltaSlopeHighOccupancyRZ
string name of filter dslopeRZ high occupancy
Definition: FilterID.h:55