 |
Belle II Software
release-05-01-25
|
14 #include <tracking/dataobjects/FilterID.h>
17 #include <tracking/vxdCaTracking/TwoHitFilters.h>
19 #include <tracking/vxdCaTracking/ThreeHitFilters.h>
21 #include <tracking/vxdCaTracking/FourHitFilters.h>
23 #include <framework/logging/Logger.h>
37 template<
class Po
intType>
38 class XHitFilterFactory {
42 XHitFilterFactory(
double x = 0,
double y = 0,
double z = 0,
double mField = 1.5) :
60 using TwoHitFunction =
typename std::function<double(
const PointType&,
const PointType&)>;
63 using ThreeHitFunction =
typename std::function<double(
const PointType&,
const PointType&,
const PointType&)>;
66 using FourHitFunction =
typename std::function<double(
const PointType&,
const PointType&,
const PointType&,
const PointType&)>;
83 auto prepareStuff = [ = ](
const PointType & outerHit,
const PointType & innerHit) ->
void {
84 TVector3 tOuterHit(outerHit.X(), outerHit.Y(), outerHit.Z());
85 TVector3 tInnerHit(innerHit.X(), innerHit.Y(), innerHit.Z());
91 return [ = ](
const PointType & outerHit,
const PointType & innerHit) ->
double {
92 prepareStuff(outerHit, innerHit);
98 return [ = ](
const PointType & outerHit,
const PointType & innerHit) ->
double {
99 prepareStuff(outerHit, innerHit);
105 return [ = ](
const PointType & outerHit,
const PointType & innerHit) ->
double {
106 prepareStuff(outerHit, innerHit);
112 return [ = ](
const PointType & outerHit,
const PointType & innerHit) ->
double {
113 prepareStuff(outerHit, innerHit);
119 return [ = ](
const PointType & outerHit,
const PointType & innerHit) ->
double {
120 prepareStuff(outerHit, innerHit);
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());
135 return [ = ](
const PointType & outerHit,
const PointType & innerHit) ->
double {
136 prepareStuffHiOc(outerHit, innerHit);
142 return [ = ](
const PointType & outerHit,
const PointType & innerHit) ->
double {
143 prepareStuffHiOc(outerHit, innerHit);
149 return [ = ](
const PointType & outerHit,
const PointType & innerHit) ->
double {
150 prepareStuffHiOc(outerHit, innerHit);
156 return [ = ](
const PointType & outerHit,
const PointType & innerHit) ->
double {
157 prepareStuffHiOc(outerHit, innerHit);
163 return [ = ](
const PointType & outerHit,
const PointType & innerHit) ->
double {
164 prepareStuffHiOc(outerHit, innerHit);
170 return [ = ](
const PointType & outerHit,
const PointType & innerHit) ->
double {
171 prepareStuffHiOc(outerHit, innerHit);
177 return [ = ](
const PointType & outerHit,
const PointType & innerHit) ->
double {
178 prepareStuffHiOc(outerHit, innerHit);
185 B2ERROR(
" XHitFilterAdapter-2Hit: given name (raw/full): " << variableType <<
187 " is not known, returning dummy function with 0.0 as a result instead!");
189 return [&](
const PointType&,
const PointType&) ->
double {
return 0.0; };
207 auto prepareStuff3Hit = [ = ](
const PointType & outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
void {
208 TVector3 tOuterHit(outerHit.X(), outerHit.Y(), outerHit.Z());
209 TVector3 tCenterHit(centerHit.X(), centerHit.Y(), centerHit.Z());
210 TVector3 tInnerHit(innerHit.X(), innerHit.Y(), innerHit.Z());
216 return [ = ](
const PointType & outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
double {
217 prepareStuff3Hit(outerHit, centerHit, innerHit);
223 return [ = ](
const PointType & outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
double {
224 prepareStuff3Hit(outerHit, centerHit, innerHit);
230 return [ = ](
const PointType & outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
double {
231 prepareStuff3Hit(outerHit, centerHit, innerHit);
237 return [ = ](
const PointType & outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
double {
238 prepareStuff3Hit(outerHit, centerHit, innerHit);
244 return [ = ](
const PointType & outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
double {
245 prepareStuff3Hit(outerHit, centerHit, innerHit);
251 return [ = ](
const PointType & outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
double {
252 prepareStuff3Hit(outerHit, centerHit, innerHit);
258 return [ = ](
const PointType & outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
double {
259 prepareStuff3Hit(outerHit, centerHit, innerHit);
265 return [ = ](
const PointType & outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
double {
266 prepareStuff3Hit(outerHit, centerHit, innerHit);
272 return [ = ](
const PointType & outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
double {
273 prepareStuff3Hit(outerHit, centerHit, innerHit);
280 auto prepareStuff4Hit = [ = ](
const PointType & outerHit,
const PointType & centerHit,
281 const PointType & innerHit) ->
void {
282 TVector3 tOuterHit(outerHit.X(), outerHit.Y(), outerHit.Z());
283 TVector3 tCenterHit(centerHit.X(), centerHit.Y(), centerHit.Z());
284 TVector3 tInnerHit(innerHit.X(), innerHit.Y(), innerHit.Z());
290 return [ = ](
const PointType & outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
double {
291 prepareStuff4Hit(outerHit, centerHit, innerHit);
297 return [ = ](
const PointType & outerHit,
const PointType & centerHit,
const PointType & innerHit) ->
double {
298 prepareStuff4Hit(outerHit, centerHit, innerHit);
304 B2ERROR(
" XHitFilterAdapter-3Hit: given name (raw/full): " << variableType <<
306 " is not known, returning dummy function with 0.0 as a result instead!");
308 return [&](
const PointType&,
const PointType&,
const PointType&) ->
double {
return 0.0; };
327 auto prepareStuff4Hit = [ = ](
const PointType & outerHit,
const PointType & outerCenterHit,
328 const PointType & innerCenterHit,
const PointType & innerHit) ->
void {
329 TVector3 tOuterHit(outerHit.X(), outerHit.Y(), outerHit.Z());
330 TVector3 tOuterCenterHit(outerCenterHit.X(), outerCenterHit.Y(), outerCenterHit.Z());
331 TVector3 tInnerCenterHit(innerCenterHit.X(), innerCenterHit.Y(), innerCenterHit.Z());
332 TVector3 tInnerHit(innerHit.X(), innerHit.Y(), innerHit.Z());
338 return [ = ](
const PointType & outerHit,
const PointType & outerCenterHit,
339 const PointType & innerCenterHit ,
const PointType & innerHit) ->
double {
340 prepareStuff4Hit(outerHit, outerCenterHit, innerCenterHit, innerHit);
346 return [ = ](
const PointType & outerHit,
const PointType & outerCenterHit,
347 const PointType & innerCenterHit ,
const PointType & innerHit) ->
double {
348 prepareStuff4Hit(outerHit, outerCenterHit, innerCenterHit, innerHit);
354 B2ERROR(
" XHitFilterAdapter-4Hit: given name (raw/full): " << variableType <<
356 " is not known, returning dummy function with 0.0 as a result instead!");
358 return [&](
const PointType&,
const PointType&,
const PointType&,
const PointType&) ->
double {
return 0.0; };
@ distanceZ
string name of filter dZ
void resetValues(TVector3 &outerHit, TVector3 ¢erHit, TVector3 &innerHit)
Overrides Constructor-Setup.
double calcAngleRZ()
calculates the angle between the hits/vectors (RZ), returning unit: none (calculation for degrees is ...
typename std::function< double(const Belle2::SecMapTrainerHit &, const Belle2::SecMapTrainerHit &)> TwoHitFunction
typedef for more readable function-type - to be used for 2-hit-selectionVariables.
@ helixParameterFit
string name of filter helix Paramater Fit
double calcDist3D() const
calculates the distance between the hits (3D), returning unit: cm^2 for speed optimization
@ anglesHighOccupancy3D
string name of filter a3D high occupancy
@ normedDistance3D
string name of filter nd3D
TwoHitFilters m_twoHit
contains all 2-hit-filters.
TwoHitFunction get2HitInterface(std::string variableName)
For given name of a variableType a function for the corresponding Filter is returned.
@ angles3D
string name of filter a3D
double calcCircleDist2IP()
calculates the distance of the point of closest approach of circle to the IP, returning unit: cm
double calcNormedDist3D() const
calculates the normed distance between the hits (3D), return unit: none
void resetValues(TVector3 &outer, TVector3 &outerCenter, TVector3 &innerCenter, TVector3 &inner)
Overrides Constructor-Setup.
ThreeHitFunction get3HitInterface(std::string variableName)
For given name of a variableType a function for the corresponding Filter is returned.
double calcDeltaSlopeRZ()
calculates deviations in the slope of the inner segment and the outer segment, returning unit: none
double calcSlopeRZ() const
calculates the angle of the slope of the hits in RZ, returnValue = theta = atan(r/z)
@ slopeRZ
string name of filter slopeRZ
double calcDistZ() const
calculates the distance between the hits (Z only), returning unit: cm
@ anglesRZ
string name of filter aRZ
@ pT
string name of filter pT
@ deltaSlopeZOverS
deltaSlopeZOverS Filter
typename std::function< double(const Belle2::SecMapTrainerHit &, const Belle2::SecMapTrainerHit &, const Belle2::SecMapTrainerHit &, const Belle2::SecMapTrainerHit &)> FourHitFunction
typedef for more readable function-type - to be used for 4-hit-selectionVariables.
@ deltapT
string name of filter dPt
@ distance2IP
string name of filter d2IP
@ deltapTHighOccupancy
string name of filter dPt high occupancy
double calcAngleXY()
calculates the angle between the hits/vectors (XY), returning unit: none (calculation for degrees is ...
@ distanceXY
string name of filter dXY
@ distanceHighOccupancy2IP
string name of filter d2IP high occupancy
XHitFilterFactory(double x=0, double y=0, double z=0, double mField=1.5)
constructor where virtual IP has been passed
double calcAngle3D()
calculates the angle between the hits/vectors (3D), returning unit: none (calculation for degrees is ...
Abstract base class for different kinds of events.
ThreeHitFilters m_threeHit
contains all 3-hit-filters.
@ pTHighOccupancy
string name of filter pT high occupancy
@ deltaDistance2IP
string name of filter dd2IP
@ anglesHighOccupancyXY
string name of filter aXY high occupancy
double calcDeltaDistCircleCenter()
calculates ddist2IP-value directly (ddist2IP= difference in magnitude of the points of closest approa...
FourHitFilters m_fourHit
contains all 4-hit-filters.
FourHitFunction get4HitInterface(std::string variableName)
For given name of a variableType a function for the corresponding Filter is returned.
@ distance3D
string name of filter d3D
static std::string getTypeName(filterTypes filterType)
returns name of given type, needed for compatibility with other modules
void resetMagneticField(double magneticFieldStrength=1.5)
Overrides Constructor-Setup for magnetic field.
TVector3 m_virtualIP
contains global coordinates of virtual interaction point.
double calcHelixParameterFit()
calculates the helixparameter describing the deviation in z per unit angle, returning unit: none
double calcDeltaSlopeZOverS()
compares the "slopes" z over arc length.
void resetMagneticField(double magneticFieldStrength=1.5)
Overrides Constructor-Setup for magnetic field.
@ deltaDistanceHighOccupancy2IP
string name of filter dd2IP high occupancy
filterTypes
filterTyoes contains enums assigning unique values for each filter type allowing fast filter type rec...
static filterTypes getTypeEnum(const std::string &filterString)
returns type of given name, needed for compatibility with other modules.
void resetValues(TVector3 &outerHit, TVector3 &innerHit)
Overrides Constructor-Setup.
double calcDeltaSOverZ()
calculates the helixparameter describing the deviation in arc length per unit in z.
double calcDistXY() const
calculates the distance between the hits (XY), returning unit: cm^2 for speed optimization
@ anglesXY
string name of filter aXY
@ deltaSlopeRZ
string name of filter dslopeRZ
FilterID::filterTypes XHitFilterType
constructor where nothing has been passed
@ deltaSOverZ
deltaSOverZ Filter
double calcDeltapT()
calculates dpt-value (dpt= difference in transverse momentum of 2 subsets of the hits),...
typename std::function< double(const Belle2::SecMapTrainerHit &, const Belle2::SecMapTrainerHit &, const Belle2::SecMapTrainerHit &)> ThreeHitFunction
typedef for more readable function-type - to be used for 3-hit-selectionVariables.
@ anglesHighOccupancyRZ
string name of filter aRZ high occupancy
@ helixParameterHighOccupancyFit
string name of filter hFit high occupancy
double calcPt()
calculates the estimation of the transverse momentum of the 3-hit-tracklet, returning unit: GeV/c
@ deltaSlopeHighOccupancyRZ
string name of filter dslopeRZ high occupancy