ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
FPGATrackSimHough1DShiftTool Class Reference

#include <FPGATrackSimHough1DShiftTool.h>

Inheritance diagram for FPGATrackSimHough1DShiftTool:
Collaboration diagram for FPGATrackSimHough1DShiftTool:

Public Member Functions

 FPGATrackSimHough1DShiftTool (const std::string &, const std::string &, const IInterface *)
 
virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 
virtual StatusCode getRoads (const std::vector< const FPGATrackSimHit * > &hits, std::vector< FPGATrackSimRoad * > &roads) override
 

Private Member Functions

void calculateShifts ()
 
float getPtFromShiftDiff (int shift) const
 
void readShifts (std::string const &filepath)
 
std::vector< boost::dynamic_bitset<> > makeHitMasks (const std::vector< const FPGATrackSimHit * > &hits)
 
FPGATrackSimRoad makeRoad (const std::vector< const FPGATrackSimHit * > &hits, int bin_track, size_t iShift)
 
void matchIdealGeoSector (FPGATrackSimRoad &r) const
 
bool passThreshold (std::vector< boost::dynamic_bitset<>> &binHits, int bin) const
 
void printHitMasks (std::vector< boost::dynamic_bitset<>> const &hitMasks) const
 
void drawHitMasks (std::vector< boost::dynamic_bitset<>> const &hitMasks, std::string const &name)
 
void drawHitMasks (std::vector< boost::dynamic_bitset<>> const &hitMasks, std::string const &name, std::vector< int > const &shifts)
 
void printShifts () const
 
std::pair< int, int > getBins (const FPGATrackSimHit *) const
 
float phitrkDiff (float r1, float phi1, float r2, float phi2) const
 
std::pair< float, bool > phitrk (int bin, std::vector< int > const &shifts) const
 
float qPt (float r, float deltaPhi) const
 
float deltaPhi (float r, float qPt) const
 
void calculated0Shifts ()
 
std::vector< int > applyVariation (const std::vector< int > &base, const std::vector< int > &var, int sign) const
 
void calculateDropable ()
 
std::vector< int > shiftWithDrop (std::vector< int > &shift, unsigned droplayer) const
 

Private Attributes

ServiceHandle< IFPGATrackSimEventSelectionSvcm_EvtSel {this, "FPGATrackSimEventSelectionSvc", "FPGATrackSimEventSelectionSvc"}
 
ServiceHandle< IFPGATrackSimBankSvcm_FPGATrackSimBankSvc {this, "FPGATrackSimBankSvc", "FPGATrackSimBankSvc"}
 
ServiceHandle< IFPGATrackSimMappingSvcm_FPGATrackSimMapping {this, "FPGATrackSimMappingSvc", "FPGATrackSimMappingSvc"}
 
Gaudi::Property< bool > m_traceHits { this, "traceHits", true, "Trace each hit that goes in a bin. Disabling this will save memory/time since each bin doesn't have to store all its hits but the roads created won't have hits from convolution, etc."}
 
Gaudi::Property< bool > m_doEtaPatternConsts { this, "doEtaPatternConsts", false, "Whether to use the eta pattern tool for constant generation"}
 
Gaudi::Property< bool > m_useSpacePoints { this, "useSpacePoints", false, "Whether we are using spacepoints." }
 
Gaudi::Property< bool > m_useSectors { this, "useSectors", false, "Will reverse calculate the sector for track-fitting purposes" }
 
Gaudi::Property< bool > m_idealGeoRoads { this, "IdealGeoRoads", false, "Set sectors to use ideal geometry fit constants" }
 
Gaudi::Property< bool > m_doRegionalMapping { this, "RegionalMapping", false, "Use the sub-region maps to define the sector" }
 
Gaudi::Property< bool > m_drawHitMasks { this, "drawHitMasks", false, "Draws hit masks if true"}
 
Gaudi::Property< int > m_subRegion { this, "subRegion", 0, "Sub region of this transform, or -1 for full region" }
 
Gaudi::Property< float > m_phiMin { this, "phiMin", 0, "Minimum phi of transform" }
 
Gaudi::Property< float > m_phiMax { this, "phiMax", 0, "Maximum phi of transform" }
 
Gaudi::Property< float > m_qptMin { this, "qptMin", 0, "Minimum q/pT of transform" }
 
Gaudi::Property< float > m_qptMax { this, "qptMax", 0, "Maximum q/pT of transform" }
 
Gaudi::Property< unsigned > m_phiBins { this, "nBins", 0, "Number of phi bins used by transform." }
 
Gaudi::Property< unsigned > m_threshold { this, "threshold", 0, "Minimum number of layers hit to accept as a road (inclusive)" }
 
Gaudi::Property< unsigned > m_iterStep { this, "iterStep", 0, "Instead of iterating over steps in pT, we iterate over iterStep-bin shifts in iterLayer" }
 
Gaudi::Property< unsigned > m_iterLayer { this, "iterLayer", 0, "Instead of iterating over steps in pT, we iterate over iterStep-bin shifts in iterLayer" }
 
Gaudi::Property< bool > m_useDiff { this, "useDiff", false, "Use the diff of inner and outer layer" }
 
Gaudi::Property< bool > m_variableExtend { this, "variableExtend", false, "Do variable extension based off of hit delta R" }
 
Gaudi::Property< bool > m_phiRangeCut {this, "phiRangeCut", false, "Require tracks to be in phi range to avoid counting minbias roads for larger region" }
 
Gaudi::Property< float > m_d0spread {this, "d0spread", -1.0, "Make patterns with a d0spread as given, negative value turns it off" }
 
Gaudi::Property< std::vector< float > > m_hitExtendProperty {this, "hitExtend", {}, "Number of adjacent bins that a hit triggers" }
 
Gaudi::Property< std::string > m_bitShift_path { this, "bitShifts", "", "Instead of calculating bit shifts, input a list of shifts via a text file" }
 
Gaudi::Property< bool > m_applyDropable { this, "applyDropable", false, "Enable logic that prevents redundant patterns with dropped hits" }
 
Gaudi::Property< int > m_neighborWindow { this, "neighborWindow", 0, "Supress if neighbors have higher number of hit layers" }
 
Gaudi::Property< unsigned > m_historyWindow {this, "historyWindow", 0, "Suppress if previous N bit shifts have neighbors with higher nubmer of hit layers" }
 
Gaudi::Property< bool > m_fieldCorrection {this, "fieldCorrection", true, "Apply corrections to hough equation due to field nonuniformity" }
 
Gaudi::Property< float > m_enhanceHighPt {this, "enhanceHighPt", -1.0, "if positive, double number of patterns for region with qpT below value" }
 
std::vector< float > m_hitExtend
 
std::vector< float > m_r
 
unsigned m_nLayers
 
float m_phiStep
 
std::vector< double > m_bins
 
FPGATrackSimTrackPars m_regionMin
 
FPGATrackSimTrackPars m_regionMax
 
std::vector< std::vector< int > > m_shifts
 
std::vector< boost::dynamic_bitset<> > m_dropable
 
std::vector< float > m_qpt
 
std::vector< std::vector< float > > m_phivals
 
std::vector< std::vector< int > > m_d0shifts
 
std::vector< unsigned > m_currentcounts
 
std::deque< std::vector< unsigned > > m_vetolist
 
std::vector< FPGATrackSimRoadm_roads
 
unsigned m_event = 0
 
std::string m_name
 
TFile m_monitorFile
 

Detailed Description

Definition at line 83 of file FPGATrackSimHough1DShiftTool.h.

Constructor & Destructor Documentation

◆ FPGATrackSimHough1DShiftTool()

FPGATrackSimHough1DShiftTool::FPGATrackSimHough1DShiftTool ( const std::string &  algname,
const std::string &  name,
const IInterface *  ifc 
)

Definition at line 39 of file FPGATrackSimHough1DShiftTool.cxx.

39  :
40  base_class(algname, name, ifc)
41 {
42  declareInterface<IFPGATrackSimRoadFinderTool>(this);
43 }

Member Function Documentation

◆ applyVariation()

std::vector< int > FPGATrackSimHough1DShiftTool::applyVariation ( const std::vector< int > &  base,
const std::vector< int > &  var,
int  sign 
) const
private

Definition at line 742 of file FPGATrackSimHough1DShiftTool.cxx.

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 }

◆ calculated0Shifts()

void FPGATrackSimHough1DShiftTool::calculated0Shifts ( )
private

Definition at line 723 of file FPGATrackSimHough1DShiftTool.cxx.

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 }

◆ calculateDropable()

void FPGATrackSimHough1DShiftTool::calculateDropable ( )
private

Definition at line 765 of file FPGATrackSimHough1DShiftTool.cxx.

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 }

◆ calculateShifts()

void FPGATrackSimHough1DShiftTool::calculateShifts ( )
private

Definition at line 124 of file FPGATrackSimHough1DShiftTool.cxx.

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 }

◆ deltaPhi()

float FPGATrackSimHough1DShiftTool::deltaPhi ( float  r,
float  qPt 
) const
private

Definition at line 618 of file FPGATrackSimHough1DShiftTool.cxx.

619 {
620  float dPhi = std::asin(fpgatracksim::A * r * qPt);
622  return dPhi;
623 }

◆ drawHitMasks() [1/2]

void FPGATrackSimHough1DShiftTool::drawHitMasks ( std::vector< boost::dynamic_bitset<>> const hitMasks,
std::string const name 
)
private

Definition at line 682 of file FPGATrackSimHough1DShiftTool.cxx.

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 }

◆ drawHitMasks() [2/2]

void FPGATrackSimHough1DShiftTool::drawHitMasks ( std::vector< boost::dynamic_bitset<>> const hitMasks,
std::string const name,
std::vector< int > const shifts 
)
private

Definition at line 698 of file FPGATrackSimHough1DShiftTool.cxx.

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 }

◆ finalize()

StatusCode FPGATrackSimHough1DShiftTool::finalize ( )
overridevirtual

Definition at line 307 of file FPGATrackSimHough1DShiftTool.cxx.

308 {
309  return StatusCode::SUCCESS;
310 }

◆ getBins()

std::pair< int, int > FPGATrackSimHough1DShiftTool::getBins ( const FPGATrackSimHit hit) const
private

Definition at line 564 of file FPGATrackSimHough1DShiftTool.cxx.

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 }

◆ getPtFromShiftDiff()

float FPGATrackSimHough1DShiftTool::getPtFromShiftDiff ( int  shift) const
private

Definition at line 556 of file FPGATrackSimHough1DShiftTool.cxx.

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 }

◆ getRoads()

StatusCode FPGATrackSimHough1DShiftTool::getRoads ( const std::vector< const FPGATrackSimHit * > &  hits,
std::vector< FPGATrackSimRoad * > &  roads 
)
overridevirtual

Definition at line 316 of file FPGATrackSimHough1DShiftTool.cxx.

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 }

◆ initialize()

StatusCode FPGATrackSimHough1DShiftTool::initialize ( )
overridevirtual

Definition at line 46 of file FPGATrackSimHough1DShiftTool.cxx.

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 }

◆ makeHitMasks()

std::vector< boost::dynamic_bitset<> > FPGATrackSimHough1DShiftTool::makeHitMasks ( const std::vector< const FPGATrackSimHit * > &  hits)
private

Definition at line 418 of file FPGATrackSimHough1DShiftTool.cxx.

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 }

◆ makeRoad()

FPGATrackSimRoad FPGATrackSimHough1DShiftTool::makeRoad ( const std::vector< const FPGATrackSimHit * > &  hits,
int  bin_track,
size_t  iShift 
)
private

Definition at line 435 of file FPGATrackSimHough1DShiftTool.cxx.

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 }

◆ matchIdealGeoSector()

void FPGATrackSimHough1DShiftTool::matchIdealGeoSector ( FPGATrackSimRoad r) const
private

Definition at line 489 of file FPGATrackSimHough1DShiftTool.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 }

◆ passThreshold()

bool FPGATrackSimHough1DShiftTool::passThreshold ( std::vector< boost::dynamic_bitset<>> &  binHits,
int  bin 
) const
private

Definition at line 382 of file FPGATrackSimHough1DShiftTool.cxx.

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 }

◆ phitrk()

std::pair< float, bool > FPGATrackSimHough1DShiftTool::phitrk ( int  bin,
std::vector< int > const shifts 
) const
private

Definition at line 605 of file FPGATrackSimHough1DShiftTool.cxx.

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 }

◆ phitrkDiff()

float FPGATrackSimHough1DShiftTool::phitrkDiff ( float  r1,
float  phi1,
float  r2,
float  phi2 
) const
private

Definition at line 598 of file FPGATrackSimHough1DShiftTool.cxx.

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 }

◆ printHitMasks()

void FPGATrackSimHough1DShiftTool::printHitMasks ( std::vector< boost::dynamic_bitset<>> const hitMasks) const
private

Definition at line 665 of file FPGATrackSimHough1DShiftTool.cxx.

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 }

◆ printShifts()

void FPGATrackSimHough1DShiftTool::printShifts ( ) const
private

Definition at line 707 of file FPGATrackSimHough1DShiftTool.cxx.

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 }

◆ qPt()

float FPGATrackSimHough1DShiftTool::qPt ( float  r,
float  deltaPhi 
) const
private

Definition at line 587 of file FPGATrackSimHough1DShiftTool.cxx.

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 }

◆ readShifts()

void FPGATrackSimHough1DShiftTool::readShifts ( std::string const filepath)
private

Definition at line 190 of file FPGATrackSimHough1DShiftTool.cxx.

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 }

◆ shiftWithDrop()

std::vector< int > FPGATrackSimHough1DShiftTool::shiftWithDrop ( std::vector< int > &  shift,
unsigned  droplayer 
) const
private

Definition at line 756 of file FPGATrackSimHough1DShiftTool.cxx.

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 }

Member Data Documentation

◆ m_applyDropable

Gaudi::Property<bool> FPGATrackSimHough1DShiftTool::m_applyDropable { this, "applyDropable", false, "Enable logic that prevents redundant patterns with dropped hits" }
private

Definition at line 138 of file FPGATrackSimHough1DShiftTool.h.

◆ m_bins

std::vector<double> FPGATrackSimHough1DShiftTool::m_bins
private

Definition at line 154 of file FPGATrackSimHough1DShiftTool.h.

◆ m_bitShift_path

Gaudi::Property<std::string> FPGATrackSimHough1DShiftTool::m_bitShift_path { this, "bitShifts", "", "Instead of calculating bit shifts, input a list of shifts via a text file" }
private

Definition at line 137 of file FPGATrackSimHough1DShiftTool.h.

◆ m_currentcounts

std::vector<unsigned> FPGATrackSimHough1DShiftTool::m_currentcounts
private

Definition at line 168 of file FPGATrackSimHough1DShiftTool.h.

◆ m_d0shifts

std::vector<std::vector<int> > FPGATrackSimHough1DShiftTool::m_d0shifts
private

Definition at line 167 of file FPGATrackSimHough1DShiftTool.h.

◆ m_d0spread

Gaudi::Property<float> FPGATrackSimHough1DShiftTool::m_d0spread {this, "d0spread", -1.0, "Make patterns with a d0spread as given, negative value turns it off" }
private

Definition at line 135 of file FPGATrackSimHough1DShiftTool.h.

◆ m_doEtaPatternConsts

Gaudi::Property<bool> FPGATrackSimHough1DShiftTool::m_doEtaPatternConsts { this, "doEtaPatternConsts", false, "Whether to use the eta pattern tool for constant generation"}
private

Definition at line 113 of file FPGATrackSimHough1DShiftTool.h.

◆ m_doRegionalMapping

Gaudi::Property<bool> FPGATrackSimHough1DShiftTool::m_doRegionalMapping { this, "RegionalMapping", false, "Use the sub-region maps to define the sector" }
private

Definition at line 117 of file FPGATrackSimHough1DShiftTool.h.

◆ m_drawHitMasks

Gaudi::Property<bool> FPGATrackSimHough1DShiftTool::m_drawHitMasks { this, "drawHitMasks", false, "Draws hit masks if true"}
private

Definition at line 118 of file FPGATrackSimHough1DShiftTool.h.

◆ m_dropable

std::vector<boost::dynamic_bitset<> > FPGATrackSimHough1DShiftTool::m_dropable
private

Definition at line 162 of file FPGATrackSimHough1DShiftTool.h.

◆ m_enhanceHighPt

Gaudi::Property<float> FPGATrackSimHough1DShiftTool::m_enhanceHighPt {this, "enhanceHighPt", -1.0, "if positive, double number of patterns for region with qpT below value" }
private

Definition at line 142 of file FPGATrackSimHough1DShiftTool.h.

◆ m_event

unsigned FPGATrackSimHough1DShiftTool::m_event = 0
private

Definition at line 180 of file FPGATrackSimHough1DShiftTool.h.

◆ m_EvtSel

ServiceHandle<IFPGATrackSimEventSelectionSvc> FPGATrackSimHough1DShiftTool::m_EvtSel {this, "FPGATrackSimEventSelectionSvc", "FPGATrackSimEventSelectionSvc"}
private

Definition at line 104 of file FPGATrackSimHough1DShiftTool.h.

◆ m_fieldCorrection

Gaudi::Property<bool> FPGATrackSimHough1DShiftTool::m_fieldCorrection {this, "fieldCorrection", true, "Apply corrections to hough equation due to field nonuniformity" }
private

Definition at line 141 of file FPGATrackSimHough1DShiftTool.h.

◆ m_FPGATrackSimBankSvc

ServiceHandle<IFPGATrackSimBankSvc> FPGATrackSimHough1DShiftTool::m_FPGATrackSimBankSvc {this, "FPGATrackSimBankSvc", "FPGATrackSimBankSvc"}
private

Definition at line 105 of file FPGATrackSimHough1DShiftTool.h.

◆ m_FPGATrackSimMapping

ServiceHandle<IFPGATrackSimMappingSvc> FPGATrackSimHough1DShiftTool::m_FPGATrackSimMapping {this, "FPGATrackSimMappingSvc", "FPGATrackSimMappingSvc"}
private

Definition at line 106 of file FPGATrackSimHough1DShiftTool.h.

◆ m_historyWindow

Gaudi::Property<unsigned> FPGATrackSimHough1DShiftTool::m_historyWindow {this, "historyWindow", 0, "Suppress if previous N bit shifts have neighbors with higher nubmer of hit layers" }
private

Definition at line 140 of file FPGATrackSimHough1DShiftTool.h.

◆ m_hitExtend

std::vector<float> FPGATrackSimHough1DShiftTool::m_hitExtend
private

Definition at line 145 of file FPGATrackSimHough1DShiftTool.h.

◆ m_hitExtendProperty

Gaudi::Property<std::vector<float> > FPGATrackSimHough1DShiftTool::m_hitExtendProperty {this, "hitExtend", {}, "Number of adjacent bins that a hit triggers" }
private

Definition at line 136 of file FPGATrackSimHough1DShiftTool.h.

◆ m_idealGeoRoads

Gaudi::Property<bool> FPGATrackSimHough1DShiftTool::m_idealGeoRoads { this, "IdealGeoRoads", false, "Set sectors to use ideal geometry fit constants" }
private

Definition at line 116 of file FPGATrackSimHough1DShiftTool.h.

◆ m_iterLayer

Gaudi::Property<unsigned> FPGATrackSimHough1DShiftTool::m_iterLayer { this, "iterLayer", 0, "Instead of iterating over steps in pT, we iterate over iterStep-bin shifts in iterLayer" }
private

Definition at line 129 of file FPGATrackSimHough1DShiftTool.h.

◆ m_iterStep

Gaudi::Property<unsigned> FPGATrackSimHough1DShiftTool::m_iterStep { this, "iterStep", 0, "Instead of iterating over steps in pT, we iterate over iterStep-bin shifts in iterLayer" }
private

Definition at line 128 of file FPGATrackSimHough1DShiftTool.h.

◆ m_monitorFile

TFile FPGATrackSimHough1DShiftTool::m_monitorFile
private

Definition at line 182 of file FPGATrackSimHough1DShiftTool.h.

◆ m_name

std::string FPGATrackSimHough1DShiftTool::m_name
private

Definition at line 181 of file FPGATrackSimHough1DShiftTool.h.

◆ m_neighborWindow

Gaudi::Property<int> FPGATrackSimHough1DShiftTool::m_neighborWindow { this, "neighborWindow", 0, "Supress if neighbors have higher number of hit layers" }
private

Definition at line 139 of file FPGATrackSimHough1DShiftTool.h.

◆ m_nLayers

unsigned FPGATrackSimHough1DShiftTool::m_nLayers
private

Definition at line 151 of file FPGATrackSimHough1DShiftTool.h.

◆ m_phiBins

Gaudi::Property<unsigned> FPGATrackSimHough1DShiftTool::m_phiBins { this, "nBins", 0, "Number of phi bins used by transform." }
private

Definition at line 126 of file FPGATrackSimHough1DShiftTool.h.

◆ m_phiMax

Gaudi::Property<float> FPGATrackSimHough1DShiftTool::m_phiMax { this, "phiMax", 0, "Maximum phi of transform" }
private

Definition at line 122 of file FPGATrackSimHough1DShiftTool.h.

◆ m_phiMin

Gaudi::Property<float> FPGATrackSimHough1DShiftTool::m_phiMin { this, "phiMin", 0, "Minimum phi of transform" }
private

Definition at line 121 of file FPGATrackSimHough1DShiftTool.h.

◆ m_phiRangeCut

Gaudi::Property<bool> FPGATrackSimHough1DShiftTool::m_phiRangeCut {this, "phiRangeCut", false, "Require tracks to be in phi range to avoid counting minbias roads for larger region" }
private

Definition at line 133 of file FPGATrackSimHough1DShiftTool.h.

◆ m_phiStep

float FPGATrackSimHough1DShiftTool::m_phiStep
private

Definition at line 153 of file FPGATrackSimHough1DShiftTool.h.

◆ m_phivals

std::vector<std::vector<float> > FPGATrackSimHough1DShiftTool::m_phivals
private

Definition at line 166 of file FPGATrackSimHough1DShiftTool.h.

◆ m_qpt

std::vector<float> FPGATrackSimHough1DShiftTool::m_qpt
private

Definition at line 165 of file FPGATrackSimHough1DShiftTool.h.

◆ m_qptMax

Gaudi::Property<float> FPGATrackSimHough1DShiftTool::m_qptMax { this, "qptMax", 0, "Maximum q/pT of transform" }
private

Definition at line 124 of file FPGATrackSimHough1DShiftTool.h.

◆ m_qptMin

Gaudi::Property<float> FPGATrackSimHough1DShiftTool::m_qptMin { this, "qptMin", 0, "Minimum q/pT of transform" }
private

Definition at line 123 of file FPGATrackSimHough1DShiftTool.h.

◆ m_r

std::vector<float> FPGATrackSimHough1DShiftTool::m_r
private

Definition at line 146 of file FPGATrackSimHough1DShiftTool.h.

◆ m_regionMax

FPGATrackSimTrackPars FPGATrackSimHough1DShiftTool::m_regionMax
private

Definition at line 159 of file FPGATrackSimHough1DShiftTool.h.

◆ m_regionMin

FPGATrackSimTrackPars FPGATrackSimHough1DShiftTool::m_regionMin
private

Definition at line 158 of file FPGATrackSimHough1DShiftTool.h.

◆ m_roads

std::vector<FPGATrackSimRoad> FPGATrackSimHough1DShiftTool::m_roads
private

Definition at line 175 of file FPGATrackSimHough1DShiftTool.h.

◆ m_shifts

std::vector<std::vector<int> > FPGATrackSimHough1DShiftTool::m_shifts
private

Definition at line 161 of file FPGATrackSimHough1DShiftTool.h.

◆ m_subRegion

Gaudi::Property<int> FPGATrackSimHough1DShiftTool::m_subRegion { this, "subRegion", 0, "Sub region of this transform, or -1 for full region" }
private

Definition at line 120 of file FPGATrackSimHough1DShiftTool.h.

◆ m_threshold

Gaudi::Property<unsigned> FPGATrackSimHough1DShiftTool::m_threshold { this, "threshold", 0, "Minimum number of layers hit to accept as a road (inclusive)" }
private

Definition at line 127 of file FPGATrackSimHough1DShiftTool.h.

◆ m_traceHits

Gaudi::Property<bool> FPGATrackSimHough1DShiftTool::m_traceHits { this, "traceHits", true, "Trace each hit that goes in a bin. Disabling this will save memory/time since each bin doesn't have to store all its hits but the roads created won't have hits from convolution, etc."}
private

Definition at line 111 of file FPGATrackSimHough1DShiftTool.h.

◆ m_useDiff

Gaudi::Property<bool> FPGATrackSimHough1DShiftTool::m_useDiff { this, "useDiff", false, "Use the diff of inner and outer layer" }
private

Definition at line 131 of file FPGATrackSimHough1DShiftTool.h.

◆ m_useSectors

Gaudi::Property<bool> FPGATrackSimHough1DShiftTool::m_useSectors { this, "useSectors", false, "Will reverse calculate the sector for track-fitting purposes" }
private

Definition at line 115 of file FPGATrackSimHough1DShiftTool.h.

◆ m_useSpacePoints

Gaudi::Property<bool> FPGATrackSimHough1DShiftTool::m_useSpacePoints { this, "useSpacePoints", false, "Whether we are using spacepoints." }
private

Definition at line 114 of file FPGATrackSimHough1DShiftTool.h.

◆ m_variableExtend

Gaudi::Property<bool> FPGATrackSimHough1DShiftTool::m_variableExtend { this, "variableExtend", false, "Do variable extension based off of hit delta R" }
private

Definition at line 132 of file FPGATrackSimHough1DShiftTool.h.

◆ m_vetolist

std::deque<std::vector<unsigned> > FPGATrackSimHough1DShiftTool::m_vetolist
private

Definition at line 169 of file FPGATrackSimHough1DShiftTool.h.


The documentation for this class was generated from the following files:
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
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
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
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
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
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
MCP::ScaleSmearParam::r2
@ r2
FPGATrackSimHough1DShiftTool::m_doRegionalMapping
Gaudi::Property< bool > m_doRegionalMapping
Definition: FPGATrackSimHough1DShiftTool.h:117
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
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
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
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::m_historyWindow
Gaudi::Property< unsigned > m_historyWindow
Definition: FPGATrackSimHough1DShiftTool.h:140
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_phivals
std::vector< std::vector< float > > m_phivals
Definition: FPGATrackSimHough1DShiftTool.h:166
FPGATrackSimHough1DShiftTool::m_useSpacePoints
Gaudi::Property< bool > m_useSpacePoints
Definition: FPGATrackSimHough1DShiftTool.h:114
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
FPGATrackSimHough1DShiftTool::m_r
std::vector< float > m_r
Definition: FPGATrackSimHough1DShiftTool.h:146
FPGATrackSimHit::getR
float getR() const
Definition: FPGATrackSimHit.h:128
FPGATrackSimHit::setLayer
void setLayer(unsigned v)
Definition: FPGATrackSimHit.h:87
h
RunTileMonitoring.towers
towers
Definition: RunTileMonitoring.py:133
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
layer_bitmask_t
uint32_t layer_bitmask_t
Definition: FPGATrackSimTypes.h:22
FPGATrackSimHough1DShiftTool::m_iterStep
Gaudi::Property< unsigned > m_iterStep
Definition: FPGATrackSimHough1DShiftTool.h:128
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
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
MCP::ScaleSmearParam::r1
@ r1
FPGATrackSimHough1DShiftTool::passThreshold
bool passThreshold(std::vector< boost::dynamic_bitset<>> &binHits, int bin) const
Definition: FPGATrackSimHough1DShiftTool.cxx:382
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
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