Belle II Software development
SingleHoughSpaceFastInterceptFinder Class Referenceabstract

Findlet for finding intersections of sinusoidal curves in the 2D Hough space by iteratively calling FastInterceptFinder2d. More...

#include <SingleHoughSpaceFastInterceptFinder.h>

Inheritance diagram for SingleHoughSpaceFastInterceptFinder:
Findlet< VXDHoughState, std::vector< VXDHoughState * > > CompositeProcessingSignalListener ProcessingSignalListener

Classes

struct  paircompare
 this sorting makes sure the clusters can be searched from bottom left of the HS to top right normally, a C++ array looks like a matrix: (0, 0 ) ... (maxX, 0 ) ... ... (0, maxY) ... (maxX, maxY) but for sorting we want it to be like regular coordinates (0, maxY) ... (maxX, maxY) ... ... (0, 0 ) ... (maxX, 0 ) By setting the offset to the maximum allowed number of cells (2^14) and simplifying (16384 - lhs.second) * 16384 + lhs.first < (16384 - rhs.second) * 16384 + rhs.first to (rhs.second - lhs.second) * 16384 < rhs.first - lhs.first we get the formula below More...
 

Public Types

using IOTypes = std::tuple< AIOTypes... >
 Types that should be served to apply on invocation.
 
using IOVectors = std::tuple< std::vector< AIOTypes >... >
 Vector types that should be served to apply on invocation.
 

Public Member Functions

 SingleHoughSpaceFastInterceptFinder ()
 Find intercepts in the 2D Hough space.
 
void exposeParameters (ModuleParamList *moduleParamList, const std::string &prefix) override
 Expose the parameters of the sub findlets.
 
void initialize () override
 Create the store arrays.
 
void apply (std::vector< VXDHoughState > &hits, std::vector< std::vector< VXDHoughState * > > &rawTrackCandidates) override
 Load in the prepared hits and create track candidates for further processing like hit filtering and fitting.
 
virtual std::string getDescription ()
 Brief description of the purpose of the concrete findlet.
 
virtual void apply (ToVector< AIOTypes > &... ioVectors)=0
 Main function executing the algorithm.
 
void beginRun () override
 Receive and dispatch signal for the beginning of a new run.
 
void beginEvent () override
 Receive and dispatch signal for the start of a new event.
 
void endRun () override
 Receive and dispatch signal for the end of the run.
 
void terminate () override
 Receive and dispatch Signal for termination of the event processing.
 

Protected Types

using ToVector = typename ToVectorImpl< T >::Type
 Short hand for ToRangeImpl.
 

Protected Member Functions

void addProcessingSignalListener (ProcessingSignalListener *psl)
 Register a processing signal listener to be notified.
 
int getNProcessingSignalListener ()
 Get the number of currently registered listeners.
 

Private Types

using Super = TrackFindingCDC::Findlet< VXDHoughState, std::vector< VXDHoughState * > >
 Parent class.
 

Private Member Functions

unsigned short layerFilter (const std::bitset< 8 > &layer)
 layer filter, checks if at least hits from 3 layers are in a set of hits
 
void fastInterceptFinder2d (const std::vector< VXDHoughState * > &hits, uint xmin, uint xmax, uint ymin, uint ymax, uint currentRecursion)
 find intercepts in the 2D Hough Space by recursively calling itself until no hits are assigned to a given Hough Space cell, or until the maximum number of recursions (m_maxRecursionLevel) is reached
 
void FindHoughSpaceCluster ()
 Find Hough Space clusters.
 
void DepthFirstSearch (uint lastIndexX, uint lastIndexY)
 Perform depth first search recursive algorithm to find clusters in the Hough Space.
 

Private Attributes

uint m_maxRecursionLevel = 9
 maximum number of recursive calls of FastInterceptFinder2d
 
uint m_nAngleSectors = 256
 number of sectors of the Hough Space on the horizontal axis
 
uint m_nVerticalSectors = 512
 number of sectors of the Hough Space on the vertical axis
 
double m_verticalHoughSpaceSize = 0.16
 vertical size of the Hough Space, defaults to the value for u-side
 
double m_minimumX = -3.168
 minimum x value of the Hough Space, defaults to the value for u-side
 
double m_maximumX = 3.168
 maximum x value of the Hough Space, defaults to the value for u-side
 
uint m_MinimumHSClusterSize = 1
 minimum cluster size of sectors belonging to intercepts in the Hough Space
 
uint m_MaximumHSClusterSize = 10
 maximum cluster size of sectors belonging to intercepts in the Hough Space
 
uint m_MaximumHSClusterSizeX = 2
 maximum cluster size in x of sectors belonging to intercepts in the Hough Space
 
uint m_MaximumHSClusterSizeY = 10
 maximum cluster size in y of sectors belonging to intercepts in the Hough Space
 
double m_unitX = 0
 HS unit size in x.
 
double m_unitY = 0
 HS unit size in y.
 
std::array< double, 16385 > m_HSSinValuesLUT = {0}
 Look-Up-Tables for values as cache to speed up calculation sine values of the Hough Space sector boarder coordinates.
 
std::array< double, 16385 > m_HSCosValuesLUT = {0}
 cosine values of the Hough Space sector boarder coordinates
 
std::array< double, 16384 > m_HSCenterSinValuesLUT = {0}
 sine values of the Hough Space sector center coordinates
 
std::array< double, 16384 > m_HSCenterCosValuesLUT = {0}
 cosine values of the Hough Space sector center coordinates
 
std::array< double, 16385 > m_HSYLUT = {0}
 y values of the Hough Space sector boarders
 
std::array< double, 16384 > m_HSYCenterLUT = {0}
 y values of the Hough Space sector centers
 
std::array< double, 16385 > m_HSXLUT = {0}
 x values of the Hough Space sector boarders
 
std::array< double, 16384 > m_HSXCenterLUT = {0}
 x values of the Hough Space sector centers
 
std::map< std::pair< uint, uint >, std::pair< int, std::vector< VXDHoughState * > >, paircomparem_activeSectors
 Map containing only active HS sectors, i.e.
 
uint m_clusterCount = 0
 count the clusters
 
uint m_clusterSize = 0
 size of the current cluster
 
std::pair< uint, uint > m_clusterInitialPosition = std::make_pair(0, 0)
 start cell of the recursive cluster finding in the Hough Space
 
std::pair< int, int > m_clusterCoG = std::make_pair(0, 0)
 center of gravity containing describing the current best track parameters in the Hough Space
 
std::vector< VXDHoughState * > m_currentTrackCandidate
 the current track candidate
 
std::vector< std::vector< VXDHoughState * > > m_trackCandidates
 vector containing track candidates, consisting of the found intersection values in the Hough Space
 
std::vector< ProcessingSignalListener * > m_subordinaryProcessingSignalListeners
 References to subordinary signal processing listener contained in this findlet.
 
bool m_initialized = false
 Flag to keep track whether initialization happened before.
 
bool m_terminated = false
 Flag to keep track whether termination happened before.
 
std::string m_initializedAs
 Name of the type during initialisation.
 

Detailed Description

Findlet for finding intersections of sinusoidal curves in the 2D Hough space by iteratively calling FastInterceptFinder2d.

The found track candidates are then clustered via a recursive search. Afterwards track candidates are formed and stored in the output vector.

Definition at line 31 of file SingleHoughSpaceFastInterceptFinder.h.

Member Typedef Documentation

◆ IOTypes

using IOTypes = std::tuple<AIOTypes...>
inherited

Types that should be served to apply on invocation.

Definition at line 30 of file Findlet.h.

◆ IOVectors

using IOVectors = std::tuple< std::vector<AIOTypes>... >
inherited

Vector types that should be served to apply on invocation.

Definition at line 53 of file Findlet.h.

◆ Super

using Super = TrackFindingCDC::Findlet<VXDHoughState, std::vector<VXDHoughState*> >
private

Parent class.

Definition at line 33 of file SingleHoughSpaceFastInterceptFinder.h.

◆ ToVector

using ToVector = typename ToVectorImpl<T>::Type
protectedinherited

Short hand for ToRangeImpl.

Definition at line 49 of file Findlet.h.

Constructor & Destructor Documentation

◆ SingleHoughSpaceFastInterceptFinder()

Find intercepts in the 2D Hough space.

Definition at line 22 of file SingleHoughSpaceFastInterceptFinder.cc.

22 : Super()
23{
24}
TrackFindingCDC::Findlet< VXDHoughState, std::vector< VXDHoughState * > > Super
Parent class.

Member Function Documentation

◆ addProcessingSignalListener()

void addProcessingSignalListener ( ProcessingSignalListener psl)
protectedinherited

Register a processing signal listener to be notified.

Definition at line 55 of file CompositeProcessingSignalListener.cc.

56{
58}
std::vector< ProcessingSignalListener * > m_subordinaryProcessingSignalListeners
References to subordinary signal processing listener contained in this findlet.

◆ apply()

void apply ( std::vector< VXDHoughState > &  hits,
std::vector< std::vector< VXDHoughState * > > &  rawTrackCandidates 
)
override

Load in the prepared hits and create track candidates for further processing like hit filtering and fitting.

Definition at line 98 of file SingleHoughSpaceFastInterceptFinder.cc.

100{
101 m_trackCandidates.clear();
102 m_activeSectors.clear();
103
104 const std::vector<VXDHoughState*> currentEventHitList = TrackFindingCDC::as_pointers<VXDHoughState>(hits);
105
106 fastInterceptFinder2d(currentEventHitList, 0, m_nAngleSectors, 0, m_nVerticalSectors, 0);
107
109
110 for (auto& trackCand : m_trackCandidates) {
111 // sort for layer, and 2D radius in case of same layer before storing as SpacePointTrackCand
112 // outer hit goes first, as later on tracks are build from outside to inside
113 std::sort(trackCand.begin(), trackCand.end(),
114 [](const VXDHoughState * a, const VXDHoughState * b) {
115 return
116 (a->getDataCache().layer > b->getDataCache().layer) or
117 (a->getDataCache().layer == b->getDataCache().layer
118 and a->getHit()->getPosition().Perp() > b->getHit()->getPosition().Perp());
119 });
120
121 rawTrackCandidates.emplace_back(trackCand);
122 }
123
124 B2DEBUG(29, "m_trackCandidates.size: " << m_trackCandidates.size());
125
126}
uint m_nVerticalSectors
number of sectors of the Hough Space on the vertical axis
std::map< std::pair< uint, uint >, std::pair< int, std::vector< VXDHoughState * > >, paircompare > m_activeSectors
Map containing only active HS sectors, i.e.
uint m_nAngleSectors
number of sectors of the Hough Space on the horizontal axis
std::vector< std::vector< VXDHoughState * > > m_trackCandidates
vector containing track candidates, consisting of the found intersection values in the Hough Space
void fastInterceptFinder2d(const std::vector< VXDHoughState * > &hits, uint xmin, uint xmax, uint ymin, uint ymax, uint currentRecursion)
find intercepts in the 2D Hough Space by recursively calling itself until no hits are assigned to a g...
Simple container for hit information to be used during intercept finding.
Definition: VXDHoughState.h:24

◆ beginEvent()

void beginEvent ( )
overridevirtualinherited

Receive and dispatch signal for the start of a new event.

Reimplemented from ProcessingSignalListener.

Reimplemented in SpacePointTagger< Belle2::CKFToPXDResult, Belle2::PXDCluster >, SpacePointTagger< Belle2::CKFToSVDResult, Belle2::SVDCluster >, BaseEventTimeExtractor< RecoTrack * >, BaseEventTimeExtractor< TrackFindingCDC::CDCWireHit & >, SharingHitsMatcher< Belle2::TrackFindingCDC::CDCTrack, Belle2::TrackFindingCDC::CDCSegment2D >, MCSymmetric< BaseAxialSegmentPairFilter >, MCSymmetric< BaseFacetFilter >, MCSymmetric< BaseFacetRelationFilter >, MCSymmetric< BaseSegmentPairFilter >, MCSymmetric< BaseSegmentPairRelationFilter >, MCSymmetric< BaseSegmentRelationFilter >, MCSymmetric< BaseSegmentTripleFilter >, MCSymmetric< BaseSegmentTripleRelationFilter >, MCSymmetric< BaseTrackRelationFilter >, StoreVectorSwapper< Belle2::TrackFindingCDC::CDCFacet >, StoreVectorSwapper< Belle2::TrackFindingCDC::CDCWireHit, true >, StoreVectorSwapper< Belle2::TrackFindingCDC::CDCSegment2D >, StoreVectorSwapper< Belle2::TrackFindingCDC::CDCTrack >, StoreVectorSwapper< Belle2::TrackFindingCDC::CDCSegmentPair >, StoreVectorSwapper< Belle2::TrackFindingCDC::CDCSegmentTriple >, RecoTrackStorer, ROIFinder, and SVDHoughTracking.

Definition at line 31 of file CompositeProcessingSignalListener.cc.

32{
35 psl->beginEvent();
36 }
37}
Interface for an algorithm part that needs to receive the module processing signals.
virtual void beginEvent()
Receive signal for the start of a new event.

◆ beginRun()

void beginRun ( )
overridevirtualinherited

Receive and dispatch signal for the beginning of a new run.

Reimplemented from ProcessingSignalListener.

Reimplemented in LayerRelationFilter< AFilter >, FourHitFilter, QualityIndicatorFilter, ThreeHitFilter, TwoHitVirtualIPFilter, TwoHitVirtualIPQIFilter, RecoTrackStorer, ROIFinder, SpacePointLoaderAndPreparer, and TrackCandidateResultRefiner.

Definition at line 23 of file CompositeProcessingSignalListener.cc.

24{
27 psl->beginRun();
28 }
29}
virtual void beginRun()
Receive signal for the beginning of a new run.

◆ DepthFirstSearch()

void DepthFirstSearch ( uint  lastIndexX,
uint  lastIndexY 
)
private

Perform depth first search recursive algorithm to find clusters in the Hough Space.

Parameters
lastIndexXx-index of the last cell checked
lastIndexYy-index of the last cell checked

Definition at line 248 of file SingleHoughSpaceFastInterceptFinder.cc.

249{
251
252 for (uint currentIndexY = lastIndexY; currentIndexY >= lastIndexY - 1; currentIndexY--) {
253 if (abs((int)m_clusterInitialPosition.second - (int)currentIndexY) >= m_MaximumHSClusterSizeY or
254 m_clusterSize >= m_MaximumHSClusterSize or currentIndexY > m_nVerticalSectors) return;
255 for (uint currentIndexX = lastIndexX; currentIndexX <= lastIndexX + 1; currentIndexX++) {
256 if (abs((int)m_clusterInitialPosition.first - (int)currentIndexX) >= m_MaximumHSClusterSizeX or
257 m_clusterSize >= m_MaximumHSClusterSize or currentIndexX > m_nAngleSectors) return;
258
259 // The cell (currentIndexX, currentIndexY) is the current one has already been checked, so continue
260 if (lastIndexX == currentIndexX && lastIndexY == currentIndexY) continue;
261
262 // first check bounds to avoid out-of-bound array access
263 // as they are uints, they are always >= 0, and in case of an overflow they would be too large
264 if (currentIndexX < m_nAngleSectors and currentIndexY < m_nVerticalSectors) {
265
266 auto activeSector = m_activeSectors.find({currentIndexX, currentIndexY});
267 // Only continue searching if the current cluster is smaller than the maximum cluster size
268 if (activeSector != m_activeSectors.end() and activeSector->second.first < 0 /*and m_clusterSize < m_MaximumHSClusterSize*/) {
269 activeSector->second.first = m_clusterCount;
271
272 // No need to check whether currentIndex exists as a key in m_activeSectors as they were created at the same time
273 // so it's certain the key exists.
274 for (VXDHoughState* hit : activeSector->second.second) {
275 if (not TrackFindingCDC::is_in(hit, m_currentTrackCandidate)) {
276 m_currentTrackCandidate.emplace_back(hit);
277 }
278 }
279
280 // search in the next Hough Space cells...
281 DepthFirstSearch(currentIndexX, currentIndexY);
282 }
283 }
284 }
285 }
286}
void DepthFirstSearch(uint lastIndexX, uint lastIndexY)
Perform depth first search recursive algorithm to find clusters in the Hough Space.
std::pair< uint, uint > m_clusterInitialPosition
start cell of the recursive cluster finding in the Hough Space
uint m_MaximumHSClusterSizeX
maximum cluster size in x of sectors belonging to intercepts in the Hough Space
std::vector< VXDHoughState * > m_currentTrackCandidate
the current track candidate
uint m_MaximumHSClusterSizeY
maximum cluster size in y of sectors belonging to intercepts in the Hough Space
uint m_MaximumHSClusterSize
maximum cluster size of sectors belonging to intercepts in the Hough Space

◆ endRun()

void endRun ( )
overridevirtualinherited

Receive and dispatch signal for the end of the run.

Reimplemented from ProcessingSignalListener.

Definition at line 39 of file CompositeProcessingSignalListener.cc.

40{
42 psl->endRun();
43 }
45}
virtual void endRun()
Receive signal for the end of the run.

◆ exposeParameters()

void exposeParameters ( ModuleParamList moduleParamList,
const std::string &  prefix 
)
overridevirtual

Expose the parameters of the sub findlets.

Reimplemented from Findlet< VXDHoughState, std::vector< VXDHoughState * > >.

Definition at line 26 of file SingleHoughSpaceFastInterceptFinder.cc.

27{
28 Super::exposeParameters(moduleParamList, prefix);
29
30 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "maximumRecursionLevel"), m_maxRecursionLevel,
31 "Maximum recursion level for the fast Hough trafo algorithm.", m_maxRecursionLevel);
32
33 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "nAngleSectors"), m_nAngleSectors,
34 "Number of angle sectors (= x-axis) dividing the Hough space.", m_nAngleSectors);
35
36 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "nVerticalSectors"), m_nVerticalSectors,
37 "Number of vertical sectors (= y-axis) dividing the Hough space.", m_nVerticalSectors);
38
39 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "verticalHoughSpaceSize"), m_verticalHoughSpaceSize,
40 "Vertical size of the Hough space.", m_verticalHoughSpaceSize);
41
42 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "HoughSpaceMinimumX"), m_minimumX,
43 "Minimum x value of the Hough space.", m_minimumX);
44
45 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "HoughSpaceMaximumX"), m_maximumX,
46 "Maximum x value of the Hough space.", m_maximumX);
47
48 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "minimumHSClusterSize"), m_MinimumHSClusterSize,
49 "Maximum x value of the Hough space.", m_MinimumHSClusterSize);
50
51 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "maximumHSClusterSize"), m_MaximumHSClusterSize,
52 "Maximum x value of the Hough space.", m_MaximumHSClusterSize);
53
54 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "maximumHSClusterSizeX"), m_MaximumHSClusterSizeX,
55 "Maximum x value of the Hough space.", m_MaximumHSClusterSizeX);
56
57 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "maximumHSClusterSizeY"), m_MaximumHSClusterSizeY,
58 "Maximum x value of the Hough space.", m_MaximumHSClusterSizeY);
59
60}
virtual void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix)
Forward prefixed parameters of this findlet to the module parameter list.
Definition: Findlet.h:69
uint m_MinimumHSClusterSize
minimum cluster size of sectors belonging to intercepts in the Hough Space
double m_minimumX
minimum x value of the Hough Space, defaults to the value for u-side
double m_verticalHoughSpaceSize
vertical size of the Hough Space, defaults to the value for u-side
double m_maximumX
maximum x value of the Hough Space, defaults to the value for u-side
uint m_maxRecursionLevel
maximum number of recursive calls of FastInterceptFinder2d
void addParameter(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.

◆ fastInterceptFinder2d()

void fastInterceptFinder2d ( const std::vector< VXDHoughState * > &  hits,
uint  xmin,
uint  xmax,
uint  ymin,
uint  ymax,
uint  currentRecursion 
)
private

find intercepts in the 2D Hough Space by recursively calling itself until no hits are assigned to a given Hough Space cell, or until the maximum number of recursions (m_maxRecursionLevel) is reached

Parameters
hitsvector containing the hits that are used for track finding
xminminimum x-index of the sub-Hough Space in the current recursion step
xmaxmaximum x-index of the sub-Hough Space in the current recursion step
yminminimum y-index of the sub-Hough Space in the current recursion step
ymaxmaximum y-index of the sub-Hough Space in the current recursion step
currentRecursioncurrent recursion step, has to be < m_maxRecursionLevel

Definition at line 129 of file SingleHoughSpaceFastInterceptFinder.cc.

132{
133 std::vector<VXDHoughState*> containedHits;
134 containedHits.reserve(hits.size());
135 std::bitset<8> layerHits; /* For layer filter */
136
137 if (currentRecursion == m_maxRecursionLevel + 1) return;
138
139 // these int-divisions can cause {min, center} or {center, max} to be the same, which is a desired behaviour
140 const uint centerx = xmin + (uint)((xmax - xmin) / 2);
141 const uint centery = ymin + (uint)((ymax - ymin) / 2);
142 const uint xIndexCache[3] = {xmin, centerx, xmax};
143 const uint yIndexCache[3] = {ymin, centery, ymax};
144
145 for (int i = 0; i < 2 ; ++i) {
146 const uint left = xIndexCache[i];
147 const uint right = xIndexCache[i + 1];
148 const uint localIndexX = left;
149
150 if (left == right) continue;
151
152 const double& sinLeft = m_HSSinValuesLUT[left];
153 const double& cosLeft = m_HSCosValuesLUT[left];
154 const double& sinRight = m_HSSinValuesLUT[right];
155 const double& cosRight = m_HSCosValuesLUT[right];
156
157 // the sin and cos of the current center can't be stored in a LUT, as the number of possible centers
158 // is quite large and the logic would become rather complex
159 const double sinCenter = m_HSCenterSinValuesLUT[(left + right) / 2];
160 const double cosCenter = m_HSCenterCosValuesLUT[(left + right) / 2];
161
162 for (int j = 0; j < 2; ++j) {
163 const uint lowerIndex = yIndexCache[j];
164 const uint upperIndex = yIndexCache[j + 1];
165
166 if (lowerIndex == upperIndex) continue;
167
168 const uint localIndexY = lowerIndex;
169 const double& localUpperCoordinate = m_HSYLUT[lowerIndex];
170 const double& localLowerCoordinate = m_HSYLUT[upperIndex];
171
172 // reset layerHits and containedHits
173 layerHits = 0;
174 containedHits.clear();
175 for (VXDHoughState* hit : hits) {
176
177 const VXDHoughState::DataCache& hitData = hit->getDataCache();
178 const double& m = hitData.xConformal;
179 const double& a = hitData.yConformal;
180
181 const double derivativeyLeft = m * -sinLeft + a * cosLeft;
182 const double derivativeyRight = m * -sinRight + a * cosRight;
183 const double derivativeyCenter = m * -sinCenter + a * cosCenter;
184
185 // Only interested in the rising arm of the sinosoidal curves.
186 // Thus if derivative on both sides of the cell is negative, ignore and continue.
187 if (derivativeyLeft < 0 and derivativeyRight < 0 and derivativeyCenter < 0) continue;
188
189 const double yLeft = m * cosLeft + a * sinLeft;
190 const double yRight = m * cosRight + a * sinRight;
191 const double yCenter = m * cosCenter + a * sinCenter;
192
193 /* Check if HS-parameter curve is inside (or outside) actual sub-HS */
194 if ((yLeft <= localUpperCoordinate and yRight >= localLowerCoordinate) or
195 (yCenter <= localUpperCoordinate and yLeft >= localLowerCoordinate and yRight >= localLowerCoordinate) or
196 (yCenter >= localLowerCoordinate and yLeft <= localUpperCoordinate and yRight <= localUpperCoordinate)) {
197 layerHits[hitData.layer] = true;
198 containedHits.emplace_back(hit);
199 }
200 }
201
202 if (layerFilter(layerHits) > 0) {
203 // recursive call of fastInterceptFinder2d, until currentRecursion == m_maxRecursionLevel
204 if (currentRecursion < m_maxRecursionLevel) {
205 fastInterceptFinder2d(containedHits, left, right, lowerIndex, upperIndex, currentRecursion + 1);
206 } else {
207 m_activeSectors.insert({std::make_pair(localIndexX, localIndexY), std::make_pair(-layerFilter(layerHits), containedHits) });
208 }
209 }
210 }
211 }
212}
std::array< double, 16384 > m_HSCenterSinValuesLUT
sine values of the Hough Space sector center coordinates
std::array< double, 16385 > m_HSYLUT
y values of the Hough Space sector boarders
std::array< double, 16384 > m_HSCenterCosValuesLUT
cosine values of the Hough Space sector center coordinates
unsigned short layerFilter(const std::bitset< 8 > &layer)
layer filter, checks if at least hits from 3 layers are in a set of hits
std::array< double, 16385 > m_HSSinValuesLUT
Look-Up-Tables for values as cache to speed up calculation sine values of the Hough Space sector boar...
std::array< double, 16385 > m_HSCosValuesLUT
cosine values of the Hough Space sector boarder coordinates
Cache containing the most important information of this state which will often be needed.
Definition: VXDHoughState.h:70
float yConformal
conformal transformed y coordinate of this hit
Definition: VXDHoughState.h:80
unsigned short layer
Geometrical Layer this state is based on.
Definition: VXDHoughState.h:96
float xConformal
conformal transformed x coordinate of this hit
Definition: VXDHoughState.h:78

◆ FindHoughSpaceCluster()

void FindHoughSpaceCluster ( )
private

Find Hough Space clusters.

Loop over all found sectors in m_SectorArray and then calls the DepthFirstSearch function to recursively find the clusters

Definition at line 215 of file SingleHoughSpaceFastInterceptFinder.cc.

216{
217 m_clusterCount = 1;
218
219 for (auto& currentCell : m_activeSectors) {
220
221 // cell content meanings:
222 // -3, -4 : active sector, not yet visited
223 // 0 : non-active sector (will never be visited, only checked)
224 // 1,2,3...: index of the clusters
225 if (currentCell.second.first > -1) continue;
226
227 m_clusterInitialPosition = std::make_pair(currentCell.first.first, currentCell.first.second);
228 m_clusterSize = 1;
229 currentCell.second.first = m_clusterCount;
230
232 for (VXDHoughState* hit : currentCell.second.second) {
233 m_currentTrackCandidate.emplace_back(hit);
234 }
235
236 // Check for HS sectors connected to each other which could form a cluster
237 DepthFirstSearch(currentCell.first.first, currentCell.first.second);
238 // if cluster valid (i.e. not too small and not too big): finalize!
240
243 }
245 }
246}

◆ getDescription()

virtual std::string getDescription ( )
inlinevirtualinherited

Brief description of the purpose of the concrete findlet.

Definition at line 60 of file Findlet.h.

61 {
62 return "(no description)";
63 }

◆ getNProcessingSignalListener()

int getNProcessingSignalListener ( )
protectedinherited

Get the number of currently registered listeners.

Definition at line 60 of file CompositeProcessingSignalListener.cc.

61{
63}

◆ initialize()

void initialize ( )
overridevirtual

Create the store arrays.

Reimplemented from CompositeProcessingSignalListener.

Definition at line 62 of file SingleHoughSpaceFastInterceptFinder.cc.

63{
65
66 m_maxRecursionLevel = ceil(log2(std::max(m_nAngleSectors, m_nVerticalSectors))) - 1;
67 if (m_maxRecursionLevel > 14) {
68 B2ERROR("The maximum number of recursions (maximumRecursionLevel) must not be larger than 14, but it is " <<
70 ", please choose a smaller value for maximumRecursionLevel, and / or for nAngleSectors and / or nVerticalSectors.");
71 }
73 for (uint i = 0; i < m_nAngleSectors; i++) {
74 double x = m_minimumX + m_unitX * (double)i;
75 double xc = x + 0.5 * m_unitX;
76
77 m_HSXLUT[i] = x;
78 m_HSSinValuesLUT[i] = sin(x);
79 m_HSCosValuesLUT[i] = cos(x);
80 m_HSCenterSinValuesLUT[i] = sin(xc);
81 m_HSCenterCosValuesLUT[i] = cos(xc);
82 m_HSXCenterLUT[i] = xc;
83 }
87
89 for (uint i = 0; i <= m_nVerticalSectors; i++) {
92 }
93 B2DEBUG(29, "HS size x: " << (m_maximumX - m_minimumX) << " HS size y: " << m_verticalHoughSpaceSize <<
94 " unitX: " << m_unitX << " unitY: " << m_unitY);
95}
void initialize() override
Receive and dispatch signal before the start of the event processing.
std::array< double, 16384 > m_HSYCenterLUT
y values of the Hough Space sector centers
std::array< double, 16385 > m_HSXLUT
x values of the Hough Space sector boarders
std::array< double, 16384 > m_HSXCenterLUT
x values of the Hough Space sector centers

◆ layerFilter()

unsigned short layerFilter ( const std::bitset< 8 > &  layer)
inlineprivate

layer filter, checks if at least hits from 3 layers are in a set of hits

Parameters
layerbitset containing information whether there as a hit in a layer

Definition at line 52 of file SingleHoughSpaceFastInterceptFinder.h.

53 {
54 uint layercount = layer.count();
55 return (layercount >= 3 ? layercount : 0);
56 }

◆ terminate()

void terminate ( )
overridevirtualinherited

Receive and dispatch Signal for termination of the event processing.

Reimplemented from ProcessingSignalListener.

Reimplemented in StereoHitTrackQuadTreeMatcher< Belle2::TrackFindingCDC::HyperHough >, StereoHitTrackQuadTreeMatcher< Belle2::TrackFindingCDC::QuadraticLegendre >, and StereoHitTrackQuadTreeMatcher< Belle2::TrackFindingCDC::Z0TanLambdaLegendre >.

Definition at line 47 of file CompositeProcessingSignalListener.cc.

48{
50 psl->terminate();
51 }
53}
virtual void terminate()
Receive Signal for termination of the event processing.

Member Data Documentation

◆ m_activeSectors

std::map<std::pair<uint, uint>, std::pair<int, std::vector<VXDHoughState*> >, paircompare> m_activeSectors
private

Map containing only active HS sectors, i.e.

those with hits from enough layers contained in them. The keys are the indices of the HS cell, and the custom sort function above is used to sort the content. The value is a pair consisting of the (negative) number of layers hit in a given cell, and a vector containing the hit information of all hits that are contained in this cell. During cluster finding the first value of the value-pair will be assigned the current cluster number.

Definition at line 153 of file SingleHoughSpaceFastInterceptFinder.h.

◆ m_clusterCoG

std::pair<int, int> m_clusterCoG = std::make_pair(0, 0)
private

center of gravity containing describing the current best track parameters in the Hough Space

Definition at line 163 of file SingleHoughSpaceFastInterceptFinder.h.

◆ m_clusterCount

uint m_clusterCount = 0
private

count the clusters

Definition at line 156 of file SingleHoughSpaceFastInterceptFinder.h.

◆ m_clusterInitialPosition

std::pair<uint, uint> m_clusterInitialPosition = std::make_pair(0, 0)
private

start cell of the recursive cluster finding in the Hough Space

Definition at line 161 of file SingleHoughSpaceFastInterceptFinder.h.

◆ m_clusterSize

uint m_clusterSize = 0
private

size of the current cluster

Definition at line 158 of file SingleHoughSpaceFastInterceptFinder.h.

◆ m_currentTrackCandidate

std::vector<VXDHoughState*> m_currentTrackCandidate
private

the current track candidate

Definition at line 166 of file SingleHoughSpaceFastInterceptFinder.h.

◆ m_HSCenterCosValuesLUT

std::array<double, 16384> m_HSCenterCosValuesLUT = {0}
private

cosine values of the Hough Space sector center coordinates

Definition at line 119 of file SingleHoughSpaceFastInterceptFinder.h.

◆ m_HSCenterSinValuesLUT

std::array<double, 16384> m_HSCenterSinValuesLUT = {0}
private

sine values of the Hough Space sector center coordinates

Definition at line 117 of file SingleHoughSpaceFastInterceptFinder.h.

◆ m_HSCosValuesLUT

std::array<double, 16385> m_HSCosValuesLUT = {0}
private

cosine values of the Hough Space sector boarder coordinates

Definition at line 115 of file SingleHoughSpaceFastInterceptFinder.h.

◆ m_HSSinValuesLUT

std::array<double, 16385> m_HSSinValuesLUT = {0}
private

Look-Up-Tables for values as cache to speed up calculation sine values of the Hough Space sector boarder coordinates.

Definition at line 113 of file SingleHoughSpaceFastInterceptFinder.h.

◆ m_HSXCenterLUT

std::array<double, 16384> m_HSXCenterLUT = {0}
private

x values of the Hough Space sector centers

Definition at line 127 of file SingleHoughSpaceFastInterceptFinder.h.

◆ m_HSXLUT

std::array<double, 16385> m_HSXLUT = {0}
private

x values of the Hough Space sector boarders

Definition at line 125 of file SingleHoughSpaceFastInterceptFinder.h.

◆ m_HSYCenterLUT

std::array<double, 16384> m_HSYCenterLUT = {0}
private

y values of the Hough Space sector centers

Definition at line 123 of file SingleHoughSpaceFastInterceptFinder.h.

◆ m_HSYLUT

std::array<double, 16385> m_HSYLUT = {0}
private

y values of the Hough Space sector boarders

Definition at line 121 of file SingleHoughSpaceFastInterceptFinder.h.

◆ m_initialized

bool m_initialized = false
privateinherited

Flag to keep track whether initialization happened before.

Definition at line 52 of file ProcessingSignalListener.h.

◆ m_initializedAs

std::string m_initializedAs
privateinherited

Name of the type during initialisation.

Definition at line 58 of file ProcessingSignalListener.h.

◆ m_MaximumHSClusterSize

uint m_MaximumHSClusterSize = 10
private

maximum cluster size of sectors belonging to intercepts in the Hough Space

Definition at line 99 of file SingleHoughSpaceFastInterceptFinder.h.

◆ m_MaximumHSClusterSizeX

uint m_MaximumHSClusterSizeX = 2
private

maximum cluster size in x of sectors belonging to intercepts in the Hough Space

Definition at line 101 of file SingleHoughSpaceFastInterceptFinder.h.

◆ m_MaximumHSClusterSizeY

uint m_MaximumHSClusterSizeY = 10
private

maximum cluster size in y of sectors belonging to intercepts in the Hough Space

Definition at line 103 of file SingleHoughSpaceFastInterceptFinder.h.

◆ m_maximumX

double m_maximumX = 3.168
private

maximum x value of the Hough Space, defaults to the value for u-side

Definition at line 94 of file SingleHoughSpaceFastInterceptFinder.h.

◆ m_maxRecursionLevel

uint m_maxRecursionLevel = 9
private

maximum number of recursive calls of FastInterceptFinder2d

Definition at line 80 of file SingleHoughSpaceFastInterceptFinder.h.

◆ m_MinimumHSClusterSize

uint m_MinimumHSClusterSize = 1
private

minimum cluster size of sectors belonging to intercepts in the Hough Space

Definition at line 97 of file SingleHoughSpaceFastInterceptFinder.h.

◆ m_minimumX

double m_minimumX = -3.168
private

minimum x value of the Hough Space, defaults to the value for u-side

Definition at line 92 of file SingleHoughSpaceFastInterceptFinder.h.

◆ m_nAngleSectors

uint m_nAngleSectors = 256
private

number of sectors of the Hough Space on the horizontal axis

Definition at line 83 of file SingleHoughSpaceFastInterceptFinder.h.

◆ m_nVerticalSectors

uint m_nVerticalSectors = 512
private

number of sectors of the Hough Space on the vertical axis

Definition at line 86 of file SingleHoughSpaceFastInterceptFinder.h.

◆ m_subordinaryProcessingSignalListeners

std::vector<ProcessingSignalListener*> m_subordinaryProcessingSignalListeners
privateinherited

References to subordinary signal processing listener contained in this findlet.

Definition at line 52 of file CompositeProcessingSignalListener.h.

◆ m_terminated

bool m_terminated = false
privateinherited

Flag to keep track whether termination happened before.

Definition at line 55 of file ProcessingSignalListener.h.

◆ m_trackCandidates

std::vector<std::vector<VXDHoughState*> > m_trackCandidates
private

vector containing track candidates, consisting of the found intersection values in the Hough Space

Definition at line 169 of file SingleHoughSpaceFastInterceptFinder.h.

◆ m_unitX

double m_unitX = 0
private

HS unit size in x.

Definition at line 107 of file SingleHoughSpaceFastInterceptFinder.h.

◆ m_unitY

double m_unitY = 0
private

HS unit size in y.

Definition at line 109 of file SingleHoughSpaceFastInterceptFinder.h.

◆ m_verticalHoughSpaceSize

double m_verticalHoughSpaceSize = 0.16
private

vertical size of the Hough Space, defaults to the value for u-side

Definition at line 89 of file SingleHoughSpaceFastInterceptFinder.h.


The documentation for this class was generated from the following files: