8#include <tracking/vxdHoughTracking/findlets/TrackCandidateResultRefiner.h>
9#include <framework/core/ModuleParamList.h>
10#include <framework/geometry/BFieldManager.h>
11#include <tracking/spacePointCreation/SpacePointTrackCand.h>
12#include <tracking/trackFindingVXD/trackQualityEstimators/QualityEstimatorCircleFit.h>
13#include <tracking/trackFindingVXD/trackQualityEstimators/QualityEstimatorMC.h>
14#include <tracking/trackFindingVXD/trackQualityEstimators/QualityEstimatorRiemannHelixFit.h>
15#include <tracking/trackFindingVXD/trackQualityEstimators/QualityEstimatorTripletFit.h>
16#include <tracking/trackingUtilities/utilities/StringManipulation.h>
17#include <tracking/dbobjects/SVDHoughParameters.h>
20using namespace TrackingUtilities;
21using namespace vxdHoughTracking;
35 m_overlapResolver.exposeParameters(moduleParamList, TrackingUtilities::prefixed(prefix,
"refinerOverlapResolver"));
38 "Identifier which estimation method to use. Valid identifiers are: [mcInfo, circleFit, tripletFit, helixFit]",
41 "Only required for MCInfo method. Name of StoreArray containing MCRecoTracks.",
44 "Only required for MCInfo method. If false combining several MCTracks is allowed.",
48 "Cut on quality indicator value for track candidates of size 3. Only accept SpacePointTrackCands with QI above this value.",
51 "Cut on quality indicator value for track candidates of size 4. Only accept SpacePointTrackCands with QI above this value.",
54 "Cut on quality indicator value for track candidates of size 5. Only accept SpacePointTrackCands with QI above this value.",
58 "Maximum number of SpacePointTrackCands with a length of 3, 4, 5, or 6 each.",
72 m_estimator = std::make_unique<QualityEstimatorTripletFit>();
74 m_estimator = std::make_unique<QualityEstimatorCircleFit>();
76 m_estimator = std::make_unique<QualityEstimatorRiemannHelixFit>();
94 B2FATAL(
"SVDHough - TrackCandidateResultRefiner: SVDHoughParameter dbobject not found, using default parameters.");
104 std::vector<SpacePointTrackCand>& refinedResults)
106 refinedResults.clear();
107 std::vector<SpacePointTrackCand> selectedResults;
108 selectedResults.reserve(unrefinedResults.size());
111 double qi =
m_estimator->estimateQuality(aTrackCandidate.getSortedHits());
112 aTrackCandidate.setQualityIndicator(qi);
119 (aTrackCandidate.getNHits() >= 6)) {
120 selectedResults.emplace_back(aTrackCandidate);
125 if (selectedResults.size() <= 1) {
126 std::swap(selectedResults, refinedResults);
131 std::sort(selectedResults.begin(), selectedResults.end(),
133 return ((a.getNHits() > b.getNHits()) or
134 (a.getNHits() == b.getNHits() and a.getQualityIndicator() > b.getQualityIndicator()));
137 std::array<uint, 8> numberOfHitsInCheckedSPTCs{{0, 0, 0, 0, 0, 0, 0, 0}};
138 refinedResults.reserve(selectedResults.size());
139 for (
auto& currentSPTC : selectedResults) {
141 numberOfHitsInCheckedSPTCs[currentSPTC.size()] += 1;
142 refinedResults.emplace_back(currentSPTC);
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.
Storage for (VXD) SpacePoint-based track candidates.
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
Accessor to arrays stored in the data store.
void initialize() override
void addProcessingSignalListener(ProcessingSignalListener *psl)
virtual void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix)
static const double T
[tesla]
double m_minQualitiyIndicatorSize4
Cut on the quality estimator and only further propagate SPTCs with four hits that are above this valu...
bool m_MCStrictQualityEstimator
Only required for MCInfo method.
void initialize() override
Create the store arrays.
TrackingUtilities::Findlet< SpacePointTrackCand, SpacePointTrackCand > Super
Parent class.
DBObjPtr< SVDHoughParameters > m_SVDHoughParameters
DB object containing the SVDHough parameters.
std::string m_EstimationMethod
Identifier which estimation method to use.
uint m_maxNumberOfEachPathLength
Accept nHits for each size at maximum.
double m_minQualitiyIndicatorSize3
Cut on the quality estimator and only further propagate SPTCs with three hits that are above this val...
~TrackCandidateResultRefiner()
Default destructor.
void apply(std::vector< SpacePointTrackCand > &unrefinedResults, std::vector< SpacePointTrackCand > &refinedResults) override
Reject bad SpacePointTrackCands and bad hits inside the remaining.
void beginRun() override
Check dbobject validity.
TrackCandidateOverlapResolver m_overlapResolver
Resolve hit overlaps in track candidates.
std::string m_MCRecoTracksStoreArrayName
sets the name of the expected StoreArray containing MCRecoTracks. Only required for MCInfo method
std::unique_ptr< QualityEstimatorBase > m_estimator
pointer to the selected QualityEstimator
double m_minQualitiyIndicatorSize5
Cut on the quality estimator and only further propagate SPTCs with five hits that are above this valu...
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the parameters of the sub findlets.
TrackCandidateResultRefiner()
Find intercepts in the 2D Hough space.
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.