9#include <gtest/gtest.h>
11#include <tracking/spacePointCreation/SpacePoint.h>
12#include <tracking/trackFindingVXD/filterMap/threeHitVariables/CircleCenterXY.h>
13#include <tracking/trackFindingVXD/filterMap/fourHitVariables/DeltaPt.h>
14#include <tracking/trackFindingVXD/filterMap/fourHitVariables/DeltaCircleRadius.h>
15#include <tracking/trackFindingVXD/filterMap/fourHitVariables/DeltaDistCircleCenter.h>
16#include <tracking/trackFindingVXD/filterTools/SelectionVariableHelper.h>
18#include <tracking/trackFindingVXD/filterMap/filterFramework/Shortcuts.h>
20#include <framework/geometry/B2Vector3.h>
22#include <vxd/geometry/SensorInfoBase.h>
30namespace VXDTFfourHitFilterTest {
46 r1.SetAngles(45, 20, 30);
47 TGeoTranslation t1(globalX, globalY, globalZ);
48 TGeoCombiTrans c1(t1, r1);
49 TGeoHMatrix transform = c1;
50 sensorInfoBase.setTransformation(transform);
52 sensorInfoBase.setTransformation(transform,
true);
54 return sensorInfoBase;
60 SpacePoint provideSpacePointDummy(
double X,
double Y,
double Z)
65 PXDCluster aCluster =
PXDCluster(aVxdID, 0., 0., 0.1, 0.1, 0, 0, 1, 1, 1, 1, 1, 1);
73 double lastResult = 0.;
81 template<
class Var,
typename ... otherTypes>
82 static void notify(
const Var& filterType,
83 typename Var::variableType fResult,
86 B2INFO(
"ResultsObserver: Filter " << filterType.name() <<
" got result of " << fResult);
94 TEST_F(FourHitFilterTest, SpacePointCreation)
96 SpacePoint testSP = provideSpacePointDummy(1.2, 2.3, 4.2);
104 TEST_F(FourHitFilterTest, SelectionVariableName)
106 auto dDCircleCenter = DeltaDistCircleCenter<SpacePoint>();
107 EXPECT_EQ(
"DeltaDistCircleCenter", dDCircleCenter.name());
108 auto dPt = DeltaPt<SpacePoint>();
109 EXPECT_EQ(
"DeltaPt", dPt.name());
114 TEST_F(FourHitFilterTest, TestDeltaPtAndDeltaDistCircleCenter)
116 SpacePoint outerSP = provideSpacePointDummy(0, 0, 0.);
117 SpacePoint outerCenterSP = provideSpacePointDummy(-2, 0, 0.);
118 SpacePoint innerCenterSP = provideSpacePointDummy(0, 2, 0.);
119 SpacePoint innerSP = provideSpacePointDummy(2, 0, 0.);
121 B2Vector3D centerO_OC_IC = CircleCenterXY<SpacePoint>::value(outerSP, outerCenterSP, innerCenterSP);
122 B2Vector3D centerOC_IC_I = CircleCenterXY<SpacePoint>::value(outerCenterSP, innerCenterSP, innerSP);
123 EXPECT_FLOAT_EQ(-1., centerO_OC_IC[0]);
124 EXPECT_FLOAT_EQ(1., centerO_OC_IC[1]);
125 EXPECT_FLOAT_EQ(0., centerOC_IC_I[0]);
126 EXPECT_FLOAT_EQ(0., centerOC_IC_I[1]);
130 EXPECT_TRUE(filterDeltaDistCircleCenter.accept(outerSP, outerCenterSP, innerCenterSP, innerSP));
131 EXPECT_FLOAT_EQ(
sqrt(2), lastResult);
134 EXPECT_TRUE(filteDeltaPt.accept(outerSP, outerCenterSP, innerCenterSP, innerSP));
135 EXPECT_FLOAT_EQ(0.00263349, lastResult);
139 EXPECT_TRUE(filteDeltaCircleRadius.accept(outerSP, outerCenterSP, innerCenterSP, innerSP));
140 EXPECT_FLOAT_EQ(-0.58578646, lastResult);
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)
This class is used to select pairs, triplets... of objects.
The PXD Cluster class This class stores all information about reconstructed PXD clusters The position...
Represents a range of arithmetic types.
SpacePoint typically is build from 1 PXDCluster or 1-2 SVDClusters.
const B2Vector3D & getPosition() const
return the position vector in global coordinates
Base class to provide Sensor Information for PXD and SVD.
The most CPU efficient Observer for the VXDTF filter tools (even if useless).
Class to uniquely identify a any structure of the PXD and SVD.
Test class for these new and shiny two-hit-filters.
takes result, prints it and stores it to lastResult
static void notify(const Var &filterType, typename Var::variableType fResult, otherTypes ...)
notify function is called by the filter, this one takes result, prints it and stores it to lastResult...
double sqrt(double a)
sqrt for double
Abstract base class for different kinds of events.