9#include <gtest/gtest.h>
11#include <tracking/spacePointCreation/SpacePoint.h>
12#include <tracking/spacePointCreation/SpacePointTrackCand.h>
13#include <tracking/trackFindingVXD/filterMap/trackletVariables/ZiggZaggXY.h>
14#include <tracking/trackFindingVXD/filterMap/trackletVariables/ZiggZaggXYWithSigma.h>
15#include <tracking/trackFindingVXD/filterMap/trackletVariables/ZiggZaggRZ.h>
17#include <tracking/trackFindingVXD/filterMap/filterFramework/Shortcuts.h>
19#include <vxd/geometry/SensorInfoBase.h>
24namespace VXDTFtrackletFilterTest {
40 r1.SetAngles(45, 20, 30);
41 TGeoTranslation t1(globalX, globalY, globalZ);
42 TGeoCombiTrans c1(t1, r1);
43 TGeoHMatrix transform = c1;
44 sensorInfoBase.setTransformation(transform);
46 sensorInfoBase.setTransformation(transform,
true);
48 return sensorInfoBase;
54 SpacePoint provideSpacePointDummy(
double X,
double Y,
double Z)
59 PXDCluster aCluster =
PXDCluster(aVxdID, 0., 0., 0.1, 0.1, 0, 0, 1, 1, 1, 1, 1, 1);
75 template<
class Var,
typename ... otherTypes>
76 static void notify(
const Var& filterType,
77 typename Var::variableType fResult,
80 B2INFO(
"ResultsObserver: Filter " << filterType.name() <<
" got result of " << fResult);
88 TEST_F(TrackletFilterTest, SpacePointCreation)
90 SpacePoint testSP = provideSpacePointDummy(1.2, 2.3, 4.2);
98 TEST_F(TrackletFilterTest, SelectionVariableName)
100 auto ziggZaggXYChecker = ZiggZaggXY<SpacePoint, SpacePointTrackCand>();
101 EXPECT_EQ(
"ZiggZaggXY", ziggZaggXYChecker.name());
103 auto ziggZaggXYWithSigmaChecker = ZiggZaggXYWithSigma<SpacePoint, SpacePointTrackCand>();
104 EXPECT_EQ(
"ZiggZaggXYWithSigma", ziggZaggXYWithSigmaChecker.name());
106 auto ziggZaggRZChecker = ZiggZaggRZ<SpacePoint, SpacePointTrackCand>();
107 EXPECT_EQ(
"ZiggZaggRZ", ziggZaggRZChecker.name());
112 TEST_F(TrackletFilterTest, TestZiggZagg)
115 SpacePoint outerSP = provideSpacePointDummy(1.1, 1., 1.);
116 SpacePoint outerCenterSP = provideSpacePointDummy(2., 2., 2.);
117 SpacePoint innerCenterSP = provideSpacePointDummy(3., 2.1, 3.);
118 SpacePoint innerSP = provideSpacePointDummy(4., 3., 3.);
119 SpacePoint innermostSP = provideSpacePointDummy(5., 3, 6.);
122 const std::vector<const Belle2::SpacePoint*> aSpacePointVec = { &outerSP, &outerCenterSP, &innerCenterSP, &innerSP };
125 ziggZaggXYChecker4VecSPs(
127 EXPECT_FALSE(ziggZaggXYChecker4VecSPs.accept(aSpacePointVec));
128 EXPECT_EQ(2, lastResult);
136 EXPECT_FALSE(ziggZaggXYChecker4SPTC.accept(aSpacePointTC));
137 EXPECT_EQ(2, lastResult);
139 ziggZaggXYWithSigmaChecker4SPTC(
141 EXPECT_FALSE(ziggZaggXYWithSigmaChecker4SPTC.accept(aSpacePointTC));
142 EXPECT_EQ(2, lastResult);
145 EXPECT_FALSE(ziggZaggRZChecker4SPTC.accept(aSpacePointTC));
146 EXPECT_EQ(2, lastResult);
150 const std::vector<const Belle2::SpacePoint*> aSpacePointVec2 = { &outerSP, &outerCenterSP, &innerCenterSP, &innerSP, &innerSP };
153 EXPECT_FALSE(ziggZaggXYChecker4SPTC.accept(aSpacePointTC2));
154 EXPECT_EQ(3, lastResult);
155 EXPECT_FALSE(ziggZaggXYWithSigmaChecker4SPTC.accept(aSpacePointTC2));
156 EXPECT_EQ(2, lastResult);
157 EXPECT_FALSE(ziggZaggRZChecker4SPTC.accept(aSpacePointTC2));
158 EXPECT_EQ(3, lastResult);
162 const std::vector<const Belle2::SpacePoint*> aSpacePointVec3 = { &outerSP, &outerCenterSP, &innerSP, &innermostSP };
165 EXPECT_TRUE(ziggZaggXYChecker4SPTC.accept(aSpacePointTC3));
166 EXPECT_EQ(1, lastResult);
167 EXPECT_TRUE(ziggZaggXYWithSigmaChecker4SPTC.accept(aSpacePointTC3));
168 EXPECT_EQ(1, lastResult);
169 EXPECT_FALSE(ziggZaggRZChecker4SPTC.accept(aSpacePointTC3));
170 EXPECT_EQ(2, lastResult);
174 SpacePoint testSP1 = provideSpacePointDummy(1.001, 1., 0.);
175 SpacePoint testSP2 = provideSpacePointDummy(2., 2.0002, 0.);
176 SpacePoint testSP3 = provideSpacePointDummy(3.0005, 3., 0.);
177 SpacePoint testSP4 = provideSpacePointDummy(4., 4.0003, 0.);
178 SpacePoint testSP5 = provideSpacePointDummy(5.001, 5., 0.);
179 const std::vector<const Belle2::SpacePoint*> aSpacePointVec4 = { &testSP1, &testSP2, &testSP3, &testSP4, &testSP5 };
182 EXPECT_FALSE(ziggZaggXYChecker4SPTC.accept(aSpacePointTC4));
183 EXPECT_EQ(2, lastResult);
184 EXPECT_TRUE(ziggZaggXYWithSigmaChecker4SPTC.accept(aSpacePointTC4));
185 EXPECT_EQ(0, 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)
Represents a closed set of arithmetic types.
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...
Storage for (VXD) SpacePoint-based track candidates.
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.
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...
Test class for these new and shiny two-hit-filters.
Abstract base class for different kinds of events.