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 = [ = ](
const PointType &
outerHit,
const PointType & innerHit) ->
void {
83 B2Vector3D tInnerHit(innerHit.X(), innerHit.Y(), innerHit.Z());
89 return [ = ](
const PointType &
outerHit,
const PointType & innerHit) ->
double {
96 return [ = ](
const PointType &
outerHit,
const PointType & innerHit) ->
double {
103 return [ = ](
const PointType &
outerHit,
const PointType & innerHit) ->
double {
110 return [ = ](
const PointType &
outerHit,
const PointType & innerHit) ->
double {
117 return [ = ](
const PointType &
outerHit,
const PointType & innerHit) ->
double {
124 auto prepareStuffHiOc = [ = ](
const PointType &
outerHit,
const PointType & innerHit) ->
void {
126 B2Vector3D tInnerHit(innerHit.X(), innerHit.Y(), innerHit.Z());
133 return [ = ](
const PointType &
outerHit,
const PointType & innerHit) ->
double {
134 prepareStuffHiOc(
outerHit, innerHit);
140 return [ = ](
const PointType &
outerHit,
const PointType & innerHit) ->
double {
141 prepareStuffHiOc(
outerHit, innerHit);
147 return [ = ](
const PointType &
outerHit,
const PointType & innerHit) ->
double {
148 prepareStuffHiOc(
outerHit, innerHit);
154 return [ = ](
const PointType &
outerHit,
const PointType & innerHit) ->
double {
155 prepareStuffHiOc(
outerHit, innerHit);
161 return [ = ](
const PointType &
outerHit,
const PointType & innerHit) ->
double {
162 prepareStuffHiOc(
outerHit, innerHit);
168 return [ = ](
const PointType &
outerHit,
const PointType & innerHit) ->
double {
169 prepareStuffHiOc(
outerHit, innerHit);
175 return [ = ](
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 = [ = ](
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());
214 return [ = ](
const PointType &
outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
double {
215 prepareStuff3Hit(
outerHit, centerHit, innerHit);
221 return [ = ](
const PointType &
outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
double {
222 prepareStuff3Hit(
outerHit, centerHit, innerHit);
228 return [ = ](
const PointType &
outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
double {
229 prepareStuff3Hit(
outerHit, centerHit, innerHit);
235 return [ = ](
const PointType &
outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
double {
236 prepareStuff3Hit(
outerHit, centerHit, innerHit);
242 return [ = ](
const PointType &
outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
double {
243 prepareStuff3Hit(
outerHit, centerHit, innerHit);
249 return [ = ](
const PointType &
outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
double {
250 prepareStuff3Hit(
outerHit, centerHit, innerHit);
256 return [ = ](
const PointType &
outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
double {
257 prepareStuff3Hit(
outerHit, centerHit, innerHit);
263 return [ = ](
const PointType &
outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
double {
264 prepareStuff3Hit(
outerHit, centerHit, innerHit);
270 return [ = ](
const PointType &
outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
double {
271 prepareStuff3Hit(
outerHit, centerHit, innerHit);
278 auto prepareStuff4Hit = [ = ](
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 [ = ](
const PointType &
outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
double {
289 prepareStuff4Hit(
outerHit, centerHit, innerHit);
295 return [ = ](
const PointType &
outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
double {
296 prepareStuff4Hit(
outerHit, centerHit, innerHit);
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 = [ = ](
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());
336 return [ = ](
const PointType &
outerHit,
const PointType & outerCenterHit,
337 const PointType & innerCenterHit,
const PointType & innerHit) ->
double {
338 prepareStuff4Hit(
outerHit, outerCenterHit, innerCenterHit, innerHit);
344 return [ = ](
const PointType &
outerHit,
const PointType & outerCenterHit,
345 const PointType & innerCenterHit,
const PointType & innerHit) ->
double {
346 prepareStuff4Hit(
outerHit, outerCenterHit, innerCenterHit, innerHit);
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; };
DataType Z() const
access variable Z (= .at(2) without boundary check)
DataType X() const
access variable X (= .at(0) without boundary check)
DataType Y() const
access variable Y (= .at(1) without boundary check)
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.
double calcDeltaDistCircleCenter()
calculates ddist2IP-value directly (ddist2IP= difference in magnitude of the points of closest approa...
double calcDeltapT()
calculates dpt-value (dpt= difference in transverse momentum of 2 subsets of the hits),...
void resetMagneticField(const double magneticFieldStrength=1.5)
Overrides Constructor-Setup for magnetic field.
void resetValues(const B2Vector3D &outer, const B2Vector3D &outerCenter, const B2Vector3D &innerCenter, const B2Vector3D &inner)
Overrides Constructor-Setup.
The class 'ThreeHitFilters' bundles filter methods using 3 hits which are stored in B2Vector3Ds.
double calcAngle3D()
calculates the angle between the hits/vectors (3D), returning unit: none (calculation for degrees is ...
double calcDeltaSOverZ()
calculates the helixparameter describing the deviation in arc length per unit in z.
void resetValues(const B2Vector3D &outerHit, const B2Vector3D ¢erHit, 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 calcDeltaSlopeZOverS()
compares the "slopes" z over arc length.
double calcCircleDist2IP()
calculates the distance of the point of closest approach of circle to the IP, returning unit: cm
void resetMagneticField(const double magneticFieldStrength=1.5)
Overrides Constructor-Setup for magnetic field.
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 ...
The class 'TwoHitFilters' bundles filter methods using 2 hits which are stored in B2Vector3Ds.
double calcNormedDist3D() const
calculates the normed distance between the hits (3D), return unit: none
double calcDist3D() const
calculates the distance between the hits (3D), returning unit: cm^2 for speed optimization
double calcDistXY() const
calculates the distance between the hits (XY), returning unit: cm^2 for speed optimization
double calcSlopeRZ() const
calculates the angle of the slope of the hits in RZ, returnValue = theta = atan(r/z)
double calcDistZ() const
calculates the distance between the hits (Z only), returning unit: cm
void resetValues(const B2Vector3D &outerHit, const B2Vector3D &innerHit)
Overrides Constructor-Setup.
The factory serves as an interface between all x-hit-filters and a user only knowing their name (in s...
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.
B2Vector3D outerHit(0, 0, 0)
testing out of range behavior
Abstract base class for different kinds of events.