8 #include <tracking/vxdHoughTracking/filters/pathFilters/QualityIndicatorFilter.h>
9 #include <tracking/trackFindingCDC/filters/base/Filter.icc.h>
10 #include <tracking/trackFindingVXD/trackQualityEstimators/QualityEstimatorCircleFit.h>
11 #include <tracking/trackFindingVXD/trackQualityEstimators/QualityEstimatorMC.h>
12 #include <tracking/trackFindingVXD/trackQualityEstimators/QualityEstimatorRiemannHelixFit.h>
13 #include <tracking/trackFindingVXD/trackQualityEstimators/QualityEstimatorTripletFit.h>
14 #include <tracking/trackFindingCDC/utilities/StringManipulation.h>
15 #include <framework/core/ModuleParamList.templateDetails.h>
16 #include <framework/geometry/BFieldManager.h>
19 using namespace TrackFindingCDC;
20 using namespace vxdHoughTracking;
22 void QualityIndicatorFilter::exposeParameters(
ModuleParamList* moduleParamList,
const std::string& prefix)
24 moduleParamList->
addParameter(TrackFindingCDC::prefixed(prefix,
"trackQualityEstimationMethod"), m_EstimationMethod,
25 "Identifier which estimation method to use. Valid identifiers are: [mcInfo, circleFit, tripletFit, helixFit]",
28 moduleParamList->
addParameter(TrackFindingCDC::prefixed(prefix,
"MCRecoTracksStoreArrayName"), m_MCRecoTracksStoreArrayName,
29 "Only required for MCInfo method. Name of StoreArray containing MCRecoTracks.",
30 m_MCRecoTracksStoreArrayName);
32 moduleParamList->
addParameter(TrackFindingCDC::prefixed(prefix,
"MCStrictQualityEstimator"), m_MCStrictQualityEstimator,
33 "Only required for MCInfo method. If false combining several MCTracks is allowed.",
34 m_MCStrictQualityEstimator);
36 moduleParamList->
addParameter(TrackFindingCDC::prefixed(prefix,
"QICut"), m_QIcut,
37 "Cut on the quality indicator. Only process QI values larger than this.", m_QIcut);
40 void QualityIndicatorFilter::beginRun()
43 m_estimator->setMagneticFieldStrength(bFieldZ);
45 if (m_EstimationMethod ==
"mcInfo") {
51 void QualityIndicatorFilter::initialize()
54 if (m_EstimationMethod ==
"mcInfo") {
56 mcRecoTracks.
isRequired(m_MCRecoTracksStoreArrayName);
57 m_estimator = std::make_unique<QualityEstimatorMC>(m_MCRecoTracksStoreArrayName, m_MCStrictQualityEstimator);
58 }
else if (m_EstimationMethod ==
"tripletFit") {
59 m_estimator = std::make_unique<QualityEstimatorTripletFit>();
60 }
else if (m_EstimationMethod ==
"circleFit") {
61 m_estimator = std::make_unique<QualityEstimatorCircleFit>();
62 }
else if (m_EstimationMethod ==
"helixFit") {
63 m_estimator = std::make_unique<QualityEstimatorRiemannHelixFit>();
65 B2ASSERT(
"QualityEstimator could not be initialized with method: " << m_EstimationMethod, m_estimator);
68 TrackFindingCDC::Weight
71 const std::vector<TrackFindingCDC::WithWeight<const VXDHoughState*>>& previousHits = pair.first;
73 std::vector<const SpacePoint*> spacePoints;
74 spacePoints.reserve(previousHits.size() + 1);
75 for (
auto& hit : previousHits) {
76 spacePoints.emplace_back(hit->getHit());
78 spacePoints.emplace_back(pair.second->getHit());
82 std::reverse(spacePoints.begin(), spacePoints.end());
84 const auto& estimatorResult = m_estimator->estimateQualityAndProperties(spacePoints);
86 if (estimatorResult.qualityIndicator < m_QIcut) {
90 return estimatorResult.qualityIndicator;
The Module parameter list class.
Class implementing the algorithm used for the MC based quality estimation.
void forceUpdateClusterNames()
Setter to force the class to update its cluster names.
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
AObject Object
Type of the object to be analysed.
static const double T
[tesla]
void addParameter(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.
static void getField(const double *pos, double *field)
return the magnetic field at a given position.
Abstract base class for different kinds of events.