8#include <tracking/trackFindingCDC/filters/facet/FitFacetVarSet.h>
10#include <tracking/trackFindingCDC/fitting/FacetFitter.h>
12#include <tracking/trackFindingCDC/eventdata/hits/CDCFacet.h>
13#include <tracking/trackFindingCDC/eventdata/hits/CDCWireHit.h>
15#include <tracking/trackFindingCDC/numerics/Quadratic.h>
18using namespace TrackFindingCDC;
22 if (not ptrFacet)
return false;
31 constexpr const int nSteps = 0;
34 const double s = fitLine->
lengthOnCurve(startWirePos2D, endWirePos2D);
37 var<
named(
"chi2_0_per_s")>() = chi2_0 / s;
39 var<
named(
"fit_0_phi0_sigma")>() = std::sqrt(fitLine.
variance(ELineParameter::c_Phi0));
44 constexpr const int nSteps = 1;
47 const double s = fitLine->
lengthOnCurve(startWirePos2D, endWirePos2D);
50 var<
named(
"chi2_1_per_s")>() = chi2_1 / s;
52 var<
named(
"fit_1_phi0_sigma")>() = std::sqrt(fitLine.
variance(ELineParameter::c_Phi0));
59 const double s = fitLine->
lengthOnCurve(startWirePos2D, endWirePos2D);
62 var<
named(
"chi2_per_s")>() = chi2 / s;
65 constexpr const double erfWidth = 120.0;
66 constexpr const double tanhWidth = 1.64 * erfWidth;
68 var<
named(
"erf")>() = std::erf(chi2 / erfWidth);
69 var<
named(
"tanh")>() = std::tanh(chi2 / tanhWidth);
71 var<
named(
"fit_phi0_sigma")>() = std::sqrt(fitLine.
variance(ELineParameter::c_Phi0));
81 const double startDistance = fitLine->
distance(startWirePos2D) - startL;
82 const double middleDistance = fitLine->
distance(middleWirePos2D) - middleL;
83 const double endDistance = fitLine->
distance(endWirePos2D) - endL;
85 var<
named(
"start_distance")>() = startDistance;
86 var<
named(
"middle_distance")>() = middleDistance;
87 var<
named(
"end_distance")>() = endDistance;
88 var<
named(
"d2")>() = square(startDistance) + square(middleDistance) + square(endDistance);
Class representing a triple of neighboring oriented wire with additional trajectory information.
const UncertainParameterLine2D & getFitLine() const
Getter for the contained line fit information.
const CDCWireHit & getMiddleWireHit() const
Getter for the hit wire of the second oriented wire hit.
CDCRLWireHit & getStartRLWireHit()
Getter for the first oriented wire hit.
const CDCWireHit & getEndWireHit() const
Getter for the hit wire of the third oriented wire hit.
const CDCWireHit & getStartWireHit() const
Getter for the hit wire of the first oriented wire hit.
CDCRLWireHit & getEndRLWireHit()
Getter for the third oriented wire hit.
CDCRLWireHit & getMiddleRLWireHit()
Getter for the second oriented wire hit.
Class representing an oriented hit wire including a hypotheses whether the causing track passes left ...
double getSignedRefDriftLength() const
Getter for the drift length at the reference position of the wire.
const Vector2D & getRefPos2D() const
The two dimensional reference position (z=0) of the underlying wire.
static double fit(const CDCFacet &facet, int nSteps=100)
Fits a proper line to facet and returns the chi2.
bool extract(const CDCFacet *ptrFacet) final
Generate and assign the contained variables.
double distance(const Vector2D &point) const
Gives the signed distance of a point to the line.
const Vector2D & tangential() const
Gives the tangential vector of the line.
double lengthOnCurve(const Vector2D &from, const Vector2D &to) const
Denotes the length on the line between the two points.
A parameter line including including an line covariance matrix which is interpreted as located in the...
double variance(const ELineParameter &i) const
Getter for individual diagonal elements of the covariance matrix.
static constexpr int named(const char *name)
Getter for the index from the name.
Float_t & var()
Reference getter for the value of the ith variable. Static version.
A two dimensional vector which is equipped with functions for correct handling of orientation relate...
double phi() const
Gives the azimuth angle being the angle to the x axes ( range -M_PI to M_PI )
Abstract base class for different kinds of events.