12#include <tracking/dataobjects/FilterID.h>
15#include <tracking/vxdCaTracking/TwoHitFilters.h>
17#include <tracking/vxdCaTracking/ThreeHitFilters.h>
19#include <tracking/vxdCaTracking/FourHitFilters.h>
21#include <framework/logging/Logger.h>
25#include <framework/geometry/B2Vector3.h>
35 template<
class Po
intType>
58 using TwoHitFunction =
typename std::function<double(
const PointType&,
const PointType&)>;
61 using ThreeHitFunction =
typename std::function<double(
const PointType&,
const PointType&,
const PointType&)>;
64 using FourHitFunction =
typename std::function<double(
const PointType&,
const PointType&,
const PointType&,
const PointType&)>;
81 auto prepareStuff = [ this ](
const PointType &
outerHit,
const PointType & innerHit) ->
void {
83 B2Vector3D tInnerHit(innerHit.X(), innerHit.Y(), innerHit.Z());
84 m_twoHit.resetValues(tOuterHit, tInnerHit);
89 return [
this, &prepareStuff ](
const PointType &
outerHit,
const PointType & innerHit) ->
double {
96 return [
this, &prepareStuff ](
const PointType &
outerHit,
const PointType & innerHit) ->
double {
103 return [
this, &prepareStuff ](
const PointType &
outerHit,
const PointType & innerHit) ->
double {
110 return [
this, &prepareStuff ](
const PointType &
outerHit,
const PointType & innerHit) ->
double {
117 return [
this, &prepareStuff ](
const PointType &
outerHit,
const PointType & innerHit) ->
double {
124 auto prepareStuffHiOc = [ this ](
const PointType &
outerHit,
const PointType & innerHit) ->
void {
126 B2Vector3D tInnerHit(innerHit.X(), innerHit.Y(), innerHit.Z());
133 return [
this, &prepareStuffHiOc ](
const PointType &
outerHit,
const PointType & innerHit) ->
double {
134 prepareStuffHiOc(
outerHit, innerHit);
140 return [
this, &prepareStuffHiOc ](
const PointType &
outerHit,
const PointType & innerHit) ->
double {
141 prepareStuffHiOc(
outerHit, innerHit);
147 return [
this, &prepareStuffHiOc ](
const PointType &
outerHit,
const PointType & innerHit) ->
double {
148 prepareStuffHiOc(
outerHit, innerHit);
154 return [
this, &prepareStuffHiOc ](
const PointType &
outerHit,
const PointType & innerHit) ->
double {
155 prepareStuffHiOc(
outerHit, innerHit);
161 return [
this, &prepareStuffHiOc ](
const PointType &
outerHit,
const PointType & innerHit) ->
double {
162 prepareStuffHiOc(
outerHit, innerHit);
168 return [
this, &prepareStuffHiOc ](
const PointType &
outerHit,
const PointType & innerHit) ->
double {
169 prepareStuffHiOc(
outerHit, innerHit);
175 return [
this, &prepareStuffHiOc ](
const PointType &
outerHit,
const PointType & innerHit) ->
double {
176 prepareStuffHiOc(
outerHit, innerHit);
183 B2ERROR(
" XHitFilterAdapter-2Hit: given name (raw/full): " << variableType <<
185 " is not known, returning dummy function with 0.0 as a result instead!");
187 return [&](
const PointType&,
const PointType&) ->
double {
return 0.0; };
205 auto prepareStuff3Hit = [ this ](
const PointType &
outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
void {
207 B2Vector3D tCenterHit(centerHit.X(), centerHit.Y(), centerHit.Z());
208 B2Vector3D tInnerHit(innerHit.X(), innerHit.Y(), innerHit.Z());
209 m_threeHit.resetValues(tOuterHit, tCenterHit, tInnerHit);
214 return [
this, &prepareStuff3Hit ](
const PointType &
outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
double {
215 prepareStuff3Hit(
outerHit, centerHit, innerHit);
221 return [
this, &prepareStuff3Hit ](
const PointType &
outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
double {
222 prepareStuff3Hit(
outerHit, centerHit, innerHit);
228 return [
this, &prepareStuff3Hit ](
const PointType &
outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
double {
229 prepareStuff3Hit(
outerHit, centerHit, innerHit);
235 return [
this, &prepareStuff3Hit ](
const PointType &
outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
double {
236 prepareStuff3Hit(
outerHit, centerHit, innerHit);
242 return [
this, &prepareStuff3Hit ](
const PointType &
outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
double {
243 prepareStuff3Hit(
outerHit, centerHit, innerHit);
249 return [
this, &prepareStuff3Hit ](
const PointType &
outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
double {
250 prepareStuff3Hit(
outerHit, centerHit, innerHit);
256 return [
this, &prepareStuff3Hit ](
const PointType &
outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
double {
257 prepareStuff3Hit(
outerHit, centerHit, innerHit);
263 return [
this, &prepareStuff3Hit ](
const PointType &
outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
double {
264 prepareStuff3Hit(
outerHit, centerHit, innerHit);
270 return [
this, &prepareStuff3Hit ](
const PointType &
outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
double {
271 prepareStuff3Hit(
outerHit, centerHit, innerHit);
278 auto prepareStuff4Hit = [ this ](
const PointType &
outerHit,
const PointType & centerHit,
279 const PointType & innerHit) ->
void {
281 B2Vector3D tCenterHit(centerHit.X(), centerHit.Y(), centerHit.Z());
282 B2Vector3D tInnerHit(innerHit.X(), innerHit.Y(), innerHit.Z());
288 return [
this, &prepareStuff4Hit ](
const PointType &
outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
double {
289 prepareStuff4Hit(
outerHit, centerHit, innerHit);
295 return [
this, &prepareStuff4Hit ](
const PointType &
outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
double {
296 prepareStuff4Hit(
outerHit, centerHit, innerHit);
297 return m_fourHit.calcDeltaDistCircleCenter();
302 B2ERROR(
" XHitFilterAdapter-3Hit: given name (raw/full): " << variableType <<
304 " is not known, returning dummy function with 0.0 as a result instead!");
306 return [&](
const PointType&,
const PointType&,
const PointType&) ->
double {
return 0.0; };
325 auto prepareStuff4Hit = [ this ](
const PointType &
outerHit,
const PointType & outerCenterHit,
326 const PointType & innerCenterHit,
const PointType & innerHit) ->
void {
328 B2Vector3D tOuterCenterHit(outerCenterHit.X(), outerCenterHit.Y(), outerCenterHit.Z());
329 B2Vector3D tInnerCenterHit(innerCenterHit.X(), innerCenterHit.Y(), innerCenterHit.Z());
330 B2Vector3D tInnerHit(innerHit.X(), innerHit.Y(), innerHit.Z());
331 m_fourHit.resetValues(tOuterHit, tOuterCenterHit, tInnerCenterHit, tInnerHit);
336 return [
this, &prepareStuff4Hit ](
const PointType &
outerHit,
const PointType & outerCenterHit,
337 const PointType & innerCenterHit,
const PointType & innerHit) ->
double {
338 prepareStuff4Hit(
outerHit, outerCenterHit, innerCenterHit, innerHit);
344 return [
this, &prepareStuff4Hit ](
const PointType &
outerHit,
const PointType & outerCenterHit,
345 const PointType & innerCenterHit,
const PointType & innerHit) ->
double {
346 prepareStuff4Hit(
outerHit, outerCenterHit, innerCenterHit, innerHit);
347 return m_fourHit.calcDeltaDistCircleCenter();
352 B2ERROR(
" XHitFilterAdapter-4Hit: given name (raw/full): " << variableType <<
354 " is not known, returning dummy function with 0.0 as a result instead!");
356 return [&](
const PointType&,
const PointType&,
const PointType&,
const PointType&) ->
double {
return 0.0; };
static filterTypes getTypeEnum(const std::string &filterString)
returns type of given name, needed for compatibility with other modules.
static std::string getTypeName(filterTypes filterType)
returns name of given type, needed for compatibility with other modules
filterTypes
filterTyoes contains enums assigning unique values for each filter type allowing fast filter type rec...
@ distanceHighOccupancy2IP
string name of filter d2IP high occupancy
@ deltaDistance2IP
string name of filter dd2IP
@ distance2IP
string name of filter d2IP
@ deltaSlopeHighOccupancyRZ
string name of filter dslopeRZ high occupancy
@ anglesHighOccupancy3D
string name of filter a3D high occupancy
@ deltapT
string name of filter dPt
@ distanceXY
string name of filter dXY
@ anglesXY
string name of filter aXY
@ normedDistance3D
string name of filter nd3D
@ slopeRZ
string name of filter slopeRZ
@ distance3D
string name of filter d3D
@ anglesHighOccupancyXY
string name of filter aXY high occupancy
@ helixParameterFit
string name of filter helix Parameter Fit
@ deltaSlopeRZ
string name of filter dslopeRZ
@ deltaDistanceHighOccupancy2IP
string name of filter dd2IP high occupancy
@ helixParameterHighOccupancyFit
string name of filter hFit high occupancy
@ deltapTHighOccupancy
string name of filter dPt high occupancy
@ pTHighOccupancy
string name of filter pT high occupancy
@ angles3D
string name of filter a3D
@ anglesRZ
string name of filter aRZ
@ deltaSlopeZOverS
deltaSlopeZOverS Filter
@ distanceZ
string name of filter dZ
@ deltaSOverZ
deltaSOverZ Filter
@ pT
string name of filter pT
@ anglesHighOccupancyRZ
string name of filter aRZ high occupancy
The class 'FourHitFilters' bundles filter methods using 4 hits which are stored in B2Vector3Ds.
The class 'ThreeHitFilters' bundles filter methods using 3 hits which are stored in B2Vector3Ds.
The class 'TwoHitFilters' bundles filter methods using 2 hits which are stored in B2Vector3Ds.
ThreeHitFunction get3HitInterface(std::string variableName)
For given name of a variableType a function for the corresponding Filter is returned.
typename std::function< double(const PointType &, const PointType &, const PointType &, const PointType &)> FourHitFunction
typedef for more readable function-type - to be used for 4-hit-selectionVariables.
B2Vector3D m_virtualIP
contains global coordinates of virtual interaction point.
FourHitFilters m_fourHit
contains all 4-hit-filters.
XHitFilterFactory(double x=0, double y=0, double z=0, double mField=1.5)
constructor where virtual IP has been passed
ThreeHitFunction get3HitInterface(XHitFilterType variableType)
For given name of a variableType a function for the corresponding Filter is returned.
ThreeHitFilters m_threeHit
contains all 3-hit-filters.
FourHitFunction get4HitInterface(XHitFilterType variableType)
For given name of a variableType a function for the corresponding Filter is returned.
typename std::function< double(const PointType &, const PointType &)> TwoHitFunction
typedef for more readable function-type - to be used for 2-hit-selectionVariables.
TwoHitFunction get2HitInterface(std::string variableName)
For given name of a variableType a function for the corresponding Filter is returned.
FilterID::filterTypes XHitFilterType
constructor where nothing has been passed
FourHitFunction get4HitInterface(std::string variableName)
For given name of a variableType a function for the corresponding Filter is returned.
typename std::function< double(const PointType &, const PointType &, const PointType &)> ThreeHitFunction
typedef for more readable function-type - to be used for 3-hit-selectionVariables.
TwoHitFilters m_twoHit
contains all 2-hit-filters.
TwoHitFunction get2HitInterface(XHitFilterType variableType)
For given name of a variableType a function for the corresponding Filter is returned.
B2Vector3< double > B2Vector3D
typedef for common usage with double
B2Vector3D outerHit(0, 0, 0)
testing out of range behavior
Abstract base class for different kinds of events.