10#include <tracking/vxdHoughTracking/filters/relations/LayerRelationFilter.dcl.h>
11#include <tracking/trackFindingCDC/filters/base/RelationFilter.icc.h>
12#include <tracking/trackFindingCDC/utilities/StringManipulation.h>
13#include <tracking/spacePointCreation/SpacePoint.h>
14#include <framework/core/ModuleParamList.templateDetails.h>
15#include <vxd/geometry/GeoCache.h>
22 namespace vxdHoughTracking {
24 template <
class AFilter>
30 template <
class AFilter>
33 moduleParamList->
addParameter(TrackFindingCDC::prefixed(prefix,
"hitJumping"), m_hitJumping,
34 "Make it possible to jump over N layers.", m_hitJumping);
36 m_filter.exposeParameters(moduleParamList, prefix);
39 template <
class AFilter>
47 for (
const auto& layerVXDID : layers) {
48 m_maximalLadderCache[layerVXDID.getLayerNumber()] = geoCache.getLadders(layerVXDID).size();
52 template <
class AFilter>
55 template <
class AFilter>
56 std::vector<VXDHoughState*>
59 std::vector<VXDHoughState*> possibleNextHits;
60 possibleNextHits.reserve(hits.size());
63 const unsigned int currentLayer = currentVXDHoughState.
layer;
64 const unsigned int nextPossibleLayer = std::max(
static_cast<int>(currentLayer) - 1 - m_hitJumping, 0);
67 if (currentHit == nextHit) {
72 const unsigned int nextLayer = nextVXDHoughState.
layer;
74 if (std::max(currentLayer, nextPossibleLayer) >= nextLayer and nextLayer >= std::min(currentLayer, nextPossibleLayer)) {
76 if (currentLayer == nextLayer) {
79 const unsigned int fromLadderNumber = currentVXDHoughState.
ladder;
80 const unsigned int maximumLadderNumber = m_maximalLadderCache.at(currentLayer);
87 const int direction = -1;
88 const unsigned int overlappingLadder =
89 ((fromLadderNumber + maximumLadderNumber - 1) + direction) % maximumLadderNumber + 1;
91 if (nextVXDHoughState.
ladder != overlappingLadder) {
113 possibleNextHits.push_back(nextHit);
117 return possibleNextHits;
120 template <
class AFilter>
123 return m_filter(std::make_pair(&from, &to));
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.
TrackFindingCDC::Weight operator()(const VXDHoughState &from, const VXDHoughState &to) final
Get the weight of the relation between from and to.
void beginRun() final
Initialize the maximal ladder cache.
std::vector< VXDHoughState * > getPossibleTos(VXDHoughState *from, const std::vector< VXDHoughState * > &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.
LayerRelationFilter()
Add the filter as listener.
AFilter m_filter
Filter for rejecting the states.
~LayerRelationFilter()
Default destructor.
Simple container for hit information to be used during intercept finding.
const DataCache getDataCache() const
Get the cached data of this state.
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.
Cache containing the most important information of this state which will often be needed.
float localNormalizedu
Local normalized uCoordinate of this state, only set if based on SpacePoint.
unsigned short layer
Geometrical Layer this state is based on.
unsigned short ladder
Ladder this state is based on (only use for SpacePoint based states)