ATLAS Offline Software
FPGATrackSimHough1DShiftTool.cxx
Go to the documentation of this file.
1 // Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
22 #include "TH2.h"
23 
24 #include <sstream>
25 #include <cmath>
26 #include <algorithm>
27 #include <boost/dynamic_bitset.hpp>
28 #include <iostream>
29 
30 static inline std::string to_string(std::vector<size_t> v);
31 static inline boost::dynamic_bitset<> lshift(boost::dynamic_bitset<> const & b, int n);
32 static inline boost::dynamic_bitset<> rshift(boost::dynamic_bitset<> const & b, int n);
33 static inline void updateBinHits(std::vector<boost::dynamic_bitset<>> & binHits, unsigned layer, boost::dynamic_bitset<> const & b);
34 static inline int layersHit(FPGATrackSimRoad& r);
35 
37 // AthAlgTool
38 
39 FPGATrackSimHough1DShiftTool::FPGATrackSimHough1DShiftTool(const std::string& algname, const std::string &name, const IInterface *ifc) :
40  base_class(algname, name, ifc)
41 {
42  declareInterface<IFPGATrackSimRoadFinderTool>(this);
43 }
44 
45 
47 {
48  // Config printout
49  ATH_MSG_INFO("Phi range: (" << m_phiMin << "," << m_phiMax << "," << m_phiBins << ")");
50  if (m_useDiff) ATH_MSG_INFO("useDiff Set True");
51  if (m_variableExtend) ATH_MSG_INFO("variableExtend Set True");
52  ATH_MSG_INFO("enhancedHighPt " << m_enhanceHighPt.value());
53  ATH_MSG_INFO("applyDropable " << m_applyDropable.value());
54  ATH_MSG_INFO("threshold " << m_threshold.value());
55 
56  // Retrieve info
57  ATH_CHECK(m_FPGATrackSimBankSvc.retrieve());
58  ATH_CHECK(m_FPGATrackSimMapping.retrieve());
59  m_nLayers = m_FPGATrackSimMapping->PlaneMap_1st()->getNLogiLayers();
60 
61  // Error checking
62  if (m_phiMin >= m_phiMax || m_phiBins == 0u) {
63  ATH_MSG_FATAL("initialize() Phi range invalid");
64  return StatusCode::FAILURE;
65  }
66 
67  // Fix inputs
68  if (!m_hitExtendProperty.value().empty()) {
69  if (m_hitExtendProperty.value().size() != m_nLayers) {
70  ATH_MSG_FATAL("initialize() Hit extend must have size == nLayers");
71  return StatusCode::FAILURE;
72  } else {
74  }
75  } else {
76  m_hitExtend.resize(m_nLayers,0); // all 0
77  }
78  if (m_iterStep == 0u) m_iterStep = m_hitExtend[m_iterLayer] * 2 + 1; // default 1
79 
80  // Copy correct r values from the region map.
81  m_r.resize(m_nLayers);
82  for (unsigned ilayer = 0; ilayer < m_nLayers; ilayer++) {
83  m_r[ilayer] = m_FPGATrackSimMapping->SubRegionMap()->getAvgRadius(m_subRegion, ilayer);
84  }
85 
86  // Warnings / corrections
87  if (m_idealGeoRoads)
88  {
89  if (m_useSectors)
90  {
91  ATH_MSG_WARNING("initialize() idealGeoRoads conflicts with useSectors, switching off FPGATrackSim sector matching");
92  m_useSectors = false;
93  }
94  if (!m_traceHits)
95  {
96  ATH_MSG_WARNING("initialize() idealGeoRoads requires tracing hits, turning on automatically");
97  m_traceHits = true;
98  }
99  }
100 
101  // Fill convenience variables
103  for (unsigned i = 0; i <= m_phiBins; i++)
104  m_bins.push_back(m_phiMin + m_phiStep * i);
105  m_regionMin = m_EvtSel->getRegions()->getMin(m_EvtSel->getRegionID());
106  m_regionMax = m_EvtSel->getRegions()->getMax(m_EvtSel->getRegionID());
107 
108  m_regionMin.phi = m_regionMin.phi - 0.01; // For phi boundary effect
109  m_regionMax.phi = m_regionMax.phi + 0.01; // For phi boundary effect
110 
111  m_currentcounts.resize(m_phiBins);
112 
113  // Calculate the shift amounts
114  if (m_bitShift_path.value().empty()) calculateShifts();
116  printShifts();
117 
118 
119  return StatusCode::SUCCESS;
120 }
121 
122 
123 // Fills m_shifts
125 {
126  // Calculated d0shift if selected
127  if (m_d0spread>0) calculated0Shifts();
128 
129 
130  // Iterate over a steps of m_iterStep bin shift in m_iterLayer
131  for (int sign = -1; sign<2; sign+=2) {
132 
133  // start at highest pT
134  float iterShift = (sign>0) ? 0.0 : -1.0; // don't double count zero
135 
136  while (true)
137  {
138  float qpt = qPt(m_r[m_iterLayer], m_phiStep * iterShift);
139  if (abs(qpt)>std::max(abs(m_qptMin),abs(m_qptMax))) break;
140 
141  if ((qpt <= m_qptMax ) && (qpt >= m_qptMin )) {
142 
143  std::vector<int> shifts; // Fill both +iterShift and -iterShift here
144  for (unsigned i = 0; i < m_nLayers; i++)
145  {
146  float dPhi = deltaPhi(m_r[i], qpt);
147  if (m_useDiff){
148  dPhi -= deltaPhi(m_r[0], qpt);
149  }
150 
151  int shift = static_cast<int>(round(dPhi / m_phiStep));
152  if (shift >= static_cast<int>(m_phiBins) || shift <= -(static_cast<int>(m_phiBins))) return;
153  shifts.push_back(shift);
154  }
155 
156  // if thre are d0shifts, apply them
157  for (const std::vector<int>& d0shift: m_d0shifts){
158  m_shifts.push_back(applyVariation(shifts,d0shift,1));
159  m_shifts.push_back(applyVariation(shifts,d0shift,-1));
160  }
161 
162  m_qpt.push_back(qpt);
163  m_shifts.push_back(shifts);
164 
165  }
166 
167  // smaller steps if in "enhanceHighPt" range
168  iterShift += ((std::abs(qpt)>m_enhanceHighPt) ? sign*float(m_iterStep): sign*float(m_iterStep)/2.0) ;
169  }
170  ATH_MSG_INFO("Ending shift, qpt("<< m_qptMin << ", " << m_qptMax <<") sign:" << sign << " shift:" << iterShift);
171 
172 
173  // figure out which patterns are the same after dropping a hit
175  }
176 
177 }
178 
179 
180 // Fills m_shifts
181 //
182 // This reads a bitshift pattern file, which is a simple space-separated text file
183 // where each row respresents one shift set / pattern. Each row contains
184 // (nLayers - 1) columns representing the shifts in layers [1, nLayers)
185 // (implicit 0 shift in layer 0), followed by a column that is a 'droplist'.
186 // The droplist is a string of 0s and 1s indicating which layers can be dropped
187 // for 4/5 matching, i.e (layer 0 is right-most bit).
188 //
189 // See /eos/atlas/atlascerngroupdisk/det-htt/sectors_constants/BitShiftHoughPatterns/2021-02-20/
190 void FPGATrackSimHough1DShiftTool::readShifts(std::string const & filepath)
191 {
192  // Open the file
193  std::ifstream fin(filepath);
194  if (!fin.is_open())
195  {
196  ATH_MSG_FATAL("Couldn't open " << filepath);
197  throw ("FPGATrackSimHough1DShiftTool::readShifts couldn't open " + filepath);
198  }
199 
200  // Variables to fill
201  std::string line;
202  bool ok = true;
203  int subregion = -1;
204  bool newsubr = false;
205  bool headerdone = false;
206  int nslices = 0;
207  int nphi=0;
208 
209 
210  // Parse the file
211  while (getline(fin, line))
212  {
213  newsubr|=(line.empty());
214  if (line.empty() || line[0] == '#') continue;
215  std::istringstream sline(line);
216  if (!headerdone) {
217  std::string towers, phi;
218  ok = ok && (sline >> towers);
219  if (towers!="towers") {
220  ATH_MSG_FATAL("Parse Error expected 'towers' got "<< towers);
221  throw ("FPGATrackSimHough1DShiftTool::readShifts couldn't parse " + filepath);
222  }
223  ok = ok && (sline >> nslices);
224  ATH_MSG_INFO("FPGATrackSimHough1DShiftTool::readShifts " << nslices << "slices in shift file");
225  ok = ok && (sline >> phi);
226  if (phi!="phi") {
227  ATH_MSG_FATAL("Parse Error expected 'phi' got "<< phi);
228  throw ("FPGATrackSimHough1DShiftTool::readShifts couldn't parse " + filepath);
229  }
230  ok = ok && (sline >> nphi);
231  headerdone=true;
232  continue;
233  }
234 
235  if (newsubr) {
236  ok = ok && (sline >> subregion);
237  ATH_MSG_INFO("FPGATrackSimHough1DShiftTool::readShifts " << subregion << " looking for " << m_subRegion);
238  newsubr=false;
239  continue;
240  }
241 
242  if (subregion==m_subRegion) {
243  ATH_MSG_INFO("FPGATrackSimHough1DShiftTool::readShifts found subregion " << m_subRegion);
244  // Shifts
245  std::vector<int> shifts;
246  shifts.push_back(0); // layer 0 is implicit 0 TODO
247  for (unsigned layer = 1; layer < m_nLayers; layer++)
248  {
249  int shift = 0;
250  ok = ok && (sline >> shift);
251  if (!ok) break;
252  shifts.push_back(shift);
253  }
254  if (!ok) break;
255  if (shifts[0]<-1000) {
256  ATH_MSG_INFO("FPGATrackSimHough1DShiftTool::readShifts skipping line with shift out of range: " << line);
257  continue;
258  }
259 
260  // Dropable
261  std::string droplist;
262  ok = ok && (sline >> droplist);
263  ok = ok && (droplist.size() == m_nLayers);
264  if (!ok) break;
265 
266  boost::dynamic_bitset<> drops(m_nLayers);
267  for (unsigned i = 0; i < m_nLayers; i++)
268  if (droplist[i] == '1')
269  drops[m_nLayers - i - 1] = true; // Droplist is printed with MSB on left
270 
271  // qpT
272  float qpt = 0;
273  ok = ok && (sline >> qpt);
274  if (!ok) break;
275  if ((qpt<m_qptMin) or (qpt>m_qptMax)) continue;
276 
277  // Phi Vals
278  std::vector<float> phivals;
279  for (unsigned layer = 0; layer < m_nLayers; layer++)
280  {
281  float phival = 0;
282  ok = ok && (sline >> phival);
283  if (!ok) break;
284  phivals.push_back(phival);
285  }
286 
287  m_qpt.push_back(qpt);
288  m_shifts.push_back(shifts);
289  m_dropable.push_back(drops);
290  m_phivals.push_back(phivals);
291 
292 
293  }
294  }
295 
296  if (!ok)
297  {
298  ATH_MSG_FATAL("Found error reading file at line: " << line);
299  throw "FPGATrackSimHough1DShiftTool::readShifts read error";
300  }
301 
302  if (m_shifts.size()==0) ATH_MSG_FATAL("FPGATrackSimHough1DShiftTool::readShifts no shifts read");
303  ATH_MSG_INFO("Read " << m_shifts.size() << " patterns from " << filepath);
304 }
305 
306 
308 {
309  return StatusCode::SUCCESS;
310 }
311 
312 
314 // Main Algorithm
315 
316 StatusCode FPGATrackSimHough1DShiftTool::getRoads(const std::vector<const FPGATrackSimHit*> & hits, std::vector<FPGATrackSimRoad*> & roads)
317 {
318 
319  roads.clear();
320  m_roads.clear();
321 
322  ATH_MSG_DEBUG("Input Hits Size:" << hits.size() << "\n");
323 
324  // Get hit masks
325  std::vector<boost::dynamic_bitset<>> hitMasks(makeHitMasks(hits));
326  if (m_drawHitMasks) drawHitMasks(hitMasks, m_name + "_e" + std::to_string(m_event));
327 
328  // Iterate over shifts
329  for (size_t iShift = 0; iShift < m_shifts.size(); iShift++)
330  {
331  // Track hit layers in each bin
332  std::vector<boost::dynamic_bitset<>> binHits(m_phiBins, boost::dynamic_bitset<>(m_nLayers));
333 
334 
335  // Add the counts
336  for (unsigned i = 0; i < m_nLayers; i++)
337  updateBinHits(binHits, i, lshift(hitMasks[i], m_shifts[iShift][i]));
338 
339  // Check the threshold
340  for (unsigned bin = 0; bin < m_phiBins; bin++)
341  {
342  // First check we're not missing hits in not allowed layers
343  if (m_applyDropable && !m_dropable.empty() && (~(binHits[bin] | m_dropable[iShift])).any()) continue;
344 
345  m_currentcounts[bin]=binHits[bin].count();
346 
347  if (passThreshold(binHits,bin))
348  {
349  FPGATrackSimRoad r = makeRoad(hits, bin, iShift);
350 
351  if (m_phiRangeCut && (r.getX() > m_regionMax.phi || r.getX() < m_regionMin.phi)) continue;
352 
353  m_roads.push_back(r);
354 
355  ATH_MSG_DEBUG("New Road: "<< layersHit(r) <<" lyrs, " << r.getNHits() << " hits :"
356  << to_string(r.getNHits_layer()) << " reg=" << r.getSubRegion()
357  << " bin=" << bin << " shift=" << iShift << " phi=" << r.getX() << " pti=" << r.getY() << " " << m_qpt[iShift]);
358 
359 
360  }
361 
362  }
363 
364  // Add/Remove history
365  m_vetolist.push_front(m_currentcounts);
366  if (m_vetolist.size() > m_historyWindow) {
367  m_vetolist.pop_back();
368  }
369  }
370 
371  roads.reserve(m_roads.size());
372  for (FPGATrackSimRoad & r : m_roads) roads.push_back(&r);
373 
374  if (roads.size()==0 && m_drawHitMasks) drawHitMasks(hitMasks, m_name + "_fail_e" + std::to_string(m_event));
375 
376  m_event++;
377  return StatusCode::SUCCESS;
378 }
379 
380 
381 
382 bool FPGATrackSimHough1DShiftTool::passThreshold(std::vector<boost::dynamic_bitset<>>& binHits, int bin ) const
383 {
384  // Check the threshold
385  if (binHits[bin].count() < m_threshold) return false;
386 
387  // Apply neighbor veto
388  if (m_neighborWindow>0) {
389  for (int i = -m_neighborWindow; i <= m_neighborWindow; i++) {
390  if ((bin+i < 0) or ((bin+i)>=int(m_phiBins))) continue; // ignore edges
391  if (binHits[bin+i].count()>binHits[bin].count()) {
392  // neighbor has more layers
393  return false;
394  }
395  if (i!=0 && (binHits[bin+i].count()==binHits[bin].count())) {
396  // favor lower phi bin
397  return false;
398  }
399  for (unsigned j = 0; j < m_vetolist.size(); j++) {
400  if (m_vetolist[j][bin+i]>binHits[bin].count()) {
401  // past neighbor has more layers
402  return false;
403  }
404  if ((m_vetolist[j][bin+i]==binHits[bin].count()) and (i<0)) {
405  // favor previous shift and lower phi bin
406  return false;
407  }
408  }
409  }
410  }
411 
412  return true; // passed threshold, wasn't vetoed by neighbors
413 
414 }
415 
416 
417 
418 std::vector<boost::dynamic_bitset<>> FPGATrackSimHough1DShiftTool::makeHitMasks(const std::vector<const FPGATrackSimHit*> & hits)
419 {
420  std::vector<boost::dynamic_bitset<>> hitMasks(m_nLayers, boost::dynamic_bitset<>(m_phiBins));
421  for (const FPGATrackSimHit* hit : hits)
422  {
423  if (m_subRegion >= 0 && !m_FPGATrackSimMapping->SubRegionMap()->isInRegion(m_subRegion, *hit)) continue;
424 
425  auto bins = getBins(hit);
426 
427  for (int i = std::max(bins.first, 0); i <= std::min(bins.second, (int)m_phiBins - 1); i++)
428  hitMasks[hit->getLayer()][i] = true;
429  }
430 
431  return hitMasks;
432 }
433 
434 
435 FPGATrackSimRoad FPGATrackSimHough1DShiftTool::makeRoad(const std::vector<const FPGATrackSimHit*>& hits, int bin_track, size_t iShift)
436 {
437  std::vector<int> const & shifts = m_shifts[iShift];
438  float qpT = m_qpt[iShift];
439 
440  std::vector<const FPGATrackSimHit*> road_hits;
441  layer_bitmask_t hitLayers = 0;
442 
443  for (const FPGATrackSimHit* hit : hits)
444  {
445  if (m_subRegion >= 0 && !m_FPGATrackSimMapping->SubRegionMap()->isInRegion(m_subRegion, *hit)) continue;
446 
447  // Get the shifted bins of the hit
448  auto bins = getBins(hit);
449  bins.first += shifts[hit->getLayer()]; // note boost::dynamic_bitset stores [0] as the LSB, i.e. rightmost. So leftshift = +bin
450  bins.second += shifts[hit->getLayer()];
451 
452  // Check if it's the same bin as the track
453  if (bin_track >= bins.first && bin_track <= bins.second)
454  {
455  road_hits.push_back(hit);
456  hitLayers |= 1 << hit->getLayer();
457  }
458  }
459 
460  auto sorted_hits = ::sortByLayer(road_hits);
461  sorted_hits.resize(m_nLayers); // If no hits in last layer, return from sortByLayer will be too short
462  // Combination of last two addRoad() functions from FPGATrackSimHoughTransformTool.cxx are implemented above (up to here)
463  // Below want to look at first addRoad()/matchIdealGeoSector() function in FPGATrackSimHoughTransformTool.cxx
464 
466  r.setHitLayers(hitLayers);
467  r.setHits(sorted_hits);
468  r.setSubRegion(m_subRegion);
469  if (m_fieldCorrection) {
470  int inner_bin = static_cast<int>(bin_track)-static_cast<int>(shifts[0]);
471  if ((inner_bin < 0) || (inner_bin >= static_cast<int>(m_phiBins))) {
472  r.setX(-100000);
473  } else {
474  r.setX(m_bins[inner_bin] + 0.5*m_phiStep + deltaPhi(m_r[0],qpT));
475  }
476  } else {
477  r.setX(phitrk(bin_track,shifts).first); // will be a large negative number if invalid
478  }
479  r.setY(qpT);
480 
481  if (m_useSectors) r.setSector(m_FPGATrackSimBankSvc->SectorBank_1st()->findSector(sorted_hits));
483 
484  return r;
485  // TODO sector, wildcard layers?
486 }
487 
488 // Taken from "HoughTransformTool.cxx"
490 {
491  // We now look up the binning information in the sector bank.
492  const FPGATrackSimSectorBank* sectorbank = m_FPGATrackSimBankSvc->SectorBank_1st();
493 
494  // Look up q/pt (or |q/pt|) from the Hough road, convert to MeV.
495  double qoverpt = r.getY()*0.001;
496  if (sectorbank->isAbsQOverPtBinning()) {
497  qoverpt = std::abs(qoverpt);
498  }
499 
500  int sectorbin = 0;
501 
502  // Retrieve the bin boundaries from the sector bank; map this onto them.
503  std::vector<double> qoverpt_bins = sectorbank->getQOverPtBins();
504  auto bounds = std::equal_range(qoverpt_bins.begin(), qoverpt_bins.end(), qoverpt);
505 
506  sectorbin = fpgatracksim::QPT_SECTOR_OFFSET*(bounds.first - qoverpt_bins.begin() - 1);
507  if (sectorbin < 0) sectorbin = 0;
508  if ((sectorbin / 10) > static_cast<int>(qoverpt_bins.size() - 2))sectorbin = 10*(qoverpt_bins.size() - 2);
509 
510  if (m_doRegionalMapping){
511  int subregion = r.getSubRegion();
512  sectorbin += subregion*fpgatracksim::SUBREGION_SECTOR_OFFSET;
513  }
514  std::vector<module_t> modules;
515  for (unsigned int il = 0; il < r.getNLayers(); il++) {
516  if (r.getNHits_layer()[il] == 0) {
517  modules.push_back(-1);
518 
519  layer_bitmask_t wc_layers = r.getWCLayers();
520  wc_layers |= (0x1 << il);
521  r.setWCLayers(wc_layers);
522 
523  FPGATrackSimHit *wcHit = new FPGATrackSimHit();
525  wcHit->setLayer(il);
526  wcHit->setDetType(m_FPGATrackSimMapping->PlaneMap_1st()->getDetType(il));
527  std::vector<const FPGATrackSimHit*> wcHits;
528  wcHits.push_back(wcHit);
529  r.setHits(il,wcHits);
530  }
531  else {
532  modules.push_back(sectorbin);
533  }
534  }
535 
536  // If we are using eta patterns. We need to first run the roads through the road filter.
537  // Then the filter will be responsible for setting the actual sector.
538  // As a hack, we can store the sector bin ID in the road for now.
539  // This is fragile! If we want to store a different ID for each layer, it will break.
540 
541  // Similarly, we do the same thing for spacepoints. this probably means we can't combine the two.
542  // maybe better to store the module array instead of just a number?
543 
544  r.setSectorBin(sectorbin);
546  r.setSector(sectorbank->findSector(modules));
547  }
548 }
549 
550 
552 // Helpers
553 
554 // Given a relative shift between iterLayer and layer 0, returns the corresponding qpt.
555 // This does a linear approximation of the Hough transform equation.
557 {
558  if (m_iterLayer == 0u) ATH_MSG_FATAL("getPtFromShiftDiff() iterLayer can't be 0");
559  return (shift * m_phiStep / fpgatracksim::A) / (m_r[m_iterLayer] - m_r[0]);
560 }
561 
562 
563 // Returns the range of bins (inclusive) given a phi and an extension in number of bins
564 std::pair<int, int> FPGATrackSimHough1DShiftTool::getBins(const FPGATrackSimHit* hit) const
565 {
566  float phi = hit->getGPhi();
567  float bin_extend = m_hitExtend[hit->getLayer()];
568  float center = (phi - m_phiMin) / m_phiStep;
569 
570  if (m_variableExtend){
571  float r = hit->getR();
572  float dphimax = deltaPhi(r,m_qptMax);
573  float maxshift = +1*((std::sin(dphimax)*(r-m_r[hit->getLayer()]))/r)/m_phiStep;
574  float dphimin = deltaPhi(r,m_qptMin);
575  float minshift = +1*((std::sin(dphimin)*(r-m_r[hit->getLayer()]))/r)/m_phiStep;
576 
577  center += (maxshift+minshift)/2.0;
578  bin_extend += std::abs((maxshift-minshift)/2.0);
579 
580  }
581 
582  int low = std::max(static_cast<int>(center - bin_extend),0);
583  int high = std::min(static_cast<int>(center + bin_extend),static_cast<int>(m_phiBins-1));
584  return { low, high };
585 }
586 
588 {
589  if (m_useDiff) {
590  float r1=m_r[0];
591  float r2=r;
592  float sign = deltaPhi>0 ? 1 : -1;
593  return sign*1/(2*fpgatracksim::A) * std::sqrt((4*std::sin(deltaPhi)*std::sin(deltaPhi))/( r1*r1 + r2*r2 -2*r2*r1*std::cos(deltaPhi)));
594  }
595  return std::sin(deltaPhi) / (fpgatracksim::A * r);
596 }
597 
598 float FPGATrackSimHough1DShiftTool::phitrkDiff(float r1, float phi1, float r2, float phi2) const
599 {
600  float phi_track = phi1+ std::atan2(r2-r1*std::cos(phi2-phi1),r1*std::sin(phi2-phi1)) - TMath::Pi()/2.0;
601  return phi_track;
602 }
603 
604 
605 std::pair<float, bool> FPGATrackSimHough1DShiftTool::phitrk(int bin, std::vector<int> const & shifts ) const
606 {
607  int inner_bin = static_cast<int>(bin)-static_cast<int>(shifts[0]);
608  int outer_bin = static_cast<int>(bin)-static_cast<int>(shifts[m_nLayers-1]);
609  if ((inner_bin < 0) || (inner_bin >= static_cast<int>(m_phiBins))) return {-100000,false};
610  if ((outer_bin < 0) || (outer_bin >= static_cast<int>(m_phiBins))) return {-100000,false};
611  float phi1 = m_bins[inner_bin];
612  float phi2 = m_bins[outer_bin];
613  float phi_track = phitrkDiff(m_r[0],phi1,m_r[m_nLayers-1],phi2)+0.5*m_phiStep;
614  return {phi_track,true};
615 }
616 
617 
618 float FPGATrackSimHough1DShiftTool::deltaPhi(float r, float qPt) const
619 {
620  float dPhi = std::asin(fpgatracksim::A * r * qPt);
622  return dPhi;
623 }
624 
625 
626 static inline std::string to_string(std::vector<size_t> v)
627 {
628  std::ostringstream oss;
629  oss << "[";
630  if (!v.empty())
631  {
632  std::copy(v.begin(), v.end()-1, std::ostream_iterator<size_t>(oss, ", "));
633  oss << v.back();
634  }
635  oss << "]";
636  return oss.str();
637 }
638 
639 
640 static inline boost::dynamic_bitset<> lshift(boost::dynamic_bitset<> const & b, int n)
641 {
642  if (n < 0) return rshift(b, -n);
643  return b << n;
644 }
645 
646 static inline boost::dynamic_bitset<> rshift(boost::dynamic_bitset<> const & b, int n)
647 {
648  if (n < 0) return lshift(b, -n);
649 
650  boost::dynamic_bitset<> out(b >> n);
651 
652  // Force 0-padding
653  for (int i = 0; i < n; i++)
654  out[out.size() - 1 - i] = false;
655 
656  return out;
657 }
658 
659 static inline void updateBinHits(std::vector<boost::dynamic_bitset<>> & binHits, unsigned layer, boost::dynamic_bitset<> const & b)
660 {
661  for (size_t i = 0; i < b.size(); i++)
662  if (b[i]) binHits[i].set(layer);
663 }
664 
665 void FPGATrackSimHough1DShiftTool::printHitMasks(std::vector<boost::dynamic_bitset<>> const & hitMasks) const
666 {
667  std::stringstream ss;
668  ss << "Hit Masks:\n";
669  for (auto const & b : hitMasks)
670  {
671  ss << "\t";
672  for (size_t i = 0; i < b.size(); i++)
673  {
674  if (b[i]) ss << 1;
675  else ss << ".";
676  }
677  ss << "\n";
678  }
679  ATH_MSG_DEBUG(ss.str() << "\n\n");
680 }
681 
682 void FPGATrackSimHough1DShiftTool::drawHitMasks(std::vector<boost::dynamic_bitset<>> const & hitMasks, std::string const & name)
683 {
684  m_monitorFile.cd();
685 
686  TH2F h(name.c_str(), "Hough 1D Shift;phi;layer",
688  m_nLayers, 0, m_nLayers
689  );
690 
691  for (size_t layer = 0; layer < m_nLayers; layer++)
692  for (size_t i = 0; i < m_phiBins; i++)
693  h.SetBinContent(i+1, layer+1, hitMasks[layer][i]); // +1 since root bins are 1-indexed
694 
695  h.Write();
696 }
697 
698 void FPGATrackSimHough1DShiftTool::drawHitMasks(std::vector<boost::dynamic_bitset<>> const & hitMasks, std::string const & name, std::vector<int> const & shifts)
699 {
700  std::vector<boost::dynamic_bitset<>> shiftedMasks;
701  for (size_t layer = 0; layer < m_nLayers; layer++)
702  shiftedMasks.push_back(lshift(hitMasks[layer], shifts[layer]));
703 
704  drawHitMasks(shiftedMasks, name);
705 }
706 
708 {
709  std::stringstream ss;
710  ss << "Shifts:\n";
711  for (size_t i = 0; i < m_shifts.size(); i++)
712  {
713  float qpt = qPt(m_r[m_iterLayer], m_phiStep * m_shifts[i][m_iterLayer]); // q/pT represented by this shift
714  ss << "q/pT=" << qpt << "; ";
715  for (int shift : m_shifts[i]) ss << shift << " ";
716  if (!m_dropable.empty()) ss << m_dropable[i];
717  ss << "\n";
718  }
719  ATH_MSG_VERBOSE(ss.str());
720 }
721 
722 
724 {
725  int steps=1;
726  while (true) {
727  float d0step = steps*m_phiStep*m_r[0];
728  ATH_MSG_DEBUG("d0step = " << d0step);
729  std::vector<int> d0shift;
730  for (unsigned lyr = 0; lyr < m_nLayers; lyr++) {
731  float phi_for_d0step = d0step/m_r[lyr];
732  int shift = static_cast<int>(round(phi_for_d0step/ m_phiStep));
733  d0shift.push_back(shift);
734  }
735  m_d0shifts.push_back(d0shift);
736  if (d0step>m_d0spread) break;
737  ++steps;
738  }
739  ATH_MSG_DEBUG("d0 Shifts Found = " << m_d0shifts.size());
740 }
741 
742 std::vector<int> FPGATrackSimHough1DShiftTool::applyVariation(const std::vector<int>& base, const std::vector<int>& var, int sign) const
743 {
744  std::vector<int> retv;
745 
746  if (base.size()!=var.size()) {
747  ATH_MSG_ERROR("Base and Var lengths must match " << base.size() << " " << var.size() );
748  }
749 
750  for (unsigned i = 0; i < base.size(); i++) {
751  retv.push_back(base[i]+sign*var[i]);
752  }
753  return retv;
754 }
755 
756 std::vector<int> FPGATrackSimHough1DShiftTool::shiftWithDrop(std::vector<int>& shift,unsigned droplayer) const
757 {
758  std::vector<int> retv(m_nLayers-1);
759  for (unsigned lyr = 0; lyr < m_nLayers; lyr++) {
760  if (lyr !=droplayer) retv.push_back(shift[lyr]);
761  }
762  return retv;
763 }
764 
766 {
767 
768  // one set per layer with shift set
769  std::vector< std::set< std::vector<int> > > reducedShifts(m_nLayers);
770 
771  m_dropable.resize(m_shifts.size());
772 
773  for (size_t iShift = 0; iShift < m_shifts.size(); iShift++)
774  {
775  boost::dynamic_bitset<> drops(m_nLayers);
776  for (unsigned droplayer =0; droplayer < m_nLayers; droplayer++) {
777  if (reducedShifts[droplayer].insert(shiftWithDrop(m_shifts[iShift],droplayer)).second) {
778  // true if the is a new shift in the set
779  drops.set(droplayer);
780  }
781  }
782 
783  m_dropable[iShift]=drops;
784 
785  }
786 
787 }
788 
789 
790 static inline int layersHit(FPGATrackSimRoad& r) {
791  int cnt =0;
792  for (unsigned i = 0; i < r.getNLayers(); i++) {
793  if (r.getHitLayers() & (1<<i)) cnt++;
794  }
795  return cnt;
796 }
FPGATrackSimHough1DShiftTool::printHitMasks
void printHitMasks(std::vector< boost::dynamic_bitset<>> const &hitMasks) const
Definition: FPGATrackSimHough1DShiftTool.cxx:665
fpgatracksim::SUBREGION_SECTOR_OFFSET
constexpr int SUBREGION_SECTOR_OFFSET
Definition: FPGATrackSimConstants.h:24
FPGATrackSimHough1DShiftTool::deltaPhi
float deltaPhi(float r, float qPt) const
Definition: FPGATrackSimHough1DShiftTool.cxx:618
PlotCalibFromCool.il
il
Definition: PlotCalibFromCool.py:381
base
std::string base
Definition: hcg.cxx:78
FPGATrackSimHough1DShiftTool::m_traceHits
Gaudi::Property< bool > m_traceHits
Definition: FPGATrackSimHough1DShiftTool.h:111
beamspotman.r
def r
Definition: beamspotman.py:676
FPGATrackSimHough1DShiftTool::calculated0Shifts
void calculated0Shifts()
Definition: FPGATrackSimHough1DShiftTool.cxx:723
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
beamspotnt.var
var
Definition: bin/beamspotnt.py:1394
FPGATrackSimHough1DShiftTool::m_doEtaPatternConsts
Gaudi::Property< bool > m_doEtaPatternConsts
Definition: FPGATrackSimHough1DShiftTool.h:113
getMenu.algname
algname
Definition: getMenu.py:53
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
FPGATrackSimHough1DShiftTool::m_fieldCorrection
Gaudi::Property< bool > m_fieldCorrection
Definition: FPGATrackSimHough1DShiftTool.h:141
module_driven_slicing.nslices
nslices
Definition: module_driven_slicing.py:575
checkFileSG.line
line
Definition: checkFileSG.py:75
FPGATrackSimTrackPars::phi
double phi
Definition: FPGATrackSimTrackPars.h:24
FPGATrackSimRegionSlices.h
Stores slice definitions for FPGATrackSim regions.
FPGATrackSimHough1DShiftTool::m_regionMax
FPGATrackSimTrackPars m_regionMax
Definition: FPGATrackSimHough1DShiftTool.h:159
max
#define max(a, b)
Definition: cfImp.cxx:41
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
FPGATrackSimHoughTransformTool::fieldCorrection
static double fieldCorrection(unsigned region, double y, double r)
Definition: FPGATrackSimHoughTransformTool.cxx:301
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
python.App.bins
bins
Definition: App.py:410
FPGATrackSimPlaneMap.h
Maps physical layers to logical layers.
FPGATrackSimHough1DShiftTool::m_phiStep
float m_phiStep
Definition: FPGATrackSimHough1DShiftTool.h:153
FPGATrackSimHough1DShiftTool::calculateShifts
void calculateShifts()
Definition: FPGATrackSimHough1DShiftTool.cxx:124
TH2F
Definition: rootspy.cxx:420
FPGATrackSimHough1DShiftTool::m_threshold
Gaudi::Property< unsigned > m_threshold
Definition: FPGATrackSimHough1DShiftTool.h:127
xAOD::deltaPhi
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap setEtaBin setIsTgcFailure setDeltaPt deltaPhi
Definition: L2StandAloneMuon_v1.cxx:160
FPGATrackSimHough1DShiftTool::phitrk
std::pair< float, bool > phitrk(int bin, std::vector< int > const &shifts) const
Definition: FPGATrackSimHough1DShiftTool.cxx:605
FPGATrackSimHough1DShiftTool::m_qpt
std::vector< float > m_qpt
Definition: FPGATrackSimHough1DShiftTool.h:165
IFPGATrackSimMappingSvc.h
FPGATrackSimHoughTransformTool.h
Implements road finding using a Hough transform.
MuonGM::round
float round(const float toRound, const unsigned int decimals)
Definition: Mdt.cxx:27
FPGATrackSimHough1DShiftTool::m_regionMin
FPGATrackSimTrackPars m_regionMin
Definition: FPGATrackSimHough1DShiftTool.h:158
FPGATrackSimHit::getLayer
unsigned getLayer() const
Definition: FPGATrackSimHit.cxx:75
FPGATrackSimHough1DShiftTool::getBins
std::pair< int, int > getBins(const FPGATrackSimHit *) const
Definition: FPGATrackSimHough1DShiftTool.cxx:564
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
FPGATrackSimHough1DShiftTool::m_phiMax
Gaudi::Property< float > m_phiMax
Definition: FPGATrackSimHough1DShiftTool.h:122
bin
Definition: BinsDiffFromStripMedian.h:43
FPGATrackSimHough1DShiftTool::m_phiRangeCut
Gaudi::Property< bool > m_phiRangeCut
Definition: FPGATrackSimHough1DShiftTool.h:133
FPGATrackSimHough1DShiftTool::m_FPGATrackSimMapping
ServiceHandle< IFPGATrackSimMappingSvc > m_FPGATrackSimMapping
Definition: FPGATrackSimHough1DShiftTool.h:106
FPGATrackSimHough1DShiftTool::m_vetolist
std::deque< std::vector< unsigned > > m_vetolist
Definition: FPGATrackSimHough1DShiftTool.h:169
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
FPGATrackSimHough1DShiftTool::makeHitMasks
std::vector< boost::dynamic_bitset<> > makeHitMasks(const std::vector< const FPGATrackSimHit * > &hits)
Definition: FPGATrackSimHough1DShiftTool.cxx:418
FPGATrackSimHough1DShiftTool::m_doRegionalMapping
Gaudi::Property< bool > m_doRegionalMapping
Definition: FPGATrackSimHough1DShiftTool.h:117
FPGATrackSimHough1DShiftTool.h
Implements road finding using Elliot's simplified Hough transform.
FPGATrackSimHough1DShiftTool::m_subRegion
Gaudi::Property< int > m_subRegion
Definition: FPGATrackSimHough1DShiftTool.h:120
FPGATrackSimHough1DShiftTool::m_bins
std::vector< double > m_bins
Definition: FPGATrackSimHough1DShiftTool.h:154
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:83
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
FPGATrackSimHough1DShiftTool::m_applyDropable
Gaudi::Property< bool > m_applyDropable
Definition: FPGATrackSimHough1DShiftTool.h:138
FPGATrackSimConstants.h
FPGATrackSimSectorBank::getQOverPtBins
const std::vector< double > & getQOverPtBins() const
Definition: FPGATrackSimSectorBank.h:50
FPGATrackSimHough1DShiftTool::m_currentcounts
std::vector< unsigned > m_currentcounts
Definition: FPGATrackSimHough1DShiftTool.h:168
FPGATrackSimHough1DShiftTool::shiftWithDrop
std::vector< int > shiftWithDrop(std::vector< int > &shift, unsigned droplayer) const
Definition: FPGATrackSimHough1DShiftTool.cxx:756
FPGATrackSimHit
Definition: FPGATrackSimHit.h:38
FPGATrackSimHough1DShiftTool::m_event
unsigned m_event
Definition: FPGATrackSimHough1DShiftTool.h:180
FPGATrackSimHough1DShiftTool::m_neighborWindow
Gaudi::Property< int > m_neighborWindow
Definition: FPGATrackSimHough1DShiftTool.h:139
FPGATrackSimHit::getGPhi
float getGPhi() const
Definition: FPGATrackSimHit.h:129
HitType::wildcard
@ wildcard
FPGATrackSimRegionMap.h
Maps ITK module indices to FPGATrackSim regions.
FPGATrackSimHough1DShiftTool::m_dropable
std::vector< boost::dynamic_bitset<> > m_dropable
Definition: FPGATrackSimHough1DShiftTool.h:162
FPGATrackSimHough1DShiftTool::drawHitMasks
void drawHitMasks(std::vector< boost::dynamic_bitset<>> const &hitMasks, std::string const &name)
Definition: FPGATrackSimHough1DShiftTool.cxx:682
FPGATrackSimHough1DShiftTool::finalize
virtual StatusCode finalize() override
Definition: FPGATrackSimHough1DShiftTool.cxx:307
FPGATrackSimHit::setDetType
void setDetType(SiliconTech detType)
Definition: FPGATrackSimHit.h:52
beamspotman.steps
int steps
Definition: beamspotman.py:505
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
FPGATrackSimHough1DShiftTool::m_variableExtend
Gaudi::Property< bool > m_variableExtend
Definition: FPGATrackSimHough1DShiftTool.h:132
FPGATrackSimHough1DShiftTool::m_shifts
std::vector< std::vector< int > > m_shifts
Definition: FPGATrackSimHough1DShiftTool.h:161
FPGATrackSimSectorBank::findSector
sector_t findSector(std::vector< module_t > const &modules) const
Definition: FPGATrackSimSectorBank.cxx:121
FPGATrackSimHough1DShiftTool::m_useSectors
Gaudi::Property< bool > m_useSectors
Definition: FPGATrackSimHough1DShiftTool.h:115
FPGATrackSimHough1DShiftTool::qPt
float qPt(float r, float deltaPhi) const
Definition: FPGATrackSimHough1DShiftTool.cxx:587
FPGATrackSimHough1DShiftTool::m_d0spread
Gaudi::Property< float > m_d0spread
Definition: FPGATrackSimHough1DShiftTool.h:135
lumiFormat.i
int i
Definition: lumiFormat.py:92
FPGATrackSimHough1DShiftTool::m_hitExtendProperty
Gaudi::Property< std::vector< float > > m_hitExtendProperty
Definition: FPGATrackSimHough1DShiftTool.h:136
FPGATrackSimHough1DShiftTool::getRoads
virtual StatusCode getRoads(const std::vector< const FPGATrackSimHit * > &hits, std::vector< FPGATrackSimRoad * > &roads) override
Definition: FPGATrackSimHough1DShiftTool.cxx:316
beamspotman.n
n
Definition: beamspotman.py:731
FPGATrackSimHough1DShiftTool::m_historyWindow
Gaudi::Property< unsigned > m_historyWindow
Definition: FPGATrackSimHough1DShiftTool.h:140
FPGATrackSimHough1DShiftTool::FPGATrackSimHough1DShiftTool
FPGATrackSimHough1DShiftTool(const std::string &, const std::string &, const IInterface *)
Definition: FPGATrackSimHough1DShiftTool.cxx:39
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
extractSporadic.h
list h
Definition: extractSporadic.py:97
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
LArG4ShowerLibProcessing.hits
hits
Definition: LArG4ShowerLibProcessing.py:136
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
TauGNNUtils::Variables::Track::dPhi
bool dPhi(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:530
FPGATrackSimHough1DShiftTool::m_useDiff
Gaudi::Property< bool > m_useDiff
Definition: FPGATrackSimHough1DShiftTool.h:131
FPGATrackSimHough1DShiftTool::m_idealGeoRoads
Gaudi::Property< bool > m_idealGeoRoads
Definition: FPGATrackSimHough1DShiftTool.h:116
FPGATrackSimHough1DShiftTool::m_qptMin
Gaudi::Property< float > m_qptMin
Definition: FPGATrackSimHough1DShiftTool.h:123
sign
int sign(int a)
Definition: TRT_StrawNeighbourSvc.h:127
FPGATrackSimHough1DShiftTool::matchIdealGeoSector
void matchIdealGeoSector(FPGATrackSimRoad &r) const
Definition: FPGATrackSimHough1DShiftTool.cxx:489
FPGATrackSimHough1DShiftTool::phitrkDiff
float phitrkDiff(float r1, float phi1, float r2, float phi2) const
Definition: FPGATrackSimHough1DShiftTool.cxx:598
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
sortByLayer
std::vector< std::vector< const FPGATrackSimHit * > > sortByLayer(Container const &hits)
Definition: FPGATrackSimHit.h:215
FPGATrackSimHough1DShiftTool::readShifts
void readShifts(std::string const &filepath)
Definition: FPGATrackSimHough1DShiftTool.cxx:190
FPGATrackSimHough1DShiftTool::m_qptMax
Gaudi::Property< float > m_qptMax
Definition: FPGATrackSimHough1DShiftTool.h:124
FPGATrackSimHough1DShiftTool::m_bitShift_path
Gaudi::Property< std::string > m_bitShift_path
Definition: FPGATrackSimHough1DShiftTool.h:137
FPGATrackSimHough1DShiftTool::m_iterLayer
Gaudi::Property< unsigned > m_iterLayer
Definition: FPGATrackSimHough1DShiftTool.h:129
FPGATrackSimHough1DShiftTool::m_EvtSel
ServiceHandle< IFPGATrackSimEventSelectionSvc > m_EvtSel
Definition: FPGATrackSimHough1DShiftTool.h:104
FPGATrackSimHough1DShiftTool::m_drawHitMasks
Gaudi::Property< bool > m_drawHitMasks
Definition: FPGATrackSimHough1DShiftTool.h:118
FPGATrackSimSectorBank
Definition: FPGATrackSimSectorBank.h:30
min
#define min(a, b)
Definition: cfImp.cxx:40
fpgatracksim::QPT_SECTOR_OFFSET
constexpr int QPT_SECTOR_OFFSET
Definition: FPGATrackSimConstants.h:23
FPGATrackSimHough1DShiftTool::m_useSpacePoints
Gaudi::Property< bool > m_useSpacePoints
Definition: FPGATrackSimHough1DShiftTool.h:114
FPGATrackSimHough1DShiftTool::m_phivals
std::vector< std::vector< float > > m_phivals
Definition: FPGATrackSimHough1DShiftTool.h:166
FPGATrackSimHough1DShiftTool::m_monitorFile
TFile m_monitorFile
Definition: FPGATrackSimHough1DShiftTool.h:182
FPGATrackSimHough1DShiftTool::calculateDropable
void calculateDropable()
Definition: FPGATrackSimHough1DShiftTool.cxx:765
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
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
plotBeamSpotVxVal.bin
int bin
Definition: plotBeamSpotVxVal.py:83
FPGATrackSimHit.h
: FPGATrackSim-specific class to represent an hit in the detector.
FPGATrackSimHough1DShiftTool::m_r
std::vector< float > m_r
Definition: FPGATrackSimHough1DShiftTool.h:146
python.PyAthena.v
v
Definition: PyAthena.py:157
FPGATrackSimHough1DShiftTool::getPtFromShiftDiff
float getPtFromShiftDiff(int shift) const
Definition: FPGATrackSimHough1DShiftTool.cxx:556
FPGATrackSimHit::getR
float getR() const
Definition: FPGATrackSimHit.h:128
FPGATrackSimHit::setLayer
void setLayer(unsigned v)
Definition: FPGATrackSimHit.h:87
h
IFPGATrackSimEventSelectionSvc.h
RunTileMonitoring.towers
towers
Definition: RunTileMonitoring.py:133
trigbs_pickEvents.cnt
cnt
Definition: trigbs_pickEvents.py:71
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
FPGATrackSimHough1DShiftTool::initialize
virtual StatusCode initialize() override
Definition: FPGATrackSimHough1DShiftTool.cxx:46
layer_bitmask_t
uint32_t layer_bitmask_t
Definition: FPGATrackSimTypes.h:22
FPGATrackSimHough1DShiftTool::m_iterStep
Gaudi::Property< unsigned > m_iterStep
Definition: FPGATrackSimHough1DShiftTool.h:128
IFPGATrackSimBankSvc.h
FPGATrackSimSectorBank::isAbsQOverPtBinning
bool isAbsQOverPtBinning() const
Definition: FPGATrackSimSectorBank.h:52
FPGATrackSimHough1DShiftTool::m_roads
std::vector< FPGATrackSimRoad > m_roads
Definition: FPGATrackSimHough1DShiftTool.h:175
compute_lumi.fin
fin
Definition: compute_lumi.py:19
FPGATrackSimHough1DShiftTool::m_nLayers
unsigned m_nLayers
Definition: FPGATrackSimHough1DShiftTool.h:151
FPGATrackSimHough1DShiftTool::printShifts
void printShifts() const
Definition: FPGATrackSimHough1DShiftTool.cxx:707
FPGATrackSimHough1DShiftTool::m_phiBins
Gaudi::Property< unsigned > m_phiBins
Definition: FPGATrackSimHough1DShiftTool.h:126
calibdata.copy
bool copy
Definition: calibdata.py:27
FPGATrackSimHough1DShiftTool::applyVariation
std::vector< int > applyVariation(const std::vector< int > &base, const std::vector< int > &var, int sign) const
Definition: FPGATrackSimHough1DShiftTool.cxx:742
FPGATrackSimHough1DShiftTool::m_d0shifts
std::vector< std::vector< int > > m_d0shifts
Definition: FPGATrackSimHough1DShiftTool.h:167
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
FPGATrackSimHough1DShiftTool::passThreshold
bool passThreshold(std::vector< boost::dynamic_bitset<>> &binHits, int bin) const
Definition: FPGATrackSimHough1DShiftTool.cxx:382
FPGATrackSimTypes.h
FPGATrackSimHough1DShiftTool::m_phiMin
Gaudi::Property< float > m_phiMin
Definition: FPGATrackSimHough1DShiftTool.h:121
FPGATrackSimHough1DShiftTool::m_enhanceHighPt
Gaudi::Property< float > m_enhanceHighPt
Definition: FPGATrackSimHough1DShiftTool.h:142
readCCLHist.float
float
Definition: readCCLHist.py:83
FPGATrackSimHough1DShiftTool::m_hitExtend
std::vector< float > m_hitExtend
Definition: FPGATrackSimHough1DShiftTool.h:145
FPGATrackSimSectorBank.h
This file declares a class that stores the module IDs of the sectors.
FPGATrackSimRoad
Definition: FPGATrackSimRoad.h:29
FPGATrackSimHough1DShiftTool::m_name
std::string m_name
Definition: FPGATrackSimHough1DShiftTool.h:181
FPGATrackSimHough1DShiftTool::m_FPGATrackSimBankSvc
ServiceHandle< IFPGATrackSimBankSvc > m_FPGATrackSimBankSvc
Definition: FPGATrackSimHough1DShiftTool.h:105
FPGATrackSimHit::setHitType
void setHitType(HitType type)
Definition: FPGATrackSimHit.h:51
FPGATrackSimHough1DShiftTool::makeRoad
FPGATrackSimRoad makeRoad(const std::vector< const FPGATrackSimHit * > &hits, int bin_track, size_t iShift)
Definition: FPGATrackSimHough1DShiftTool.cxx:435