10#include <tracking/ckf/svd/filters/relations/LayerSVDRelationFilter.dcl.h>
11#include <tracking/trackFindingCDC/filters/base/RelationFilter.icc.h>
13#include <tracking/trackFindingCDC/utilities/StringManipulation.h>
15#include <tracking/spacePointCreation/SpacePoint.h>
16#include <framework/core/ModuleParamList.templateDetails.h>
17#include <vxd/geometry/GeoCache.h>
25 template <
class AFilter,
class APrefilter>
32 template <
class AFilter,
class APrefilter>
40 for (
const auto& layerVXDID : layers) {
41 m_maximalLadderCache[layerVXDID.getLayerNumber()] = geoCache.getLadders(layerVXDID).size();
45 template <
class AFilter,
class APrefilter>
48 template <
class AFilter,
class APrefilter>
49 std::vector<CKFToSVDState*>
51 const std::vector<CKFToSVDState*>& states)
const
53 std::vector<CKFToSVDState*> possibleNextStates;
54 possibleNextStates.reserve(states.size());
56 const CKFToSVDState::stateCache& currentStateCache = currentState->
getStateCache();
57 const unsigned int currentLayer = currentStateCache.geoLayer;
58 const unsigned int nextPossibleLayer = std::max(
static_cast<int>(currentLayer) - 1 - m_param_hitJumping, 0);
61 if (currentState == nextState) {
65 const CKFToSVDState::stateCache& nextStateCache = nextState->getStateCache();
66 const unsigned int nextLayer = nextStateCache.geoLayer;
68 if (std::max(currentLayer, nextPossibleLayer) >= nextLayer and nextLayer >= std::min(currentLayer, nextPossibleLayer)) {
70 if (currentLayer == nextLayer) {
73 const unsigned int fromLadderNumber = currentStateCache.ladder;
74 const unsigned int maximumLadderNumber = m_maximalLadderCache.find(currentLayer)->second;
81 const int direction = -1;
82 const unsigned int overlappingLadder =
83 ((fromLadderNumber + maximumLadderNumber - 1) + direction) % maximumLadderNumber + 1;
85 if (nextStateCache.ladder != overlappingLadder) {
98 if (currentStateCache.localNormalizedu > 0.2f) {
102 if (nextStateCache.localNormalizedu <= 0.8f) {
108 TrackFindingCDC::Weight weight = m_prefilter(std::make_pair(currentState, nextState));
109 if (std::isnan(weight)) {
114 possibleNextStates.push_back(nextState);
118 return possibleNextStates;
121 template <
class AFilter,
class APrefilter>
124 moduleParamList->
addParameter(TrackFindingCDC::prefixed(prefix,
"hitJumping"), m_param_hitJumping,
125 "Make it possible to jump over N layers.", m_param_hitJumping);
127 m_filter.exposeParameters(moduleParamList, prefix);
128 m_prefilter.exposeParameters(moduleParamList, TrackFindingCDC::prefixed(
"pre", prefix));
131 template <
class AFilter,
class APrefilter>
134 return m_filter(std::make_pair(&from, &to));
Specialized CKF State for extrapolating into the SVD.
const struct stateCache & getStateCache() const
Get the cached data of this state.
APrefilter m_prefilter
Loose pre-filter to reject possibleTos.
AFilter m_filter
Filter for rejecting the states.
The Module parameter list class.
void addProcessingSignalListener(ProcessingSignalListener *psl)
Register a processing signal listener to be notified.
static GeoCache & getInstance()
Return a reference to the singleton instance.
void addParameter(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.
void beginRun() final
Initialize the maximal ladder cache.
LayerSVDRelationFilter()
Add the filter as listener.
std::vector< CKFToSVDState * > getPossibleTos(CKFToSVDState *from, const std::vector< CKFToSVDState * > &states) const final
Return all states the given state is possible related to.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters of the filter.
~LayerSVDRelationFilter()
Default destructor.
TrackFindingCDC::Weight operator()(const CKFToSVDState &from, const CKFToSVDState &to) final
Give a final weight to the possibilities by asking the filter.
Abstract base class for different kinds of events.