ATLAS Offline Software
EtaHoughTransformAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "EtaHoughTransformAlg.h"
6 
8 
15 
19 
20 #include "Acts/Utilities/RangeXD.hpp"
21 #include <format>
22 
23 namespace MuonR4{
24  // helper to check if our trajectory traverses a chamber
25  inline bool passesThrough(const SpacePointBucket::chamberLocation & loc, double y0, double tanTheta){
26  double yCross = (y0 + loc.location().z() * tanTheta);
27  return (loc.minY() < yCross && yCross < loc. maxY());
28  }
29  // determines the local residual when traversing a chamber
30  inline double proximity(const SpacePoint* dc, double y0, double tanTheta) {
32  return std::min(std::abs(HoughHelpers::Eta::houghParamMdtLeft(tanTheta, dc) - y0),
33  std::abs(HoughHelpers::Eta::houghParamMdtRight(tanTheta, dc) - y0));
34  }
35  return std::abs(HoughHelpers::Eta::houghParamStrip(tanTheta, dc) - y0);
36  }
43  constexpr double chamberCoverage(const std::array<double,2>& seedEdges,
44  const std::array<double, 2>& chambEdges) {
45  // The seed is full embedded
46  if (chambEdges[0] <= seedEdges[0] && chambEdges[1] >= seedEdges[1]) {
47  return 1.;
48  }
50  else if (chambEdges[0]<= seedEdges[0]) {
51  return (chambEdges[1] - seedEdges[0]) / (seedEdges[1] - seedEdges[0]);
52  }
54  else if (chambEdges[1] >= seedEdges[1]) {
55  return (seedEdges[1] - chambEdges[0]) / (seedEdges[1] - seedEdges[0]);
56  }
58  else if (seedEdges[0] <= chambEdges[0] && seedEdges[1] >= chambEdges[1]) {
59  return (chambEdges[1] - chambEdges[0]) / (seedEdges[1] - seedEdges[0]);
60  }
61  return 0.;
62  }
63 
67  ATH_CHECK(m_maxima.initialize());
68  ATH_CHECK(m_idHelperSvc.retrieve());
69  ATH_CHECK(m_visionTool.retrieve(EnableTool{!m_visionTool.empty()}));
70  return StatusCode::SUCCESS;
71 }
72 StatusCode EtaHoughTransformAlg::execute(const EventContext& ctx) const {
73 
75  const SpacePointContainer* spacePoints{nullptr};
77 
78  // book the output container
80  ATH_CHECK(writeMaxima.record(std::make_unique<EtaHoughMaxContainer>()));
81 
82  const ActsGeometryContext* gctx{nullptr};
83  ATH_CHECK(SG::get(gctx, m_geoCtxKey, ctx));
84 
86 
88  preProcess(ctx, *gctx, *spacePoints, data);
89 
93  for (auto& [station, stationHoughBuckets] : data.houghSetups) {
94  // reset the list of maxima
95  for (auto& bucket : stationHoughBuckets) {
96  processBucket(ctx, data, bucket);
97  }
98  for (HoughMaximum& max : data.maxima) {
99  writeMaxima->push_back(std::make_unique<HoughMaximum>(std::move(max)));
100  }
101  data.maxima.clear();
102  }
103  std::stable_sort(writeMaxima->begin(), writeMaxima->end(),
104  [](const HoughMaximum* a, const HoughMaximum* b){
105  return (*a->parentBucket()) < (*b->parentBucket());
106  });
107  return StatusCode::SUCCESS;
108 }
109 void EtaHoughTransformAlg::preProcess(const EventContext& ctx,
110  const ActsGeometryContext& gctx,
112  HoughEventData& data) const {
113 
114  ATH_MSG_DEBUG("Load " << spacePoints.size() << " space point buckets");
115  for (const SpacePointBucket* bucket : spacePoints) {
116  if (m_visionTool.isEnabled()) {
117  m_visionTool->visualizeBucket(ctx, *bucket, "bucket");
118  }
119  std::vector<HoughSetupForBucket>& buckets = data.houghSetups[bucket->front()->msSector()];
120  HoughSetupForBucket& hs{buckets.emplace_back(bucket)};
121  const Amg::Transform3D globToLoc{hs.bucket->msSector()->globalToLocalTrans(gctx)};
122  Amg::Vector3D leftSide = globToLoc.translation() - (hs.bucket->coveredMin() * Amg::Vector3D::UnitY());
123  Amg::Vector3D rightSide = globToLoc.translation() - (hs.bucket->coveredMax() * Amg::Vector3D::UnitY());
124 
125  // get the average z of our hits and use it to correct our angle estimate
126  double zmin{1.e9}, zmax{-1.e9};
127  for (const std::shared_ptr<MuonR4::SpacePoint> & sp : *bucket) {
128  zmin = std::min(zmin, sp->positionInChamber().z());
129  zmax = std::max(zmax, sp->positionInChamber().z());
130  }
131  const double z = 0.5*(zmin + zmax);
132 
133  // estimate the angle, adding extra tolerance based on our target resolution
134  const double tanThetaLeft = (leftSide.y() - m_targetResoIntercept) / (leftSide.z() - z) - m_targetResoTanTheta;
135  const double tanThetaRight = (rightSide.y() + m_targetResoIntercept) / (rightSide.z() - z) + m_targetResoTanTheta;
136  hs.searchWindowTanAngle = {tanThetaLeft, tanThetaRight};
137  double ymin{1e9}, ymax{-1e9};
138 
141  for (const std::shared_ptr<MuonR4::SpacePoint> & hit : *bucket){
142  // two estimates: For the two extrema of tan(theta) resulting from the guesstimate
143  double y0l = hit->positionInChamber().y() - hit->positionInChamber().z() * tanThetaLeft;
144  double y0r = hit->positionInChamber().y() - hit->positionInChamber().z() * tanThetaRight;
145  // pick the widest envelope
148  }
149  hs.searchWindowIntercept = {ymin, ymax};
150  }
151 }
153  switch (hit->type()){
155  const auto* dc = static_cast<const xAOD::MdtDriftCircle*>(hit->primaryMeasurement());
157  }
159  return hit->measuresEta();
160  }
162  const auto* meas = static_cast<const xAOD::sTgcMeasurement*>(hit->primaryMeasurement());
163  return meas->channelType() == sTgcIdHelper::sTgcChannelTypes::Strip;
164  } default:
165  break;
166  }
167  return false;
168 }
169 
171  HoughPlaneConfig cfg;
172  cfg.nBinsX = m_nBinsTanTheta;
173  cfg.nBinsY = m_nBinsIntercept;
174  ActsPeakFinderForMuonCfg peakFinderCfg;
175  peakFinderCfg.fractionCutoff = m_peakFractionCutOff;
176  peakFinderCfg.threshold = m_peakThreshold;
177  peakFinderCfg.minSpacingBetweenPeaks = {m_minMaxDistTheta, m_minMaxDistIntercept};
178  data.houghPlane = std::make_unique<HoughPlane>(cfg);
179  data.peakFinder = std::make_unique<ActsPeakFinderForMuon>(peakFinderCfg);
180 }
181 
182 bool EtaHoughTransformAlg::passSeedQuality (const HoughSetupForBucket& currentBucket, const MuonR4::ActsPeakFinderForMuon::Maximum & maximum) const{
183 
184  // now we propagate along the seed trajectory and collect crossed volumes
185  int expectedPrecisionChambers{0}, seenPrecisionChambers{0};
186  bool hasTrig = false;
187 
188  std::unordered_set<const MuonGMR4::MuonReadoutElement*> seenChambers{};
189  std::set<std::pair<int,int>> seenLayers;
190  using enum Acts::TrapezoidVolumeBounds::BoundValues;
191  const double halfX = currentBucket.bucket->msSector()->bounds()->get(eHalfLengthXposY);
193  std::array<double, 2> tubeExtend{halfX, -halfX};
194 
195  auto addSeenHit = [&tubeExtend, &seenLayers, &seenChambers](const SpacePoint& sp,
197  const double sensorL,
198  const int mL, const int layer){
199  seenLayers.emplace(mL, layer);
200  seenChambers.insert(re);
201  tubeExtend[0] = std::min(tubeExtend[0], sp.positionInChamber().x() - sensorL);
202  tubeExtend[1] = std::max(tubeExtend[1], sp.positionInChamber().x() + sensorL);
203  };
204  for (const SpacePoint* SP : maximum.hitIdentifiers){
205  ATH_MSG_VERBOSE(__func__<<"() - "<<__LINE__<<" Maximum has associated hit in "
206  << m_idHelperSvc->toStringDetEl(SP->identify()));
207 
208  if (isPrecisionHit(SP)) {
210  const auto* dc = static_cast<const xAOD::MdtDriftCircle*>(SP->primaryMeasurement());
211  const MuonGMR4::MdtReadoutElement* re = dc->readoutElement();
212  addSeenHit(*SP, re, 0.5*re->activeTubeLength(dc->measurementHash()),
213  re->multilayer(), dc->tubeLayer());
214  } else if(SP->type() == xAOD::UncalibMeasType::MMClusterType){
215  const auto* clust = static_cast<const xAOD::MMCluster*>(SP->primaryMeasurement());
216  const MuonGMR4::MmReadoutElement* re = clust->readoutElement();
217  addSeenHit(*SP, re, 0.5*re->stripLayer(clust->measurementHash()).design().stripLength(clust->channelNumber()),
218  re->multilayer(), clust->gasGap());
219  } else if (SP->type() == xAOD::UncalibMeasType::sTgcStripType) {
220  const auto* clust = static_cast<const xAOD::sTgcMeasurement*>(SP->primaryMeasurement());
221  const MuonGMR4::sTgcReadoutElement* re = clust->readoutElement();
222  addSeenHit(*SP, re, 0.5*re->stripLayer(clust->measurementHash()).design().stripLength(clust->channelNumber()),
223  re->multilayer(), clust->gasGap());
224  }
225  } else {
226  seenChambers.insert(xAOD::muonReadoutElement(SP->primaryMeasurement()));
227  }
228  }
229  // loop over all chambers in the bucket
230  for (const auto & muonChamber : currentBucket.bucket->chamberLocations()){
231  // skip any we don't touch
232  if (!passesThrough(muonChamber, maximum.y, maximum.x)) {
233  ATH_MSG_VERBOSE(__func__<<"() - "<<__LINE__<<" maximum does not cross "
234  << m_idHelperSvc->toStringDetEl(muonChamber.readoutEle()->identify()));
235  continue;
236  }
237  ATH_MSG_VERBOSE(__func__<<"() - "<<__LINE__<<" maximum crosses "
238  << m_idHelperSvc->toStringDetEl(muonChamber.readoutEle()->identify())<<", "
239  <<(*muonChamber.bounds())<<", @: "<<Amg::toString(muonChamber.location()));
240  // for MDT multilayers, we increase our expected number of crossed chambers / tubes
241  const ActsTrk::DetectorType type = muonChamber.readoutEle()->detectorType();
242 
243  // now we check if we have a compatible measurement on our seed
244  const bool hasHit = seenChambers.count(muonChamber.readoutEle());
245  const bool precTech = (type == ActsTrk::DetectorType::Mdt || type == ActsTrk::DetectorType::Mm ||
247  if (hasHit) {
248  // if we find an MDT hit, we increment the counter for seen chambers
249  if (precTech) {
250  ++seenPrecisionChambers;
251  } else {
252  hasTrig = true;
253  continue;
254  }
255  } else if (precTech) {
258  const double lowL = muonChamber.width(maximum.y + muonChamber.location().z() * maximum.x);
259  const std::array<double, 2> chambEdges{muonChamber.location().x() - lowL,
260  muonChamber.location().x() + lowL};
261 
262  const double coverage = chamberCoverage(tubeExtend, chambEdges);
263  if (coverage < 0.95){
264  ATH_MSG_VERBOSE(__func__<<"() - "<<__LINE__<<" Reject chamber due to partial coverage: "<<coverage
265  <<", chamb extend: "<<chambEdges[0]<<"-"<<chambEdges[1]
266  <<", tube extend: "<<tubeExtend[0]<<"-"<<tubeExtend[1]
267  <<", "<<(*muonChamber.readoutEle()->msSector()->bounds()));
268  continue;
269  }
270  } else {
271  continue;
272  }
273  ++expectedPrecisionChambers;
274  }
275  // compute the minimum number of requested precision layers
276  // the integer division will round down (resulting cut: 2 for single-ML, 4 for dual-ML)
277  int minLayers = seenLayers.size() / 2 + 1;
278  // require 2 precision chambers with measurements, except if we only cross one precision multilayer in total
279  int minSeenPrecisionChambers = (expectedPrecisionChambers > 1) + 1;
280  // if we have at least one trigger hit, we loosen the requirements on precision hits and chambers
281  if (hasTrig) {
282  minLayers -= 1;
283  minSeenPrecisionChambers = 1;
284  }
285  ATH_MSG_VERBOSE(__func__<<"() - "<<__LINE__<<": "<<currentBucket.bucket->msSector()->identString()<<
286  ", seen prec: "<<seenPrecisionChambers<<", required: "<<minSeenPrecisionChambers
287  <<" -- layers: "<<seenLayers.size()<<", required: "<<minLayers);
288  return seenPrecisionChambers >= minSeenPrecisionChambers && (int)seenLayers.size() >= minLayers;
289 }
290 
291 
292 void EtaHoughTransformAlg::processBucket(const EventContext& ctx,
294  HoughSetupForBucket& bucket) const {
296 
297  double chamberCenter = 0.5 * (bucket.searchWindowIntercept.first +
298  bucket.searchWindowIntercept.second);
299  // build a symmetric window around the (geometric) chamber center so that
300  // the bin width is equivalent to our target resolution
301  double searchStart = chamberCenter - 0.5 * data.houghPlane->nBinsY() * m_targetResoIntercept;
302  double searchEnd = chamberCenter + 0.5 * data.houghPlane->nBinsY() * m_targetResoIntercept;
303  // Protection for very wide buckets - if the search space does not cover all
304  // of the bucket, widen the bin size so that we cover everything
305  searchStart = std::min(searchStart, bucket.searchWindowIntercept.first -
307  searchEnd = std::max(searchEnd, bucket.searchWindowIntercept.second +
309  // also treat tan(theta)
310  double tanThetaMean = 0.5 * (bucket.searchWindowTanAngle.first +
311  bucket.searchWindowTanAngle.second);
312  double searchStartTanTheta = tanThetaMean - 0.5 * data.houghPlane->nBinsX() * m_targetResoTanTheta;
313  double searchEndTanTheta = tanThetaMean + 0.5 * data.houghPlane->nBinsX() * m_targetResoTanTheta;
314  searchStartTanTheta = std::min(searchStartTanTheta, bucket.searchWindowTanAngle.first -
316  searchEndTanTheta = std::max(searchEndTanTheta, bucket.searchWindowTanAngle.second +
318 
319  data.currAxisRanges = Acts::HoughTransformUtils::HoughAxisRanges{
320  searchStartTanTheta, searchEndTanTheta, searchStart, searchEnd};
321 
322  data.houghPlane->reset();
323  for (const SpacePointBucket::value_type& hit : *(bucket.bucket)) {
324  fillFromSpacePoint(data, hit.get());
325  }
326  auto maxima = data.peakFinder->findPeaks(*(data.houghPlane), data.currAxisRanges);
327  if (m_visionTool.isEnabled()) {
328  m_visionTool->visualizeAccumulator(ctx, *data.houghPlane, data.currAxisRanges, maxima,
329  "#eta Hough accumulator");
330  }
331  if (maxima.empty()) {
332  ATH_MSG_DEBUG("Station "<<bucket.bucket->msSector()->identString()
333  <<":\n Mean tanTheta was "<<tanThetaMean
334  << " and my intercept "<<chamberCenter
335  <<", with hits in the bucket in "<< bucket.bucket->coveredMin()
336  <<" - "<<bucket.bucket->coveredMax()
337  <<". The bucket found a search range of ("
338  <<bucket.searchWindowTanAngle.first<<" - "
339  <<bucket.searchWindowTanAngle.second<<") and ("
340  <<bucket.searchWindowIntercept.first<<" - "
341  <<bucket.searchWindowIntercept.second
342  <<") , and my final search range is ["
343  <<searchStartTanTheta<<" - "<<searchEndTanTheta
344  <<"] and ["<<searchStart<<" - "<<searchEnd
345  <<"] with "<<m_nBinsTanTheta<<" and "
346  <<m_nBinsIntercept<<" bins.");
347  return;
348  }
349 
350  // remember used hits - assign only to first maximum when counting
351  // precision hits
352  std::set<HoughHitType> seenHits;
353 
354  // now clean up and potentially write the maxima
355  for (const auto& max : maxima) {
356 
357  // precision hit cut, using only the measurements on the hough maximum
358  unsigned int nPrec{0};
359  auto toBins = [&data](double x, double y){
360  return std::make_pair(
361  Acts::HoughTransformUtils::binIndex(data.currAxisRanges.xMin, data.currAxisRanges.xMax, data.houghPlane->nBinsX(), x),
362  Acts::HoughTransformUtils::binIndex(data.currAxisRanges.yMin, data.currAxisRanges.yMax, data.houghPlane->nBinsY(), y)
363  );
364  };
365  auto accumulatorBins = toBins(max.x,max.y);
366  for (const HoughHitType& hit : data.houghPlane->hitIds(accumulatorBins.first, accumulatorBins.second)) {
367  auto res = seenHits.emplace(hit);
368  if (res.second){
369  nPrec += isPrecisionHit(hit);
370  }
371  }
372  if (nPrec < m_nPrecHitCut) {
373  ATH_MSG_VERBOSE("The maximum did not pass the precision hit cut");
374  continue;
375  }
376 
377  // convert the set of hit identifiers from ACTS to the vector we need later
378  std::vector<HoughHitType> hitList{max.hitIdentifiers.begin(), max.hitIdentifiers.end()};
379 
380  // apply a seed quality cut.
381  if (!passSeedQuality(bucket, max)) {
382  // if seed visualisation is enabled, draw the rejected seed
383  if (m_visionTool.isEnabled()) {
384  const HoughMaximum& houghMax{max.x, max.y, 1. *hitList.size(), std::move(hitList), bucket.bucket};
385  const SegmentSeed seed{houghMax};
388  for (auto & chamber : bucket.bucket->chamberLocations()) {
389  primitives.push_back(MuonValR4::drawBox(chamber.minY(), chamber.minZ(),
390  chamber.maxY(), chamber.maxZ(), kGray+2));
391  const Identifier detId{chamber.readoutEle()->identify()};
392  const int eta = m_idHelperSvc->stationEta(detId);
393  std::string chLabel = std::format("{:}{:1d}{:}{:2d}", m_idHelperSvc->stationNameString(detId),
394  std::abs(eta), eta > 0? 'A' : 'C', m_idHelperSvc->stationPhi(detId));
395  switch (chamber.readoutEle()->detectorType()) {
397  chLabel += std::format("M{:1d}", m_idHelperSvc->mdtIdHelper().multilayer(detId));
398  } default:
399  break;
400  }
401  primitives.push_back(MuonValR4::drawLabel(chLabel, chamber.minY(), chamber.maxZ() + 0.02,8));
402  }
403 
404  primitives.push_back(MuonValR4::drawLabel(std::format("Missed seed - score {}, layer score {}, comprising {} measurements ",data.houghPlane->nHits(accumulatorBins.first, accumulatorBins.second),data.houghPlane->nLayers(accumulatorBins.first, accumulatorBins.second),hitList.size()),0.05,0.03,12));
405 
406  primitivesForAcc.push_back(MuonValR4::drawLabel(std::format("Missed seed - score {}, layer score {}, comprising {} measurements ",data.houghPlane->nHits(accumulatorBins.first, accumulatorBins.second),data.houghPlane->nLayers(accumulatorBins.first, accumulatorBins.second),hitList.size()),0.05,0.03,12));
407  m_visionTool->visualizeAccumulator(ctx, *data.houghPlane, data.currAxisRanges, {max},
408  "MissedAccumulator", std::move(primitivesForAcc));
409  m_visionTool->visualizeSeed(ctx, seed, "Missed seed",std::move(primitives));
410  }
411  continue;
412  }
413 
414  // this seed looks good! Let's finalise it
415  size_t nHits = hitList.size();
416  // add phi measurements - will be filtered for compatibility in separate algorithm
417  extendWithPhiHits(hitList, bucket);
418  // sort hits by layer
420  std::ranges::stable_sort(hitList, sorter);
421  // create hough maximum instance and add it to the event data for later writing!
422  const HoughMaximum& houghMax{data.maxima.emplace_back(max.x, max.y, nHits, std::move(hitList), bucket.bucket)};
423 
424  // if desired, visualise the result
425  if (m_visionTool.isEnabled()) {
426  const SegmentSeed seed{houghMax};
429  for (auto & chamber : bucket.bucket->chamberLocations()){
430  primitives.push_back(MuonValR4::drawBox(chamber.minY(), chamber.minZ(), chamber.maxY(), chamber.maxZ(), kGray+2));
431  }
432  primitives.push_back(MuonValR4::drawLabel(std::format("score {}, layer score {}, comprising {} measurements. wx = {:.2f}, wy = {:.1f} ",data.houghPlane->nHits(accumulatorBins.first, accumulatorBins.second),data.houghPlane->nLayers(accumulatorBins.first, accumulatorBins.second),hitList.size(), max.wx, max.wy),0.05,0.03,12));
433  primitivesForAcc.push_back(MuonValR4::drawLabel(std::format("score {}, layer score {}, comprising {} measurements. wx = {:.2f}, wy = {:.1f} ",data.houghPlane->nHits(accumulatorBins.first, accumulatorBins.second),data.houghPlane->nLayers(accumulatorBins.first, accumulatorBins.second),hitList.size(), max.wx / m_targetResoTanTheta, max.wy / m_targetResoIntercept),0.05,0.03,12));
434 
435  m_visionTool->visualizeAccumulator(ctx, *data.houghPlane, data.currAxisRanges, {max},"#eta Hough accumulator", std::move(primitivesForAcc));
436  m_visionTool->visualizeSeed(ctx, seed, "#eta-HoughSeed", std::move(primitives));
437  }
438  }
439 }
441 
442  using namespace std::placeholders;
443  double w = 1.0;
444  // convert Gaudi::property to double to avoid deep copy in std::bind expression
445  double resolutionTarget = m_targetResoIntercept;
446  // downweight RPC measurements in the barrel relative to MDT
448  w = 0.5;
449  }
451  // if invalid time, do not count this hit towards a potential peak.
452  // The hits will still be included in a potential maximum formed by valid hits,
453  // for later recovery.
454  if (!isPrecisionHit(SP)) w = 0;
455  const auto* dc = static_cast<const xAOD::MdtDriftCircle*>(SP->primaryMeasurement());
456  // dummy index for precision layer counting within the hough plane
457  const unsigned precisionLayerIndex = (dc->readoutElement()->multilayer() * 10 + dc->tubeLayer());
458  data.houghPlane->fill<HoughHitType>(SP, data.currAxisRanges, HoughHelpers::Eta::houghParamMdtLeft,
459  std::bind(HoughHelpers::Eta::houghWidthMdt, _1, _2, resolutionTarget), SP, precisionLayerIndex, w);
460  data.houghPlane->fill<HoughHitType>(SP, data.currAxisRanges, HoughHelpers::Eta::houghParamMdtRight,
461  std::bind(HoughHelpers::Eta::houghWidthMdt, _1, _2, resolutionTarget), SP, precisionLayerIndex, w);
462  } else {
463  if (SP->measuresEta()) {
464  data.houghPlane->fill<HoughHitType>(SP, data.currAxisRanges, HoughHelpers::Eta::houghParamStrip,
465  std::bind(HoughHelpers::Eta::houghWidthStrip, _1, _2, resolutionTarget), SP, 0, w * (
466  m_downWeightMultiplePrd ? 1.0 / SP->nEtaInstanceCounts() : 1.));
467  }
468  }
469 }
470 void EtaHoughTransformAlg::extendWithPhiHits(std::vector<HoughHitType>& hitList,
471  HoughSetupForBucket& bucket) const {
472  for (const SpacePointBucket::value_type& hit : *bucket.bucket) {
473  if (!hit->measuresEta()) {
474  hitList.push_back(hit.get());
475  }
476  }
477 }
478 }
MuonR4::minLayers
constexpr unsigned int minLayers
Definition: CombinatorialNSWSeedFinderAlg.cxx:63
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
MuonGMR4::MmReadoutElement
Definition: MmReadoutElement.h:18
ymin
double ymin
Definition: listroot.cxx:63
UtilFunctions.h
MuonR4::EtaHoughTransformAlg::m_minMaxDistIntercept
DoubleProperty m_minMaxDistIntercept
Definition: EtaHoughTransformAlg.h:96
MuonR4::SpacePoint::type
xAOD::UncalibMeasType type() const
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/SpacePoint.cxx:71
MuonR4::EtaHoughTransformAlg::m_downWeightMultiplePrd
BooleanProperty m_downWeightMultiplePrd
Definition: EtaHoughTransformAlg.h:108
MuonR4::SpacePointBucket
: The muon space point bucket represents a collection of points that will bre processed together in t...
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/MuonSpacePoint/SpacePointContainer.h:21
vtune_athena.format
format
Definition: vtune_athena.py:14
xAOD::MMCluster_v1
Definition: MMCluster_v1.h:20
ActsTrk::DetectorType
DetectorType
Simple enum to Identify the Type of the ACTS sub detector.
Definition: GeometryDefs.h:17
MuonR4::SpacePointBucket::msSector
const MuonGMR4::SpectrometerSector * msSector() const
returns th associated muonChamber
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/MuonSpacePoint/SpacePointContainer.h:33
MuonR4::SpacePointPerLayerSorter
The SpacePointPerLayerSorter sort two given space points by their layer Identifier.
Definition: SpacePointPerLayerSorter.h:15
MuonR4::EtaHoughTransformAlg::m_targetResoIntercept
DoubleProperty m_targetResoIntercept
Definition: EtaHoughTransformAlg.h:84
MuonR4::SpacePointBucket::coveredMin
double coveredMin() const
lower interval value covered by the bucket
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/MuonSpacePoint/SpacePointContainer.h:29
calibdata.chamber
chamber
Definition: calibdata.py:31
PixelAthClusterMonAlgCfg.zmin
zmin
Definition: PixelAthClusterMonAlgCfg.py:169
VisualizationHelpers.h
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
MuonR4::EtaHoughTransformAlg::m_geoCtxKey
SG::ReadHandleKey< ActsGeometryContext > m_geoCtxKey
Definition: EtaHoughTransformAlg.h:117
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
SegmentSeed.h
MuonGMR4::SpectrometerSector::chamberLocation::location
const Amg::Vector3D & location() const
Returns the location.
Definition: SpectrometerSector.h:96
xAOD::UncalibMeasType::MMClusterType
@ MMClusterType
MuonR4::HoughEventData_impl::HoughSetupForBucket::searchWindowIntercept
std::pair< double, double > searchWindowIntercept
Definition: HoughEventData.h:46
MuonGMR4::MuonReadoutElement
The MuonReadoutElement is an abstract class representing the geometry representing the muon detector.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:38
MuonValR4::drawBox
std::unique_ptr< TBox > drawBox(const Amg::Vector3D &boxCenter, const double boxWidth, const double boxHeight, const int color=kGreen+2, const int fillStyle=hollowFilling, const int view=objViewEta)
Creates a box for drawing, e.g strip measurements.
Definition: VisualizationHelpers.cxx:41
HoughHelperFunctions.h
MuonR4::EtaHoughTransformAlg::passSeedQuality
bool passSeedQuality(const HoughSetupForBucket &currentBucket, const MuonR4::ActsPeakFinderForMuon::Maximum &maximum) const
apply quality cuts on a given maximum
Definition: EtaHoughTransformAlg.cxx:182
postInclude.sorter
sorter
Definition: postInclude.SortInput.py:23
MuonGMR4::SpectrometerSector::chamberLocation::minY
double minY() const
Returns the minimum y covered by the chamber location.
Definition: SpectrometerSector.h:78
MuonR4::ActsPeakFinderForMuonCfg
Acts::HoughTransformUtils::PeakFinders::IslandsAroundMaxConfig ActsPeakFinderForMuonCfg
Definition: MuonHoughDefs.h:26
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
ActsTrk::DetectorType::sTgc
@ sTgc
Micromegas (NSW)
xAOD::UncalibMeasType::sTgcStripType
@ sTgcStripType
SpectrometerSector.h
x
#define x
MuonGMR4::SpectrometerSector::identString
std::string identString() const
Returns a string encoding the chamber index & the sector of the MS sector.
Definition: SpectrometerSector.cxx:66
python.SystemOfUnits.mL
float mL
Definition: SystemOfUnits.py:95
MuonValR4::drawLabel
std::unique_ptr< TLatex > drawLabel(const std::string &text, const double xPos, const double yPos, const unsigned int fontSize=18)
Create a TLatex label,.
Definition: VisualizationHelpers.cxx:32
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
Muon::MdtStatusDriftTime
@ MdtStatusDriftTime
The tube produced a vaild measurement.
Definition: MdtDriftCircleStatus.h:34
MuonR4::EtaHoughTransformAlg::initialize
virtual StatusCode initialize() override
Definition: EtaHoughTransformAlg.cxx:64
MuonR4::EtaHoughTransformAlg::m_minSigmasSearchTanTheta
DoubleProperty m_minSigmasSearchTanTheta
Definition: EtaHoughTransformAlg.h:87
MuonR4::EtaHoughTransformAlg::m_visionTool
ToolHandle< MuonValR4::IPatternVisualizationTool > m_visionTool
Pattern visualization tool.
Definition: EtaHoughTransformAlg.h:119
MuonR4::HoughHelpers::Eta::houghWidthStrip
double houghWidthStrip(double tanTheta, const MuonR4::HoughHitType &strip, double targetReso)
Uncertainty parametrisation for strip measurements.
Definition: HoughHelperFunctions.cxx:27
EtaHoughTransformAlg.h
MuonR4::SpacePoint::primaryMeasurement
const xAOD::UncalibratedMeasurement * primaryMeasurement() const
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/SpacePoint.cxx:47
MuonR4::SpacePointBucket::coveredMax
double coveredMax() const
upper interval value covered by the bucket
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/MuonSpacePoint/SpacePointContainer.h:31
MuonR4::HoughHelpers::Eta::houghWidthMdt
double houghWidthMdt(double tanTheta, const MuonR4::HoughHitType &dc, double targetReso)
uncertainty parametrisation for drift circles
Definition: HoughHelperFunctions.cxx:21
MuonR4::EtaHoughTransformAlg::m_minMaxDistTheta
DoubleProperty m_minMaxDistTheta
Definition: EtaHoughTransformAlg.h:94
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
xAOD::sTgcMeasurement_v1::channelType
virtual sTgcChannelTypes channelType() const =0
Returns the channel type of the measurement (Pad/Wire/Strip)
MuonR4::EtaHoughTransformAlg::m_peakThreshold
DoubleProperty m_peakThreshold
Definition: EtaHoughTransformAlg.h:92
ActsTrk::DetectorType::Mm
@ Mm
Maybe not needed in the migration.
xAOD::UncalibratedMeasurement_v1::type
virtual xAOD::UncalibMeasType type() const =0
Returns the type of the measurement type as a simple enumeration.
MuonR4::HoughEventData_impl::HoughSetupForBucket::bucket
const SpacePointBucket * bucket
Definition: HoughEventData.h:42
CreatePhysValWebPage.hs
hs
Definition: CreatePhysValWebPage.py:107
z
#define z
SG::get
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
Definition: ReadCondHandle.h:287
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
UtilFunctions.h
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
MuonR4::EtaHoughTransformAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: EtaHoughTransformAlg.cxx:72
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:11
MuonR4::passesThrough
bool passesThrough(const SpacePointBucket::chamberLocation &loc, double y0, double tanTheta)
Definition: EtaHoughTransformAlg.cxx:25
PixelAthClusterMonAlgCfg.zmax
zmax
Definition: PixelAthClusterMonAlgCfg.py:169
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MuonR4::EtaHoughTransformAlg::m_nPrecHitCut
UnsignedIntegerProperty m_nPrecHitCut
Definition: EtaHoughTransformAlg.h:100
IDPVM::binIndex
unsigned int binIndex(const T &val, const std::vector< T > &partitions)
general utility function to return bin index given a value and the upper endpoints of each bin
Definition: InDetPhysValMonitoringUtilities.h:43
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
MuonR4::EtaHoughTransformAlg::processBucket
void processBucket(const EventContext &ctx, HoughEventData &data, HoughSetupForBucket &currentBucket) const
process a bucket.
Definition: EtaHoughTransformAlg.cxx:292
MuonR4::HoughHelpers::Eta::houghParamMdtLeft
double houghParamMdtLeft(double tanTheta, const MuonR4::HoughHitType &dc)
left-side straight line parametrisation for drift circles
Definition: HoughHelperFunctions.cxx:9
F600IntegrationConfig.spacePoints
spacePoints
Definition: F600IntegrationConfig.py:122
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
ActsGeometryContext
Include the GeoPrimitives which need to be put first.
Definition: ActsGeometryContext.h:27
MdtDriftCircle.h
MuonR4::SpacePoint
The muon space point is the combination of two uncalibrated measurements one of them measures the eta...
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/MuonSpacePoint/SpacePoint.h:19
MuonR4::EtaHoughTransformAlg::m_nBinsIntercept
IntegerProperty m_nBinsIntercept
Definition: EtaHoughTransformAlg.h:105
MuonR4::HoughEventData_impl::HoughSetupForBucket
Hough transform configuration for one bucket of the search space.
Definition: HoughEventData.h:40
MuonR4::SegmentFit::ParamDefs::y0
@ y0
ActsTrk::DetectorType::Mdt
@ Mdt
MuonSpectrometer.
MuonValR4::IPatternVisualizationTool::PrimitiveVec
std::vector< PrimitivePtr > PrimitiveVec
Definition: IPatternVisualizationTool.h:31
MuonGMR4::MdtReadoutElement
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MdtReadoutElement.h:18
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:76
sTgcMeasurement.h
WriteCaloSwCorrections.cfg
cfg
Definition: WriteCaloSwCorrections.py:23
MuonR4::chamberCoverage
constexpr double chamberCoverage(const std::array< double, 2 > &seedEdges, const std::array< double, 2 > &chambEdges)
Calculates how much of the unkknown coordinate along the tube range is covered by the chamber of inte...
Definition: EtaHoughTransformAlg.cxx:43
MuonGMR4::SpectrometerSector::bounds
std::shared_ptr< Acts::TrapezoidVolumeBounds > bounds() const
Returns the volume bounds.
Definition: SpectrometerSector.cxx:90
MuonR4::EtaHoughTransformAlg::m_peakFractionCutOff
DoubleProperty m_peakFractionCutOff
Definition: EtaHoughTransformAlg.h:98
MuonR4::EtaHoughTransformAlg::m_maxima
SG::WriteHandleKey< EtaHoughMaxContainer > m_maxima
Definition: EtaHoughTransformAlg.h:115
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MuonGMR4::sTgcReadoutElement
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/sTgcReadoutElement.h:20
MuonR4::SpacePointBucket::chamberLocations
const std::vector< chamberLocation > & chamberLocations() const
returns the list of all tracking chambers in the bucket for fast navigation
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/MuonSpacePoint/SpacePointContainer.h:46
MuonR4
This header ties the generic definitions in this package.
Definition: HoughEventData.h:16
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:73
MuonR4::EtaHoughTransformAlg::preProcess
void preProcess(const EventContext &ctx, const ActsGeometryContext &gctx, const SpacePointContainer &spacePoints, HoughEventData &data) const
pre-processing method called once per event.
Definition: EtaHoughTransformAlg.cxx:109
a
TList * a
Definition: liststreamerinfos.cxx:10
MuonR4::HoughMaximum
Data class to represent an eta maximum in hough space.
Definition: HoughMaximum.h:14
MuonR4::EtaHoughTransformAlg::extendWithPhiHits
void extendWithPhiHits(std::vector< HoughHitType > &hitList, HoughSetupForBucket &bucket) const
extend a maximum with all compatible (pure) phi hits.
Definition: EtaHoughTransformAlg.cxx:470
MuonR4::EtaHoughTransformAlg::m_targetResoTanTheta
DoubleProperty m_targetResoTanTheta
Definition: EtaHoughTransformAlg.h:82
y
#define y
python.CaloAddPedShiftConfig.int
int
Definition: CaloAddPedShiftConfig.py:45
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
MuonR4::SpacePoint::measuresEta
bool measuresEta() const
: Does the space point contain an eta measurement
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/SpacePoint.cxx:77
MuonR4::EtaHoughTransformAlg::m_spacePointKey
SG::ReadHandleKey< SpacePointContainer > m_spacePointKey
Definition: EtaHoughTransformAlg.h:113
MuonR4::HoughEventData_impl::HoughSetupForBucket::searchWindowTanAngle
std::pair< double, double > searchWindowTanAngle
Definition: HoughEventData.h:48
MuonR4::proximity
double proximity(const SpacePoint *dc, double y0, double tanTheta)
Definition: EtaHoughTransformAlg.cxx:30
MuonR4::EtaHoughTransformAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Handle to the IdHelperSvc.
Definition: EtaHoughTransformAlg.h:110
MuonR4::EtaHoughTransformAlg::isPrecisionHit
static bool isPrecisionHit(const HoughHitType &hit)
Returns whether the hit is a precision hit or not.
Definition: EtaHoughTransformAlg.cxx:152
re
const boost::regex re(r_e)
MuonR4::SegmentSeed
Representation of a segment seed (a fully processed hough maximum) produced by the hough transform.
Definition: SegmentSeed.h:14
MuonR4::EtaHoughTransformAlg::m_nBinsTanTheta
IntegerProperty m_nBinsTanTheta
Definition: EtaHoughTransformAlg.h:103
xAOD::MdtDriftCircle_v1::status
MdtDriftCircleStatus status() const
Returns the status of the measurement.
MuonR4::EtaHoughTransformAlg::prepareHoughPlane
void prepareHoughPlane(HoughEventData &data) const
prepare the accumulator and the peak finder once per event
Definition: EtaHoughTransformAlg.cxx:170
MuonR4::HoughHelpers::Eta::houghParamMdtRight
double houghParamMdtRight(double tanTheta, const MuonR4::HoughHitType &dc)
right-side straight line parametrisation for drift circles
Definition: HoughHelperFunctions.cxx:13
MMCluster.h
MuonR4::HoughHelpers::Eta::houghParamStrip
double houghParamStrip(double tanTheta, const MuonR4::HoughHitType &strip)
straight line parametrisation for strip detector measurements
Definition: HoughHelperFunctions.cxx:17
xAOD::MdtDriftCircle_v1
https://gitlab.cern.ch/atlas/athena/-/blob/master/MuonSpectrometer/MuonReconstruction/MuonRecEvent/Mu...
Definition: MdtDriftCircle_v1.h:21
xAOD::muonReadoutElement
const MuonGMR4::MuonReadoutElement * muonReadoutElement(const UncalibratedMeasurement *meas)
Returns the associated readout element to the measurement.
Definition: MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/Root/UtilFunctions.cxx:40
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:198
MuonGMR4::SpectrometerSector::chamberLocation
: Helper struct for fast approximate navigation.
Definition: SpectrometerSector.h:48
xAOD::UncalibMeasType::RpcStripType
@ RpcStripType
xAOD::UncalibMeasType::MdtDriftCircleType
@ MdtDriftCircleType
SpacePointPerLayerSorter.h
MuonR4::SpacePoint::identify
const Identifier & identify() const
: Identifier of the primary measurement
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/SpacePoint.cxx:80
xAOD::sTgcMeasurement_v1
Definition: sTgcMeasurement_v1.h:21
ymax
double ymax
Definition: listroot.cxx:64
MuonR4::HoughEventData_impl
Templated event data class for the phase-2 muon hough transform.
Definition: HoughEventData.h:22
MuonR4::EtaHoughTransformAlg::fillFromSpacePoint
void fillFromSpacePoint(HoughEventData &data, const MuonR4::HoughHitType &SP) const
fill the accumulator from a given space point.
Definition: EtaHoughTransformAlg.cxx:440
MuonR4::EtaHoughTransformAlg::m_minSigmasSearchIntercept
DoubleProperty m_minSigmasSearchIntercept
Definition: EtaHoughTransformAlg.h:90
Identifier
Definition: IdentifierFieldParser.cxx:14