Belle II Software  release-08-01-10
MultiHoughSpaceFastInterceptFinder.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #include <tracking/vxdHoughTracking/findlets/MultiHoughSpaceFastInterceptFinder.h>
9 #include <tracking/vxdHoughTracking/entities/VXDHoughState.h>
10 #include <tracking/spacePointCreation/SpacePoint.h>
11 #include <tracking/spacePointCreation/SpacePointTrackCand.h>
12 #include <tracking/trackFindingCDC/utilities/StringManipulation.h>
13 #include <tracking/trackFindingCDC/utilities/Algorithms.h>
14 #include <vxd/dataobjects/VxdID.h>
15 #include <framework/core/ModuleParamList.h>
16 #include <framework/core/ModuleParamList.templateDetails.h>
17 
18 using namespace Belle2;
19 using namespace TrackFindingCDC;
20 using namespace vxdHoughTracking;
21 
22 MultiHoughSpaceFastInterceptFinder::MultiHoughSpaceFastInterceptFinder() : Super()
23 {
25 }
26 
27 void MultiHoughSpaceFastInterceptFinder::exposeParameters(ModuleParamList* moduleParamList, const std::string& prefix)
28 {
29  Super::exposeParameters(moduleParamList, prefix);
30 
31  moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "maximumRecursionLevel"), m_maxRecursionLevel,
32  "Maximum recursion level for the fast Hough trafo algorithm.", m_maxRecursionLevel);
33 
34  moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "nAngleSectors"), m_nAngleSectors,
35  "Number of angle sectors (= x-axis) dividing the Hough space.", m_nAngleSectors);
36 
37  moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "nVerticalSectors"), m_nVerticalSectors,
38  "Number of vertical sectors (= y-axis) dividing the Hough space.", m_nVerticalSectors);
39 
40  moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "verticalHoughSpaceSize"), m_verticalHoughSpaceSize,
41  "Vertical size of the Hough space.", m_verticalHoughSpaceSize);
42 
43  moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "HoughSpaceMinimumX"), m_minimumX,
44  "Minimum x value of the Hough space.", m_minimumX);
45 
46  moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "HoughSpaceMaximumX"), m_maximumX,
47  "Maximum x value of the Hough space.", m_maximumX);
48 
49  moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "minimumHSClusterSize"), m_MinimumHSClusterSize,
50  "Maximum x value of the Hough space.", m_MinimumHSClusterSize);
51 
52  moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "maximumHSClusterSize"), m_MaximumHSClusterSize,
53  "Maximum x value of the Hough space.", m_MaximumHSClusterSize);
54 
55  moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "maximumHSClusterSizeX"), m_MaximumHSClusterSizeX,
56  "Maximum x value of the Hough space.", m_MaximumHSClusterSizeX);
57 
58  moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "maximumHSClusterSizeY"), m_MaximumHSClusterSizeY,
59  "Maximum x value of the Hough space.", m_MaximumHSClusterSizeY);
60 
61 }
62 
64 {
66 
67  m_maxRecursionLevel = ceil(log2(std::max(m_nAngleSectors, m_nVerticalSectors))) - 1;
68  if (m_maxRecursionLevel > 14) {
69  B2ERROR("The maximum number of recursions (maximumRecursionLevel) must not be larger than 14, but it is " <<
71  ", please choose a smaller value for maximumRecursionLevel, and / or for nAngleSectors and / or nVerticalSectors.");
72  }
74  for (uint i = 0; i < m_nAngleSectors; i++) {
75  double x = m_minimumX + m_unitX * (double)i;
76  double xc = x + 0.5 * m_unitX;
77 
78  m_HSXLUT[i] = x;
79  m_HSSinValuesLUT[i] = sin(x);
80  m_HSCosValuesLUT[i] = cos(x);
81  m_HSCenterSinValuesLUT[i] = sin(xc);
82  m_HSCenterCosValuesLUT[i] = cos(xc);
83  m_HSXCenterLUT[i] = xc;
84  }
88 
90  for (uint i = 0; i <= m_nVerticalSectors; i++) {
93  }
94  B2DEBUG(29, "HS size x: " << (m_maximumX - m_minimumX) << " HS size y: " << m_verticalHoughSpaceSize <<
95  " unitX: " << m_unitX << " unitY: " << m_unitY);
96 
98 
99 }
100 
101 
102 void MultiHoughSpaceFastInterceptFinder::apply(std::vector<VXDHoughState>& hits,
103  std::vector<std::vector<VXDHoughState*>>& rawTrackCandidates)
104 {
105  m_trackCandidates.clear();
106 
107  for (auto& friends : m_fullFriendMap) {
108  m_activeSectors.clear();
109  m_currentSensorsHitList.clear();
110 
111  m_HitSelector.apply(hits, friends.second, m_currentSensorsHitList);
112 
114 
116  }
117 
118  for (auto& trackCand : m_trackCandidates) {
119  // sort for layer, and 2D radius in case of same layer before storing as SpacePointTrackCand
120  // outer hit goes first, as later on tracks are build from outside to inside
121  std::sort(trackCand.begin(), trackCand.end(),
122  [](const VXDHoughState * a, const VXDHoughState * b) {
123  return
124  (a->getDataCache().layer > b->getDataCache().layer) or
125  (a->getDataCache().layer == b->getDataCache().layer
126  and a->getHit()->getPosition().Perp() > b->getHit()->getPosition().Perp());
127  });
128 
129  rawTrackCandidates.emplace_back(trackCand);
130  }
131 
132  B2DEBUG(29, "m_trackCandidates.size: " << m_trackCandidates.size());
133 
134 }
135 
137 {
138  const std::vector<VxdID> friends6XX1 = {VxdID(3, 0, 1), VxdID(3, 0, 2), VxdID(4, 0, 1), VxdID(4, 0, 2), VxdID(5, 0, 1), VxdID(5, 0, 2), VxdID(5, 0, 3), VxdID(6, 0, 2), VxdID(6, 0, 3)};
139  const std::vector<VxdID> friends6XX5 = {VxdID(3, 0, 2), VxdID(4, 0, 2), VxdID(4, 0, 3), VxdID(5, 0, 3), VxdID(5, 0, 4), VxdID(6, 0, 3), VxdID(6, 0, 4)};
140 
141  friendSensorMap thetaFriends;
142  thetaFriends.insert(std::make_pair(VxdID(6, 0, 1), friends6XX1));
143  thetaFriends.insert(std::make_pair(VxdID(6, 0, 5), friends6XX5));
144 
145  const std::vector<VxdID> friends601X = {VxdID(3, 1, 0), VxdID(3, 6, 0), VxdID(3, 7, 0), VxdID(4, 1, 0), VxdID(4, 2, 0), VxdID(4, 10, 0), VxdID(5, 1, 0), VxdID(5, 2, 0), VxdID(5, 12, 0), VxdID(6, 1, 0)};
146  const std::vector<VxdID> friends602X = {VxdID(3, 1, 0), VxdID(3, 2, 0), VxdID(3, 7, 0), VxdID(4, 1, 0), VxdID(4, 2, 0), VxdID(4, 10, 0), VxdID(5, 1, 0), VxdID(5, 2, 0), VxdID(5, 3, 0), VxdID(6, 2, 0)};
147  const std::vector<VxdID> friends603X = {VxdID(3, 1, 0), VxdID(3, 2, 0), VxdID(3, 7, 0), VxdID(4, 1, 0), VxdID(4, 2, 0), VxdID(4, 3, 0), VxdID(5, 2, 0), VxdID(5, 3, 0), VxdID(6, 3, 0)};
148  const std::vector<VxdID> friends604X = {VxdID(3, 1, 0), VxdID(3, 2, 0), VxdID(4, 2, 0), VxdID(4, 3, 0), VxdID(5, 3, 0), VxdID(5, 4, 0), VxdID(6, 4, 0)};
149  const std::vector<VxdID> friends605X = {VxdID(3, 1, 0), VxdID(3, 2, 0), VxdID(3, 3, 0), VxdID(4, 2, 0), VxdID(4, 3, 0), VxdID(4, 4, 0), VxdID(5, 3, 0), VxdID(5, 4, 0), VxdID(5, 5, 0), VxdID(6, 5, 0)};
150  const std::vector<VxdID> friends606X = {VxdID(3, 2, 0), VxdID(3, 3, 0), VxdID(4, 3, 0), VxdID(4, 4, 0), VxdID(4, 5, 0), VxdID(5, 4, 0), VxdID(5, 5, 0), VxdID(5, 6, 0), VxdID(6, 6, 0)};
151  const std::vector<VxdID> friends607X = {VxdID(3, 2, 0), VxdID(3, 3, 0), VxdID(3, 4, 0), VxdID(4, 4, 0), VxdID(4, 5, 0), VxdID(5, 5, 0), VxdID(5, 6, 0), VxdID(6, 7, 0)};
152  const std::vector<VxdID> friends608X = {VxdID(3, 2, 0), VxdID(3, 3, 0), VxdID(3, 4, 0), VxdID(4, 4, 0), VxdID(4, 5, 0), VxdID(4, 6, 0), VxdID(5, 6, 0), VxdID(5, 7, 0), VxdID(6, 8, 0)};
153  const std::vector<VxdID> friends609X = {VxdID(3, 3, 0), VxdID(3, 4, 0), VxdID(3, 5, 0), VxdID(4, 5, 0), VxdID(4, 6, 0), VxdID(4, 7, 0), VxdID(5, 6, 0), VxdID(5, 7, 0), VxdID(5, 8, 0), VxdID(6, 9, 0)};
154  const std::vector<VxdID> friends610X = {VxdID(3, 3, 0), VxdID(3, 4, 0), VxdID(3, 5, 0), VxdID(4, 5, 0), VxdID(4, 6, 0), VxdID(4, 7, 0), VxdID(5, 7, 0), VxdID(5, 8, 0), VxdID(5, 9, 0), VxdID(6, 10, 0)};
155  const std::vector<VxdID> friends611X = {VxdID(3, 4, 0), VxdID(3, 5, 0), VxdID(4, 6, 0), VxdID(4, 7, 0), VxdID(4, 8, 0), VxdID(5, 8, 0), VxdID(5, 9, 0), VxdID(6, 11, 0)};
156  const std::vector<VxdID> friends612X = {VxdID(3, 4, 0), VxdID(3, 5, 0), VxdID(3, 6, 0), VxdID(4, 7, 0), VxdID(4, 8, 0), VxdID(5, 9, 0), VxdID(5, 10, 0), VxdID(6, 12, 0)};
157  const std::vector<VxdID> friends613X = {VxdID(3, 5, 0), VxdID(3, 6, 0), VxdID(4, 7, 0), VxdID(4, 8, 0), VxdID(4, 9, 0), VxdID(5, 9, 0), VxdID(5, 10, 0), VxdID(5, 11, 0), VxdID(6, 13, 0)};
158  const std::vector<VxdID> friends614X = {VxdID(3, 5, 0), VxdID(3, 6, 0), VxdID(3, 7, 0), VxdID(4, 8, 0), VxdID(4, 9, 0), VxdID(4, 10, 0), VxdID(5, 10, 0), VxdID(5, 11, 0), VxdID(5, 12, 0), VxdID(6, 14, 0)};
159  const std::vector<VxdID> friends615X = {VxdID(3, 6, 0), VxdID(3, 7, 0), VxdID(4, 9, 0), VxdID(4, 10, 0), VxdID(5, 11, 0), VxdID(5, 12, 0), VxdID(6, 15, 0)};
160  const std::vector<VxdID> friends616X = {VxdID(3, 1, 0), VxdID(3, 7, 0), VxdID(4, 1, 0), VxdID(4, 9, 0), VxdID(4, 10, 0), VxdID(5, 1, 0), VxdID(5, 12, 0), VxdID(6, 16, 0)};
161 
162  friendSensorMap phiFriends;
163  phiFriends.insert(std::make_pair(VxdID(6, 1, 0), friends601X));
164  phiFriends.insert(std::make_pair(VxdID(6, 2, 0), friends602X));
165  phiFriends.insert(std::make_pair(VxdID(6, 3, 0), friends603X));
166  phiFriends.insert(std::make_pair(VxdID(6, 4, 0), friends604X));
167  phiFriends.insert(std::make_pair(VxdID(6, 5, 0), friends605X));
168  phiFriends.insert(std::make_pair(VxdID(6, 6, 0), friends606X));
169  phiFriends.insert(std::make_pair(VxdID(6, 7, 0), friends607X));
170  phiFriends.insert(std::make_pair(VxdID(6, 8, 0), friends608X));
171  phiFriends.insert(std::make_pair(VxdID(6, 9, 0), friends609X));
172  phiFriends.insert(std::make_pair(VxdID(6, 10, 0), friends610X));
173  phiFriends.insert(std::make_pair(VxdID(6, 11, 0), friends611X));
174  phiFriends.insert(std::make_pair(VxdID(6, 12, 0), friends612X));
175  phiFriends.insert(std::make_pair(VxdID(6, 13, 0), friends613X));
176  phiFriends.insert(std::make_pair(VxdID(6, 14, 0), friends614X));
177  phiFriends.insert(std::make_pair(VxdID(6, 15, 0), friends615X));
178  phiFriends.insert(std::make_pair(VxdID(6, 16, 0), friends616X));
179 
180  std::vector<VxdID> friendSensors;
181 
182  // loop over all phiFriends containing layer 6 ladders
183  for (auto& phiFriendPair : phiFriends) {
184  // get the according vector friends6XX0 for this phiFriendPair
185  std::vector<VxdID> phiFriendLadders = phiFriendPair.second;
186  unsigned short layer6Ladder = phiFriendPair.first.getLadderNumber();
187  // loop over all thetafriends containing layer 6 sensors
188  for (auto& thetaFriendPair : thetaFriends) {
189  friendSensors.clear();
190  // get the according vector friends600Y
191  std::vector<VxdID> thetaFriendSensors = thetaFriendPair.second;
192  unsigned short layer6Sensor = thetaFriendPair.first.getSensorNumber();
193 
194  // loop over all the layers/ladders in this phifriends vector, one specific friends6XX0
195  for (auto& phiFriend : phiFriendLadders) {
196  // loop over all sensor number in the different layers 3-5, one specific friends600Y
197  for (auto& thetaFriend : thetaFriendSensors) {
198  if (phiFriend.getLayerNumber() == thetaFriend.getLayerNumber()) {
199  // get layer number of either phiFriend or thetaFriend, ladder number from phiFriend, and the sensor number from the thetaFriend
200  friendSensors.emplace_back(VxdID(phiFriend.getLayerNumber(), phiFriend.getLadderNumber(), thetaFriend.getSensorNumber()));
201  }
202  }
203  }
204  // add the layer 6 sensor to the list of its own friends to check the vector with std::find in fillThisSensorsHitMap
205  friendSensors.emplace_back(VxdID(6, layer6Ladder, layer6Sensor));
206  m_fullFriendMap.insert(std::make_pair(VxdID(6, layer6Ladder, layer6Sensor), friendSensors));
207  }
208  }
209 }
210 
211 
212 void MultiHoughSpaceFastInterceptFinder::fastInterceptFinder2d(const std::vector<VXDHoughState*>& hits, uint xmin, uint xmax,
213  uint ymin,
214  uint ymax, uint currentRecursion)
215 {
216  std::vector<VXDHoughState*> containedHits;
217  containedHits.reserve(hits.size());
218  std::bitset<8> layerHits; /* For layer filter */
219 
220  if (currentRecursion == m_maxRecursionLevel + 1) return;
221 
222  // these int-divisions can cause {min, center} or {center, max} to be the same, which is a desired behaviour
223  const uint centerx = xmin + (uint)((xmax - xmin) / 2);
224  const uint centery = ymin + (uint)((ymax - ymin) / 2);
225  const uint xIndexCache[3] = {xmin, centerx, xmax};
226  const uint yIndexCache[3] = {ymin, centery, ymax};
227 
228  for (int i = 0; i < 2 ; ++i) {
229  const uint left = xIndexCache[i];
230  const uint right = xIndexCache[i + 1];
231  const uint localIndexX = left;
232 
233  if (left == right) continue;
234 
235  const double& sinLeft = m_HSSinValuesLUT[left];
236  const double& cosLeft = m_HSCosValuesLUT[left];
237  const double& sinRight = m_HSSinValuesLUT[right];
238  const double& cosRight = m_HSCosValuesLUT[right];
239 
240  // the sin and cos of the current center can't be stored in a LUT, as the number of possible centers
241  // is quite large and the logic would become rather complex
242  const double sinCenter = m_HSCenterSinValuesLUT[(left + right) / 2];
243  const double cosCenter = m_HSCenterCosValuesLUT[(left + right) / 2];
244 
245  for (int j = 0; j < 2; ++j) {
246  const uint lowerIndex = yIndexCache[j];
247  const uint upperIndex = yIndexCache[j + 1];
248 
249  if (lowerIndex == upperIndex) continue;
250 
251  const uint localIndexY = lowerIndex;
252  const double& localUpperCoordinate = m_HSYLUT[lowerIndex];
253  const double& localLowerCoordinate = m_HSYLUT[upperIndex];
254 
255  // reset layerHits and containedHits
256  layerHits = 0;
257  containedHits.clear();
258  for (VXDHoughState* hit : hits) {
259 
260  const VXDHoughState::DataCache& hitData = hit->getDataCache();
261  const double& m = hitData.xConformal;
262  const double& a = hitData.yConformal;
263 
264  const double derivativeyLeft = m * -sinLeft + a * cosLeft;
265  const double derivativeyRight = m * -sinRight + a * cosRight;
266  const double derivativeyCenter = m * -sinCenter + a * cosCenter;
267 
268  // Only interested in the rising arm of the sinosoidal curves.
269  // Thus if derivative on both sides of the cell is negative, ignore and continue.
270  if (derivativeyLeft < 0 and derivativeyRight < 0 and derivativeyCenter < 0) continue;
271 
272  const double yLeft = m * cosLeft + a * sinLeft;
273  const double yRight = m * cosRight + a * sinRight;
274  const double yCenter = m * cosCenter + a * sinCenter;
275 
276  /* Check if HS-parameter curve is inside (or outside) actual sub-HS */
277  if ((yLeft <= localUpperCoordinate and yRight >= localLowerCoordinate) or
278  (yCenter <= localUpperCoordinate and yLeft >= localLowerCoordinate and yRight >= localLowerCoordinate) or
279  (yCenter >= localLowerCoordinate and yLeft <= localUpperCoordinate and yRight <= localUpperCoordinate)) {
280  layerHits[hitData.layer] = true;
281  containedHits.emplace_back(hit);
282  }
283  }
284 
285  if (layerFilter(layerHits) > 0) {
286  // recursive call of fastInterceptFinder2d, until currentRecursion == m_maxRecursionLevel
287  if (currentRecursion < m_maxRecursionLevel) {
288  fastInterceptFinder2d(containedHits, left, right, lowerIndex, upperIndex, currentRecursion + 1);
289  } else {
290  m_activeSectors.insert({std::make_pair(localIndexX, localIndexY), std::make_pair(-layerFilter(layerHits), containedHits) });
291  }
292  }
293  }
294  }
295 }
296 
297 
299 {
300  m_clusterCount = 1;
301 
302  for (auto& currentCell : m_activeSectors) {
303 
304  // cell content meanings:
305  // -3, -4 : active sector, not yet visited
306  // 0 : non-active sector (will never be visited, only checked)
307  // 1,2,3...: index of the clusters
308  if (currentCell.second.first > -1) continue;
309 
310  m_clusterInitialPosition = std::make_pair(currentCell.first.first, currentCell.first.second);
311  m_clusterSize = 1;
312  currentCell.second.first = m_clusterCount;
313 
314  m_currentTrackCandidate.clear();
315  for (VXDHoughState* hit : currentCell.second.second) {
316  m_currentTrackCandidate.emplace_back(hit);
317  }
318 
319  // Check for HS sectors connected to each other which could form a cluster
320  DepthFirstSearch(currentCell.first.first, currentCell.first.second);
321  // if cluster valid (i.e. not too small and not too big): finalize!
323 
325  m_currentTrackCandidate.clear();
326  }
327  m_clusterCount++;
328  }
329 }
330 
331 void MultiHoughSpaceFastInterceptFinder::DepthFirstSearch(uint lastIndexX, uint lastIndexY)
332 {
333  if (m_clusterSize >= m_MaximumHSClusterSize) return;
334 
335  for (uint currentIndexY = lastIndexY; currentIndexY >= lastIndexY - 1; currentIndexY--) {
336  if (abs((int)m_clusterInitialPosition.second - (int)currentIndexY) >= m_MaximumHSClusterSizeY or
337  m_clusterSize >= m_MaximumHSClusterSize or currentIndexY > m_nVerticalSectors) return;
338  for (uint currentIndexX = lastIndexX; currentIndexX <= lastIndexX + 1; currentIndexX++) {
339  if (abs((int)m_clusterInitialPosition.first - (int)currentIndexX) >= m_MaximumHSClusterSizeX or
340  m_clusterSize >= m_MaximumHSClusterSize or currentIndexX > m_nAngleSectors) return;
341 
342  // The cell (currentIndexX, currentIndexY) is the current one has already been checked, so continue
343  if (lastIndexX == currentIndexX && lastIndexY == currentIndexY) continue;
344 
345  // first check bounds to avoid out-of-bound array access
346  // as they are uints, they are always >= 0, and in case of an overflow they would be too large
347  if (currentIndexX < m_nAngleSectors and currentIndexY < m_nVerticalSectors) {
348 
349  auto activeSector = m_activeSectors.find({currentIndexX, currentIndexY});
350  // Only continue searching if the current cluster is smaller than the maximum cluster size
351  if (activeSector != m_activeSectors.end() and activeSector->second.first < 0 /*and m_clusterSize < m_MaximumHSClusterSize*/) {
352  activeSector->second.first = m_clusterCount;
353  m_clusterSize++;
354 
355  // No need to check whether currentIndex exists as a key in m_activeSectors as they were created at the same time
356  // so it's certain the key exists.
357  for (VXDHoughState* hit : activeSector->second.second) {
358  if (not TrackFindingCDC::is_in(hit, m_currentTrackCandidate)) {
359  m_currentTrackCandidate.emplace_back(hit);
360  }
361  }
362  // search in the next Hough Space cells...
363  DepthFirstSearch(currentIndexX, currentIndexY);
364  }
365  }
366  }
367  }
368 }
The Module parameter list class.
void initialize() override
Receive and dispatch signal before the start of the event processing.
void addProcessingSignalListener(ProcessingSignalListener *psl)
Register a processing signal listener to be notified.
virtual void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix)
Forward prefixed parameters of this findlet to the module parameter list.
Definition: Findlet.h:69
Interface for an algorithm part that needs to receive the module processing signals.
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33
baseType getLadderNumber() const
Get the ladder id.
Definition: VxdID.h:98
void apply(std::vector< VXDHoughState > &hits, const std::vector< VxdID > &friendSensorList, std::vector< VXDHoughState * > &selectedHits) override
Load the hits in a sensor friend list for a given L6 sensor from hits and store them in selectedHits,...
Definition: HitSelector.h:33
std::array< double, 16384 > m_HSCenterSinValuesLUT
sine values of the Hough Space sector center coordinates
uint m_nVerticalSectors
number of sectors of the Hough Space on the vertical axis
std::vector< VXDHoughState * > m_currentSensorsHitList
hits that are in the acceptance region (= on friend sensors) for the current L6 senosr
uint m_MinimumHSClusterSize
minimum cluster size of sectors belonging to intercepts in the Hough Space
std::map< VxdID, std::vector< VxdID > > friendSensorMap
Map that contains the "friend" sensors for each SVD L6 sensor.
std::array< double, 16384 > m_HSYCenterLUT
y values of the Hough Space sector centers
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
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
HitSelector m_HitSelector
Use the friend map to just fill the hits in the acceptance region of the current L6 sensor into the m...
std::array< double, 16385 > m_HSXLUT
x values of the Hough Space sector boarders
double m_minimumX
minimum x value of the Hough Space, defaults to the value for u-side
std::vector< std::vector< VXDHoughState * > > m_trackCandidates
vector containing track candidates, consisting of the found intersection values in the Hough Space
double m_verticalHoughSpaceSize
vertical size of the Hough Space, defaults to the value for u-side
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 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
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 assinged to a g...
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...
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 f...
std::vector< VXDHoughState * > m_currentTrackCandidate
the current track candidate
void initializeSectorFriendMap()
fill the map of friend sensors for each L6 sensor to
double m_maximumX
maximum x value of the Hough Space, defaults to the value for u-side
uint m_MaximumHSClusterSizeY
maximum cluster size in y of sectors belonging to intercepts in the Hough Space
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the parameters of the sub findlets.
uint m_MaximumHSClusterSize
maximum cluster size of sectors belonging to intercepts in the Hough Space
std::array< double, 16385 > m_HSCosValuesLUT
cosine values of the Hough Space sector boarder coordinates
std::array< double, 16384 > m_HSXCenterLUT
x values of the Hough Space sector centers
friendSensorMap m_fullFriendMap
friendMap for all the SVD L6 sensors
uint m_maxRecursionLevel
maximum number of recursive calls of fastInterceptFinder2d
Simple container for hit information to be used during intercept finding.
Definition: VXDHoughState.h:24
void addParameter(const std::string &name, T &paramVariable, 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.
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