ATLAS Offline Software
MuonChamberHoleRecoveryTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 #include <map>
8 
32 #include "TrkVolumes/Volume.h"
33 
34 namespace {
35  struct PullCluster {
37  std::unique_ptr<Trk::TrackParameters> pars{};
38  std::unique_ptr<Muon::MuonClusterOnTrack> clus{};
39  };
40  using ClusterLayerMap = std::map<Identifier, PullCluster>;
41 
42 } // namespace
43 namespace Muon {
45 
46 
49  return m_trk.trackStateOnSurfaces()->begin();
50  }
52  return m_trk.trackStateOnSurfaces()->end();
53  }
55  return m_curr_itr != end() ? (*m_curr_itr) : nullptr;
56  }
58  if (!m_nextCalled) {
59  m_nextCalled = true;
60  return true;
61  }
62  if (m_curr_itr == end()) return false;
63  return (++m_curr_itr) != end();
64  }
66  if (!m_copiedStates.insert(tsos()).second) return;
67  if (target == CopyTarget::GlobalTrkStates) m_newStates.emplace_back(tsos()->clone());
68  else chamberStates.emplace_back(tsos()->clone());
69  }
71  return chamberStates.empty() ? tsos()->trackParameters() : chamberStates[0]->trackParameters();
72  }
74  if (chamberStates.empty()) return;
75  std::stable_sort(chamberStates.begin(), chamberStates.end(), SortTSOSByDistanceToPars(chamberPars()));
76  m_newStates.insert(m_newStates.end(), std::make_move_iterator(chamberStates.begin()),
77  std::make_move_iterator(chamberStates.end()));
78  chamberStates.clear();
79  }
80  std::unique_ptr<Trk::TrackStates> MuonChamberHoleRecoveryTool::RecoveryState::releaseStates() {
81  finalizeChamber();
82  std::unique_ptr<Trk::TrackStates> outVec = std::make_unique<Trk::TrackStates>();
83  for (std::unique_ptr<const Trk::TrackStateOnSurface>& tsos : m_newStates){
84  outVec->push_back(std::move(tsos));
85  }
86  return outVec;
87  }
88 
89  MuonChamberHoleRecoveryTool::MuonChamberHoleRecoveryTool(const std::string& ty, const std::string& na, const IInterface* pa) :
90  AthAlgTool(ty, na, pa) {
91  declareInterface<IMuonHoleRecoveryTool>(this);
92  }
93 
96  ATH_CHECK(m_edmHelperSvc.retrieve());
97  ATH_CHECK(m_idHelperSvc.retrieve());
98  ATH_CHECK(m_trackingVolumesSvc.retrieve());
99  ATH_CHECK(m_printer.retrieve());
100  ATH_CHECK(m_extrapolator.retrieve());
101 
102 
103  ATH_CHECK(m_key_csc.initialize(!m_key_csc.empty()));
104  ATH_CHECK(m_key_stgc.initialize(!m_key_stgc.empty()));
105  ATH_CHECK(m_key_mm.initialize(!m_key_mm.empty()));
106 
107  ATH_CHECK(m_key_mdt.initialize(!m_key_mdt.empty()));
108  ATH_CHECK(m_key_tgc.initialize(!m_key_tgc.empty()));
109  ATH_CHECK(m_key_rpc.initialize(!m_key_rpc.empty()));
110 
111  ATH_CHECK(m_cscRotCreator.retrieve(DisableTool{m_key_csc.empty()}));
112 
113  const bool hasClusKey = !m_key_stgc.empty() || !m_key_mm.empty() || !m_key_tgc.empty() || !m_key_rpc.empty();
114  ATH_CHECK(m_clusRotCreator.retrieve(EnableTool{hasClusKey}));
115  ATH_CHECK(m_mdtRotCreator.retrieve(EnableTool{!m_key_mdt.empty()}));
116  ATH_CHECK(m_pullCalculator.retrieve());
117 
119  return StatusCode::SUCCESS;
120  }
122  while(trkRecov.nextState()) {
123  const Trk::TrackParameters* pars = trkRecov.tsos()->trackParameters();
124  ATH_MSG_VERBOSE("Track parameters "<<(*pars));
127  if (msVol.inside(pars->position())) {
128  ATH_MSG_VERBOSE("Tracking parameters are inside the MS");
129  trkRecov.copyState(target);
130  continue;
131  }
132 
133  if (trkRecov.tsos()->type(Trk::TrackStateOnSurface::Hole)) {
134  ATH_MSG_VERBOSE("Skip hole in MS");
135  continue;
136  }
138  const Trk::MeasurementBase* meas = trkRecov.tsos()->measurementOnTrack();
139  if (!meas) {
140  ATH_MSG_VERBOSE("The track state does not have an associated measurement");
141  trkRecov.copyState(target);
142  continue;
143  }
144  trkRecov.tsosId = m_edmHelperSvc->getIdentifier(*meas);
145  // Potentially a pseudo measurement. Anyway keep it
146  if (!trkRecov.tsosId.is_valid() || !m_idHelperSvc->isMuon(trkRecov.tsosId)) {
147  ATH_MSG_VERBOSE("No muon measurement");
148  trkRecov.copyState(target);
149  continue;
150  }
151  return true;
152  }
153  return false;
154  }
155 
156  std::set<Identifier> MuonChamberHoleRecoveryTool::layersOnTrkIds(const Trk::Track& track) const {
157  std::set<Identifier> layerIds{};
158  for (const Trk::TrackStateOnSurface* tsos: *track.trackStateOnSurfaces()){
159  const Trk::MeasurementBase* meas = tsos->measurementOnTrack();
160  if (!meas) continue;
161  const Identifier measId = m_edmHelperSvc->getIdentifier(*meas);
162 
163  if (!m_idHelperSvc->isMuon(measId)) continue;
164  layerIds.insert(measId);
165  layerIds.insert(m_idHelperSvc->layerId(measId));
166  // split competing ROTs into constituents
167  const CompetingMuonClustersOnTrack* comp = dynamic_cast<const CompetingMuonClustersOnTrack*>(meas);
168  if (!comp) { continue; }
169 
170  for (const Muon::MuonClusterOnTrack* clust : comp->containedROTs()) {
171  layerIds.insert(m_idHelperSvc->layerId(clust->identify()));
172  }
173  }
174  return layerIds;
175  }
176 
177  std::unique_ptr<Trk::Track> MuonChamberHoleRecoveryTool::recover(const Trk::Track& track, const EventContext& ctx) const {
178  ATH_MSG_DEBUG(" performing hole search track " << std::endl
179  << m_printer->print(track) << std::endl
180  << m_printer->printMeasurements(track));
181 
182  RecoveryState recovState{track};
183  recovState.layersOnTrk = layersOnTrkIds(track);
184 
188  recoverHitsInChamber(ctx, recovState);
189  std::unique_ptr<Trk::Track> newTrack = std::make_unique<Trk::Track>(track.info(), recovState.releaseStates(),
190  track.fitQuality() ? track.fitQuality()->uniqueClone() : nullptr);
191  return newTrack;
192  }
193  void MuonChamberHoleRecoveryTool::recoverHitsInChamber(const EventContext& ctx, RecoveryState& trkRecov) const {
194  const Muon::MuonStationIndex::ChIndex currStation = m_idHelperSvc->chamberIndex(trkRecov.tsosId);
196  std::set<Identifier> chambInStation{};
197  do {
198  if (currStation != m_idHelperSvc->chamberIndex(trkRecov.tsosId)) {
199  trkRecov.finalizeChamber();
200  recoverHitsInChamber(ctx, trkRecov);
201  return;
202  }
205  if (chambInStation.insert(m_idHelperSvc->chamberId(trkRecov.tsosId)).second) {
206  if (m_idHelperSvc->isMdt(trkRecov.tsosId)) {
207  recoverMdtHits(ctx, trkRecov.tsosId, *trkRecov.tsos()->trackParameters(),
208  trkRecov.chamberStates, trkRecov.layersOnTrk);
209  } else {
210  recoverClusterHits(ctx, trkRecov.tsosId, *trkRecov.tsos()->trackParameters(),
211  trkRecov.chamberStates, trkRecov.layersOnTrk);
212  }
213  }
215  trkRecov.finalizeChamber();
216  }
217  void MuonChamberHoleRecoveryTool::recoverMdtHits(const EventContext& ctx,
218  const Identifier& chId,
219  const Trk::TrackParameters& pars,
220  NewTrackStates& newStates, std::set<Identifier>& knownLayers) const {
221 
222 
223  std::set<Identifier> chHoles = holesInMdtChamber(ctx, pars.position(), pars.momentum().unit(), chId, knownLayers);
224  ATH_MSG_VERBOSE(" chamber " << m_idHelperSvc->toStringChamber(chId) << " has holes " << chHoles.size());
225  if (chHoles.empty()) return;
226 
227  const std::vector<const MdtPrepData*> prdCandidates{loadPrepDataHits<MdtPrepData>(ctx, m_key_mdt, chHoles)};
228  bool addedState{false};
229  for (const MdtPrepData* mdtPrd : prdCandidates) {
230  const Trk::StraightLineSurface& surf{mdtPrd->detectorElement()->surface(mdtPrd->identify())};
231  std::unique_ptr<Trk::TrackParameters> exPars = m_extrapolator->extrapolateDirectly(ctx, pars, surf, Trk::anyDirection, false, Trk::muon);
232  if (!exPars) {
233  ATH_MSG_WARNING("Propagation to "<<m_idHelperSvc->toString(mdtPrd->identify())<<" failed.");
234  continue;
235  }
236 
239  if (!surf.globalToLocal(exPars->position(), exPars->momentum(), locPos)) {
240  ATH_MSG_DEBUG(" failed to calculate drift sign ");
241  continue;
242  }
243  if (!surf.insideBounds(locPos)) {
244  chHoles.erase(mdtPrd->identify());
245  continue;
246  }
247 
248  // calibrate Mdt PRD
249  const Amg::Vector3D momentum = exPars->momentum();
250  std::unique_ptr<MdtDriftCircleOnTrack> mdtROT{m_mdtRotCreator->createRIO_OnTrack(*mdtPrd,
251  exPars->position(),
252  &momentum)};
253  if (!mdtROT) continue;
254 
258  m_mdtRotCreator->updateSign(*mdtROT, side);
259 
261  std::optional<const Trk::ResidualPull> resPull{m_pullCalculator->residualPull(mdtROT.get(),
262  exPars.get(),
264  if (!resPull) { continue; }
265 
266  const double pull = resPull->pull().front();
267  const double radialResidual = std::abs(mdtROT->localParameters()[Trk::locR]) -
268  std::abs(exPars->parameters()[Trk::locR]);
269 
270  unsigned int hitFlag = 1;
271  if (mdtPrd->adc() < m_adcCut || mdtPrd->status() != MdtStatusDriftTime)
272  hitFlag = 3; // noise
273  else if (std::abs(pull) < m_associationPullCutEta)
274  hitFlag = 0; // hit on track
275  else if (radialResidual > 0.)
276  hitFlag = 2; // out of time
277 
278  ATH_MSG_VERBOSE(__func__<<"() - Recover "<<m_printer->print(*mdtROT)<<" pull: "<<pull<<" hitFlag: "<<hitFlag);
279  std::unique_ptr<Trk::TrackStateOnSurface> tsos = MuonTSOSHelper::createMeasTSOS(std::move(mdtROT),
280  std::move(exPars),
281  (hitFlag != 0 || !m_addMeasurements) ?
284 
285  if (!addedState) {
286  newStates.emplace_back(std::move(tsos));
287  addedState = true;
288  } else {
289  const MdtDriftCircleOnTrack* prevDC = static_cast<const MdtDriftCircleOnTrack*>(newStates.back()->measurementOnTrack());
290  if (prevDC->identify() != mdtPrd->identify()) {
291  newStates.emplace_back(std::move(tsos));
292  } else {
293  ATH_MSG_DEBUG("Two hits recorded for the same tube "<<std::endl<<
294  " *** current: "<<m_printer->print(*tsos->measurementOnTrack())<<std::endl<<
295  " *** previous: "<<m_printer->print(*prevDC));
296  std::optional<Trk::ResidualPull> prevPullObj{m_pullCalculator->residualPull(prevDC,
297  tsos->trackParameters(),
299  const double prevPull = prevPullObj->pull().front();
301  if (std::abs(pull) < std::abs(prevPull) ||
303  newStates.back()->type(Trk::TrackStateOnSurface::Outlier))) {
304  newStates.back() = std::move(tsos);
305  }
306 
307  }
308  }
309  chHoles.erase(mdtPrd->identify());
310  knownLayers.insert(mdtPrd->identify());
311  }
312 
313  for (const Identifier& hole : chHoles) {
314  const Trk::Surface& surf{getDetectorElement(ctx, hole)->surface(hole)};
315  std::unique_ptr<Trk::TrackParameters> exPars = m_extrapolator->extrapolateDirectly(ctx, pars, surf, Trk::anyDirection, false, Trk::muon);
316  if (!exPars) {
317  ATH_MSG_WARNING("Propagation to "<<m_idHelperSvc->toString(hole)<<" failed.");
318  continue;
319  }
320  ATH_MSG_VERBOSE(__func__<<"() - Add hole "<<m_idHelperSvc->toString(hole));
321  newStates.emplace_back(MuonTSOSHelper::createHoleTSOS(std::move(exPars)));
322  }
323  }
325  const Identifier& chambId,
326  const Trk::TrackParameters& pars,
327  NewTrackStates& states, std::set<Identifier>& knownLayers) const {
328 
329  NewTrackStates recovered{};
330  if (m_idHelperSvc->isRpc(chambId)) {
331  recovered = recoverChamberClusters(ctx, m_key_rpc, chambId, pars, knownLayers);
332  } else if (m_idHelperSvc->isTgc(chambId)) {
333  recovered = recoverChamberClusters(ctx, m_key_tgc, chambId, pars, knownLayers);
334  } else if (m_idHelperSvc->isCsc(chambId)) {
335  recovered = recoverChamberClusters(ctx, m_key_csc, chambId, pars, knownLayers);
336  } else if (m_idHelperSvc->isMM(chambId)) {
337  recovered = recoverChamberClusters(ctx, m_key_mm, chambId, pars, knownLayers);
338  } else if (m_idHelperSvc->issTgc(chambId)) {
339  recovered = recoverChamberClusters(ctx, m_key_stgc, chambId, pars, knownLayers);
340  }
341  states.insert(states.end(), std::make_move_iterator(recovered.begin()),
342  std::make_move_iterator(recovered.end()));
343  }
345  const EventContext& ctx,
346  const Trk::TrackParameters& pars,
347  std::set<Identifier>& layIds,
348  NewTrackStates& states) const {
349  ATH_MSG_VERBOSE(" performing holes search in chamber " << m_idHelperSvc->toString(detElId));
350  recoverClusterHits(ctx, detElId, pars, states, layIds);
351  }
352 
353 
355  const Identifier& detElId) const {
357  const MuonGM::MuonDetectorManager* MuonDetMgr{*DetectorManagerHandle};
358  if (!MuonDetMgr) {
359  ATH_MSG_ERROR("Null pointer to the read MuonDetectorManager conditions object");
360  return nullptr;
361  }
362  if (m_idHelperSvc->isMdt(detElId))
363  return MuonDetMgr->getMdtReadoutElement(detElId);
364  else if (m_idHelperSvc->isTgc(detElId))
365  return MuonDetMgr->getTgcReadoutElement(detElId);
366  else if (m_idHelperSvc->isRpc(detElId))
367  return MuonDetMgr->getRpcReadoutElement(detElId);
368  else if (m_idHelperSvc->isCsc(detElId))
369  return MuonDetMgr->getCscReadoutElement(detElId);
370  // New Small Wheel
371  else if (m_idHelperSvc->issTgc(detElId))
372  return MuonDetMgr->getsTgcReadoutElement(detElId);
373  else if (m_idHelperSvc->isMM(detElId))
374  return MuonDetMgr->getMMReadoutElement(detElId);
375  return nullptr;
376  }
377 
378  std::set<Identifier> MuonChamberHoleRecoveryTool::holesInMdtChamber(const EventContext& ctx, const Amg::Vector3D& position, const Amg::Vector3D& direction,
379  const Identifier& chId, const std::set<Identifier>& tubeIds) const {
380 
382  if (!interSectSvc.isValid()) {
383  ATH_MSG_ERROR("Failed to retrieve chamber intersection service");
384  throw std::runtime_error("No chamber intersection service");
385  }
386  const MuonGM::MdtReadoutElement* readoutEle = interSectSvc->detMgr()->getMdtReadoutElement(chId);
387 
388  MuonStationIntersect intersect = interSectSvc->tubesCrossedByTrack(chId, position, direction);
389 
390  // clear hole vector
391  std::set<Identifier> holes;
392  for (unsigned int ii = 0; ii < intersect.tubeIntersects().size(); ++ii) {
393  const MuonTubeIntersect& tint = intersect.tubeIntersects()[ii];
394 
395  if (tubeIds.count(tint.tubeId)) { continue; }
396  ATH_MSG_VERBOSE(" intersect " << m_idHelperSvc->toString(tint.tubeId) << " dist wire " << tint.rIntersect
397  << " dist to tube end " << tint.xIntersect);
398 
399  if (std::abs(tint.rIntersect) > readoutEle->innerTubeRadius() || tint.xIntersect > -10.) {
400  ATH_MSG_VERBOSE(" not counted");
401  continue;
402  }
403  // check whether there is a hit in this tube
404  ATH_MSG_VERBOSE(" hole tube");
405  holes.insert(tint.tubeId);
406 
407  }
408  return holes;
409  }
410  template <class Prd> std::vector<const Prd*> MuonChamberHoleRecoveryTool::loadPrepDataHits(const EventContext& ctx,
412  const std::set<Identifier>& gasGapIds) const {
413  std::vector<const Prd*> collectedHits{};
414  if (key.empty()) {
415  ATH_MSG_DEBUG("No container configured for "<<typeid(Prd).name());
416  return collectedHits;
417  }
419  if (!prdContainer.isPresent()) {
420  ATH_MSG_FATAL("Failed to load prep data collection "<<key.fullKey());
421  throw std::runtime_error("Invalid prepdata container");
422  }
424  std::set<IdentifierHash> chamberIds{};
425  std::transform(gasGapIds.begin(), gasGapIds.end(),
426  std::inserter(chamberIds, chamberIds.end()),
427  [this](const Identifier& id){
428  return m_idHelperSvc->moduleHash(id);
429  });
430  for (const IdentifierHash& moduleHash : chamberIds) {
431  const MuonPrepDataCollection<Prd>* prdColl = prdContainer->indexFindPtr(moduleHash);
432  if (!prdColl) continue;
433  collectedHits.reserve(collectedHits.size() + prdColl->size());
434  for (const Prd* prd: *prdColl) {
435  bool appendPrd{false};
437  appendPrd = gasGapIds.count(prd->identify());
438  } else {
439  appendPrd = gasGapIds.count(m_idHelperSvc->layerId(prd->identify()));
440  }
441  if (appendPrd) {
442  ATH_MSG_VERBOSE(__func__<<"() - Add prd candidate "<<m_printer->print(*prd));
443  collectedHits.push_back(prd);
444  }
445  }
446  }
450  std::sort(collectedHits.begin(), collectedHits.end(), [](const Prd* a, const Prd* b){
451  return a->identify() < b->identify();
452  });
453  }
454  return collectedHits;
455  }
456  std::set<Identifier> MuonChamberHoleRecoveryTool::getHoleLayerIds(const Identifier& detElId,
457  const std::set<Identifier>& knownLayers) const {
458  std::set<Identifier> holeGaps{};
459  if (m_idHelperSvc->isMdt(detElId)) {
460  const MdtIdHelper& idHelper{m_idHelperSvc->mdtIdHelper()};
461  for (int ml = 1; ml <= idHelper.numberOfMultilayers(detElId); ++ml) {
462  for (int layer = idHelper.tubeLayerMin(detElId);
463  layer <= idHelper.tubeLayerMax(detElId); ++layer) {
464  const Identifier layerId = idHelper.channelID(detElId, ml, layer, 1);
465  if (!knownLayers.count(layerId)) holeGaps.insert(layerId);
466  }
467  }
468  } else if (m_idHelperSvc->isMM(detElId)) {
469  const MmIdHelper& idHelper{m_idHelperSvc->mmIdHelper()};
470  for (int ml : {1 ,2}) {
471  for (int gap = MmIdHelper::gasGapMin(); gap <= MmIdHelper::gasGapMax(); ++gap) {
472  const Identifier layerId = idHelper.channelID(detElId, ml, gap, 1);
473  if (!knownLayers.count(layerId)) holeGaps.insert(layerId);
474  }
475  }
476  } else if (m_idHelperSvc->issTgc(detElId)) {
477  const sTgcIdHelper& idHelper{m_idHelperSvc->stgcIdHelper()};
478  using channelType = sTgcIdHelper::sTgcChannelTypes;
479  for (int ml : {1, 2}) {
480  for (const channelType chType : {channelType::Strip,
481  channelType::Pad,
482  channelType::Wire}){
483  for (int gap = sTgcIdHelper::gasGapMin();
484  gap <= sTgcIdHelper::gasGapMax(); ++gap) {
485  const Identifier layerId = idHelper.channelID(detElId, ml, gap, chType, 1);
486  if (!knownLayers.count(layerId)) holeGaps.insert(layerId);
487  }
488  }
489  }
490  } else if (m_idHelperSvc->isTgc(detElId)) {
491  const TgcIdHelper& idHelper = m_idHelperSvc->tgcIdHelper();
492  const int gapMax{idHelper.gasGapMax(detElId)};
493  for (int gasgap = idHelper.gasGapMin(detElId);
494  gasgap < gapMax; ++gasgap){
495  for (int measPhi: {0,1}) {
497  if (gapMax == 3 && gasgap ==2 && measPhi == 1) continue;
498  const Identifier layerId = idHelper.channelID(detElId, gasgap, measPhi, 1);
499  if (!knownLayers.count(layerId)) holeGaps.insert(layerId);
500  }
501  }
502  } else if (m_idHelperSvc->isRpc(detElId)) {
503  const RpcIdHelper& idHelper = m_idHelperSvc->rpcIdHelper();
504  const int doubZ{idHelper.doubletZ(detElId)};
505  const int gapMax{idHelper.gasGapMax(detElId)};
506  for (int phiGap = idHelper.doubletPhi(detElId);
507  phiGap <= RpcIdHelper::doubletPhiMax(); ++phiGap) {
508  for (int gap = idHelper.gasGapMin(detElId);
509  gap <= gapMax; ++gap) {
510  for (int measPhi: {0, 1}) {
511  const Identifier layerId = idHelper.channelID(detElId, doubZ, phiGap, gap, measPhi, 1);
512  if (!knownLayers.count(layerId)) holeGaps.insert(layerId);
513  }
514  }
515  }
516  } else if (m_idHelperSvc->isCsc(detElId)) {
517  const CscIdHelper& idHelper{m_idHelperSvc->cscIdHelper()};
518  for (int layer = 1; layer <= 4; ++ layer) {
519  for (bool measPhi: {false, true}) {
520  const Identifier layId = idHelper.channelID(detElId, 2, layer, measPhi, 1);
521  if (!knownLayers.count(layId)) holeGaps.insert(layId);
522  }
523  }
524  }
525  return holeGaps;
526  }
527  template <class Prd> NewTrackStates MuonChamberHoleRecoveryTool::recoverChamberClusters(const EventContext& ctx,
529  const Identifier& detElId,
530  const Trk::TrackParameters& parsInChamb,
531  std::set<Identifier>& knownLayers) const {
532  NewTrackStates recoveredStates{};
533  const std::set<Identifier> missingLayers = getHoleLayerIds(detElId, knownLayers);
534  std::vector<const Prd*> prdCandidates = loadPrepDataHits(ctx, prdKey, missingLayers);
536  using LayerParsMap = std::map<Identifier, std::unique_ptr<Trk::TrackParameters>>;
537  LayerParsMap parsAtSurfMap{};
538  for (const Identifier& holeId : missingLayers) {
539  const Trk::TrkDetElementBase* detEl = getDetectorElement(ctx, holeId);
540  const Trk::Surface& surf{detEl->surface(holeId)};
541  std::unique_ptr<Trk::TrackParameters> pars = m_extrapolator->extrapolateDirectly(ctx, parsInChamb, surf,
542  Trk::anyDirection, false, Trk::muon);
543  if (!pars) {
544  ATH_MSG_VERBOSE("Surface layer "<<m_idHelperSvc->toStringGasGap(holeId)<<" cannot be reached");
545  continue;
546  }
547  if (!Amg::hasPositiveDiagElems(*pars->covariance())) {
548  ATH_MSG_DEBUG("Uncertainties of extraploation to "<<m_idHelperSvc->toStringGasGap(holeId)<<" blew up");
549  continue;
550  }
551  const Amg::Vector2D locExPos{pars->parameters()[Trk::locX],
552  pars->parameters()[Trk::locY]};
553  bool inbounds{false};
555  inbounds = static_cast<const MuonGM::MMReadoutElement*>(detEl)->insideActiveBounds(holeId, locExPos, 10.,10.);
556  } else {
557  inbounds = surf.insideBounds(locExPos, 10., 10.);
558  }
560  if (!inbounds) {
561  ATH_MSG_VERBOSE("Extrapolation to layer "<<m_idHelperSvc->toStringGasGap(holeId)
562  <<" is outside of the chamber "<<Amg::toString(locExPos, 2));
563  continue;
564  }
565  parsAtSurfMap[holeId] = std::move(pars);
566  }
567  ClusterLayerMap bestClusterInLay;
569  for (const Prd* hit : prdCandidates) {
570  const Identifier layId = m_idHelperSvc->layerId(hit->identify());
572  LayerParsMap::const_iterator pars_itr = parsAtSurfMap.find(layId);
573  if (pars_itr == parsAtSurfMap.end()) {
574  continue;
575  }
576  const std::unique_ptr<Trk::TrackParameters>& parsInLay{pars_itr->second};
577  std::unique_ptr<MuonClusterOnTrack> calibClus{};
579  calibClus.reset(m_cscRotCreator->createRIO_OnTrack(*hit,
580  parsInLay->position(),
581  parsInLay->momentum().unit()));
582  } else {
583  calibClus.reset(m_clusRotCreator->createRIO_OnTrack(*hit,
584  parsInLay->position(),
585  parsInLay->momentum().unit()));
586  }
587  if (!calibClus) continue;
588 
590  const sTgcIdHelper& idHelper{m_idHelperSvc->stgcIdHelper()};
591  if (idHelper.channelType(hit->identify()) == sTgcIdHelper::sTgcChannelTypes::Pad){
593  const Amg::Vector2D locExPos{parsInLay->parameters()[Trk::locX],
594  parsInLay->parameters()[Trk::locY]};
595 
596  const MuonGM::MuonPadDesign* pad = hit->detectorElement()->getPadDesign(hit->identify());
597  const Amg::Vector2D padDist = pad->distanceToPad(locExPos, idHelper.channel(hit->identify()));
598 
600  const double xCov = std::hypot(Amg::error(*parsInLay->covariance(), Trk::locX),
601  Amg::error(hit->localCovariance(), Trk::locX));
603  const double yCov =Amg::error(*parsInLay->covariance(), Trk::locY);
604 
605  const double xPull = padDist.x() / xCov;
606  const double yPull = padDist.y() / yCov;
607 
608  ATH_MSG_VERBOSE(__func__<<"() - check "<<m_printer->print(*calibClus)
609  <<" diff "<<Amg::toString(padDist, 2)
610  <<" covariance: ("<<xCov<<", "<<yCov<<")"
611  <<" pull: ("<<xPull<<","<<yPull<<").");
612 
614  if (xPull > m_associationPullCutEta || yPull > m_associationPullCutPhi) continue;
615  const double pull = std::hypot(xPull, yPull);
616 
618  PullCluster& bestClus = bestClusterInLay[layId];
619  if (bestClus.pull < pull) continue;
620  bestClus.pull = pull;
621  bestClus.clus = std::move(calibClus);
622  bestClus.pars = parsInLay->uniqueClone();
623  continue;
624  }
625  }
626 
628  std::optional<const Trk::ResidualPull> resPull{
629  m_pullCalculator->residualPull(calibClus.get(), parsInLay.get(),
631  if (!resPull || resPull->pull().empty()) {
632  continue;
633  }
634 
635  const double pull = std::abs(resPull->pull().front());
636  const double pullCut = m_idHelperSvc->measuresPhi(layId) ? m_associationPullCutPhi
638  if (pull > pullCut) continue;
639 
640  PullCluster& bestClus = bestClusterInLay[layId];
641  if (bestClus.pull < pull) continue;
642  bestClus.pull = pull;
643  bestClus.clus = std::move(calibClus);
644  bestClus.pars = parsInLay->uniqueClone();
645 
646  }
648  for (auto& [layerId, foundClus]: bestClusterInLay) {
649  ATH_MSG_VERBOSE(__func__<<"() recovered hit " << m_printer->print(*foundClus.clus)<<" pull: "<<foundClus.pull);
650  std::unique_ptr<Trk::TrackStateOnSurface> tsos = MuonTSOSHelper::createMeasTSOS(std::move(foundClus.clus),
651  std::move(foundClus.pars),
653  recoveredStates.emplace_back(std::move(tsos));
654  knownLayers.insert(layerId);
655  parsAtSurfMap[layerId].reset();
656  }
658  for (auto& [layerId, exPars] : parsAtSurfMap) {
659  if (!exPars) continue;
660  ATH_MSG_VERBOSE(__func__<<"() add new hole state "<<m_idHelperSvc->toStringGasGap(layerId));
661  recoveredStates.emplace_back(MuonTSOSHelper::createHoleTSOS(std::move(exPars)));
662  }
663  return recoveredStates;
664  }
665 } // namespace Muon
DataVector::reserve
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
Trk::anyDirection
@ anyDirection
Definition: PropDirection.h:22
plotting.yearwise_luminosity_vs_mu.comp
comp
Definition: yearwise_luminosity_vs_mu.py:23
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
MuonCluster.h
Muon::MuonChamberHoleRecoveryTool::m_key_mm
SG::ReadHandleKey< Muon::MMPrepDataContainer > m_key_mm
Definition: MuonChamberHoleRecoveryTool.h:187
Trk::TrackStateOnSurface::trackParameters
const TrackParameters * trackParameters() const
return ptr to trackparameters const overload
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
MuonGM::MuonPadDesign
Parameters defining the design of the readout sTGC pads.
Definition: MuonPadDesign.h:40
MdtReadoutElement.h
Muon::MuonPrepDataContainer
Template for Muon PRD containers (which are basically collections of MuonPrepDataCollections).
Definition: MuonPrepDataContainer.h:42
Muon::MuonChamberHoleRecoveryTool::m_key_stgc
SG::ReadHandleKey< Muon::sTgcPrepDataContainer > m_key_stgc
Definition: MuonChamberHoleRecoveryTool.h:186
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
Muon::MuonChamberHoleRecoveryTool::layersOnTrkIds
std::set< Identifier > layersOnTrkIds(const Trk::Track &track) const
Returns a set of all layer Identifiers of the associated track hits.
Definition: MuonChamberHoleRecoveryTool.cxx:156
Amg::hasPositiveDiagElems
bool hasPositiveDiagElems(const AmgSymMatrix(N) &mat)
Returns true if all diagonal elements of the covariance matrix are finite aka sane in the above defin...
Definition: EventPrimitivesCovarianceHelpers.h:96
Muon::MuonChamberHoleRecoveryTool::m_addMeasurements
Gaudi::Property< bool > m_addMeasurements
Definition: MuonChamberHoleRecoveryTool.h:192
sTgcClusterOnTrack.h
Muon::MuonChamberHoleRecoveryTool::getNextMuonMeasurement
bool getNextMuonMeasurement(RecoveryState &trkRecov, RecoveryState::CopyTarget target) const
Increments the internal iterator of the RecoveryState until the next muon measurement on track is fou...
Definition: MuonChamberHoleRecoveryTool.cxx:121
Muon::MuonChamberHoleRecoveryTool::recoverChamberClusters
NewTrackStates recoverChamberClusters(const EventContext &ctx, const SG::ReadHandleKey< MuonPrepDataContainerT< Prd >> &prdKey, const Identifier &chambId, const Trk::TrackParameters &parsInChamb, std::set< Identifier > &knownLayers) const
Attempts to recover all missing hits in a chamber.
Definition: MuonChamberHoleRecoveryTool.cxx:527
max
#define max(a, b)
Definition: cfImp.cxx:41
StraightLineSurface.h
TrackParameters.h
MeasurementBase.h
Muon::MuonTubeIntersect
Definition: MuonTubeIntersect.h:12
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
Muon::MuonChamberHoleRecoveryTool::recover
std::unique_ptr< Trk::Track > recover(const Trk::Track &track, const EventContext &ctx) const override
returns a new track with holes recovered
Definition: MuonChamberHoleRecoveryTool.cxx:177
Trk::locX
@ locX
Definition: ParamDefs.h:37
Trk::locY
@ locY
local cartesian
Definition: ParamDefs.h:38
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
MuonGM::MdtReadoutElement::innerTubeRadius
double innerTubeRadius() const
Returns the inner tube radius excluding the aluminium walls.
Muon::MuonChamberHoleRecoveryTool::loadPrepDataHits
std::vector< const Prd * > loadPrepDataHits(const EventContext &ctx, const SG::ReadHandleKey< MuonPrepDataContainerT< Prd >> &key, const std::set< Identifier > &layerIds) const
Definition: MuonChamberHoleRecoveryTool.cxx:410
Muon::MuonChamberHoleRecoveryTool::RecoveryState::finalizeChamber
void finalizeChamber()
Sorts the hits accumulated in the current chamber using the first track parameters in that chamber.
Definition: MuonChamberHoleRecoveryTool.cxx:73
sTgcIdHelper::gasGapMax
static int gasGapMax()
Definition: sTgcIdHelper.cxx:1044
TgcIdHelper
Definition: TgcIdHelper.h:50
Trk::ParametersBase::position
const Amg::Vector3D & position() const
Access method for the position.
Muon::MuonChamberHoleRecoveryTool::m_key_rpc
SG::ReadHandleKey< Muon::RpcPrepDataContainer > m_key_rpc
Definition: MuonChamberHoleRecoveryTool.h:185
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
Muon::MuonChamberHoleRecoveryTool::m_key_mdt
SG::ReadHandleKey< Muon::MdtPrepDataContainer > m_key_mdt
Definition: MuonChamberHoleRecoveryTool.h:182
RpcIdHelper::doubletZ
int doubletZ(const Identifier &id) const
Definition: RpcIdHelper.cxx:1061
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
InDetDD::holes
@ holes
Definition: InDetDD_Defs.h:17
Muon::MuonTSOSHelper::createHoleTSOS
static std::unique_ptr< Trk::TrackStateOnSurface > createHoleTSOS(std::unique_ptr< Trk::TrackParameters > pars)
create a hole TSOS, takes ownership of the pointers
Definition: MuonTSOSHelper.h:92
EventPrimitivesHelpers.h
Muon::MuonChamberHoleRecoveryTool::m_cscRotCreator
ToolHandle< Muon::IMuonClusterOnTrackCreator > m_cscRotCreator
Definition: MuonChamberHoleRecoveryTool.h:171
sTgcIdHelper::gasGapMin
static int gasGapMin()
Definition: sTgcIdHelper.cxx:1042
Trk::ResidualPull::Unbiased
@ Unbiased
RP with track state that has measurement not included.
Definition: ResidualPull.h:57
Trk::ITrackingVolumesSvc::MuonSpectrometerEntryLayer
@ MuonSpectrometerEntryLayer
Tracking Volume which defines the entrance surfaces of the MS.
Definition: ITrackingVolumesSvc.h:41
CompetingMuonClustersOnTrack.h
Trk::TrackStateOnSurface::measurementOnTrack
const MeasurementBase * measurementOnTrack() const
returns MeasurementBase const overload
athena.value
value
Definition: athena.py:124
Muon::MuonChamberHoleRecoveryTool::NewTrackStates
std::vector< std::unique_ptr< const Trk::TrackStateOnSurface > > NewTrackStates
Definition: MuonChamberHoleRecoveryTool.h:40
Trk::TrkDetElementBase
Definition: TrkDetElementBase.h:52
RpcIdHelper::doubletPhiMax
static int doubletPhiMax()
Definition: RpcIdHelper.cxx:1093
Trk::locR
@ locR
Definition: ParamDefs.h:44
Muon::MuonChamberHoleRecoveryTool::recoverHitsInChamber
void recoverHitsInChamber(const EventContext &ctx, RecoveryState &trkRecov) const
Loops over all muon hits in a muon chamber and tries to find missed ones by checking each tracking la...
Definition: MuonChamberHoleRecoveryTool.cxx:193
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
Muon::CompetingMuonClustersOnTrack
Definition: CompetingMuonClustersOnTrack.h:54
Muon::MuonChamberHoleRecoveryTool::MuonChamberHoleRecoveryTool
MuonChamberHoleRecoveryTool(const std::string &, const std::string &, const IInterface *)
Definition: MuonChamberHoleRecoveryTool.cxx:89
MdtDriftCircleOnTrack.h
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
RpcIdHelper::channelID
Identifier channelID(int stationName, int stationEta, int stationPhi, int doubletR, int doubletZ, int doubletPhi, int gasGap, int measuresPhi, int strip) const
Definition: RpcIdHelper.cxx:939
sTgcIdHelper::sTgcChannelTypes
sTgcChannelTypes
Definition: sTgcIdHelper.h:190
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:45
Muon::MuonChamberHoleRecoveryTool::RecoveryState::nextState
bool nextState()
Increments the internal iterator.
Definition: MuonChamberHoleRecoveryTool.cxx:57
CaloSwCorrections.gap
def gap(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:212
Identifier::is_valid
bool is_valid() const
Check if id is in a valid state.
RpcIdHelper
Definition: RpcIdHelper.h:51
Muon::MuonChamberHoleRecoveryTool::getDetectorElement
const Trk::TrkDetElementBase * getDetectorElement(const EventContext &ctx, const Identifier &id) const
Returns the detector element associated with the muon Identifier.
Definition: MuonChamberHoleRecoveryTool.cxx:354
Muon::MdtStatusDriftTime
@ MdtStatusDriftTime
The tube produced a vaild measurement.
Definition: MdtDriftCircleStatus.h:34
python.Utilities.clone
clone
Definition: Utilities.py:134
MuonTrackMakerStlTools.h
Muon::MuonChamberHoleRecoveryTool::m_printer
PublicToolHandle< Muon::MuonEDMPrinterTool > m_printer
Definition: MuonChamberHoleRecoveryTool.h:166
MMClusterOnTrack.h
Muon::MuonChamberHoleRecoveryTool::RecoveryState::copyState
void copyState(CopyTarget target)
Definition: MuonChamberHoleRecoveryTool.cxx:65
Muon::MuonChamberHoleRecoveryTool::m_extrapolator
ToolHandle< Trk::IExtrapolator > m_extrapolator
Definition: MuonChamberHoleRecoveryTool.h:167
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
Muon::MuonChamberHoleRecoveryTool::RecoveryState::RecoveryState
RecoveryState(const Trk::Track &trk)
Definition: MuonChamberHoleRecoveryTool.cxx:47
RpcIdHelper::gasGapMin
static int gasGapMin()
Definition: RpcIdHelper.cxx:1095
Muon::MuonChamberHoleRecoveryTool::m_associationPullCutEta
Gaudi::Property< double > m_associationPullCutEta
Definition: MuonChamberHoleRecoveryTool.h:195
Trk::TrackStateOnSurface::Outlier
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
Definition: TrackStateOnSurface.h:122
TRT::Hit::side
@ side
Definition: HitInfo.h:83
MagneticFieldProperties.h
Muon::MuonChamberHoleRecoveryTool::m_chamberGeoKey
SG::ReadCondHandleKey< Muon::MuonIntersectGeoData > m_chamberGeoKey
Definition: MuonChamberHoleRecoveryTool.h:190
TgcClusterOnTrack.h
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
Trk::TrackStateOnSurface::type
bool type(const TrackStateOnSurfaceType type) const
Use this method to find out if the TSoS is of a certain type: i.e.
MuonTSOSHelper.h
Volume.h
RpcClusterOnTrack.h
Muon::MuonChamberHoleRecoveryTool::RecoveryState::tsosId
Identifier tsosId
Identifier of the current trackStateOnSurface.
Definition: MuonChamberHoleRecoveryTool.h:75
Muon::MuonChamberHoleRecoveryTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonChamberHoleRecoveryTool.h:157
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
Muon::MuonChamberHoleRecoveryTool::m_DetectorManagerKey
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_DetectorManagerKey
Definition: MuonChamberHoleRecoveryTool.h:179
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ResidualPull.h
ParticleGun_EoverP_Config.momentum
momentum
Definition: ParticleGun_EoverP_Config.py:63
Muon::MuonChamberHoleRecoveryTool::initialize
StatusCode initialize() override
Definition: MuonChamberHoleRecoveryTool.cxx:94
MuonGM::MdtReadoutElement
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:51
Trk::TrackStateOnSurface::Hole
@ Hole
A hole on the track - this is defined in the following way.
Definition: TrackStateOnSurface.h:128
Muon::MuonChamberHoleRecoveryTool::m_edmHelperSvc
ServiceHandle< Muon::IMuonEDMHelperSvc > m_edmHelperSvc
Definition: MuonChamberHoleRecoveryTool.h:158
Muon::MuonChamberHoleRecoveryTool::m_pullCalculator
ToolHandle< Trk::IResidualPullCalculator > m_pullCalculator
Definition: MuonChamberHoleRecoveryTool.h:176
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
urldecode::states
states
Definition: urldecode.h:39
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
Trk::driftRadius
@ driftRadius
trt, straws
Definition: ParamDefs.h:53
MuonChamberHoleRecoveryTool.h
Muon::MuonTSOSHelper::createMeasTSOS
static std::unique_ptr< Trk::TrackStateOnSurface > createMeasTSOS(std::unique_ptr< Trk::MeasurementBase > meas, std::unique_ptr< Trk::TrackParameters > pars, Trk::TrackStateOnSurface::TrackStateOnSurfaceType type)
create a TSOS with a measurement, takes ownership of the pointers
Definition: MuonTSOSHelper.h:62
Trk::RIGHT
@ RIGHT
the drift radius is positive (see Trk::AtaStraightLine)
Definition: DriftCircleSide.h:22
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
CscClusterOnTrack.h
MdtIdHelper
Definition: MdtIdHelper.h:61
PseudoMeasurementOnTrack.h
Trk::TrkDetElementBase::surface
virtual const Surface & surface() const =0
Return surface associated with this detector element.
MmIdHelper::gasGapMax
static int gasGapMax()
Definition: MmIdHelper.cxx:827
python.StandardJetMods.pull
pull
Definition: StandardJetMods.py:282
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Trk::ParametersBase
Definition: ParametersBase.h:55
Muon::MuonChamberHoleRecoveryTool::RecoveryState::begin
Trk::TrackStates::const_iterator begin() const
Definition: MuonChamberHoleRecoveryTool.cxx:48
Muon::MuonChamberHoleRecoveryTool::m_clusRotCreator
ToolHandle< Muon::IMuonClusterOnTrackCreator > m_clusRotCreator
Definition: MuonChamberHoleRecoveryTool.h:173
Trk::muon
@ muon
Definition: ParticleHypothesis.h:28
Muon::MuonPrepDataCollection
Template to hold collections of MuonPrepRawData objects.
Definition: MuonPrepDataCollection.h:46
Muon::MuonChamberHoleRecoveryTool::getHoleLayerIds
std::set< Identifier > getHoleLayerIds(const Identifier &detElId, const std::set< Identifier > &knownLayers) const
Returns a set of all layer Identifiers (GasGap + channel orientation) in a muon chamber of type X exc...
Definition: MuonChamberHoleRecoveryTool.cxx:456
SortMeasurementsByPosition.h
TgcIdHelper::gasGapMax
static int gasGapMax(bool triplet)
Definition: TgcIdHelper.cxx:663
Muon::MuonChamberHoleRecoveryTool::createHoleTSOSsForClusterChamber
void createHoleTSOSsForClusterChamber(const Identifier &detElId, const EventContext &ctx, const Trk::TrackParameters &pars, std::set< Identifier > &layIds, NewTrackStates &states) const override
Definition: MuonChamberHoleRecoveryTool.cxx:344
Trk::MeasurementBase
Definition: MeasurementBase.h:58
Muon::MuonTubeIntersect::tubeId
Identifier tubeId
Definition: MuonTubeIntersect.h:14
Muon::MuonChamberHoleRecoveryTool::RecoveryState::tsos
const Trk::TrackStateOnSurface * tsos() const
Definition: MuonChamberHoleRecoveryTool.cxx:54
Trk::TrackStateOnSurface
represents the track state (measurement, material, fit parameters and quality) at a surface.
Definition: TrackStateOnSurface.h:71
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
Muon::MuonChamberHoleRecoveryTool::RecoveryState::chamberPars
const Trk::TrackParameters * chamberPars() const
Track parameters of the chamber.
Definition: MuonChamberHoleRecoveryTool.cxx:70
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
Amg::error
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
Definition: EventPrimitivesHelpers.h:40
RpcIdHelper::gasGapMax
int gasGapMax() const
Definition: RpcIdHelper.cxx:1097
Muon::MdtDriftCircleOnTrack
This class represents the corrected MDT measurements, where the corrections include the effects of wi...
Definition: MdtDriftCircleOnTrack.h:37
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
sTgcIdHelper
Definition: sTgcIdHelper.h:55
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
Muon::MdtPrepData
Class to represent measurements from the Monitored Drift Tubes.
Definition: MdtPrepData.h:33
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Muon::MuonChamberHoleRecoveryTool::RecoveryState::end
Trk::TrackStates::const_iterator end() const
Definition: MuonChamberHoleRecoveryTool.cxx:51
MuonDetectorManager.h
Muon::MuonChamberHoleRecoveryTool::recoverMdtHits
void recoverMdtHits(const EventContext &ctx, const Identifier &chId, const Trk::TrackParameters &pars, NewTrackStates &newStates, std::set< Identifier > &knownLayers) const
Definition: MuonChamberHoleRecoveryTool.cxx:217
Muon::MuonChamberHoleRecoveryTool::RecoveryState::layersOnTrk
std::set< Identifier > layersOnTrk
List of all measurement layers on track.
Definition: MuonChamberHoleRecoveryTool.h:73
Trk::DriftCircleSide
DriftCircleSide
Enumerates the 'side' of the wire on which the tracks passed (i.e.
Definition: DriftCircleSide.h:16
Muon::MuonChamberHoleRecoveryTool::m_key_csc
SG::ReadHandleKey< Muon::CscPrepDataContainer > m_key_csc
Definition: MuonChamberHoleRecoveryTool.h:183
Muon::MuonStationIntersect
Definition: MuonStationIntersect.h:12
EventPrimitivesCovarianceHelpers.h
Trk::ParametersBase::momentum
const Amg::Vector3D & momentum() const
Access method for the momentum.
a
TList * a
Definition: liststreamerinfos.cxx:10
Muon::MuonChamberHoleRecoveryTool::holesInMdtChamber
std::set< Identifier > holesInMdtChamber(const EventContext &ctx, const Amg::Vector3D &position, const Amg::Vector3D &direction, const Identifier &chId, const std::set< Identifier > &tubeIds) const
calculate holes in a given chamber using local straight line extrapolation
Definition: MuonChamberHoleRecoveryTool.cxx:378
MmIdHelper
Definition: MmIdHelper.h:54
Muon::MuonTubeIntersect::xIntersect
double xIntersect
Definition: MuonTubeIntersect.h:16
CscIdHelper
Definition: CscIdHelper.h:52
Amg::intersect
std::optional< double > intersect(const AmgVector(N)&posA, const AmgVector(N)&dirA, const AmgVector(N)&posB, const AmgVector(N)&dirB)
Calculates the point of closest approach of two lines.
Definition: GeoPrimitivesHelpers.h:325
MuonGM::MuonDetectorManager
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:50
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Muon::MuonChamberHoleRecoveryTool::m_key_tgc
SG::ReadHandleKey< Muon::TgcPrepDataContainer > m_key_tgc
Definition: MuonChamberHoleRecoveryTool.h:184
copySelective.target
string target
Definition: copySelective.py:37
Trk::RIO_OnTrack::identify
Identifier identify() const
return the identifier -extends MeasurementBase
Definition: RIO_OnTrack.h:152
Muon::MuonChamberHoleRecoveryTool::m_trackingVolumesSvc
ServiceHandle< Trk::ITrackingVolumesSvc > m_trackingVolumesSvc
Definition: MuonChamberHoleRecoveryTool.h:161
Muon::SortTSOSByDistanceToPars
Definition: SortMeasurementsByPosition.h:55
Muon::MuonChamberHoleRecoveryTool::RecoveryState::CopyTarget
CopyTarget
Switch indicating whether the track states are copied onto the global cache vector or onto the chambe...
Definition: MuonChamberHoleRecoveryTool.h:66
GeoPrimitivesToStringConverter.h
MuonGM::MMReadoutElement
An MMReadoutElement corresponds to a single STGC module; therefore typicaly a barrel muon station con...
Definition: MMReadoutElement.h:25
Muon::MuonChamberHoleRecoveryTool::RecoveryState
Definition: MuonChamberHoleRecoveryTool.h:53
Muon::MuonChamberHoleRecoveryTool::RecoveryState::CopyTarget::ChamberTrkStates
@ ChamberTrkStates
Muon::MuonChamberHoleRecoveryTool::m_adcCut
Gaudi::Property< double > m_adcCut
Definition: MuonChamberHoleRecoveryTool.h:197
TgcIdHelper::gasGapMin
static int gasGapMin()
Definition: TgcIdHelper.cxx:661
Muon::MuonChamberHoleRecoveryTool::m_mdtRotCreator
ToolHandle< Muon::IMdtDriftCircleOnTrackCreator > m_mdtRotCreator
Definition: MuonChamberHoleRecoveryTool.h:168
Muon::MuonStationIndex::ChIndex
ChIndex
enum to classify the different chamber layers in the muon spectrometer
Definition: MuonStationIndex.h:15
Muon::MuonTubeIntersect::rIntersect
double rIntersect
Definition: MuonTubeIntersect.h:15
MuonSegment.h
Trk::hole
@ hole
Definition: MeasurementType.h:36
TgcIdHelper::channelID
Identifier channelID(int stationName, int stationEta, int stationPhi, int gasGap, int isStrip, int channel) const
Definition: TgcIdHelper.cxx:583
Trk::LEFT
@ LEFT
the drift radius is negative (see Trk::AtaStraightLine)
Definition: DriftCircleSide.h:20
Muon::MuonChamberHoleRecoveryTool::recoverClusterHits
void recoverClusterHits(const EventContext &ctx, const Identifier &chId, const Trk::TrackParameters &chambPars, NewTrackStates &newStates, std::set< Identifier > &knownLayers) const
Definition: MuonChamberHoleRecoveryTool.cxx:324
Muon::MuonChamberHoleRecoveryTool::RecoveryState::CopyTarget::GlobalTrkStates
@ GlobalTrkStates
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
Muon::MuonChamberHoleRecoveryTool::RecoveryState::releaseStates
std::unique_ptr< Trk::TrackStates > releaseStates()
Moves the recovered track states on surface onto a Trk::TrackStates to be piped into a new Trk::Track...
Definition: MuonChamberHoleRecoveryTool.cxx:80
Muon::NewTrackStates
MuonChamberHoleRecoveryTool::NewTrackStates NewTrackStates
Definition: MuonChamberHoleRecoveryTool.cxx:44
AthAlgTool
Definition: AthAlgTool.h:26
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
Trk::Volume
Definition: Volume.h:35
MuonGM::MuonPadDesign::distanceToPad
Amg::Vector2D distanceToPad(const Amg::Vector2D &pos, int channel) const
Definition: MuonPadDesign.cxx:118
DataVector< PrepDataT >::size
size_type size() const noexcept
Returns the number of elements in the collection.
Muon::MuonChamberHoleRecoveryTool::m_associationPullCutPhi
Gaudi::Property< double > m_associationPullCutPhi
Definition: MuonChamberHoleRecoveryTool.h:196
Trk::TrackStateOnSurface::Measurement
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
Definition: TrackStateOnSurface.h:101
Muon::MuonChamberHoleRecoveryTool::RecoveryState::chamberStates
NewTrackStates chamberStates
Vector of the track states on surface in the current chamber.
Definition: MuonChamberHoleRecoveryTool.h:78
Trk::StraightLineSurface
Definition: StraightLineSurface.h:51
Muon::MuonClusterOnTrack
Base class for Muon cluster RIO_OnTracks.
Definition: MuonClusterOnTrack.h:34
MmIdHelper::gasGapMin
static int gasGapMin()
Definition: MmIdHelper.cxx:815
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32
RpcIdHelper::doubletPhi
int doubletPhi(const Identifier &id) const
Definition: RpcIdHelper.cxx:1063
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
Identifier
Definition: IdentifierFieldParser.cxx:14