12 #include <tracking/ckf/svd/filters/relations/LayerSVDRelationFilter.dcl.h>
13 #include <tracking/trackFindingCDC/filters/base/RelationFilter.icc.h>
15 #include <tracking/trackFindingCDC/utilities/StringManipulation.h>
17 #include <tracking/spacePointCreation/SpacePoint.h>
18 #include <framework/core/ModuleParamList.templateDetails.h>
19 #include <vxd/geometry/GeoCache.h>
27 template <
class AFilter,
class APrefilter>
34 template <
class AFilter,
class APrefilter>
41 const auto& layers = geoCache.getLayers(VXD::SensorInfoBase::SensorType::SVD);
42 for (
const auto& layerVXDID : layers) {
43 m_maximalLadderCache[layerVXDID.getLayerNumber()] = geoCache.getLadders(layerVXDID).size();
47 template <
class AFilter,
class APrefilter>
50 template <
class AFilter,
class APrefilter>
51 std::vector<CKFToSVDState*>
53 const std::vector<CKFToSVDState*>& states)
const
55 std::vector<CKFToSVDState*> possibleNextStates;
56 possibleNextStates.reserve(states.size());
58 const CKFToSVDState::stateCache& currentStateCache = currentState->getStateCache();
59 const unsigned int currentLayer = currentStateCache.geoLayer;
60 const unsigned int nextPossibleLayer = std::max(
static_cast<int>(currentLayer) - 1 - m_param_hitJumping, 0);
63 if (currentState == nextState) {
67 const CKFToSVDState::stateCache& nextStateCache = nextState->getStateCache();
68 const unsigned int nextLayer = nextStateCache.geoLayer;
70 if (std::max(currentLayer, nextPossibleLayer) >= nextLayer and nextLayer >= std::min(currentLayer, nextPossibleLayer)) {
72 if (currentLayer == nextLayer) {
75 const unsigned int fromLadderNumber = currentStateCache.ladder;
76 const unsigned int maximumLadderNumber = m_maximalLadderCache.find(currentLayer)->second;
83 const int direction = -1;
84 const unsigned int overlappingLadder =
85 ((fromLadderNumber + maximumLadderNumber - 1) + direction) % maximumLadderNumber + 1;
87 if (nextStateCache.ladder != overlappingLadder) {
100 if (currentStateCache.localNormalizedu > 0.2) {
104 if (nextStateCache.localNormalizedu <= 0.8) {
110 TrackFindingCDC::Weight weight = m_prefilter(std::make_pair(currentState, nextState));
111 if (std::isnan(weight)) {
116 possibleNextStates.push_back(nextState);
120 return possibleNextStates;
123 template <
class AFilter,
class APrefilter>
126 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix,
"hitJumping"), m_param_hitJumping,
127 "Make it possible to jump over N layers.", m_param_hitJumping);
129 m_filter.exposeParameters(moduleParamList, prefix);
130 m_prefilter.exposeParameters(moduleParamList, TrackFindingCDC::prefixed(
"pre", prefix));
133 template <
class AFilter,
class APrefilter>
136 return m_filter(std::make_pair(&from, &to));