8#include <tracking/trackFindingCDC/fitting/FacetFitter.h>
10#include <tracking/trackFindingCDC/geometry/UncertainParameterLine2D.h>
11#include <tracking/trackFindingCDC/geometry/LineParameters.h>
12#include <tracking/trackFindingCDC/geometry/Vector2D.h>
14#include <tracking/trackFindingCDC/numerics/Matrix.h>
16#include <framework/logging/Logger.h>
18#include <gtest/gtest.h>
21using namespace TrackFindingCDC;
24TEST(TrackFindingCDCTest, fitting_FacetFitter_fitLine)
41 for (
int nSteps : {100, 1, 0}) {
46 EXPECT_NEAR(0, fittedLine->
support().
x(), 1e-6);
47 EXPECT_NEAR(1, fittedLine->
support().
y(), 1e-6);
48 EXPECT_NEAR(0.015 * 1.0 / 4.0, fittedLine.
chi2(), 1e-6);
54TEST(TrackFindingCDCTest, fitting_FacetFitter_fitLine_alongYAxes)
71 for (
int nSteps : {100, 1, 0}) {
76 EXPECT_NEAR(1, fittedLine->
support().
x(), 1e-6);
77 EXPECT_NEAR(0, fittedLine->
support().
y(), 1e-6);
78 EXPECT_NEAR(0.015, fittedLine.
chi2(), 1e-6);
85TEST(TrackFindingCDCTest, fitting_FacetFitter_fitLine_sameSide)
102 for (
int nSteps : {100, 1, 0}) {
105 EXPECT_NEAR(-1, fittedLine->
tangential().
x(), 1e-6);
106 EXPECT_NEAR(0, fittedLine->
tangential().
y(), 1e-6);
107 EXPECT_NEAR(0, fittedLine->
support().
x(), 1e-6);
108 EXPECT_NEAR(1, fittedLine->
support().
y(), 1e-6);
109 EXPECT_NEAR(0.06, fittedLine.
chi2(), 1e-6);
static double fit(const CDCFacet &facet, int nSteps=100)
Fits a proper line to facet and returns the chi2.
const Vector2D & support() const
Gives the support vector of the line.
const Vector2D & tangential() const
Gives the tangential vector of the line.
static PlainMatrix< T, M, N > Constant(T t)
Construct a matrix with all elements set to a constant.
static PlainMatrix< T, M, N > Zero()
Construct a matrix initialized with zeros.
A parameter line including including an line covariance matrix which is interpreted as located in the...
const LineCovariance & lineCovariance() const
Getter for the whole covariance matrix of the line parameters.
double chi2() const
Getter for the chi square value of the line fit.
double x() const
Getter for the x coordinate.
double y() const
Getter for the y coordinate.
Abstract base class for different kinds of events.