8#include <tracking/trackFindingCDC/filters/facetRelation/Chi2FacetRelationFilter.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/geometry/UncertainParameterLine2D.h>
17#include <tracking/trackFindingCDC/utilities/StringManipulation.h>
19#include <framework/core/ModuleParamList.templateDetails.h>
22using namespace TrackFindingCDC;
26 : m_param_chi2CutByISuperLayer{89.0, 130.0, 130.0, 130.0, 130.0, 130.0, 130.0, 130.0, 130.0}
31 : m_param_chi2CutByISuperLayer{chi2Cut}
32 , m_param_penaltyFactor(penaltyWidth / chi2Cut)
37 const std::string& prefix)
41 moduleParamList->
addParameter(prefixed(prefix,
"chi2CutByISuperLayer"),
43 "Acceptable chi2 values by superlayer id",
46 moduleParamList->
addParameter(prefixed(prefix,
"penaltyFactor"),
48 "Factor for cut value to obtain the width used in translation from chi2 values to weight penalties",
66 B2ERROR(
"Expected chi2CutByISuperLayer to be of length 1 or "
78 constexpr const int nSteps = 0;
80 const double chi2 = fitLine.
chi2();
The Module parameter list class.
Class representing a triple of neighboring oriented wire with additional trajectory information.
ISuperLayer getISuperLayer() const
Getter for the common superlayer id of the pair.
const CDCWireHit & getStartWireHit() const
Getter for the hit wire of the first oriented wire hit.
const CDCWire & getEndWire() const
Getter for the wire the third oriented wire hit is based on.
bool isOnWire(const CDCWire &wire) const
Checks if the wire hit is based on the given wire.
std::array< double, ISuperLayerUtil::c_N > m_chi2CutByISuperLayer
Memory for the chi2 cut values distinguished by superlayer.
std::vector< double > m_param_chi2CutByISuperLayer
Parameter : The chi2 cut values distinguished by superlayer.
double m_param_penaltyFactor
Parameter : The chi2 cut values distinguished by superlayer.
void initialize() final
Initialise the parameter caches before the processing starts.
Chi2FacetRelationFilter()
Constructor with the default chi2 cut value and width parameter.
std::array< double, ISuperLayerUtil::c_N > m_penaltyWidthByISuperLayer
Memory for the chi2 cut values distinguished by superlayer.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the set of parameters of the filter to the module parameter list.
Weight operator()(const CDCFacet &fromFacet, const CDCFacet &toFacet) final
Main filter method returning the weight of the neighborhood relation.
void initialize() override
Receive and dispatch signal before the start of the event processing.
static double fit(const CDCFacet &facet, int nSteps=100)
Fits a proper line to facet and returns the chi2.
virtual void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix)
Expose the set of parameters of the filter to the module parameter list.
A parameter line including including an line covariance matrix which is interpreted as located in the...
double chi2() const
Getter for the chi square value of the line fit.
void addParameter(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.
Abstract base class for different kinds of events.
static const ISuperLayer c_N
Constant representing the total number of cdc superlayers.