9#include <gtest/gtest.h>
13#include <framework/geometry/B2Vector3.h>
15#include "tracking/trackFindingVXD/trackQualityEstimators/QualityEstimatorTripletFit.h"
19const static double allowed_chi2_deviation = 1e-20;
22namespace QualityEstimatorTests {
24 TEST(TripletFitTests, CircleChi2)
28 qualityEstimator.setMagneticFieldStrength(1.5);
40 std::vector<SpacePoint const*> hitlist;
42 hitlist.push_back(&spacePoint1);
43 hitlist.push_back(&spacePoint2);
44 hitlist.push_back(&spacePoint3);
47 auto result = qualityEstimator.estimateQualityAndProperties(hitlist);
49 ASSERT_TRUE(result.chiSquared);
50 ASSERT_NEAR(*(result.chiSquared), 0., allowed_chi2_deviation) <<
"1st perfect circle";
62 hitlist.push_back(&spacePoint1);
63 hitlist.push_back(&spacePoint2);
64 hitlist.push_back(&spacePoint3);
67 result = qualityEstimator.estimateQualityAndProperties(hitlist);
69 ASSERT_TRUE(result.chiSquared);
70 ASSERT_NEAR(*(result.chiSquared), 0., allowed_chi2_deviation) <<
"2nd perfect circle";
77 hitlist.push_back(&spacePoint1);
78 hitlist.push_back(&spacePoint2);
79 hitlist.push_back(&spacePoint3);
81 result = qualityEstimator.estimateQualityAndProperties(hitlist);
83 ASSERT_TRUE(*(result.chiSquared) > allowed_chi2_deviation) <<
"1st imperfect circle";
90 hitlist.push_back(&spacePoint1);
91 hitlist.push_back(&spacePoint2);
92 hitlist.push_back(&spacePoint3);
94 result = qualityEstimator.estimateQualityAndProperties(hitlist);
96 ASSERT_TRUE(result.chiSquared);
97 ASSERT_TRUE(*(result.chiSquared) > allowed_chi2_deviation) <<
"2nd imperfect circle";
100 TEST(TripletFitTests, CombinedCircleChi2)
104 qualityEstimator.setMagneticFieldStrength(1.5);
118 std::vector<SpacePoint const*> hitlist;
120 hitlist.push_back(&spacePoint1);
121 hitlist.push_back(&spacePoint2);
122 hitlist.push_back(&spacePoint3);
123 hitlist.push_back(&spacePoint4);
125 auto result = qualityEstimator.estimateQualityAndProperties(hitlist);
127 ASSERT_TRUE(result.chiSquared);
128 ASSERT_NEAR(*(result.chiSquared), 0., allowed_chi2_deviation) <<
"1st perfect combined circle";
136 hitlist.push_back(&spacePoint1);
137 hitlist.push_back(&spacePoint2);
138 hitlist.push_back(&spacePoint3);
139 hitlist.push_back(&spacePoint4);
141 result = qualityEstimator.estimateQualityAndProperties(hitlist);
143 ASSERT_TRUE(result.chiSquared);
144 ASSERT_TRUE(*(result.chiSquared) > allowed_chi2_deviation) <<
"Incompatible circle triplets";
151 qualityEstimator.setMagneticFieldStrength(1.5);
162 std::vector<SpacePoint const*> hitlist;
164 hitlist.push_back(&spacePoint1);
165 hitlist.push_back(&spacePoint2);
166 hitlist.push_back(&spacePoint3);
169 auto result = qualityEstimator.estimateQuality(hitlist);
170 auto resultObject = qualityEstimator.estimateQualityAndProperties(hitlist);
171 ASSERT_EQ(resultObject.qualityIndicator, result);
174 ASSERT_FALSE(resultObject.p);
176 ASSERT_TRUE(resultObject.chiSquared);
177 ASSERT_TRUE(resultObject.pt);
178 ASSERT_TRUE(resultObject.pmag);
179 ASSERT_TRUE(resultObject.curvatureSign);
184 result = qualityEstimator.estimateQuality(hitlist);
185 resultObject = qualityEstimator.estimateQualityAndProperties(hitlist);
186 ASSERT_EQ(result, resultObject.qualityIndicator);
189 ASSERT_FALSE(resultObject.chiSquared);
190 ASSERT_FALSE(resultObject.p);
191 ASSERT_FALSE(resultObject.pt);
192 ASSERT_FALSE(resultObject.pmag);
193 ASSERT_FALSE(resultObject.curvatureSign);
does a tripletFit of the given hits The filter is based on the paper 'A New Three-Dimensional Track F...
SpacePoint typically is build from 1 PXDCluster or 1-2 SVDClusters.
@ VXD
Any type of VXD Sensor.
Class to uniquely identify a any structure of the PXD and SVD.
Exception to be thrown in case of an empty result.
B2Vector3< double > B2Vector3D
typedef for common usage with double
Abstract base class for different kinds of events.