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

virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 
virtual StatusCode getRoads (const std::vector< std::shared_ptr< const FPGATrackSimHit >> &hits, std::vector< std::shared_ptr< const FPGATrackSimRoad >> &roads) override
 
virtual int getSubRegion () const 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< std::shared_ptr< const FPGATrackSimHit >> &hits)
 
FPGATrackSimRoad makeRoad (const std::vector< std::shared_ptr< const FPGATrackSimHit >> &hits, int bin_track, size_t iShift)
 
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 std::shared_ptr< const FPGATrackSimHit > &hit) 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", ""}
 
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 = 0
 
float m_phiStep = 0
 
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 84 of file FPGATrackSimHough1DShiftTool.h.

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 668 of file FPGATrackSimHough1DShiftTool.cxx.

669 {
670  std::vector<int> retv;
671 
672  if (base.size()!=var.size()) {
673  ATH_MSG_ERROR("Base and Var lengths must match " << base.size() << " " << var.size() );
674  }
675 
676  for (unsigned i = 0; i < base.size(); i++) {
677  retv.push_back(base[i]+sign*var[i]);
678  }
679  return retv;
680 }

◆ calculated0Shifts()

void FPGATrackSimHough1DShiftTool::calculated0Shifts ( )
private

Definition at line 649 of file FPGATrackSimHough1DShiftTool.cxx.

650 {
651  int steps=1;
652  while (true) {
653  float d0step = steps*m_phiStep*m_r[0];
654  ATH_MSG_DEBUG("d0step = " << d0step);
655  std::vector<int> d0shift;
656  for (unsigned lyr = 0; lyr < m_nLayers; lyr++) {
657  float phi_for_d0step = d0step/m_r[lyr];
658  int shift = static_cast<int>(round(phi_for_d0step/ m_phiStep));
659  d0shift.push_back(shift);
660  }
661  m_d0shifts.push_back(d0shift);
662  if (d0step>m_d0spread) break;
663  ++steps;
664  }
665  ATH_MSG_DEBUG("d0 Shifts Found = " << m_d0shifts.size());
666 }

◆ calculateDropable()

void FPGATrackSimHough1DShiftTool::calculateDropable ( )
private

Definition at line 691 of file FPGATrackSimHough1DShiftTool.cxx.

692 {
693 
694  // one set per layer with shift set
695  std::vector< std::set< std::vector<int> > > reducedShifts(m_nLayers);
696 
697  m_dropable.resize(m_shifts.size());
698 
699  for (size_t iShift = 0; iShift < m_shifts.size(); iShift++)
700  {
701  boost::dynamic_bitset<> drops(m_nLayers);
702  for (unsigned droplayer =0; droplayer < m_nLayers; droplayer++) {
703  if (reducedShifts[droplayer].insert(shiftWithDrop(m_shifts[iShift],droplayer)).second) {
704  // true if the is a new shift in the set
705  drops.set(droplayer);
706  }
707  }
708 
709  m_dropable[iShift]=std::move(drops);
710 
711  }
712 
713 }

◆ calculateShifts()

void FPGATrackSimHough1DShiftTool::calculateShifts ( )
private

Definition at line 115 of file FPGATrackSimHough1DShiftTool.cxx.

116 {
117  // Calculated d0shift if selected
118  if (m_d0spread>0) calculated0Shifts();
119 
120 
121  // Iterate over a steps of m_iterStep bin shift in m_iterLayer
122  for (int sign = -1; sign<2; sign+=2) {
123 
124  // start at highest pT
125  float iterShift = (sign>0) ? 0.0 : -1.0; // don't double count zero
126 
127  while (true)
128  {
129  float qpt = qPt(m_r[m_iterLayer], m_phiStep * iterShift);
130  if (abs(qpt)>std::max(abs(m_qptMin),abs(m_qptMax))) break;
131 
132  if ((qpt <= m_qptMax ) && (qpt >= m_qptMin )) {
133 
134  std::vector<int> shifts; // Fill both +iterShift and -iterShift here
135  for (unsigned i = 0; i < m_nLayers; i++)
136  {
137  float dPhi = deltaPhi(m_r[i], qpt);
138  if (m_useDiff){
139  dPhi -= deltaPhi(m_r[0], qpt);
140  }
141 
142  int shift = static_cast<int>(round(dPhi / m_phiStep));
143  if (shift >= static_cast<int>(m_phiBins) || shift <= -(static_cast<int>(m_phiBins))) return;
144  shifts.push_back(shift);
145  }
146 
147  // if thre are d0shifts, apply them
148  for (const std::vector<int>& d0shift: m_d0shifts){
149  m_shifts.push_back(applyVariation(shifts,d0shift,1));
150  m_shifts.push_back(applyVariation(shifts,d0shift,-1));
151  }
152 
153  m_qpt.push_back(qpt);
154  m_shifts.push_back(shifts);
155 
156  }
157 
158  // smaller steps if in "enhanceHighPt" range
159  iterShift += ((std::abs(qpt)>m_enhanceHighPt) ? sign*float(m_iterStep): sign*float(m_iterStep)/2.0) ;
160  }
161  ATH_MSG_INFO("Ending shift, qpt("<< m_qptMin << ", " << m_qptMax <<") sign:" << sign << " shift:" << iterShift);
162 
163 
164  // figure out which patterns are the same after dropping a hit
166  }
167 
168 }

◆ deltaPhi()

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

Definition at line 544 of file FPGATrackSimHough1DShiftTool.cxx.

545 {
546  float dPhi = std::asin(fpgatracksim::A * r * qPt);
547  if (m_fieldCorrection) dPhi += fieldCorrection(m_EvtSel->getRegionID(), qPt, r);
548  return dPhi;
549 }

◆ drawHitMasks() [1/2]

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

Definition at line 608 of file FPGATrackSimHough1DShiftTool.cxx.

609 {
610  m_monitorFile.cd();
611 
612  TH2F h(name.c_str(), "Hough 1D Shift;phi;layer",
614  m_nLayers, 0, m_nLayers
615  );
616 
617  for (size_t layer = 0; layer < m_nLayers; layer++)
618  for (size_t i = 0; i < m_phiBins; i++)
619  h.SetBinContent(i+1, layer+1, hitMasks[layer][i]); // +1 since root bins are 1-indexed
620 
621  h.Write();
622 }

◆ 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 624 of file FPGATrackSimHough1DShiftTool.cxx.

625 {
626  std::vector<boost::dynamic_bitset<>> shiftedMasks;
627  for (size_t layer = 0; layer < m_nLayers; layer++)
628  shiftedMasks.push_back(lshift(hitMasks[layer], shifts[layer]));
629 
630  drawHitMasks(shiftedMasks, name);
631 }

◆ finalize()

StatusCode FPGATrackSimHough1DShiftTool::finalize ( )
overridevirtual

Definition at line 298 of file FPGATrackSimHough1DShiftTool.cxx.

299 {
300  return StatusCode::SUCCESS;
301 }

◆ getBins()

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

Definition at line 490 of file FPGATrackSimHough1DShiftTool.cxx.

491 {
492  float phi = hit->getGPhi();
493  float bin_extend = m_hitExtend[hit->getLayer()];
494  float center = (phi - m_phiMin) / m_phiStep;
495 
496  if (m_variableExtend){
497  float r = hit->getR();
498  float dphimax = deltaPhi(r,m_qptMax);
499  float maxshift = +1*((std::sin(dphimax)*(r-m_r[hit->getLayer()]))/r)/m_phiStep;
500  float dphimin = deltaPhi(r,m_qptMin);
501  float minshift = +1*((std::sin(dphimin)*(r-m_r[hit->getLayer()]))/r)/m_phiStep;
502 
503  center += (maxshift+minshift)/2.0;
504  bin_extend += std::abs((maxshift-minshift)/2.0);
505 
506  }
507 
508  int low = std::max(static_cast<int>(center - bin_extend),0);
509  int high = std::min(static_cast<int>(center + bin_extend),static_cast<int>(m_phiBins-1));
510  return { low, high };
511 }

◆ getPtFromShiftDiff()

float FPGATrackSimHough1DShiftTool::getPtFromShiftDiff ( int  shift) const
private

Definition at line 482 of file FPGATrackSimHough1DShiftTool.cxx.

483 {
484  if (m_iterLayer == 0u) ATH_MSG_FATAL("getPtFromShiftDiff() iterLayer can't be 0");
485  return (shift * m_phiStep / fpgatracksim::A) / (m_r[m_iterLayer] - m_r[0]);
486 }

◆ getRoads()

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

Definition at line 307 of file FPGATrackSimHough1DShiftTool.cxx.

308 {
309 
310  roads.clear();
311  m_roads.clear();
312 
313  ATH_MSG_DEBUG("Input Hits Size:" << hits.size() << "\n");
314 
315  // Get hit masks
316  std::vector<boost::dynamic_bitset<>> hitMasks(makeHitMasks(hits));
317  if (m_drawHitMasks) drawHitMasks(hitMasks, m_name + "_e" + std::to_string(m_event));
318 
319  // Iterate over shifts
320  for (size_t iShift = 0; iShift < m_shifts.size(); iShift++)
321  {
322  // Track hit layers in each bin
323  std::vector<boost::dynamic_bitset<>> binHits(m_phiBins, boost::dynamic_bitset<>(m_nLayers));
324 
325 
326  // Add the counts
327  for (unsigned i = 0; i < m_nLayers; i++)
328  updateBinHits(binHits, i, lshift(hitMasks[i], m_shifts[iShift][i]));
329 
330  // Check the threshold
331  for (unsigned bin = 0; bin < m_phiBins; bin++)
332  {
333  // First check we're not missing hits in not allowed layers
334  if (m_applyDropable && !m_dropable.empty() && (~(binHits[bin] | m_dropable[iShift])).any()) continue;
335 
336  m_currentcounts[bin]=binHits[bin].count();
337 
338  if (passThreshold(binHits,bin))
339  {
340  FPGATrackSimRoad r = makeRoad(hits, bin, iShift);
341 
342  if (m_phiRangeCut && (r.getX() > m_regionMax.phi || r.getX() < m_regionMin.phi)) continue;
343 
344  m_roads.push_back(r);
345 
346  ATH_MSG_DEBUG("New Road: "<< layersHit(r) <<" lyrs, " << r.getNHits() << " hits :"
347  << to_string(r.getNHits_layer()) << " reg=" << r.getSubRegion()
348  << " bin=" << bin << " shift=" << iShift << " phi=" << r.getX() << " pti=" << r.getY() << " " << m_qpt[iShift]);
349 
350 
351  }
352 
353  }
354 
355  // Add/Remove history
356  m_vetolist.push_front(m_currentcounts);
357  if (m_vetolist.size() > m_historyWindow) {
358  m_vetolist.pop_back();
359  }
360  }
361 
362  roads.reserve(m_roads.size());
363  for (FPGATrackSimRoad & r : m_roads) roads.emplace_back(std::make_shared<const FPGATrackSimRoad>(r));
364 
365  if (roads.size()==0 && m_drawHitMasks) drawHitMasks(hitMasks, m_name + "_fail_e" + std::to_string(m_event));
366 
367  m_event++;
368  return StatusCode::SUCCESS;
369 }

◆ getSubRegion()

virtual int FPGATrackSimHough1DShiftTool::getSubRegion ( ) const
inlineoverridevirtual

Definition at line 97 of file FPGATrackSimHough1DShiftTool.h.

97 {return m_subRegion;}

◆ initialize()

StatusCode FPGATrackSimHough1DShiftTool::initialize ( )
overridevirtual

Definition at line 37 of file FPGATrackSimHough1DShiftTool.cxx.

38 {
39  // Config printout
40  ATH_MSG_INFO("Phi range: (" << m_phiMin << "," << m_phiMax << "," << m_phiBins << ")");
41  if (m_useDiff) ATH_MSG_INFO("useDiff Set True");
42  if (m_variableExtend) ATH_MSG_INFO("variableExtend Set True");
43  ATH_MSG_INFO("enhancedHighPt " << m_enhanceHighPt.value());
44  ATH_MSG_INFO("applyDropable " << m_applyDropable.value());
45  ATH_MSG_INFO("threshold " << m_threshold.value());
46 
47  // Retrieve info
49  ATH_CHECK(m_FPGATrackSimMapping.retrieve());
50  m_nLayers = m_FPGATrackSimMapping->PlaneMap_1st(0)->getNLogiLayers();
51 
52  // Error checking
53  if (m_phiMin >= m_phiMax || m_phiBins == 0u) {
54  ATH_MSG_FATAL("initialize() Phi range invalid");
55  return StatusCode::FAILURE;
56  }
57 
58  // Fix inputs
59  if (!m_hitExtendProperty.value().empty()) {
60  if (m_hitExtendProperty.value().size() != m_nLayers) {
61  ATH_MSG_FATAL("initialize() Hit extend must have size == nLayers");
62  return StatusCode::FAILURE;
63  } else {
65  }
66  } else {
67  m_hitExtend.resize(m_nLayers,0); // all 0
68  }
69  if (m_iterStep == 0u) m_iterStep = m_hitExtend[m_iterLayer] * 2 + 1; // default 1
70 
71  // Copy correct r values from the region map.
72  m_r.resize(m_nLayers);
73  for (unsigned ilayer = 0; ilayer < m_nLayers; ilayer++) {
74  m_r[ilayer] = m_FPGATrackSimMapping->SubRegionMap()->getAvgRadius(m_subRegion, ilayer);
75  }
76 
77  // Warnings / corrections
78  if (m_idealGeoRoads)
79  {
80  if (m_useSectors)
81  {
82  ATH_MSG_WARNING("initialize() idealGeoRoads conflicts with useSectors, switching off FPGATrackSim sector matching");
83  m_useSectors = false;
84  }
85  if (!m_traceHits)
86  {
87  ATH_MSG_WARNING("initialize() idealGeoRoads requires tracing hits, turning on automatically");
88  m_traceHits = true;
89  }
90  }
91 
92  // Fill convenience variables
94  for (unsigned i = 0; i <= m_phiBins; i++)
95  m_bins.push_back(m_phiMin + m_phiStep * i);
96  m_regionMin = m_EvtSel->getRegions()->getMin(m_EvtSel->getRegionID());
97  m_regionMax = m_EvtSel->getRegions()->getMax(m_EvtSel->getRegionID());
98 
99  m_regionMin.phi = m_regionMin.phi - 0.01; // For phi boundary effect
100  m_regionMax.phi = m_regionMax.phi + 0.01; // For phi boundary effect
101 
102  m_currentcounts.resize(m_phiBins);
103 
104  // Calculate the shift amounts
105  if (m_bitShift_path.value().empty()) calculateShifts();
107  printShifts();
108 
109 
110  return StatusCode::SUCCESS;
111 }

◆ makeHitMasks()

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

Definition at line 409 of file FPGATrackSimHough1DShiftTool.cxx.

410 {
411  std::vector<boost::dynamic_bitset<>> hitMasks(m_nLayers, boost::dynamic_bitset<>(m_phiBins));
412  for (auto const &hit : hits)
413  {
414  if (m_subRegion >= 0 && !m_FPGATrackSimMapping->SubRegionMap()->isInRegion(m_subRegion, *hit)) continue;
415 
416  auto bins = getBins(hit);
417 
418  for (int i = std::max(bins.first, 0); i <= std::min(bins.second, (int)m_phiBins - 1); i++)
419  hitMasks[hit->getLayer()][i] = true;
420  }
421 
422  return hitMasks;
423 }

◆ makeRoad()

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

Definition at line 426 of file FPGATrackSimHough1DShiftTool.cxx.

427 {
428  std::vector<int> const & shifts = m_shifts[iShift];
429  float qpT = m_qpt[iShift];
430 
431  std::vector<std::shared_ptr<const FPGATrackSimHit>> road_hits;
432  layer_bitmask_t hitLayers = 0;
433 
434  for (const auto & hit : hits)
435  {
436  if (m_subRegion >= 0 && !m_FPGATrackSimMapping->SubRegionMap()->isInRegion(m_subRegion, *hit)) continue;
437 
438  // Get the shifted bins of the hit
439  auto bins = getBins(hit);
440  bins.first += shifts[hit->getLayer()]; // note boost::dynamic_bitset stores [0] as the LSB, i.e. rightmost. So leftshift = +bin
441  bins.second += shifts[hit->getLayer()];
442 
443  // Check if it's the same bin as the track
444  if (bin_track >= bins.first && bin_track <= bins.second)
445  {
446  road_hits.push_back(hit);
447  hitLayers |= 1 << hit->getLayer();
448  }
449  }
450 
451  auto sorted_hits = ::sortByLayer(road_hits);
452  sorted_hits.resize(m_nLayers); // If no hits in last layer, return from sortByLayer will be too short
453  // Combination of last two addRoad() functions from FPGATrackSimHoughTransformTool.cxx are implemented above (up to here)
454  // Below want to look at first addRoad()/matchIdealGeoSector() function in FPGATrackSimHoughTransformTool.cxx
455 
457  r.setHitLayers(hitLayers);
458  r.setHits(std::vector<std::vector<std::shared_ptr<const FPGATrackSimHit>>>(std::move(sorted_hits)));
459  r.setSubRegion(m_subRegion);
460  if (m_fieldCorrection) {
461  int inner_bin = static_cast<int>(bin_track)-static_cast<int>(shifts[0]);
462  if ((inner_bin < 0) || (inner_bin >= static_cast<int>(m_phiBins))) {
463  r.setX(-100000);
464  } else {
465  r.setX(m_bins[inner_bin] + 0.5*m_phiStep + deltaPhi(m_r[0],qpT));
466  }
467  } else {
468  r.setX(phitrk(bin_track,shifts).first); // will be a large negative number if invalid
469  }
470  r.setY(qpT);
471 
472  return r;
473  // TODO sector, wildcard layers?
474 }

◆ passThreshold()

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

Definition at line 373 of file FPGATrackSimHough1DShiftTool.cxx.

374 {
375  // Check the threshold
376  if (binHits[bin].count() < m_threshold) return false;
377 
378  // Apply neighbor veto
379  if (m_neighborWindow>0) {
380  for (int i = -m_neighborWindow; i <= m_neighborWindow; i++) {
381  if ((bin+i < 0) or ((bin+i)>=int(m_phiBins))) continue; // ignore edges
382  if (binHits[bin+i].count()>binHits[bin].count()) {
383  // neighbor has more layers
384  return false;
385  }
386  if (i!=0 && (binHits[bin+i].count()==binHits[bin].count())) {
387  // favor lower phi bin
388  return false;
389  }
390  for (unsigned j = 0; j < m_vetolist.size(); j++) {
391  if (m_vetolist[j][bin+i]>binHits[bin].count()) {
392  // past neighbor has more layers
393  return false;
394  }
395  if ((m_vetolist[j][bin+i]==binHits[bin].count()) and (i<0)) {
396  // favor previous shift and lower phi bin
397  return false;
398  }
399  }
400  }
401  }
402 
403  return true; // passed threshold, wasn't vetoed by neighbors
404 
405 }

◆ phitrk()

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

Definition at line 531 of file FPGATrackSimHough1DShiftTool.cxx.

532 {
533  int inner_bin = static_cast<int>(bin)-static_cast<int>(shifts[0]);
534  int outer_bin = static_cast<int>(bin)-static_cast<int>(shifts[m_nLayers-1]);
535  if ((inner_bin < 0) || (inner_bin >= static_cast<int>(m_phiBins))) return {-100000,false};
536  if ((outer_bin < 0) || (outer_bin >= static_cast<int>(m_phiBins))) return {-100000,false};
537  float phi1 = m_bins[inner_bin];
538  float phi2 = m_bins[outer_bin];
539  float phi_track = phitrkDiff(m_r[0],phi1,m_r[m_nLayers-1],phi2)+0.5*m_phiStep;
540  return {phi_track,true};
541 }

◆ phitrkDiff()

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

Definition at line 524 of file FPGATrackSimHough1DShiftTool.cxx.

525 {
526  float phi_track = phi1+ std::atan2(r2-r1*std::cos(phi2-phi1),r1*std::sin(phi2-phi1)) - TMath::Pi()/2.0;
527  return phi_track;
528 }

◆ printHitMasks()

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

Definition at line 591 of file FPGATrackSimHough1DShiftTool.cxx.

592 {
593  std::stringstream ss;
594  ss << "Hit Masks:\n";
595  for (auto const & b : hitMasks)
596  {
597  ss << "\t";
598  for (size_t i = 0; i < b.size(); i++)
599  {
600  if (b[i]) ss << 1;
601  else ss << ".";
602  }
603  ss << "\n";
604  }
605  ATH_MSG_DEBUG(ss.str() << "\n\n");
606 }

◆ printShifts()

void FPGATrackSimHough1DShiftTool::printShifts ( ) const
private

Definition at line 633 of file FPGATrackSimHough1DShiftTool.cxx.

634 {
635  std::stringstream ss;
636  ss << "Shifts:\n";
637  for (size_t i = 0; i < m_shifts.size(); i++)
638  {
639  float qpt = qPt(m_r[m_iterLayer], m_phiStep * m_shifts[i][m_iterLayer]); // q/pT represented by this shift
640  ss << "q/pT=" << qpt << "; ";
641  for (int shift : m_shifts[i]) ss << shift << " ";
642  if (!m_dropable.empty()) ss << m_dropable[i];
643  ss << "\n";
644  }
645  ATH_MSG_VERBOSE(ss.str());
646 }

◆ qPt()

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

Definition at line 513 of file FPGATrackSimHough1DShiftTool.cxx.

514 {
515  if (m_useDiff) {
516  float r1=m_r[0];
517  float r2=r;
518  float sign = deltaPhi>0 ? 1 : -1;
519  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)));
520  }
521  return std::sin(deltaPhi) / (fpgatracksim::A * r);
522 }

◆ readShifts()

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

Definition at line 181 of file FPGATrackSimHough1DShiftTool.cxx.

182 {
183  // Open the file
184  std::ifstream fin(filepath);
185  if (!fin.is_open())
186  {
187  ATH_MSG_FATAL("Couldn't open " << filepath);
188  throw ("FPGATrackSimHough1DShiftTool::readShifts couldn't open " + filepath);
189  }
190 
191  // Variables to fill
192  std::string line;
193  bool ok = true;
194  int subregion = -1;
195  bool newsubr = false;
196  bool headerdone = false;
197  int nslices = 0;
198  int nphi=0;
199 
200 
201  // Parse the file
202  while (getline(fin, line))
203  {
204  newsubr|=(line.empty());
205  if (line.empty() || line[0] == '#') continue;
206  std::istringstream sline(line);
207  if (!headerdone) {
208  std::string towers, phi;
209  ok = ok && (sline >> towers);
210  if (towers!="towers") {
211  ATH_MSG_FATAL("Parse Error expected 'towers' got "<< towers);
212  throw ("FPGATrackSimHough1DShiftTool::readShifts couldn't parse " + filepath);
213  }
214  ok = ok && (sline >> nslices);
215  ATH_MSG_INFO("FPGATrackSimHough1DShiftTool::readShifts " << nslices << "slices in shift file");
216  ok = ok && (sline >> phi);
217  if (phi!="phi") {
218  ATH_MSG_FATAL("Parse Error expected 'phi' got "<< phi);
219  throw ("FPGATrackSimHough1DShiftTool::readShifts couldn't parse " + filepath);
220  }
221  ok = ok && (sline >> nphi);
222  headerdone=true;
223  continue;
224  }
225 
226  if (newsubr) {
227  ok = ok && (sline >> subregion);
228  ATH_MSG_INFO("FPGATrackSimHough1DShiftTool::readShifts " << subregion << " looking for " << m_subRegion);
229  newsubr=false;
230  continue;
231  }
232 
233  if (subregion==m_subRegion) {
234  ATH_MSG_INFO("FPGATrackSimHough1DShiftTool::readShifts found subregion " << m_subRegion);
235  // Shifts
236  std::vector<int> shifts;
237  shifts.push_back(0); // layer 0 is implicit 0 TODO
238  for (unsigned layer = 1; layer < m_nLayers; layer++)
239  {
240  int shift = 0;
241  ok = ok && (sline >> shift);
242  if (!ok) break;
243  shifts.push_back(shift);
244  }
245  if (!ok) break;
246  if (shifts[0]<-1000) {
247  ATH_MSG_INFO("FPGATrackSimHough1DShiftTool::readShifts skipping line with shift out of range: " << line);
248  continue;
249  }
250 
251  // Dropable
252  std::string droplist;
253  ok = ok && (sline >> droplist);
254  ok = ok && (droplist.size() == m_nLayers);
255  if (!ok) break;
256 
257  boost::dynamic_bitset<> drops(m_nLayers);
258  for (unsigned i = 0; i < m_nLayers; i++)
259  if (droplist[i] == '1')
260  drops[m_nLayers - i - 1] = true; // Droplist is printed with MSB on left
261 
262  // qpT
263  float qpt = 0;
264  ok = ok && (sline >> qpt);
265  if (!ok) break;
266  if ((qpt<m_qptMin) or (qpt>m_qptMax)) continue;
267 
268  // Phi Vals
269  std::vector<float> phivals;
270  for (unsigned layer = 0; layer < m_nLayers; layer++)
271  {
272  float phival = 0;
273  ok = ok && (sline >> phival);
274  if (!ok) break;
275  phivals.push_back(phival);
276  }
277 
278  m_qpt.push_back(qpt);
279  m_shifts.push_back(shifts);
280  m_dropable.push_back(drops);
281  m_phivals.push_back(phivals);
282 
283 
284  }
285  }
286 
287  if (!ok)
288  {
289  ATH_MSG_FATAL("Found error reading file at line: " << line);
290  throw "FPGATrackSimHough1DShiftTool::readShifts read error";
291  }
292 
293  if (m_shifts.size()==0) ATH_MSG_FATAL("FPGATrackSimHough1DShiftTool::readShifts no shifts read");
294  ATH_MSG_INFO("Read " << m_shifts.size() << " patterns from " << filepath);
295 }

◆ shiftWithDrop()

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

Definition at line 682 of file FPGATrackSimHough1DShiftTool.cxx.

683 {
684  std::vector<int> retv(m_nLayers-1);
685  for (unsigned lyr = 0; lyr < m_nLayers; lyr++) {
686  if (lyr !=droplayer) retv.push_back(shift[lyr]);
687  }
688  return retv;
689 }

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 136 of file FPGATrackSimHough1DShiftTool.h.

◆ m_bins

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

Definition at line 152 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 135 of file FPGATrackSimHough1DShiftTool.h.

◆ m_currentcounts

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

Definition at line 166 of file FPGATrackSimHough1DShiftTool.h.

◆ m_d0shifts

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

Definition at line 165 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 133 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 111 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 115 of file FPGATrackSimHough1DShiftTool.h.

◆ m_drawHitMasks

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

Definition at line 116 of file FPGATrackSimHough1DShiftTool.h.

◆ m_dropable

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

Definition at line 160 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 140 of file FPGATrackSimHough1DShiftTool.h.

◆ m_event

unsigned FPGATrackSimHough1DShiftTool::m_event = 0
private

Definition at line 178 of file FPGATrackSimHough1DShiftTool.h.

◆ m_EvtSel

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

Definition at line 102 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 139 of file FPGATrackSimHough1DShiftTool.h.

◆ m_FPGATrackSimBankSvc

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

Definition at line 103 of file FPGATrackSimHough1DShiftTool.h.

◆ m_FPGATrackSimMapping

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

Definition at line 104 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 138 of file FPGATrackSimHough1DShiftTool.h.

◆ m_hitExtend

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

Definition at line 143 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 134 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 114 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 127 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 126 of file FPGATrackSimHough1DShiftTool.h.

◆ m_monitorFile

TFile FPGATrackSimHough1DShiftTool::m_monitorFile
private

Definition at line 180 of file FPGATrackSimHough1DShiftTool.h.

◆ m_name

std::string FPGATrackSimHough1DShiftTool::m_name
private

Definition at line 179 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 137 of file FPGATrackSimHough1DShiftTool.h.

◆ m_nLayers

unsigned FPGATrackSimHough1DShiftTool::m_nLayers = 0
private

Definition at line 149 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 124 of file FPGATrackSimHough1DShiftTool.h.

◆ m_phiMax

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

Definition at line 120 of file FPGATrackSimHough1DShiftTool.h.

◆ m_phiMin

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

Definition at line 119 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 131 of file FPGATrackSimHough1DShiftTool.h.

◆ m_phiStep

float FPGATrackSimHough1DShiftTool::m_phiStep = 0
private

Definition at line 151 of file FPGATrackSimHough1DShiftTool.h.

◆ m_phivals

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

Definition at line 164 of file FPGATrackSimHough1DShiftTool.h.

◆ m_qpt

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

Definition at line 163 of file FPGATrackSimHough1DShiftTool.h.

◆ m_qptMax

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

Definition at line 122 of file FPGATrackSimHough1DShiftTool.h.

◆ m_qptMin

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

Definition at line 121 of file FPGATrackSimHough1DShiftTool.h.

◆ m_r

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

Definition at line 144 of file FPGATrackSimHough1DShiftTool.h.

◆ m_regionMax

FPGATrackSimTrackPars FPGATrackSimHough1DShiftTool::m_regionMax
private

Definition at line 157 of file FPGATrackSimHough1DShiftTool.h.

◆ m_regionMin

FPGATrackSimTrackPars FPGATrackSimHough1DShiftTool::m_regionMin
private

Definition at line 156 of file FPGATrackSimHough1DShiftTool.h.

◆ m_roads

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

Definition at line 173 of file FPGATrackSimHough1DShiftTool.h.

◆ m_shifts

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

Definition at line 159 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 118 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 125 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 109 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 129 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 113 of file FPGATrackSimHough1DShiftTool.h.

◆ m_useSpacePoints

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

Definition at line 112 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 130 of file FPGATrackSimHough1DShiftTool.h.

◆ m_vetolist

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

Definition at line 167 of file FPGATrackSimHough1DShiftTool.h.


The documentation for this class was generated from the following files:
FPGATrackSimHough1DShiftTool::deltaPhi
float deltaPhi(float r, float qPt) const
Definition: FPGATrackSimHough1DShiftTool.cxx:544
base
std::string base
Definition: hcg.cxx:78
FPGATrackSimHough1DShiftTool::m_traceHits
Gaudi::Property< bool > m_traceHits
Definition: FPGATrackSimHough1DShiftTool.h:109
beamspotman.r
def r
Definition: beamspotman.py:674
FPGATrackSimHough1DShiftTool::calculated0Shifts
void calculated0Shifts()
Definition: FPGATrackSimHough1DShiftTool.cxx:649
beamspotnt.var
var
Definition: bin/beamspotnt.py:1393
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
FPGATrackSimHough1DShiftTool::m_fieldCorrection
Gaudi::Property< bool > m_fieldCorrection
Definition: FPGATrackSimHough1DShiftTool.h:139
module_driven_slicing.nslices
nslices
Definition: module_driven_slicing.py:574
FPGATrackSimHough1DShiftTool::makeRoad
FPGATrackSimRoad makeRoad(const std::vector< std::shared_ptr< const FPGATrackSimHit >> &hits, int bin_track, size_t iShift)
Definition: FPGATrackSimHough1DShiftTool.cxx:426
FPGATrackSimTrackPars::phi
double phi
Definition: FPGATrackSimTrackPars.h:24
FPGATrackSimHough1DShiftTool::m_regionMax
FPGATrackSimTrackPars m_regionMax
Definition: FPGATrackSimHough1DShiftTool.h:157
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
FPGATrackSimHough1DShiftTool::m_phiStep
float m_phiStep
Definition: FPGATrackSimHough1DShiftTool.h:151
FPGATrackSimHough1DShiftTool::calculateShifts
void calculateShifts()
Definition: FPGATrackSimHough1DShiftTool.cxx:115
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
FPGATrackSimHough1DShiftTool::m_threshold
Gaudi::Property< unsigned > m_threshold
Definition: FPGATrackSimHough1DShiftTool.h:125
FPGATrackSimHough1DShiftTool::phitrk
std::pair< float, bool > phitrk(int bin, std::vector< int > const &shifts) const
Definition: FPGATrackSimHough1DShiftTool.cxx:531
FPGATrackSimHough1DShiftTool::m_qpt
std::vector< float > m_qpt
Definition: FPGATrackSimHough1DShiftTool.h:163
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
MuonGM::round
float round(const float toRound, const unsigned int decimals)
Definition: Mdt.cxx:27
FPGATrackSimHough1DShiftTool::m_regionMin
FPGATrackSimTrackPars m_regionMin
Definition: FPGATrackSimHough1DShiftTool.h:156
python.SystemOfUnits.second
float second
Definition: SystemOfUnits.py:135
FPGATrackSimHough1DShiftTool::m_phiMax
Gaudi::Property< float > m_phiMax
Definition: FPGATrackSimHough1DShiftTool.h:120
bin
Definition: BinsDiffFromStripMedian.h:43
FPGATrackSimHough1DShiftTool::m_phiRangeCut
Gaudi::Property< bool > m_phiRangeCut
Definition: FPGATrackSimHough1DShiftTool.h:131
FPGATrackSimHough1DShiftTool::m_FPGATrackSimMapping
ServiceHandle< IFPGATrackSimMappingSvc > m_FPGATrackSimMapping
Definition: FPGATrackSimHough1DShiftTool.h:104
FPGATrackSimHit::getLayer
int getLayer() const
Definition: FPGATrackSimHit.cxx:87
FPGATrackSimHough1DShiftTool::m_vetolist
std::deque< std::vector< unsigned > > m_vetolist
Definition: FPGATrackSimHough1DShiftTool.h:167
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
MCP::ScaleSmearParam::r2
@ r2
python.TrigEgammaMonitorHelper.TH2F
def TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:45
FPGATrackSimHough1DShiftTool::m_subRegion
Gaudi::Property< int > m_subRegion
Definition: FPGATrackSimHough1DShiftTool.h:118
dq_defect_bulk_create_defects.line
line
Definition: dq_defect_bulk_create_defects.py:27
FPGATrackSimHough1DShiftTool::m_bins
std::vector< double > m_bins
Definition: FPGATrackSimHough1DShiftTool.h:152
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
XMLtoHeader.count
count
Definition: XMLtoHeader.py:84
FPGATrackSimHough1DShiftTool::m_applyDropable
Gaudi::Property< bool > m_applyDropable
Definition: FPGATrackSimHough1DShiftTool.h:136
FPGATrackSimHough1DShiftTool::m_currentcounts
std::vector< unsigned > m_currentcounts
Definition: FPGATrackSimHough1DShiftTool.h:166
FPGATrackSimHough1DShiftTool::shiftWithDrop
std::vector< int > shiftWithDrop(std::vector< int > &shift, unsigned droplayer) const
Definition: FPGATrackSimHough1DShiftTool.cxx:682
FPGATrackSimHough1DShiftTool::m_event
unsigned m_event
Definition: FPGATrackSimHough1DShiftTool.h:178
FPGATrackSimHough1DShiftTool::m_neighborWindow
Gaudi::Property< int > m_neighborWindow
Definition: FPGATrackSimHough1DShiftTool.h:137
FPGATrackSimHit::getGPhi
float getGPhi() const
Definition: FPGATrackSimHit.h:153
FPGATrackSimHough1DShiftTool::m_dropable
std::vector< boost::dynamic_bitset<> > m_dropable
Definition: FPGATrackSimHough1DShiftTool.h:160
FPGATrackSimHough1DShiftTool::drawHitMasks
void drawHitMasks(std::vector< boost::dynamic_bitset<>> const &hitMasks, std::string const &name)
Definition: FPGATrackSimHough1DShiftTool.cxx:608
beamspotman.steps
int steps
Definition: beamspotman.py:503
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
FPGATrackSimHough1DShiftTool::m_variableExtend
Gaudi::Property< bool > m_variableExtend
Definition: FPGATrackSimHough1DShiftTool.h:130
FPGATrackSimHough1DShiftTool::m_shifts
std::vector< std::vector< int > > m_shifts
Definition: FPGATrackSimHough1DShiftTool.h:159
FPGATrackSimHough1DShiftTool::m_useSectors
Gaudi::Property< bool > m_useSectors
Definition: FPGATrackSimHough1DShiftTool.h:113
FPGATrackSimHough1DShiftTool::qPt
float qPt(float r, float deltaPhi) const
Definition: FPGATrackSimHough1DShiftTool.cxx:513
FPGATrackSimHough1DShiftTool::m_d0spread
Gaudi::Property< float > m_d0spread
Definition: FPGATrackSimHough1DShiftTool.h:133
lumiFormat.i
int i
Definition: lumiFormat.py:85
FPGATrackSimHough1DShiftTool::m_hitExtendProperty
Gaudi::Property< std::vector< float > > m_hitExtendProperty
Definition: FPGATrackSimHough1DShiftTool.h:134
FPGATrackSimHough1DShiftTool::m_historyWindow
Gaudi::Property< unsigned > m_historyWindow
Definition: FPGATrackSimHough1DShiftTool.h:138
extractSporadic.h
list h
Definition: extractSporadic.py:96
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
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:549
FPGATrackSimHough1DShiftTool::m_useDiff
Gaudi::Property< bool > m_useDiff
Definition: FPGATrackSimHough1DShiftTool.h:129
FPGATrackSimHough1DShiftTool::m_idealGeoRoads
Gaudi::Property< bool > m_idealGeoRoads
Definition: FPGATrackSimHough1DShiftTool.h:114
FPGATrackSimHough1DShiftTool::m_qptMin
Gaudi::Property< float > m_qptMin
Definition: FPGATrackSimHough1DShiftTool.h:121
sign
int sign(int a)
Definition: TRT_StrawNeighbourSvc.h:107
FPGATrackSimHough1DShiftTool::phitrkDiff
float phitrkDiff(float r1, float phi1, float r2, float phi2) const
Definition: FPGATrackSimHough1DShiftTool.cxx:524
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
FPGATrackSimHough1DShiftTool::readShifts
void readShifts(std::string const &filepath)
Definition: FPGATrackSimHough1DShiftTool.cxx:181
FPGATrackSimHough1DShiftTool::m_qptMax
Gaudi::Property< float > m_qptMax
Definition: FPGATrackSimHough1DShiftTool.h:122
plotting.yearwise_luminosity_vs_mu.bins
bins
Definition: yearwise_luminosity_vs_mu.py:30
FPGATrackSimHough1DShiftTool::m_bitShift_path
Gaudi::Property< std::string > m_bitShift_path
Definition: FPGATrackSimHough1DShiftTool.h:135
FPGATrackSimHough1DShiftTool::m_iterLayer
Gaudi::Property< unsigned > m_iterLayer
Definition: FPGATrackSimHough1DShiftTool.h:127
FPGATrackSimHough1DShiftTool::m_EvtSel
ServiceHandle< IFPGATrackSimEventSelectionSvc > m_EvtSel
Definition: FPGATrackSimHough1DShiftTool.h:102
FPGATrackSimHough1DShiftTool::m_drawHitMasks
Gaudi::Property< bool > m_drawHitMasks
Definition: FPGATrackSimHough1DShiftTool.h:116
FPGATrackSimHough1DShiftTool::m_phivals
std::vector< std::vector< float > > m_phivals
Definition: FPGATrackSimHough1DShiftTool.h:164
FPGATrackSimHough1DShiftTool::m_monitorFile
TFile m_monitorFile
Definition: FPGATrackSimHough1DShiftTool.h:180
FPGATrackSimHough1DShiftTool::calculateDropable
void calculateDropable()
Definition: FPGATrackSimHough1DShiftTool.cxx:691
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:76
plotBeamSpotVxVal.bin
int bin
Definition: plotBeamSpotVxVal.py:82
FPGATrackSimHough1DShiftTool::m_r
std::vector< float > m_r
Definition: FPGATrackSimHough1DShiftTool.h:144
FPGATrackSimHough1DShiftTool::getBins
std::pair< int, int > getBins(const std::shared_ptr< const FPGATrackSimHit > &hit) const
Definition: FPGATrackSimHough1DShiftTool.cxx:490
FPGATrackSimHit::getR
float getR() const
Definition: FPGATrackSimHit.h:152
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:126
FPGATrackSimHough1DShiftTool::m_roads
std::vector< FPGATrackSimRoad > m_roads
Definition: FPGATrackSimHough1DShiftTool.h:173
compute_lumi.fin
fin
Definition: compute_lumi.py:19
FPGATrackSimHough1DShiftTool::m_nLayers
unsigned m_nLayers
Definition: FPGATrackSimHough1DShiftTool.h:149
FPGATrackSimHough1DShiftTool::printShifts
void printShifts() const
Definition: FPGATrackSimHough1DShiftTool.cxx:633
fieldCorrection
double fieldCorrection(unsigned region, double qoverpt, double r)
Definition: FPGATrackSimFunctions.cxx:163
FPGATrackSimHough1DShiftTool::m_phiBins
Gaudi::Property< unsigned > m_phiBins
Definition: FPGATrackSimHough1DShiftTool.h:124
FPGATrackSimHough1DShiftTool::applyVariation
std::vector< int > applyVariation(const std::vector< int > &base, const std::vector< int > &var, int sign) const
Definition: FPGATrackSimHough1DShiftTool.cxx:668
FPGATrackSimHough1DShiftTool::m_d0shifts
std::vector< std::vector< int > > m_d0shifts
Definition: FPGATrackSimHough1DShiftTool.h:165
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:373
FPGATrackSimHough1DShiftTool::m_phiMin
Gaudi::Property< float > m_phiMin
Definition: FPGATrackSimHough1DShiftTool.h:119
FPGATrackSimHough1DShiftTool::m_enhanceHighPt
Gaudi::Property< float > m_enhanceHighPt
Definition: FPGATrackSimHough1DShiftTool.h:140
FPGATrackSimHough1DShiftTool::m_hitExtend
std::vector< float > m_hitExtend
Definition: FPGATrackSimHough1DShiftTool.h:143
FPGATrackSimRoad
Definition: FPGATrackSimRoad.h:31
FPGATrackSimHough1DShiftTool::makeHitMasks
std::vector< boost::dynamic_bitset<> > makeHitMasks(const std::vector< std::shared_ptr< const FPGATrackSimHit >> &hits)
Definition: FPGATrackSimHough1DShiftTool.cxx:409
FPGATrackSimHough1DShiftTool::m_name
std::string m_name
Definition: FPGATrackSimHough1DShiftTool.h:179
FPGATrackSimHough1DShiftTool::m_FPGATrackSimBankSvc
ServiceHandle< IFPGATrackSimBankSvc > m_FPGATrackSimBankSvc
Definition: FPGATrackSimHough1DShiftTool.h:103
sortByLayer
std::vector< std::vector< std::shared_ptr< const FPGATrackSimHit > > > sortByLayer(Container const &hits)
Definition: FPGATrackSimHit.h:315
python.LArMinBiasAlgConfig.float
float
Definition: LArMinBiasAlgConfig.py:65