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
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<std::shared_ptr<const FPGATrackSimHit>> & hits, std::vector<std::shared_ptr<const 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.emplace_back(std::make_shared<const FPGATrackSimRoad>(r));
158 
159  return StatusCode::SUCCESS;
160 }
161 
162 FPGATrackSimHoughTransformTool::Image FPGATrackSimHoughTransformTool::createLayerImage(std::vector<unsigned> const & layers, const std::vector<std::shared_ptr<const FPGATrackSimHit>> & hits, unsigned const scale) const
163 {
165 
166  for (auto 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 
202 FPGATrackSimHoughTransformTool::Image FPGATrackSimHoughTransformTool::createImage(const std::vector<std::shared_ptr<const FPGATrackSimHit>> & hits) const
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 double FPGATrackSimHoughTransformTool::yToX(double y, const std::shared_ptr<const FPGATrackSimHit> &hit) const
301 {
302  double x = 0;
303 
305  {
306  double r = hit->getR(); // mm
307  double phi_hit = hit->getGPhi(); // radians
308  double d0 = std::isnan(m_parMin.d0) ? 0 : m_parMin.d0; // mm, assume min = max
309  x = asin(r * fpgatracksim::A * y - d0 / r) + phi_hit;
310 
311  if (m_fieldCorrection) x += fieldCorrection(m_EvtSel->getRegionID(), y, r);
312  }
313  else
314  {
315  ATH_MSG_ERROR("yToX() not defined for the current m_par selection");
316  }
317 
318  return x;
319 }
320 
321 // Find the min/max x bins of the hit's line, in each y bin. Max is exclusive.
322 // Note this assumes yToX is monotonic. Returns {0, 0} if hit lies out of bounds.
323 std::pair<unsigned, unsigned> FPGATrackSimHoughTransformTool::yToXBins(size_t yBin_min, size_t yBin_max, const std::shared_ptr<const FPGATrackSimHit> & hit) const
324 {
325  // Get float values
326  double x_min = yToX(m_bins_y[yBin_min], hit);
327  double x_max = yToX(m_bins_y[yBin_max], hit);
328  if (x_min > x_max) std::swap(x_min, x_max);
329  if (x_max < m_parMin[m_par_x] || x_min > m_parMax[m_par_x])
330  return { 0, 0 }; // out of bounds
331 
332  // Get bins
333  int x_bin_min = quant(m_parMin[m_par_x], m_parMax[m_par_x], m_imageSize_x, x_min);
334  int x_bin_max = quant(m_parMin[m_par_x], m_parMax[m_par_x], m_imageSize_x, x_max) + 1; // exclusive
335 
336  // Extend bins
337  unsigned extend = getExtension(yBin_min, hit->getLayer());
338  x_bin_min -= extend;
339  x_bin_max += extend;
340 
341  // Clamp bins
342  if (x_bin_min < 0) x_bin_min = 0;
343  if (x_bin_max > static_cast<int>(m_imageSize_x)) x_bin_max = m_imageSize_x;
344 
345  return { x_bin_min, x_bin_max };
346 }
347 
348 // We allow variable extension based on the size of m_hitExtend_x. See comments below.
349 unsigned FPGATrackSimHoughTransformTool::getExtension(unsigned y, unsigned layer) const
350 {
351  if (m_hitExtend_x.size() == m_nLayers) return m_hitExtend_x[layer];
352  if (m_hitExtend_x.size() == m_nLayers * 2)
353  {
354  // different extension for low pt vs high pt, split in half but irrespective of sign
355  // first nLayers entries of m_hitExtend_x is for low pt half, rest are for high pt half
356  if (y < m_imageSize_y / 4 || y > 3 * m_imageSize_y / 4) return m_hitExtend_x[layer];
357  return m_hitExtend_x[m_nLayers + layer];
358  }
359  return 0;
360 }
361 
363 {
364 
365  // This logic is now identical between the 1D and 2D Hough tools. Perhaps it should
366  // be moved into the sector bank class?
367 
368  // We now look up the binning information in the sector bank.
369  const FPGATrackSimSectorBank* sectorbank = m_FPGATrackSimBankSvc->SectorBank_1st();
370 
371  // Look up q/pt (or |q/pt|) from the Hough road, convert to MeV.
372  double qoverpt = r.getY()*0.001;
373  if (sectorbank->isAbsQOverPtBinning()) {
374  qoverpt = abs(qoverpt);
375  }
376 
377  int sectorbin = 0;
378 
379  // Retrieve the bin boundaries from the sector bank; map this onto them.
380  std::vector<double> qoverpt_bins = sectorbank->getQOverPtBins();
381  auto bounds = std::equal_range(qoverpt_bins.begin(), qoverpt_bins.end(), qoverpt);
382 
383  sectorbin = fpgatracksim::QPT_SECTOR_OFFSET*(bounds.first - qoverpt_bins.begin() - 1);
384 
385  if (sectorbin < 0) sectorbin = 0;
386  if ((sectorbin / 10) > static_cast<int>(qoverpt_bins.size() - 2))sectorbin = 10*(qoverpt_bins.size() - 2);
387 
388  if (m_doRegionalMapping){
389  int subregion = r.getSubRegion();
390  sectorbin += subregion*fpgatracksim::SUBREGION_SECTOR_OFFSET;
391  }
392  std::vector<module_t> modules;
393  for (unsigned int il = 0; il < r.getNLayers(); il++) {
394  if (r.getNHits_layer()[il] == 0) {
395  modules.push_back(-1);
396 
397  layer_bitmask_t wc_layers = r.getWCLayers();
398  wc_layers |= (0x1 << il);
399  r.setWCLayers(wc_layers);
400 
401  std::shared_ptr<FPGATrackSimHit> wcHit = std::make_shared<FPGATrackSimHit>();
403  wcHit->setLayer(il);
404  wcHit->setDetType(m_FPGATrackSimMapping->PlaneMap_1st()->getDetType(il));
405  std::vector<std::shared_ptr<const FPGATrackSimHit>> wcHits;
406  wcHits.emplace_back(std::move(wcHit));
407  r.setHits(il,std::move(wcHits));
408  }
409  else {
410  modules.push_back(sectorbin);
411  }
412  }
413 
414  // If we are using eta patterns. We need to first run the roads through the road filter.
415  // Then the filter will be responsible for setting the actual sector.
416  // As a hack, we can store the sector bin ID in the road for now.
417  // This is fragile! If we want to store a different ID for each layer, it will break.
418 
419  // Similarly, we do the same thing for spacepoints. this probably means we can't combine the two.
420  // maybe better to store the module array instead of just a number?
421 
422  r.setSectorBin(sectorbin);
424  r.setSector(sectorbank->findSector(modules));
425  }
426 }
427 
428 // Creates a road from hits that pass through the given bin (x, y), and pushes it onto m_roads
429 void FPGATrackSimHoughTransformTool::addRoad(const std::vector<std::vector<std::shared_ptr<const FPGATrackSimHit>>> & hits, layer_bitmask_t hitLayers, unsigned x, unsigned y)
430 {
431  m_roads.emplace_back();
432  FPGATrackSimRoad & r = m_roads.back();
433 
434  r.setRoadID(m_roads.size() - 1);
435  r.setPID(y * m_imageSize_y + x);
436  r.setHits( std::vector<std::vector<std::shared_ptr<const FPGATrackSimHit>>>(hits)); //copy hits
437 
438  // We use the y coordinate in matchIdealGeoSectors
439  // and so it needs to be available before setting the sector.
440 
441  r.setSubRegion(m_subRegion);
442  r.setX(m_bins_x[x] + m_step_x/2);
443  r.setY(m_bins_y[y] + m_step_y/2);
444  r.setXBin(x);
445  r.setYBin(y);
446  r.setHitLayers(hitLayers);
447  r.setSubRegion(m_subRegion);
448 
449  if (m_useSectors) r.setSector(m_FPGATrackSimBankSvc->SectorBank_1st()->findSector(hits));
451 }
452 
453 
454 // Creates a road from hits that pass through the given bin (x, y), and pushes it onto m_roads
455 void FPGATrackSimHoughTransformTool::addRoad(const std::unordered_set<std::shared_ptr<const FPGATrackSimHit>> & hits, unsigned x, unsigned y)
456 {
457  layer_bitmask_t hitLayers = 0;
458  for (auto const & hit : hits)
459  hitLayers |= 1 << hit->getLayer();
460 
461  auto sorted_hits = ::sortByLayer(hits);
462  sorted_hits.resize(m_nLayers); // If no hits in last layer, return from sortByLayer will be too short
463 
464  addRoad(sorted_hits, hitLayers, x, y);
465 }
466 
467 // Use this version of addRoad when hit tracing is turned off
468 void FPGATrackSimHoughTransformTool::addRoad(const std::vector<std::shared_ptr<const FPGATrackSimHit>> & hits, unsigned x, unsigned y)
469 {
470  // Get the road hits
471  std::vector<std::shared_ptr<const FPGATrackSimHit>> road_hits;
472  layer_bitmask_t hitLayers = 0;
473  for (const auto & hit : hits)
474  {
475  if (m_subRegion >= 0 && !m_FPGATrackSimMapping->SubRegionMap()->isInRegion(m_subRegion, *hit)) continue;
476 
477  // Find the min/max y bins (after scaling)
478  unsigned int y_bin_min = (y / m_binScale[hit->getLayer()]) * m_binScale[hit->getLayer()];
479  unsigned int y_bin_max = y_bin_min + m_binScale[hit->getLayer()];
480 
481  // Find the min/max x bins
482  auto xBins = yToXBins(y_bin_min, y_bin_max, hit);
483  if (x >= xBins.first && x < xBins.second)
484  {
485  road_hits.push_back(hit);
486  hitLayers |= 1 << hit->getLayer();
487  }
488  }
489 
490  auto sorted_hits = ::sortByLayer(road_hits);
491  sorted_hits.resize(m_nLayers); // If no hits in last layer, return from sortByLayer will be too short
492 
493  addRoad(sorted_hits, hitLayers, x, y);
494 }
FPGATrackSimHoughTransformTool::m_bins_y
std::vector< double > m_bins_y
Definition: FPGATrackSimHoughTransformTool.h:181
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:149
PlotCalibFromCool.il
il
Definition: PlotCalibFromCool.py:381
FPGATrackSimHoughTransformTool::m_FPGATrackSimBankSvc
ServiceHandle< IFPGATrackSimBankSvc > m_FPGATrackSimBankSvc
Definition: FPGATrackSimHoughTransformTool.h:132
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:54
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
FPGATrackSimTrackPars::phi
double phi
Definition: FPGATrackSimTrackPars.h:24
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
max
#define max(a, b)
Definition: cfImp.cxx:41
FPGATrackSimHoughTransformTool::m_nLayers
unsigned m_nLayers
Definition: FPGATrackSimHoughTransformTool.h:175
FPGATrackSimHoughTransformTool::m_useSectors
Gaudi::Property< bool > m_useSectors
Definition: FPGATrackSimHoughTransformTool.h:164
FPGATrackSimHoughTransformTool::m_nCombineLayers
unsigned m_nCombineLayers
Definition: FPGATrackSimHoughTransformTool.h:176
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
FPGATrackSimHoughTransformTool::m_fieldCorrection
Gaudi::Property< bool > m_fieldCorrection
Definition: FPGATrackSimHoughTransformTool.h:163
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
FPGATrackSimHoughTransformTool::addRoad
void addRoad(const std::vector< std::vector< std::shared_ptr< const FPGATrackSimHit >>> &hits, layer_bitmask_t hitLayers, unsigned x, unsigned y)
Definition: FPGATrackSimHoughTransformTool.cxx:429
FPGATrackSimHoughTransformTool::m_traceHits
Gaudi::Property< bool > m_traceHits
Definition: FPGATrackSimHoughTransformTool.h:161
FPGATrackSimPlaneMap.h
Maps physical layers to logical layers.
FPGATrackSimTrackPars::qOverPt
double qOverPt
Definition: FPGATrackSimTrackPars.h:25
FPGATrackSimHoughTransformTool::matchIdealGeoSector
void matchIdealGeoSector(FPGATrackSimRoad &r) const
Definition: FPGATrackSimHoughTransformTool.cxx:362
IFPGATrackSimMappingSvc.h
FPGATrackSimHoughTransformTool::m_binScale
Gaudi::Property< std::vector< unsigned > > m_binScale
Definition: FPGATrackSimHoughTransformTool.h:157
FPGATrackSimHoughTransformTool::m_parMin
FPGATrackSimTrackPars m_parMin
Definition: FPGATrackSimHoughTransformTool.h:139
FPGATrackSimHoughTransformTool::m_combineLayers
Gaudi::Property< std::vector< unsigned > > m_combineLayers
Definition: FPGATrackSimHoughTransformTool.h:156
FPGATrackSimHoughTransformTool.h
Implements road finding using a Hough transform.
FPGATrackSimHoughTransformTool::m_idealGeoRoads
Gaudi::Property< bool > m_idealGeoRoads
Definition: FPGATrackSimHoughTransformTool.h:165
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:74
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
FPGATrackSimHoughTransformTool::m_tempMin_phi
Gaudi::Property< float > m_tempMin_phi
Definition: FPGATrackSimHoughTransformTool.h:146
FPGATrackSimHoughTransformTool::createImage
Image createImage(const std::vector< std::shared_ptr< const FPGATrackSimHit >> &hits) const
Definition: FPGATrackSimHoughTransformTool.cxx:202
FPGATrackSimHoughTransformTool::m_convSize_x
Gaudi::Property< unsigned > m_convSize_x
Definition: FPGATrackSimHoughTransformTool.h:158
FPGATrackSimHoughTransformTool::m_conv
Gaudi::Property< std::vector< int > > m_conv
Definition: FPGATrackSimHoughTransformTool.h:155
FPGATrackSimHoughTransformTool::m_imageSize_y
Gaudi::Property< unsigned > m_imageSize_y
Definition: FPGATrackSimHoughTransformTool.h:154
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:143
FPGATrackSimHoughTransformTool::m_bins_x
std::vector< double > m_bins_x
Definition: FPGATrackSimHoughTransformTool.h:180
FPGATrackSimConstants.h
FPGATrackSimSectorBank::getQOverPtBins
const std::vector< double > & getQOverPtBins() const
Definition: FPGATrackSimSectorBank.h:52
FPGATrackSimHoughTransformTool::m_tempMax_phi
Gaudi::Property< float > m_tempMax_phi
Definition: FPGATrackSimHoughTransformTool.h:147
FPGATrackSimHit::getGPhi
float getGPhi() const
Definition: FPGATrackSimHit.h:134
FPGATrackSimHoughTransformTool::m_tempMax_d0
Gaudi::Property< float > m_tempMax_d0
Definition: FPGATrackSimHoughTransformTool.h:151
FPGATrackSimHoughTransformTool::m_tempMin_qOverPt
Gaudi::Property< float > m_tempMin_qOverPt
Definition: FPGATrackSimHoughTransformTool.h:148
HitType::wildcard
@ wildcard
FPGATrackSimHoughTransformTool::m_par_x
FPGATrackSimTrackPars::pars_index m_par_x
Definition: FPGATrackSimHoughTransformTool.h:142
FPGATrackSimRegionMap.h
Maps ITK module indices to FPGATrackSim regions.
FPGATrackSimHoughTransformTool::m_localMaxWindowSize
Gaudi::Property< bool > m_localMaxWindowSize
Definition: FPGATrackSimHoughTransformTool.h:162
FPGATrackSimHit::setDetType
void setDetType(SiliconTech detType)
Definition: FPGATrackSimHit.h:55
FPGATrackSimHoughTransformTool::m_step_y
double m_step_y
Definition: FPGATrackSimHoughTransformTool.h:179
vector2D< std::pair< int, std::unordered_set< std::shared_ptr< 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::yToXBins
std::pair< unsigned, unsigned > yToXBins(size_t yBin_min, size_t yBin_max, const std::shared_ptr< const FPGATrackSimHit > &hit) const
Definition: FPGATrackSimHoughTransformTool.cxx:323
FPGATrackSimHoughTransformTool::FPGATrackSimHoughTransformTool
FPGATrackSimHoughTransformTool(const std::string &, const std::string &, const IInterface *)
Definition: FPGATrackSimHoughTransformTool.cxx:34
lumiFormat.i
int i
Definition: lumiFormat.py:85
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
FPGATrackSimHoughTransformTool::convolute
Image convolute(Image const &image) const
Definition: FPGATrackSimHoughTransformTool.cxx:221
fieldCorrection
double fieldCorrection(unsigned region, double qpt, double r)
Definition: FPGATrackSimFunctions.cxx:163
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:349
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
FPGATrackSimHoughTransformTool::m_convSize_y
Gaudi::Property< unsigned > m_convSize_y
Definition: FPGATrackSimHoughTransformTool.h:159
checkCorrelInHIST.nSteps
int nSteps
Definition: checkCorrelInHIST.py:458
FPGATrackSimHoughTransformTool::m_step_x
double m_step_x
Definition: FPGATrackSimHoughTransformTool.h:178
WriteCalibToCool.swap
swap
Definition: WriteCalibToCool.py:94
FPGATrackSimHoughTransformTool::m_roads
std::vector< FPGATrackSimRoad > m_roads
Definition: FPGATrackSimHoughTransformTool.h:189
FPGATrackSimSectorBank
Definition: FPGATrackSimSectorBank.h:32
FPGATrackSimHoughTransformTool::m_useSpacePoints
Gaudi::Property< bool > m_useSpacePoints
Definition: FPGATrackSimHoughTransformTool.h:168
FPGATrackSimHoughTransformTool::m_subRegion
Gaudi::Property< int > m_subRegion
Definition: FPGATrackSimHoughTransformTool.h:145
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:166
fpgatracksim::QPT_SECTOR_OFFSET
constexpr int QPT_SECTOR_OFFSET
Definition: FPGATrackSimConstants.h:23
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
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:153
MyPlots.image
string image
Definition: MyPlots.py:43
FPGATrackSimHoughTransformTool::yToX
double yToX(double y, const std::shared_ptr< const FPGATrackSimHit > &hit) const
Definition: FPGATrackSimHoughTransformTool.cxx:300
FPGATrackSimTrackPars::IPHI
@ IPHI
Definition: FPGATrackSimTrackPars.h:49
python.PyAthena.v
v
Definition: PyAthena.py:154
FPGATrackSimHoughTransformTool::createLayerImage
Image createLayerImage(std::vector< unsigned > const &combine_layers, const std::vector< std::shared_ptr< const FPGATrackSimHit >> &hits, unsigned const scale) const
Definition: FPGATrackSimHoughTransformTool.cxx:162
FPGATrackSimHoughTransformTool::getRoads
virtual StatusCode getRoads(const std::vector< std::shared_ptr< const FPGATrackSimHit >> &hits, std::vector< std::shared_ptr< const FPGATrackSimRoad >> &roads) override
Definition: FPGATrackSimHoughTransformTool.cxx:139
FPGATrackSimHit::getR
float getR() const
Definition: FPGATrackSimHit.h:133
ActsTrk::detail::MakeDerivedVariant::extend
constexpr std::variant< Args..., T > extend(const std::variant< Args... > &, const T &)
Definition: MakeDerivedVariant.h:17
FPGATrackSimHit::setLayer
void setLayer(unsigned v)
Definition: FPGATrackSimHit.h:92
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:536
IFPGATrackSimBankSvc.h
FPGATrackSimSectorBank::isAbsQOverPtBinning
bool isAbsQOverPtBinning() const
Definition: FPGATrackSimSectorBank.h:54
LArCellBinning.step
step
Definition: LArCellBinning.py:158
FPGATrackSimHoughTransformTool::m_hitExtend_x
Gaudi::Property< std::vector< unsigned > > m_hitExtend_x
Definition: FPGATrackSimHoughTransformTool.h:160
FPGATrackSimHoughTransformTool::m_doEtaPatternConsts
Gaudi::Property< bool > m_doEtaPatternConsts
Definition: FPGATrackSimHoughTransformTool.h:167
FPGATrackSimHoughTransformTool::m_FPGATrackSimMapping
ServiceHandle< IFPGATrackSimMappingSvc > m_FPGATrackSimMapping
Definition: FPGATrackSimHoughTransformTool.h:133
calibdata.copy
bool copy
Definition: calibdata.py:27
FPGATrackSimHoughTransformTool::m_tempMin_d0
Gaudi::Property< float > m_tempMin_d0
Definition: FPGATrackSimHoughTransformTool.h:150
FPGATrackSimHoughTransformTool::m_parMax
FPGATrackSimTrackPars m_parMax
Definition: FPGATrackSimHoughTransformTool.h:140
FPGATrackSimHoughTransformTool::m_combineLayer2D
std::vector< std::vector< unsigned > > m_combineLayer2D
Definition: FPGATrackSimHoughTransformTool.h:170
FPGATrackSimTypes.h
python.compressB64.c
def c
Definition: compressB64.py:93
FPGATrackSimHoughTransformTool::m_EvtSel
ServiceHandle< IFPGATrackSimEventSelectionSvc > m_EvtSel
Definition: FPGATrackSimHoughTransformTool.h:131
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:30
FPGATrackSimHoughTransformTool::m_threshold
Gaudi::Property< std::vector< int > > m_threshold
Definition: FPGATrackSimHoughTransformTool.h:152
FPGATrackSimHit::setHitType
void setHitType(HitType type)
Definition: FPGATrackSimHit.h:54
sortByLayer
std::vector< std::vector< std::shared_ptr< const FPGATrackSimHit > > > sortByLayer(Container const &hits)
Definition: FPGATrackSimHit.h:250
FPGATrackSimHoughTransformTool::m_image
Image m_image
Definition: FPGATrackSimHoughTransformTool.h:188