ATLAS Offline Software
FPGATrackSimHoughTransformTool.cxx
Go to the documentation of this file.
1 // Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
21 
22 #include <sstream>
23 #include <cmath>
24 #include <algorithm>
25 
26 static inline int quant(double min, double max, unsigned nSteps, double val);
27 static inline double unquant(double min, double max, unsigned nSteps, int step);
28 template <typename T>
29 static inline std::string to_string(const std::vector<T> &v);
30 
32 // AthAlgTool
33 
34 FPGATrackSimHoughTransformTool::FPGATrackSimHoughTransformTool(const std::string& algname, const std::string &name, const IInterface *ifc) :
35  base_class(algname, name, ifc)
36 {
37  declareInterface<IFPGATrackSimRoadFinderTool>(this);
38 }
39 
40 
42 {
43 
44  // Move temp variables over from properties to struct
51 
52 
53  // Debug
54  ATH_MSG_INFO("Image size: " << m_imageSize_x << " x " << m_imageSize_y);
55  ATH_MSG_INFO("Convolution size: " << m_convSize_x << " x " << m_convSize_y);
56  ATH_MSG_INFO("Convolution: " << to_string(const_cast<std::vector<int>&>(m_conv.value())));
57  ATH_MSG_INFO("Hit Extend: " << to_string(const_cast<std::vector<unsigned>&>(m_hitExtend_x.value())));
58 
59  // Retrieve info
60  ATH_CHECK(m_FPGATrackSimBankSvc.retrieve());
61  ATH_CHECK(m_FPGATrackSimMapping.retrieve());
62  m_nLayers = m_FPGATrackSimMapping->PlaneMap_1st()->getNLogiLayers();
63 
64  // Error checking
65  // TODO check bounds are set correctly
66  bool ok = false;
68  ATH_MSG_FATAL("initialize() Image size must be greater than 0");
69  else if (m_conv.size() != m_convSize_x * m_convSize_y)
70  ATH_MSG_FATAL("initialize() Convolution sizes don't match");
71  else if (!m_conv.empty() && (m_convSize_x % 2 == 0 || m_convSize_y % 2 == 0))
72  ATH_MSG_FATAL("initialize() Convolution sizes must be odd");
73  else if (m_hitExtend_x.size() % m_nLayers)
74  ATH_MSG_FATAL("initialize() Hit extentsion list must have size % nLayers");
75  else if (!m_combineLayers.empty() && m_combineLayers.size() != m_nLayers)
76  ATH_MSG_FATAL("initialize() Combine layers list must have size = nLayers");
77  else if (m_threshold.size() % 2 != 1)
78  ATH_MSG_FATAL("initialize() Threshold size must be odd");
79  else if (!m_binScale.empty() && m_binScale.size() != m_nLayers)
80  ATH_MSG_FATAL("initialize() Bin scale list must have size = nLayers");
81  else if (std::any_of(m_binScale.begin(), m_binScale.end(), [&](unsigned i){ return m_imageSize_y % i != 0; }))
82  ATH_MSG_FATAL("initialize() The imagesize is not divisible by scale");
83  else
84  ok = true;
85  if (!ok) return StatusCode::FAILURE;
86 
87  // Warnings / corrections
89  {
90  ATH_MSG_WARNING("initialize() localMaxWindowSize requires tracing hits, turning on automatically");
91  m_traceHits = true;
92  }
93  if (m_idealGeoRoads)
94  {
95  if (m_useSectors)
96  {
97  ATH_MSG_WARNING("initialize() idealGeoRoads conflicts with useSectors, switching off FPGATrackSim sector matching");
98  m_useSectors = false;
99  }
100  if (!m_traceHits)
101  {
102  ATH_MSG_WARNING("initialize() idealGeoRoads requires tracing hits, turning on automatically");
103  m_traceHits = true;
104  }
105  }
106  if (m_binScale.empty()) m_binScale.value().resize(m_nLayers, 1);
107 
108  // Fill convenience variables
111  for (unsigned i = 0; i <= m_imageSize_x; i++)
112  m_bins_x.push_back(unquant(m_parMin[m_par_x], m_parMax[m_par_x], m_imageSize_x, i));
113  for (unsigned i = 0; i <= m_imageSize_y; i++)
114  m_bins_y.push_back(unquant(m_parMin[m_par_y], m_parMax[m_par_y], m_imageSize_y, i));
115 
116  // Initialize combine layers
117  if (!m_combineLayers.empty())
118  {
119  m_nCombineLayers = *std::max_element(m_combineLayers.begin(), m_combineLayers.end()) + 1;
121  for (unsigned i = 0; i < m_combineLayers.size(); i++)
122  m_combineLayer2D[m_combineLayers[i]].push_back(i);
123  }
124  else
125  {
127  for (unsigned i = 0; i < m_nLayers; i++)
128  m_combineLayer2D.push_back({ i });
129  }
130 
131  return StatusCode::SUCCESS;
132 }
133 
134 
135 
137 // Main Algorithm
138 
139 StatusCode FPGATrackSimHoughTransformTool::getRoads(const std::vector<const FPGATrackSimHit*> & hits, std::vector<FPGATrackSimRoad*> & roads)
140 {
141  roads.clear();
142  m_roads.clear();
143 
145  if (!m_conv.empty()) m_image = convolute(m_image);
146 
147  for (unsigned y = 0; y < m_imageSize_y; y++)
148  for (unsigned x = 0; x < m_imageSize_x; x++)
149  if (passThreshold(m_image, x, y)) {
150  if (m_traceHits)
151  addRoad(m_image(y, x).second, x, y);
152  else
153  addRoad(hits, x, y);
154  }
155 
156  roads.reserve(m_roads.size());
157  for (FPGATrackSimRoad & r : m_roads) roads.push_back(&r);
158 
159  return StatusCode::SUCCESS;
160 }
161 
162 FPGATrackSimHoughTransformTool::Image FPGATrackSimHoughTransformTool::createLayerImage(std::vector<unsigned> const & layers, std::vector<FPGATrackSimHit const *> const & hits, unsigned const scale) const
163 {
165 
166  for (FPGATrackSimHit const * hit : hits)
167  {
168  if (std::find(layers.begin(), layers.end(), hit->getLayer()) == layers.end()) continue;
169 
170  if (m_subRegion >= 0) {
171  // NOTE: uncomment middle piece if we port over 2nd stage functionality.
172  auto* subrmap = /*(m_2ndStage) ? m_FPGATrackSimMapping->SubRegionMap_2nd() :*/ m_FPGATrackSimMapping->SubRegionMap();
173  if (!(subrmap->isInRegion(m_subRegion, *hit))) {
174  continue;
175  }
176  }
177 
178  // This scans over y (pT) because that is more efficient in memory, in C.
179  // Unknown if firmware will want to scan over x instead.
180  unsigned new_size_y = m_imageSize_y / scale;
181  for (unsigned y_ = 0; y_ < new_size_y; y_++)
182  {
183  unsigned y_bin_min = scale * y_;
184  unsigned y_bin_max = scale * (y_ + 1);
185 
186  // Find the min/max x bins
187  auto xBins = yToXBins(y_bin_min, y_bin_max, hit);
188 
189  // Update the image
190  for (unsigned y = y_bin_min; y < y_bin_max; y++)
191  for (unsigned x = xBins.first; x < xBins.second; x++)
192  {
193  image(y, x).first++;
194  if (m_traceHits) image(y, x).second.insert(hit);
195  }
196  }
197  }
198 
199  return image;
200 }
201 
203 {
205 
206  for (unsigned i = 0; i < m_nCombineLayers; i++)
207  {
209  for (unsigned x = 0; x < m_imageSize_x; ++x)
210  for (unsigned y = 0; y < m_imageSize_y; ++y)
211  if (layerImage(y, x).first > 0)
212  {
213  image(y, x).first++;
214  image(y, x).second.insert(layerImage(y, x).second.begin(), layerImage(y, x).second.end());
215  }
216  }
217 
218  return image;
219 }
220 
222 {
224 
225  for (unsigned y0 = 0; y0 < m_imageSize_y; y0++) // Loop over out
226  for (unsigned x0 = 0; x0 < m_imageSize_x; x0++)
227  for (unsigned r = 0; r < m_convSize_y; r++) // Loop over conv
228  for (unsigned c = 0; c < m_convSize_x; c++) {
229  int y = -static_cast<int>(m_convSize_y) / 2 + r + y0; // Indices of input
230  int x = -static_cast<int>(m_convSize_x) / 2 + c + x0; //
231 
232  if (y >= 0 && y < static_cast<int>(m_imageSize_y) && x >= 0 && x < static_cast<int>(m_imageSize_x)) {
233  int val = m_conv[r * m_convSize_x + c] * image(y, x).first;
234  if (val > 0) {
235  out(y0, x0).first += val;
236  out(y0, x0).second.insert(image(y, x).second.begin(), image(y, x).second.end());
237  }
238  }
239  }
240  return out;
241 }
242 
243 bool FPGATrackSimHoughTransformTool::passThreshold(Image const & image, unsigned x, unsigned y) const
244 {
245  // Pass window threshold
246  unsigned width = m_threshold.size() / 2;
247  if (x < width || (image.size(1) - x) < width) return false;
248  for (unsigned i = 0; i < m_threshold.size(); i++) {
249  if (image(y, x - width + i).first < m_threshold[i]) return false;
250  }
251 
252  // Pass local-maximum check
253  if (m_localMaxWindowSize) {
254  for (int j = -m_localMaxWindowSize; j <= m_localMaxWindowSize; j++) {
255  for (int i = -m_localMaxWindowSize; i <= m_localMaxWindowSize; i++) {
256  if (i == 0 && j == 0) continue;
257  if (y + j < image.size(0) && x + i < image.size(1)) {
258  if (image(y+j, x+i).first > image(y, x).first) return false;
259  if (image(y+j, x+i).first == image(y, x).first) {
260  if (image(y+j, x+i).second.size() > image(y, x).second.size()) return false;
261  if (image(y+j, x+i).second.size() == image(y, x).second.size() && j <= 0 && i <= 0) return false; // favor bottom-left (low phi, low neg q/pt)
262  }
263  }
264  }
265  }
266  }
267  return true;
268 }
269 
271 // Helpers
272 
273 
274 // Quantizes val, given a range [min, max) split into nSteps. Returns the bin below.
275 static inline int quant(double min, double max, unsigned nSteps, double val)
276 {
277  return static_cast<int>((val - min) / (max - min) * nSteps);
278 }
279 
280 // Returns the lower bound of the bin specified by step
281 static inline double unquant(double min, double max, unsigned nSteps, int step)
282 {
283  return min + (max - min) * step / nSteps;
284 }
285 
286 template <typename T>
287 static inline std::string to_string(const std::vector<T> &v)
288 {
289  std::ostringstream oss;
290  oss << "[";
291  if (!v.empty())
292  {
293  std::copy(v.begin(), v.end()-1, std::ostream_iterator<T>(oss, ", "));
294  oss << v.back();
295  }
296  oss << "]";
297  return oss.str();
298 }
299 
300 
301 double FPGATrackSimHoughTransformTool::fieldCorrection(unsigned region, double qpt, double r)
302 {
303  r = r / 1000; // convert to meters
304  if (region == 3)
305  {
306  double cor = 0.1216 * r * r - 0.0533 * r + 0.0069;
307  return -cor * qpt;
308  }
309  else if (region == 4)
310  {
311  double cor = 0.4265 * r * r - 0.0662 * r + 0.0036;
312  return -cor * qpt;
313  }
314  else return 0;
315 }
316 
317 double FPGATrackSimHoughTransformTool::yToX(double y, FPGATrackSimHit const * hit) const
318 {
319  double x = 0;
320 
322  {
323  double r = hit->getR(); // mm
324  double phi_hit = hit->getGPhi(); // radians
325  double d0 = std::isnan(m_parMin.d0) ? 0 : m_parMin.d0; // mm, assume min = max
326  x = asin(r * fpgatracksim::A * y - d0 / r) + phi_hit;
327 
328  if (m_fieldCorrection) x += fieldCorrection(m_EvtSel->getRegionID(), y, r);
329  }
330  else
331  {
332  ATH_MSG_ERROR("yToX() not defined for the current m_par selection");
333  }
334 
335  return x;
336 }
337 
338 // Find the min/max x bins of the hit's line, in each y bin. Max is exclusive.
339 // Note this assumes yToX is monotonic. Returns {0, 0} if hit lies out of bounds.
340 std::pair<unsigned, unsigned> FPGATrackSimHoughTransformTool::yToXBins(size_t yBin_min, size_t yBin_max, FPGATrackSimHit const * hit) const
341 {
342  // Get float values
343  double x_min = yToX(m_bins_y[yBin_min], hit);
344  double x_max = yToX(m_bins_y[yBin_max], hit);
345  if (x_min > x_max) std::swap(x_min, x_max);
346  if (x_max < m_parMin[m_par_x] || x_min > m_parMax[m_par_x])
347  return { 0, 0 }; // out of bounds
348 
349  // Get bins
350  int x_bin_min = quant(m_parMin[m_par_x], m_parMax[m_par_x], m_imageSize_x, x_min);
351  int x_bin_max = quant(m_parMin[m_par_x], m_parMax[m_par_x], m_imageSize_x, x_max) + 1; // exclusive
352 
353  // Extend bins
354  unsigned extend = getExtension(yBin_min, hit->getLayer());
355  x_bin_min -= extend;
356  x_bin_max += extend;
357 
358  // Clamp bins
359  if (x_bin_min < 0) x_bin_min = 0;
360  if (x_bin_max > static_cast<int>(m_imageSize_x)) x_bin_max = m_imageSize_x;
361 
362  return { x_bin_min, x_bin_max };
363 }
364 
365 // We allow variable extension based on the size of m_hitExtend_x. See comments below.
366 unsigned FPGATrackSimHoughTransformTool::getExtension(unsigned y, unsigned layer) const
367 {
368  if (m_hitExtend_x.size() == m_nLayers) return m_hitExtend_x[layer];
369  if (m_hitExtend_x.size() == m_nLayers * 2)
370  {
371  // different extension for low pt vs high pt, split in half but irrespective of sign
372  // first nLayers entries of m_hitExtend_x is for low pt half, rest are for high pt half
373  if (y < m_imageSize_y / 4 || y > 3 * m_imageSize_y / 4) return m_hitExtend_x[layer];
374  return m_hitExtend_x[m_nLayers + layer];
375  }
376  return 0;
377 }
378 
380 {
381 
382  // This logic is now identical between the 1D and 2D Hough tools. Perhaps it should
383  // be moved into the sector bank class?
384 
385  // We now look up the binning information in the sector bank.
386  const FPGATrackSimSectorBank* sectorbank = m_FPGATrackSimBankSvc->SectorBank_1st();
387 
388  // Look up q/pt (or |q/pt|) from the Hough road, convert to MeV.
389  double qoverpt = r.getY()*0.001;
390  if (sectorbank->isAbsQOverPtBinning()) {
391  qoverpt = abs(qoverpt);
392  }
393 
394  int sectorbin = 0;
395 
396  // Retrieve the bin boundaries from the sector bank; map this onto them.
397  std::vector<double> qoverpt_bins = sectorbank->getQOverPtBins();
398  auto bounds = std::equal_range(qoverpt_bins.begin(), qoverpt_bins.end(), qoverpt);
399 
400  sectorbin = fpgatracksim::QPT_SECTOR_OFFSET*(bounds.first - qoverpt_bins.begin() - 1);
401 
402  if (sectorbin < 0) sectorbin = 0;
403  if ((sectorbin / 10) > static_cast<int>(qoverpt_bins.size() - 2))sectorbin = 10*(qoverpt_bins.size() - 2);
404 
405  if (m_doRegionalMapping){
406  int subregion = r.getSubRegion();
407  sectorbin += subregion*fpgatracksim::SUBREGION_SECTOR_OFFSET;
408  }
409  std::vector<module_t> modules;
410  for (unsigned int il = 0; il < r.getNLayers(); il++) {
411  if (r.getNHits_layer()[il] == 0) {
412  modules.push_back(-1);
413 
414  layer_bitmask_t wc_layers = r.getWCLayers();
415  wc_layers |= (0x1 << il);
416  r.setWCLayers(wc_layers);
417 
418  FPGATrackSimHit *wcHit = new FPGATrackSimHit();
420  wcHit->setLayer(il);
421  wcHit->setDetType(m_FPGATrackSimMapping->PlaneMap_1st()->getDetType(il));
422  std::vector<const FPGATrackSimHit*> wcHits;
423  wcHits.push_back(wcHit);
424  r.setHits(il,wcHits);
425  }
426  else {
427  modules.push_back(sectorbin);
428  }
429  }
430 
431  // If we are using eta patterns. We need to first run the roads through the road filter.
432  // Then the filter will be responsible for setting the actual sector.
433  // As a hack, we can store the sector bin ID in the road for now.
434  // This is fragile! If we want to store a different ID for each layer, it will break.
435 
436  // Similarly, we do the same thing for spacepoints. this probably means we can't combine the two.
437  // maybe better to store the module array instead of just a number?
438 
439  r.setSectorBin(sectorbin);
441  r.setSector(sectorbank->findSector(modules));
442  }
443 }
444 
445 // Creates a road from hits that pass through the given bin (x, y), and pushes it onto m_roads
446 void FPGATrackSimHoughTransformTool::addRoad(std::vector<std::vector<const FPGATrackSimHit*>> const & hits, layer_bitmask_t hitLayers, unsigned x, unsigned y)
447 {
448  m_roads.emplace_back();
449  FPGATrackSimRoad & r = m_roads.back();
450 
451  r.setRoadID(m_roads.size() - 1);
452  r.setPID(y * m_imageSize_y + x);
453  r.setHits(hits);
454 
455  // We use the y coordinate in matchIdealGeoSectors
456  // and so it needs to be available before setting the sector.
457 
458  r.setSubRegion(m_subRegion);
459  r.setX(m_bins_x[x] + m_step_x/2);
460  r.setY(m_bins_y[y] + m_step_y/2);
461  r.setXBin(x);
462  r.setYBin(y);
463  r.setHitLayers(hitLayers);
464  r.setSubRegion(m_subRegion);
465 
466  if (m_useSectors) r.setSector(m_FPGATrackSimBankSvc->SectorBank_1st()->findSector(hits));
468 }
469 
470 
471 // Creates a road from hits that pass through the given bin (x, y), and pushes it onto m_roads
472 void FPGATrackSimHoughTransformTool::addRoad(std::unordered_set<const FPGATrackSimHit*> const & hits, unsigned x, unsigned y)
473 {
474  layer_bitmask_t hitLayers = 0;
475  for (FPGATrackSimHit const * hit : hits)
476  hitLayers |= 1 << hit->getLayer();
477 
478  auto sorted_hits = ::sortByLayer(hits);
479  sorted_hits.resize(m_nLayers); // If no hits in last layer, return from sortByLayer will be too short
480 
481  addRoad(sorted_hits, hitLayers, x, y);
482 }
483 
484 // Use this version of addRoad when hit tracing is turned off
485 void FPGATrackSimHoughTransformTool::addRoad(std::vector<const FPGATrackSimHit*> const & hits, unsigned x, unsigned y)
486 {
487  // Get the road hits
488  std::vector<FPGATrackSimHit const *> road_hits;
489  layer_bitmask_t hitLayers = 0;
490  for (const FPGATrackSimHit * hit : hits)
491  {
492  if (m_subRegion >= 0 && !m_FPGATrackSimMapping->SubRegionMap()->isInRegion(m_subRegion, *hit)) continue;
493 
494  // Find the min/max y bins (after scaling)
495  unsigned int y_bin_min = (y / m_binScale[hit->getLayer()]) * m_binScale[hit->getLayer()];
496  unsigned int y_bin_max = y_bin_min + m_binScale[hit->getLayer()];
497 
498  // Find the min/max x bins
499  auto xBins = yToXBins(y_bin_min, y_bin_max, hit);
500  if (x >= xBins.first && x < xBins.second)
501  {
502  road_hits.push_back(hit);
503  hitLayers |= 1 << hit->getLayer();
504  }
505  }
506 
507  auto sorted_hits = ::sortByLayer(road_hits);
508  sorted_hits.resize(m_nLayers); // If no hits in last layer, return from sortByLayer will be too short
509 
510  addRoad(sorted_hits, hitLayers, x, y);
511 }
FPGATrackSimHoughTransformTool::m_bins_y
std::vector< double > m_bins_y
Definition: FPGATrackSimHoughTransformTool.h:184
fpgatracksim::SUBREGION_SECTOR_OFFSET
constexpr int SUBREGION_SECTOR_OFFSET
Definition: FPGATrackSimConstants.h:24
FPGATrackSimHoughTransformTool::m_tempMax_qOverPt
Gaudi::Property< float > m_tempMax_qOverPt
Definition: FPGATrackSimHoughTransformTool.h:152
PlotCalibFromCool.il
il
Definition: PlotCalibFromCool.py:381
FPGATrackSimHoughTransformTool::m_FPGATrackSimBankSvc
ServiceHandle< IFPGATrackSimBankSvc > m_FPGATrackSimBankSvc
Definition: FPGATrackSimHoughTransformTool.h:135
FPGATrackSimTrackPars::IHIP
@ IHIP
Definition: FPGATrackSimTrackPars.h:49
beamspotman.r
def r
Definition: beamspotman.py:676
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
getMenu.algname
algname
Definition: getMenu.py:53
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
FPGATrackSimTrackPars::phi
double phi
Definition: FPGATrackSimTrackPars.h:24
max
#define max(a, b)
Definition: cfImp.cxx:41
FPGATrackSimHoughTransformTool::m_nLayers
unsigned m_nLayers
Definition: FPGATrackSimHoughTransformTool.h:178
FPGATrackSimHoughTransformTool::fieldCorrection
static double fieldCorrection(unsigned region, double y, double r)
Definition: FPGATrackSimHoughTransformTool.cxx:301
FPGATrackSimHoughTransformTool::m_useSectors
Gaudi::Property< bool > m_useSectors
Definition: FPGATrackSimHoughTransformTool.h:167
FPGATrackSimHoughTransformTool::m_nCombineLayers
unsigned m_nCombineLayers
Definition: FPGATrackSimHoughTransformTool.h:179
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
FPGATrackSimHoughTransformTool::m_fieldCorrection
Gaudi::Property< bool > m_fieldCorrection
Definition: FPGATrackSimHoughTransformTool.h:166
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
FPGATrackSimHoughTransformTool::createLayerImage
Image createLayerImage(std::vector< unsigned > const &combine_layers, std::vector< FPGATrackSimHit const * > const &hits, unsigned const scale) const
Definition: FPGATrackSimHoughTransformTool.cxx:162
FPGATrackSimHoughTransformTool::m_traceHits
Gaudi::Property< bool > m_traceHits
Definition: FPGATrackSimHoughTransformTool.h:164
FPGATrackSimHoughTransformTool::addRoad
void addRoad(std::vector< std::vector< const FPGATrackSimHit * >> const &hits, layer_bitmask_t hitLayers, unsigned x, unsigned y)
Definition: FPGATrackSimHoughTransformTool.cxx:446
FPGATrackSimPlaneMap.h
Maps physical layers to logical layers.
FPGATrackSimHoughTransformTool::createImage
Image createImage(std::vector< FPGATrackSimHit const * > const &hits) const
Definition: FPGATrackSimHoughTransformTool.cxx:202
FPGATrackSimTrackPars::qOverPt
double qOverPt
Definition: FPGATrackSimTrackPars.h:25
FPGATrackSimHoughTransformTool::matchIdealGeoSector
void matchIdealGeoSector(FPGATrackSimRoad &r) const
Definition: FPGATrackSimHoughTransformTool.cxx:379
FPGATrackSimHoughTransformTool::getRoads
virtual StatusCode getRoads(const std::vector< const FPGATrackSimHit * > &hits, std::vector< FPGATrackSimRoad * > &roads) override
Definition: FPGATrackSimHoughTransformTool.cxx:139
IFPGATrackSimMappingSvc.h
FPGATrackSimHoughTransformTool::m_binScale
Gaudi::Property< std::vector< unsigned > > m_binScale
Definition: FPGATrackSimHoughTransformTool.h:160
FPGATrackSimHoughTransformTool::m_parMin
FPGATrackSimTrackPars m_parMin
Definition: FPGATrackSimHoughTransformTool.h:142
FPGATrackSimHoughTransformTool::m_combineLayers
Gaudi::Property< std::vector< unsigned > > m_combineLayers
Definition: FPGATrackSimHoughTransformTool.h:159
FPGATrackSimHoughTransformTool.h
Implements road finding using a Hough transform.
FPGATrackSimHoughTransformTool::m_idealGeoRoads
Gaudi::Property< bool > m_idealGeoRoads
Definition: FPGATrackSimHoughTransformTool.h:168
FPGATrackSimTrackPars::d0
double d0
Definition: FPGATrackSimTrackPars.h:26
module_driven_slicing.layers
layers
Definition: module_driven_slicing.py:114
FPGATrackSimHit::getLayer
unsigned getLayer() const
Definition: FPGATrackSimHit.cxx:75
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
FPGATrackSimHoughTransformTool::m_tempMin_phi
Gaudi::Property< float > m_tempMin_phi
Definition: FPGATrackSimHoughTransformTool.h:149
FPGATrackSimHoughTransformTool::m_convSize_x
Gaudi::Property< unsigned > m_convSize_x
Definition: FPGATrackSimHoughTransformTool.h:161
FPGATrackSimHoughTransformTool::m_conv
Gaudi::Property< std::vector< int > > m_conv
Definition: FPGATrackSimHoughTransformTool.h:158
FPGATrackSimHoughTransformTool::m_imageSize_y
Gaudi::Property< unsigned > m_imageSize_y
Definition: FPGATrackSimHoughTransformTool.h:157
yodamerge_tmp.scale
scale
Definition: yodamerge_tmp.py:138
x
#define x
FPGATrackSimHoughTransformTool::m_par_y
FPGATrackSimTrackPars::pars_index m_par_y
Definition: FPGATrackSimHoughTransformTool.h:146
FPGATrackSimHoughTransformTool::m_bins_x
std::vector< double > m_bins_x
Definition: FPGATrackSimHoughTransformTool.h:183
FPGATrackSimConstants.h
FPGATrackSimSectorBank::getQOverPtBins
const std::vector< double > & getQOverPtBins() const
Definition: FPGATrackSimSectorBank.h:50
FPGATrackSimHoughTransformTool::m_tempMax_phi
Gaudi::Property< float > m_tempMax_phi
Definition: FPGATrackSimHoughTransformTool.h:150
FPGATrackSimHit
Definition: FPGATrackSimHit.h:38
FPGATrackSimHit::getGPhi
float getGPhi() const
Definition: FPGATrackSimHit.h:129
FPGATrackSimHoughTransformTool::m_tempMax_d0
Gaudi::Property< float > m_tempMax_d0
Definition: FPGATrackSimHoughTransformTool.h:154
FPGATrackSimHoughTransformTool::m_tempMin_qOverPt
Gaudi::Property< float > m_tempMin_qOverPt
Definition: FPGATrackSimHoughTransformTool.h:151
HitType::wildcard
@ wildcard
FPGATrackSimHoughTransformTool::m_par_x
FPGATrackSimTrackPars::pars_index m_par_x
Definition: FPGATrackSimHoughTransformTool.h:145
FPGATrackSimRegionMap.h
Maps ITK module indices to FPGATrackSim regions.
FPGATrackSimHoughTransformTool::m_localMaxWindowSize
Gaudi::Property< bool > m_localMaxWindowSize
Definition: FPGATrackSimHoughTransformTool.h:165
FPGATrackSimHit::setDetType
void setDetType(SiliconTech detType)
Definition: FPGATrackSimHit.h:52
FPGATrackSimHoughTransformTool::yToXBins
std::pair< unsigned, unsigned > yToXBins(size_t yBin_min, size_t yBin_max, FPGATrackSimHit const *hit) const
Definition: FPGATrackSimHoughTransformTool.cxx:340
FPGATrackSimHoughTransformTool::m_step_y
double m_step_y
Definition: FPGATrackSimHoughTransformTool.h:182
vector2D< std::pair< int, std::unordered_set< const FPGATrackSimHit * > > >
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
FPGATrackSimSectorBank::findSector
sector_t findSector(std::vector< module_t > const &modules) const
Definition: FPGATrackSimSectorBank.cxx:121
FPGATrackSimHoughTransformTool::FPGATrackSimHoughTransformTool
FPGATrackSimHoughTransformTool(const std::string &, const std::string &, const IInterface *)
Definition: FPGATrackSimHoughTransformTool.cxx:34
lumiFormat.i
int i
Definition: lumiFormat.py:92
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
FPGATrackSimHoughTransformTool::yToX
double yToX(double y, FPGATrackSimHit const *h) const
Definition: FPGATrackSimHoughTransformTool.cxx:317
LArG4ShowerLibProcessing.hits
hits
Definition: LArG4ShowerLibProcessing.py:136
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
FPGATrackSimHoughTransformTool::convolute
Image convolute(Image const &image) const
Definition: FPGATrackSimHoughTransformTool.cxx:221
TRT::Track::d0
@ d0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:62
FPGATrackSimHoughTransformTool::getExtension
unsigned getExtension(unsigned y, unsigned layer) const
Definition: FPGATrackSimHoughTransformTool.cxx:366
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
sortByLayer
std::vector< std::vector< const FPGATrackSimHit * > > sortByLayer(Container const &hits)
Definition: FPGATrackSimHit.h:215
FPGATrackSimHoughTransformTool::m_convSize_y
Gaudi::Property< unsigned > m_convSize_y
Definition: FPGATrackSimHoughTransformTool.h:162
checkCorrelInHIST.nSteps
int nSteps
Definition: checkCorrelInHIST.py:458
FPGATrackSimHoughTransformTool::m_step_x
double m_step_x
Definition: FPGATrackSimHoughTransformTool.h:181
WriteCalibToCool.swap
swap
Definition: WriteCalibToCool.py:94
FPGATrackSimHoughTransformTool::m_roads
std::vector< FPGATrackSimRoad > m_roads
Definition: FPGATrackSimHoughTransformTool.h:192
FPGATrackSimSectorBank
Definition: FPGATrackSimSectorBank.h:30
FPGATrackSimHoughTransformTool::m_useSpacePoints
Gaudi::Property< bool > m_useSpacePoints
Definition: FPGATrackSimHoughTransformTool.h:171
FPGATrackSimHoughTransformTool::m_subRegion
Gaudi::Property< int > m_subRegion
Definition: FPGATrackSimHoughTransformTool.h:148
min
#define min(a, b)
Definition: cfImp.cxx:40
FPGATrackSimHoughTransformTool::initialize
virtual StatusCode initialize() override
Definition: FPGATrackSimHoughTransformTool.cxx:41
FPGATrackSimHoughTransformTool::m_doRegionalMapping
Gaudi::Property< bool > m_doRegionalMapping
Definition: FPGATrackSimHoughTransformTool.h:169
fpgatracksim::QPT_SECTOR_OFFSET
constexpr int QPT_SECTOR_OFFSET
Definition: FPGATrackSimConstants.h:23
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
FPGATrackSimHit.h
: FPGATrackSim-specific class to represent an hit in the detector.
FPGATrackSimHoughTransformTool::m_imageSize_x
Gaudi::Property< unsigned > m_imageSize_x
Definition: FPGATrackSimHoughTransformTool.h:156
MyPlots.image
string image
Definition: MyPlots.py:43
FPGATrackSimTrackPars::IPHI
@ IPHI
Definition: FPGATrackSimTrackPars.h:49
python.PyAthena.v
v
Definition: PyAthena.py:157
FPGATrackSimHit::getR
float getR() const
Definition: FPGATrackSimHit.h:128
FPGATrackSimHit::setLayer
void setLayer(unsigned v)
Definition: FPGATrackSimHit.h:87
y
#define y
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
FPGATrackSimHoughTransformTool::passThreshold
bool passThreshold(Image const &image, unsigned x, unsigned y) const
Definition: FPGATrackSimHoughTransformTool.cxx:243
IFPGATrackSimEventSelectionSvc.h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
layer_bitmask_t
uint32_t layer_bitmask_t
Definition: FPGATrackSimTypes.h:22
DeMoScan.first
bool first
Definition: DeMoScan.py:534
IFPGATrackSimBankSvc.h
FPGATrackSimSectorBank::isAbsQOverPtBinning
bool isAbsQOverPtBinning() const
Definition: FPGATrackSimSectorBank.h:52
LArCellBinning.step
step
Definition: LArCellBinning.py:158
FPGATrackSimHoughTransformTool::m_hitExtend_x
Gaudi::Property< std::vector< unsigned > > m_hitExtend_x
Definition: FPGATrackSimHoughTransformTool.h:163
FPGATrackSimHoughTransformTool::m_doEtaPatternConsts
Gaudi::Property< bool > m_doEtaPatternConsts
Definition: FPGATrackSimHoughTransformTool.h:170
FPGATrackSimHoughTransformTool::m_FPGATrackSimMapping
ServiceHandle< IFPGATrackSimMappingSvc > m_FPGATrackSimMapping
Definition: FPGATrackSimHoughTransformTool.h:136
calibdata.copy
bool copy
Definition: calibdata.py:27
FPGATrackSimHoughTransformTool::m_tempMin_d0
Gaudi::Property< float > m_tempMin_d0
Definition: FPGATrackSimHoughTransformTool.h:153
FPGATrackSimHoughTransformTool::m_parMax
FPGATrackSimTrackPars m_parMax
Definition: FPGATrackSimHoughTransformTool.h:143
FPGATrackSimHoughTransformTool::m_combineLayer2D
std::vector< std::vector< unsigned > > m_combineLayer2D
Definition: FPGATrackSimHoughTransformTool.h:173
FPGATrackSimTypes.h
python.compressB64.c
def c
Definition: compressB64.py:93
FPGATrackSimHoughTransformTool::m_EvtSel
ServiceHandle< IFPGATrackSimEventSelectionSvc > m_EvtSel
Definition: FPGATrackSimHoughTransformTool.h:134
FPGATrackSimSectorBank.h
This file declares a class that stores the module IDs of the sectors.
MakeTH3DFromTH2Ds.xBins
list xBins
Definition: MakeTH3DFromTH2Ds.py:76
FPGATrackSimRoad
Definition: FPGATrackSimRoad.h:29
FPGATrackSimHoughTransformTool::m_threshold
Gaudi::Property< std::vector< int > > m_threshold
Definition: FPGATrackSimHoughTransformTool.h:155
FPGATrackSimHit::setHitType
void setHitType(HitType type)
Definition: FPGATrackSimHit.h:51
FPGATrackSimHoughTransformTool::m_image
Image m_image
Definition: FPGATrackSimHoughTransformTool.h:191