8#include <tracking/trackFindingCDC/filters/facet/RealisticFacetFilter.h>
10#include <tracking/trackFindingCDC/eventdata/hits/CDCFacet.h>
12#include <tracking/trackFindingCDC/numerics/Quadratic.h>
14#include <tracking/trackFindingCDC/utilities/StringManipulation.h>
16#include <framework/core/ModuleParamList.templateDetails.h>
21using namespace TrackFindingCDC;
24 : m_param_phiPullCut(11)
29 : m_param_phiPullCut(phiPullCut)
34 const std::string& prefix)
37 moduleParamList->
addParameter(prefixed(prefix,
"phiPullCut"),
39 "Acceptable angle pull in the angle of adjacent tangents to the "
50 const double startDriftLengthStd =
sqrt(startDriftLengthVar);
54 const double middleDriftLengthStd =
sqrt(middleDriftLengthVar);
58 const double endDriftLengthStd =
sqrt(endDriftLengthVar);
68 const double startToMiddleLength = startToMiddleTangentialVector.
norm();
69 const double startToEndLength = startToEndTangentialVector.
norm();
70 const double middleToEndLength = middleToEndTangentialVector.
norm();
72 const double startCos = startToMiddleTangentialVector.
cosWith(startToEndTangentialVector);
73 const double middleCos = startToMiddleTangentialVector.
cosWith(middleToEndTangentialVector);
74 const double endCos = startToEndTangentialVector.
cosWith(middleToEndTangentialVector);
76 const double startPhi = acos(startCos);
77 const double middlePhi = acos(middleCos);
78 const double endPhi = acos(endCos);
80 const double startToMiddleSigmaPhi = startDriftLengthStd / startToMiddleLength;
81 const double startToEndSigmaPhi = startDriftLengthStd / startToEndLength;
83 const double middleToStartSigmaPhi = middleDriftLengthStd / startToMiddleLength;
84 const double middleToEndSigmaPhi = middleDriftLengthStd / middleToEndLength;
86 const double endToStartSigmaPhi = endDriftLengthStd / startToEndLength;
87 const double endToMiddleSigmaPhi = endDriftLengthStd / middleToEndLength;
89 const double startPhiSigma = hypot3(startToEndSigmaPhi - startToMiddleSigmaPhi,
90 middleToStartSigmaPhi,
93 const double middlePhiSigma = hypot3(startToMiddleSigmaPhi,
94 middleToStartSigmaPhi + middleToEndSigmaPhi,
97 const double endPhiSigma = hypot3(startToEndSigmaPhi,
99 endToStartSigmaPhi - endToMiddleSigmaPhi);
101 const double startPhiPull = startPhi / startPhiSigma;
102 const double middlePhiPull = middlePhi / middlePhiSigma;
103 const double endPhiPull = endPhi / endPhiSigma;
113 std::fmin(0.1, (startPhiPull + middlePhiPull + endPhiPull) /
m_param_phiPullCut / 1000);
117 return 3 - miniPenalty;
The Module parameter list class.
Class representing a triple of neighboring oriented wire with additional trajectory information.
void adjustFitLine() const
Adjusts the contained fit line to touch such that it touches the first and third hit.
ParameterLine2D getStartToEndLine() const
Getter for the tangential line from the first to the third hit.
ParameterLine2D getStartToMiddleLine() const
Getter for the tangential line from the first to the second hit.
ParameterLine2D getMiddleToEndLine() const
Getter for the tangential line from the second to the third hit.
CDCRLWireHit & getStartRLWireHit()
Getter for 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 getRefDriftLengthVariance() const
Getter for the variance of the drift length at the reference position of the wire.
virtual void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix)
Expose the set of parameters of the filter to the module parameter list.
A line with a support point and tangential vector.
const Vector2D & tangential() const
Gives the tangential vector of the line.
double m_param_phiPullCut
Memory for the pull cu.
Weight operator()(const CDCFacet &facet) final
Main filter method returning the weight of the facet Returns NAN if the cell shall be rejected.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the set of parameters of the filter to the module parameter list.
RealisticFacetFilter()
Constructor using default direction of flight deviation cut off.
A two dimensional vector which is equipped with functions for correct handling of orientation relate...
double cosWith(const Vector2D &rhs) const
double norm() const
Calculates the length of the vector.
void addParameter(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.
double sqrt(double a)
sqrt for double
Abstract base class for different kinds of events.