ATLAS Offline Software
MuonSegmentRegionRecoveryTool.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 <ostream>
8 
45 
46 namespace Muon {
47 
48  MuonSegmentRegionRecoveryTool::MuonSegmentRegionRecoveryTool(const std::string& ty, const std::string& na, const IInterface* pa) :
49  AthAlgTool(ty, na, pa) {
50  declareInterface<IMuonHoleRecoveryTool>(this);
51  }
52 
54  ATH_CHECK(m_edmHelperSvc.retrieve());
56  ATH_CHECK(m_printer.retrieve());
57  ATH_CHECK(m_seededSegmentFinder.retrieve());
58 
59  if (!m_trackSegmentMatchingTool.empty()) {
61  ATH_MSG_INFO("Using matching tool " << m_trackSegmentMatchingTool);
62  } else {
63  ATH_MSG_DEBUG("No matching tool selected ");
64  }
65 
67  ATH_CHECK(m_extrapolator.retrieve());
68  if (m_onlyEO) {
69  ATH_CHECK(m_fitter.retrieve());
70  m_builder.disable();
71  } else {
72  m_fitter.disable();
73  ATH_CHECK(m_builder.retrieve());
74  }
75  ATH_CHECK(m_idHelperSvc.retrieve());
76  ATH_CHECK(m_hitSummaryTool.retrieve());
78  ATH_CHECK(m_regsel_mdt.retrieve());
79  ATH_CHECK(m_regsel_rpc.retrieve());
80  ATH_CHECK(m_regsel_tgc.retrieve());
82  m_recoverMM = m_recoverMM && !m_regsel_mm.empty();
83  ATH_CHECK(m_regsel_csc.retrieve(DisableTool{m_regsel_csc.empty()}));
84  ATH_CHECK(m_regsel_stgc.retrieve(DisableTool{!m_recoverSTGC}));
85  ATH_CHECK(m_regsel_mm.retrieve(DisableTool{!m_recoverMM}));
86  return StatusCode::SUCCESS;
87  }
88 
90  const Identifier& detElId, const EventContext& ctx, const Trk::TrackParameters& pars, std::set<Identifier>& layIds,
91  std::vector<std::unique_ptr<const Trk::TrackStateOnSurface>>& states) const {
92  m_chamberHoleRecoveryTool->createHoleTSOSsForClusterChamber(detElId, ctx, pars, layIds, states);
93  }
94 
102  std::unique_ptr<Trk::Track> MuonSegmentRegionRecoveryTool::recover(const Trk::Track& track, const EventContext& ctx) const {
103  // Welcome into the implementation of the recovery method
104  ATH_MSG_VERBOSE(" Entering segment recovery method " << m_printer->print(track) << std::endl << m_printer->printStations(track));
105 
106  // First run the MuonChamberHoleRecoveryTool on the input track
107  std::unique_ptr<Trk::Track> chRecTrack(m_chamberHoleRecoveryTool->recover(track, ctx));
108  if (!chRecTrack) {
109  ATH_MSG_DEBUG(" MuonChamberHoleRecoveryTool failed to create a new track "
110  << " Returning input (unrecovered) track ");
111  return std::make_unique<Trk::Track>(track);
112  }
113  ATH_MSG_VERBOSE(" After chamber hole recovery " << m_printer->print(*chRecTrack) << std::endl
114  << m_printer->printStations(*chRecTrack));
115  // only run this on single station EM tracks
116  if (m_onlyEO) {
117  // should be a sl track
118  // using release until parent tools use unique_ptr
119  if (!m_edmHelperSvc->isSLTrack(*chRecTrack)) return chRecTrack;
120 
121  // get hit summary
122  IMuonHitSummaryTool::CompactSummary hitSummary = m_hitSummaryTool->summary(*chRecTrack);
123  // should be single station
124  // using release until parent tools use unique_ptr
125  if (hitSummary.stationLayers.size() != 1 || !hitSummary.stationLayers.count(MuonStationIndex::EM)) return chRecTrack;
126  ATH_MSG_DEBUG("Single station track, checking for EO hits");
127  }
128 
129  // 1) Extrapolate back to MS entry record
130  // const Trk::TrackParameters* msEntryPars = goToMSEntryRecord( *chRecTrack );
131  // if(!msEntryPars) return chRecTrack;
132 
141  MuonData muonData;
142  // extract the hashes already on track
143  fillOnTrackChambers(*chRecTrack, muonData);
144 
145  // collect the hashes not in track close to the track
146  collectCrossedChambers(*chRecTrack, muonData);
147 
148  // 3b) compare the two std::sets and make a final std::set of not-yet-on-track Hashes
149  std::unique_ptr<Trk::Track> triggerRecTrack = addMissingChambers(ctx, *chRecTrack, muonData, false);
150  if (triggerRecTrack) chRecTrack.swap(triggerRecTrack);
151 
152  std::unique_ptr<Trk::Track> mdtRecTrack = addMissingChambers(ctx, *chRecTrack, muonData, true);
153  if (mdtRecTrack) chRecTrack.swap(mdtRecTrack);
154 
155  std::unique_ptr<Trk::Track> mdtRecTrackWithHoles = findHoles(ctx, *chRecTrack, muonData);
156  if (mdtRecTrackWithHoles) chRecTrack.swap(mdtRecTrackWithHoles);
157 
158  // recovered track, success!
159  // use release until calling tools also use unique_ptr
160  return chRecTrack;
161  }
162 
164  // void MuonSegmentRegionRecoveryTool::addHashes( DETID type, double etamin, double etamax, double phimin, double phimax,
165  void MuonSegmentRegionRecoveryTool::addHashes(DETID type, const IRoiDescriptor& roi, std::set<IdentifierHash>& hashes,
166  const std::set<IdentifierHash>& exclusion) const {
167  // if only looking at EO, skip all but MDT chambers
168  if (m_onlyEO && type != MDT) return;
169 
170  std::vector<IdentifierHash> crossed;
171 
172  if (type == MDT) m_regsel_mdt->HashIDList(roi, crossed);
173  if (type == CSC) m_regsel_csc->HashIDList(roi, crossed);
174  if (type == RPC) m_regsel_rpc->HashIDList(roi, crossed);
175  if (type == TGC) m_regsel_tgc->HashIDList(roi, crossed);
176  if (type == STGC) m_regsel_stgc->HashIDList(roi, crossed);
177  if (type == MM) m_regsel_mm->HashIDList(roi, crossed);
178 
179  for (std::vector<IdentifierHash>::iterator it = crossed.begin(); it != crossed.end(); ++it) {
180  if (!exclusion.count(*it) && !hashes.count(*it)) {
181  if (type == MDT) {
182  Identifier chId;
183  IdContext otCont = m_idHelperSvc->mdtIdHelper().module_context();
184  m_idHelperSvc->mdtIdHelper().get_id(*it, chId, &otCont);
185 
186  if (m_excludeEES && m_idHelperSvc->chamberIndex(chId) == MuonStationIndex::EES) {
187  ATH_MSG_VERBOSE(" excluding " << *it << " " << m_idHelperSvc->toStringChamber(chId));
188  continue;
189  }
190  if (m_onlyEO && m_idHelperSvc->stationIndex(chId) != MuonStationIndex::EO) {
191  ATH_MSG_VERBOSE(" excluding " << *it << " " << m_idHelperSvc->toStringChamber(chId));
192  continue;
193  }
194  ATH_MSG_VERBOSE(" -- hash " << *it << " " << m_idHelperSvc->toStringChamber(chId));
195  }
196  if (type == CSC) {
197  Identifier chId;
198  IdContext otCont = m_idHelperSvc->cscIdHelper().module_context();
199  m_idHelperSvc->cscIdHelper().get_id(*it, chId, &otCont);
200  ATH_MSG_VERBOSE(" -- csc hash " << *it << " " << m_idHelperSvc->toStringChamber(chId));
201  }
202  if (type == STGC) {
203  Identifier chId;
204  IdContext otCont = m_idHelperSvc->stgcIdHelper().detectorElement_context();
205  m_idHelperSvc->stgcIdHelper().get_id(*it, chId, &otCont);
206  ATH_MSG_VERBOSE(" -- stgc hash " << *it << " " << m_idHelperSvc->toStringChamber(chId));
207  }
208  if (type == MM) {
209  Identifier chId;
210  IdContext otCont = m_idHelperSvc->mmIdHelper().detectorElement_context();
211  m_idHelperSvc->mmIdHelper().get_id(*it, chId, &otCont);
212  ATH_MSG_VERBOSE(" -- mm hash " << *it << " " << m_idHelperSvc->toStringChamber(chId));
213  }
214  hashes.insert(*it);
215  }
216  }
217  }
218 
221  ATH_MSG_VERBOSE(" Collecting all crossed chambers");
222 
223  const Trk::TrackStates* states = track.trackStateOnSurfaces();
224  if (!states) {
225  ATH_MSG_WARNING(" track without states, cannot perform cleaning ");
226  return;
227  }
228 
229  std::set<MuonStationIndex::StIndex> stations;
230  double etamin{1e9}, etamax{-1e9}, phimin{1e9}, phimax{-1e9};
231  // loop over TSOSs
233  Trk::TrackStates::const_iterator tsit_end = states->end();
234 
235  for (; tsit != tsit_end; ++tsit) {
236  const Trk::TrackParameters* pars = (*tsit)->trackParameters();
237  if (!pars) continue;
238 
239  double rpos = pars->position().perp();
240  double zpos = std::abs(pars->position().z());
241  if (rpos < 2500 && zpos < 4000) continue;
242  double eta = pars->position().eta();
243  double phi = pars->position().phi();
244  if (msgLvl(MSG::DEBUG)) {
245  msg() << "All State parameters: eta: " << eta << " ,phi: " << phi << " pos r " << rpos << " z " << zpos;
246  if (pars->covariance()) msg() << MSG::DEBUG << " extrapolation error " << Amg::error(*pars->covariance(), Trk::locX);
247  msg() << endmsg;
248  }
249 
250  // check whether state is a measurement
251  const Trk::MeasurementBase* meas = (*tsit)->measurementOnTrack();
252  if (!meas) continue;
253 
254  Identifier id = m_edmHelperSvc->getIdentifier(*meas);
255  bool pseudo = !id.is_valid();
256 
257  if (pseudo || !m_idHelperSvc->mdtIdHelper().is_muon(id)) continue;
258 
259  if (eta > etamax) etamax = eta;
260  if (eta < etamin) etamin = eta;
261  if (phi > phimax) phimax = phi;
262  if (phi < phimin) phimin = phi;
263  if (msgLvl(MSG::DEBUG)) {
264  msg() << "Selected State parameters: eta: " << eta << " ,phi: " << phi << " pos r " << rpos << " z " << zpos;
265  if (pars->covariance()) msg() << MSG::DEBUG << " extrapolation error " << Amg::error(*pars->covariance(), Trk::locX);
266  msg() << endmsg;
267  }
268 
269  MuonStationIndex::StIndex stIndex = m_idHelperSvc->stationIndex(id);
270  if (stations.count(stIndex)) continue;
271  stations.insert(stIndex);
272 
273  // At each station launch the Reg Sel and stuff the Id hashes in a vector
274  }
275  etamin -= m_deta;
276  etamax += m_deta;
277  phimin -= m_dphi;
278  phimax += m_dphi;
279 
280  ATH_MSG_DEBUG("Eta range: " << etamin << " " << etamax << " Phi range " << phimin << " " << phimax);
281  if (etamin > etamax) { // something went wrong with the fit and no hits were selected in the loop
282  ATH_MSG_DEBUG("no hits selected, nothing further will be done");
283  return;
284  }
285 
286  RoiDescriptor roi(etamin, etamax, phimin, phimax);
287 
288  if (m_idHelperSvc->hasMDT()) addHashes(MDT, roi, data.mdt, data.mdtTrack);
289  if (m_idHelperSvc->hasRPC()) addHashes(RPC, roi, data.rpc, data.rpcTrack);
290  if (m_idHelperSvc->hasTGC()) addHashes(TGC, roi, data.tgc, data.tgcTrack);
291  if (m_regsel_csc.isEnabled()) addHashes(CSC, roi, data.csc, data.cscTrack);
292  if (m_recoverSTGC) addHashes(STGC, roi, data.stgc, data.stgcTrack);
293  if (m_recoverMM) addHashes(MM, roi, data.mm, data.mmTrack);
294 
295  std::set<IdentifierHash>::iterator hsit = data.mdt.begin();
296  std::set<IdentifierHash>::iterator hsit_end = data.mdt.end();
297  for (; hsit != hsit_end; ++hsit) {
298  Identifier chId;
299  IdContext otCont = m_idHelperSvc->mdtIdHelper().module_context();
300  m_idHelperSvc->mdtIdHelper().get_id(*hsit, chId, &otCont);
301  MuonStationIndex::ChIndex chIndex = m_idHelperSvc->chamberIndex(chId);
302  data.mdtPerStation[chIndex].insert(*hsit);
303  ATH_MSG_VERBOSE(" chamberlayer " << MuonStationIndex::chName(chIndex) << " " << m_idHelperSvc->toStringChamber(chId));
304  }
305  hsit = data.csc.begin();
306  hsit_end = data.csc.end();
307  for (; hsit != hsit_end; ++hsit) {
308  Identifier chId;
309  IdContext otCont = m_idHelperSvc->cscIdHelper().module_context();
310  m_idHelperSvc->cscIdHelper().get_id(*hsit, chId, &otCont);
311  chId = m_idHelperSvc->chamberId(chId);
312  MuonStationIndex::ChIndex chIndex = m_idHelperSvc->chamberIndex(chId);
313  ATH_MSG_VERBOSE(" chamberlayer " << MuonStationIndex::chName(chIndex) << " " << m_idHelperSvc->toString(chId));
314  }
315  }
316 
318  ATH_MSG_VERBOSE(" making set of already-on-track chambers");
319 
320  // Collect track PRD's
321  const Trk::TrackStates* states = track.trackStateOnSurfaces();
322  if (!states) {
323  ATH_MSG_WARNING(" track without states, cannot perform cleaning ");
324  return;
325  }
326 
327  std::set<MuonStationIndex::StIndex> stations;
328 
329  // loop over TSOSs
331  Trk::TrackStates::const_iterator tsit_end = states->end();
332  for (; tsit != tsit_end; ++tsit) {
333  const Trk::TrackParameters* pars = (*tsit)->trackParameters();
334  if (!pars) continue;
335 
336  // check whether state is a measurement
337  const Trk::MeasurementBase* meas = (*tsit)->measurementOnTrack();
338  if (!meas) continue;
339 
340  const Muon::MdtDriftCircleOnTrack* mdt = dynamic_cast<const Muon::MdtDriftCircleOnTrack*>(meas);
341  if (mdt && !data.mdtTrack.count(mdt->collectionHash())) {
342  data.mdtTrack.insert(mdt->collectionHash());
343  ATH_MSG_VERBOSE("Adding " << m_idHelperSvc->toStringChamber(mdt->identify()) << " hash " << mdt->collectionHash());
344  continue;
345  }
346 
347  const MuonClusterOnTrack* clus = nullptr;
348  const CompetingMuonClustersOnTrack* compRot = dynamic_cast<const CompetingMuonClustersOnTrack*>(meas);
349  if (compRot) {
350  clus = &compRot->rioOnTrack(0);
351  } else {
352  clus = dynamic_cast<const MuonClusterOnTrack*>(meas);
353  }
354  if (!clus) continue;
355 
356  const RpcClusterOnTrack* rpc = dynamic_cast<const RpcClusterOnTrack*>(clus);
357  if (rpc && !data.rpcTrack.count(rpc->collectionHash())) {
358  data.rpcTrack.insert(rpc->collectionHash());
359  ATH_MSG_VERBOSE("Adding " << m_idHelperSvc->toStringChamber(clus->identify()) << " hash " << clus->collectionHash());
360  continue;
361  }
362  const TgcClusterOnTrack* tgc = dynamic_cast<const TgcClusterOnTrack*>(clus);
363  if (tgc && !data.tgcTrack.count(tgc->collectionHash())) {
364  data.tgcTrack.insert(tgc->collectionHash());
365  ATH_MSG_VERBOSE("Adding " << m_idHelperSvc->toStringChamber(clus->identify()) << " hash " << clus->collectionHash());
366  continue;
367  }
368  const CscClusterOnTrack* csc = dynamic_cast<const CscClusterOnTrack*>(clus);
369  if (csc && !data.cscTrack.count(csc->collectionHash())) {
370  data.cscTrack.insert(csc->collectionHash());
371  ATH_MSG_VERBOSE("Adding " << m_idHelperSvc->toStringChamber(clus->identify()) << " hash " << clus->collectionHash());
372  continue;
373  }
374  // New Small Wheel
375  const sTgcClusterOnTrack* stgc = dynamic_cast<const sTgcClusterOnTrack*>(clus);
376  if (stgc && !data.stgcTrack.count(stgc->collectionHash())) {
377  data.stgcTrack.insert(stgc->collectionHash());
378  ATH_MSG_VERBOSE("Adding " << m_idHelperSvc->toStringChamber(clus->identify()) << " hash " << clus->collectionHash());
379  continue;
380  }
381  const MMClusterOnTrack* mm = dynamic_cast<const MMClusterOnTrack*>(clus);
382  if (mm && !data.mmTrack.count(mm->collectionHash())) {
383  data.mmTrack.insert(mm->collectionHash());
384  ATH_MSG_VERBOSE("Adding " << m_idHelperSvc->toStringChamber(clus->identify()) << " hash " << clus->collectionHash());
385  continue;
386  }
387  }
388  }
389 
390  std::unique_ptr<Trk::Track> MuonSegmentRegionRecoveryTool::findHoles(const EventContext& ctx, const Trk::Track& track,
391  MuonData& data) const {
392  const Trk::TrackStates* oldStates = track.trackStateOnSurfaces();
393  if (!oldStates) {
394  ATH_MSG_WARNING(" track without states, cannot perform mdt hole search ");
395  return nullptr;
396  }
397 
399  if (!InterSectSvc.isValid()) {
400  ATH_MSG_ERROR("Failed to retrieve chamber intersection service");
401  return nullptr;
402  }
403  const MuonGM::MuonDetectorManager* MuonDetMgr = InterSectSvc->detMgr();
404 
405  std::vector<std::unique_ptr<const Trk::TrackStateOnSurface>> states;
406  unsigned int nholes = 0;
407  std::set<Identifier> chambersInSearch;
408  for (const IdentifierHash& ith : data.mdt) {
409  // ignore hashes already on track
410  if (data.mdtTrack.count(ith)) {
411  ATH_MSG_VERBOSE("Chamber already on track " << ith);
412  continue;
413  }
414  Identifier chId;
415  IdContext otCont = m_idHelperSvc->mdtIdHelper().module_context();
416  m_idHelperSvc->mdtIdHelper().get_id(ith, chId, &otCont);
417 
418  // ignore chambers that already had a hole search
419  if (chambersInSearch.count(chId)) {
420  ATH_MSG_VERBOSE("Chamber already on track " << ith << " " << m_idHelperSvc->toStringChamber(chId));
421  continue;
422  }
423  const MuonGM::MdtReadoutElement* detEl = MuonDetMgr->getMdtReadoutElement(chId);
424  if (!detEl) {
425  ATH_MSG_WARNING("Found no detector element for " << ith);
426  continue;
427  }
428  std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, track, *detEl, true)};
429  if (!exPars) {
430  ATH_MSG_DEBUG("Did not reach " << m_idHelperSvc->toStringChamber(chId) << " hash " << ith);
431  continue;
432  }
433  ATH_MSG_DEBUG("Reached " << m_idHelperSvc->toStringChamber(chId) << " hash " << ith);
434 
435  // calculate crossed tubes
436  const MuonStationIntersect intersect = InterSectSvc->tubesCrossedByTrack(chId, exPars->position(), exPars->momentum().unit());
437 
438  // clear hole vector
439  for (unsigned int ii = 0; ii < intersect.tubeIntersects().size(); ++ii) {
440  const MuonTubeIntersect& tint = intersect.tubeIntersects()[ii];
441  const Identifier& id = tint.tubeId;
442  const MuonGM::MdtReadoutElement* detElLoc = MuonDetMgr->getMdtReadoutElement(id);
443 
444  // addition skip for cases when the track crosses inbetween two chambers
445  if (data.mdtTrack.count(detElLoc->identifyHash())) continue;
446 
447  Identifier ch = m_idHelperSvc->chamberId(id);
448  chambersInSearch.insert(ch);
449 
450  const Trk::Surface& surf = detElLoc->surface(id);
451  std::unique_ptr<Trk::TrackParameters> tubePars{
452  m_extrapolator->extrapolateDirectly(ctx, *exPars, surf, Trk::anyDirection, false, Trk::muon)};
453  if (!tubePars) {
454  ATH_MSG_WARNING("Failed to extrapolate to tube " << m_idHelperSvc->toString(id));
455  continue;
456  }
457  int lay = m_idHelperSvc->mdtIdHelper().tubeLayer(id);
458  int tube = m_idHelperSvc->mdtIdHelper().tube(id);
459  double tubeLen = detElLoc->getActiveTubeLength(lay, tube);
460  double distEdge = std::abs(tubePars->parameters()[Trk::locZ]) - 0.5 * tubeLen;
461  double pullEdge = tubePars->covariance() && Amg::hasPositiveDiagElems(*tubePars->covariance())
462  ? distEdge / Amg::error(*tubePars->covariance(), Trk::locZ)
463  : distEdge / 20.;
464  std::optional<Amg::Vector2D> locPos = surf.Trk::Surface::globalToLocal(tubePars->position());
465 
466  bool inBounds = false;
467  if (locPos) {
468  // perform bound check do not count holes with 100. mm of bound edge
469  inBounds = surf.bounds().insideLoc2(*locPos, -100.) && std::abs((*locPos)[Trk::locR]) <= detElLoc->innerTubeRadius();
470  }
471  if (!inBounds) {
472  ATH_MSG_VERBOSE(" discarding hole " << m_idHelperSvc->toString(id) << " dist wire " << tubePars->parameters()[Trk::locR]
473  << " outside bounds ");
474  continue;
475  }
476  ATH_MSG_VERBOSE(" new hole " << m_idHelperSvc->toString(id) << " dist wire " << tubePars->parameters()[Trk::locR]
477  << " dist tube edge " << distEdge << " pullEdge " << pullEdge);
478  ++nholes;
479  std::unique_ptr<Trk::TrackStateOnSurface> tsos = MuonTSOSHelper::createHoleTSOS(std::move(tubePars));
480  states.emplace_back(std::move(tsos));
481  }
482  if (!nholes) ATH_MSG_DEBUG("found holes " << nholes);
483  }
484 
485  for (const IdentifierHash& ith : data.csc) {
486  // ignore hashes already on track
487  if (data.cscTrack.count(ith)) {
488  ATH_MSG_VERBOSE("Chamber already on track " << ith);
489  continue;
490  }
491  Identifier chId;
492  IdContext otCont = m_idHelperSvc->cscIdHelper().module_context();
493  m_idHelperSvc->cscIdHelper().get_id(ith, chId, &otCont);
494  chId = m_idHelperSvc->chamberId(chId);
495 
496  const MuonGM::CscReadoutElement* detEl = MuonDetMgr->getCscReadoutElement(chId);
497  if (!detEl) {
498  ATH_MSG_WARNING("Found no detector element for " << ith << " " << m_idHelperSvc->toString(chId));
499  continue;
500  }
501 
502  std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, track, *detEl, true)};
503  if (!exPars) {
504  ATH_MSG_DEBUG("Did not reach " << m_idHelperSvc->toStringChamber(chId) << " hash " << ith);
505  continue;
506  }
507  Identifier detElId = m_idHelperSvc->detElId(chId);
508  std::set<Identifier> layIds;
509  std::vector<std::unique_ptr<const Trk::TrackStateOnSurface>> cscstates;
510  createHoleTSOSsForClusterChamber(detElId, ctx, *exPars, layIds, cscstates);
511  ATH_MSG_DEBUG("Reached " << m_idHelperSvc->toString(chId) << " hash " << ith << " holes " << cscstates.size());
512 
513  for (std::unique_ptr<const Trk::TrackStateOnSurface>& cscit : cscstates) {
514  ATH_MSG_VERBOSE("Adding " << cscit.get());
515  states.emplace_back(std::move(cscit));
516  }
517  }
518  for (const IdentifierHash& ith : data.tgc) {
519  // ignore hashes already on track
520  if (data.tgcTrack.count(ith)) {
521  ATH_MSG_VERBOSE("Chamber already on track " << ith);
522  continue;
523  }
524  Identifier chId;
525  IdContext otCont = m_idHelperSvc->tgcIdHelper().module_context();
526  m_idHelperSvc->tgcIdHelper().get_id(ith, chId, &otCont);
527  chId = m_idHelperSvc->chamberId(chId);
528 
529  const MuonGM::TgcReadoutElement* detEl = MuonDetMgr->getTgcReadoutElement(chId);
530  if (!detEl) {
531  ATH_MSG_WARNING("Found no detector element for " << ith << " " << m_idHelperSvc->toString(chId));
532  continue;
533  }
534 
535  std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, track, *detEl, true)};
536  if (!exPars) {
537  ATH_MSG_DEBUG("Did not reach " << m_idHelperSvc->toStringChamber(chId) << " hash " << ith);
538  continue;
539  }
540  Identifier detElId = m_idHelperSvc->detElId(chId);
541  std::set<Identifier> layIds;
542  std::vector<std::unique_ptr<const Trk::TrackStateOnSurface>> tgcstates;
543  createHoleTSOSsForClusterChamber(detElId, ctx, *exPars, layIds, tgcstates);
544  ATH_MSG_DEBUG("Reached " << m_idHelperSvc->toString(chId) << " hash " << ith << " holes " << tgcstates.size());
545 
546  for (std::unique_ptr<const Trk::TrackStateOnSurface>& tgcit : tgcstates) {
547  ATH_MSG_VERBOSE("Adding " << tgcit.get());
548  states.emplace_back(std::move(tgcit));
549  }
550  }
551 
552  for (const IdentifierHash& ith : data.rpc) {
553  // ignore hashes already on track
554  if (data.rpcTrack.count(ith)) {
555  ATH_MSG_VERBOSE("Chamber already on track " << ith);
556  continue;
557  }
558  Identifier chId;
559  IdContext otCont = m_idHelperSvc->rpcIdHelper().module_context();
560  m_idHelperSvc->rpcIdHelper().get_id(ith, chId, &otCont);
561  chId = m_idHelperSvc->chamberId(chId);
562 
563  const MuonGM::RpcReadoutElement* detEl = MuonDetMgr->getRpcReadoutElement(chId);
564  if (!detEl) {
565  ATH_MSG_WARNING("Found no detector element for " << ith << " " << m_idHelperSvc->toString(chId));
566  continue;
567  }
568 
569  std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, track, *detEl, true)};
570  if (!exPars) {
571  ATH_MSG_DEBUG("Did not reach " << m_idHelperSvc->toStringChamber(chId) << " hash " << ith);
572  continue;
573  }
574  Identifier detElId = m_idHelperSvc->detElId(chId);
575  std::set<Identifier> layIds;
576  std::vector<std::unique_ptr<const Trk::TrackStateOnSurface>> rpcstates;
577  createHoleTSOSsForClusterChamber(detElId, ctx, *exPars, layIds, rpcstates);
578  ATH_MSG_DEBUG("Reached " << m_idHelperSvc->toString(chId) << " hash " << ith << " holes " << rpcstates.size());
579 
580  for (std::unique_ptr<const Trk::TrackStateOnSurface>& rpcit : rpcstates) {
581  ATH_MSG_VERBOSE("Adding " << rpcit.get());
582  states.emplace_back(std::move(rpcit));
583  }
584  }
585 
586  // New Small Wheel
587  // sTGC
588  for (const IdentifierHash& ith : data.stgc) {
589  // ignore hashes already on track
590  if (data.stgcTrack.count(ith)) {
591  ATH_MSG_VERBOSE("Chamber already on track " << ith);
592  continue;
593  }
594  Identifier chId;
595  IdContext otCont = m_idHelperSvc->stgcIdHelper().module_context();
596  m_idHelperSvc->stgcIdHelper().get_id(ith, chId, &otCont);
597 
598  if (!chId.is_valid()) {
599  ATH_MSG_VERBOSE("invalid chId for stgc data " << ith);
600  continue;
601  }
602 
603  chId = m_idHelperSvc->chamberId(chId);
604 
605  const MuonGM::sTgcReadoutElement* detEl = MuonDetMgr->getsTgcReadoutElement(chId);
606  if (!detEl) {
607  ATH_MSG_WARNING("Found no detector element for " << ith << " " << m_idHelperSvc->toString(chId));
608  continue;
609  }
610 
611  std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, track, *detEl, true)};
612  if (!exPars) {
613  ATH_MSG_DEBUG("Did not reach " << m_idHelperSvc->toStringChamber(chId) << " hash " << ith);
614  continue;
615  }
616  Identifier detElId = m_idHelperSvc->detElId(chId);
617  std::set<Identifier> layIds;
618  std::vector<std::unique_ptr<const Trk::TrackStateOnSurface>> stgcstates;
619  createHoleTSOSsForClusterChamber(detElId, ctx, *exPars, layIds, stgcstates);
620  ATH_MSG_DEBUG("Reached " << m_idHelperSvc->toString(chId) << " hash " << ith << " holes " << stgcstates.size());
621 
622  for (std::unique_ptr<const Trk::TrackStateOnSurface>& stgcit : stgcstates) {
623  ATH_MSG_VERBOSE("Adding " << stgcit.get());
624  states.push_back(std::move(stgcit));
625  }
626  }
627 
628  // MM
629  for (const IdentifierHash& ith : data.mm) {
630  // ignore hashes already on track
631  if (data.mmTrack.count(ith)) {
632  ATH_MSG_VERBOSE("Chamber already on track " << ith);
633  continue;
634  }
635  Identifier chId;
636  IdContext otCont = m_idHelperSvc->mmIdHelper().module_context();
637  m_idHelperSvc->mmIdHelper().get_id(ith, chId, &otCont);
638 
639  if (!chId.is_valid()) {
640  ATH_MSG_VERBOSE("invalid chId for mm data " << ith);
641  continue;
642  }
643 
644  chId = m_idHelperSvc->chamberId(chId);
645 
646  const MuonGM::MMReadoutElement* detEl = MuonDetMgr->getMMReadoutElement(chId);
647  if (!detEl) {
648  ATH_MSG_WARNING("Found no detector element for " << ith << " " << m_idHelperSvc->toString(chId));
649  continue;
650  }
651 
652  std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, track, *detEl, true)};
653  if (!exPars) {
654  ATH_MSG_DEBUG("Did not reach " << m_idHelperSvc->toStringChamber(chId) << " hash " << ith);
655  continue;
656  }
657  Identifier detElId = m_idHelperSvc->detElId(chId);
658  std::set<Identifier> layIds;
659  std::vector<std::unique_ptr<const Trk::TrackStateOnSurface>> mmstates;
660  createHoleTSOSsForClusterChamber(detElId, ctx, *exPars, layIds, mmstates);
661  ATH_MSG_DEBUG("Reached " << m_idHelperSvc->toString(chId) << " hash " << ith << " holes " << mmstates.size());
662 
663  for (std::unique_ptr<const Trk::TrackStateOnSurface>& mmit : mmstates) {
664  ATH_MSG_VERBOSE("Adding " << mmit.get());
665  states.emplace_back(std::move(mmit));
666  }
667  }
668  if (!states.empty()) {
669  // states were added, create a new track
670  auto trackStateOnSurfaces = std::make_unique<Trk::TrackStates>();
671  trackStateOnSurfaces->reserve(oldStates->size() + states.size());
672 
673  std::vector<std::unique_ptr<const Trk::TrackStateOnSurface>> toBeSorted;
674  toBeSorted.reserve(oldStates->size() + states.size());
675 
676  for (const Trk::TrackStateOnSurface* sit : *oldStates) toBeSorted.emplace_back(sit->clone());
677 
678  for (std::unique_ptr<const Trk::TrackStateOnSurface>& stit : states) toBeSorted.emplace_back(std::move(stit));
679 
680  std::stable_sort(toBeSorted.begin(), toBeSorted.end(), SortTSOSs(&*m_edmHelperSvc, &*m_idHelperSvc));
681 
682  for (std::unique_ptr<const Trk::TrackStateOnSurface>& sorted : toBeSorted) { trackStateOnSurfaces->push_back(sorted.release()); }
683  std::unique_ptr<Trk::Track> trackWithHoles = std::make_unique<Trk::Track>(
684  track.info(), std::move(trackStateOnSurfaces), track.fitQuality() ? track.fitQuality()->uniqueClone() : nullptr);
685  // generate a track summary for this track
686  if (m_trackSummaryTool.isEnabled()) { m_trackSummaryTool->computeAndReplaceTrackSummary(ctx, *trackWithHoles, false); }
687  ATH_MSG_DEBUG("Track with holes " << m_printer->print(*trackWithHoles) << std::endl
688  << m_printer->printStations(*trackWithHoles));
689  return trackWithHoles;
690  }
691  return nullptr;
692  }
693 
694  std::unique_ptr<Trk::Track> MuonSegmentRegionRecoveryTool::addMissingChambers(const EventContext& ctx, const Trk::Track& track,
695  MuonData& data, bool addMdt) const {
696  // states were added, create a new track
697  std::vector<std::unique_ptr<const Trk::TrackStateOnSurface>> states;
698  std::set<IdentifierHash> newMdtHashes;
699  std::set<IdentifierHash> newRpcHashes;
700  std::set<IdentifierHash> newTgcHashes;
701  std::set<IdentifierHash> newCscHashes;
702  // New Small Wheel
703  std::set<IdentifierHash> newMMHashes;
704  std::set<IdentifierHash> newsTgcHashes;
705  if (addMdt) {
706  ATH_MSG_DEBUG("Adding Missing MDT chambers: regions " << data.mdtPerStation.size());
707  std::vector<const MdtPrepDataCollection*> newmcols;
708  for (const auto& chit : data.mdtPerStation) {
709  ATH_MSG_VERBOSE("Region " << MuonStationIndex::chName(chit.first) << " size " << chit.second.size());
710  std::vector<const MdtPrepDataCollection*> cols;
711  m_seededSegmentFinder->extractMdtPrdCols(ctx, chit.second, cols);
712  std::map<int, std::vector<const MdtPrepData*>> mdtPrds;
713  std::unique_ptr<const Trk::TrackParameters> exParsFirst;
714  for (const MdtPrepDataCollection* mit : cols) {
715  std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, track, *mit->front()->detectorElement())};
716  if (exPars) {
717  int sector = m_idHelperSvc->sector(mit->identify());
718  ATH_MSG_DEBUG("New chamber " << m_idHelperSvc->toStringChamber(mit->identify()) << " hash " << mit->identifyHash()
719  << " sector " << sector);
720  newmcols.emplace_back(mit);
721  std::vector<const MdtPrepData*>& col = mdtPrds[sector];
722  col.insert(col.end(), mit->begin(), mit->end());
723  if (!exParsFirst) exParsFirst.swap(exPars);
724 
725  } else {
726  ATH_MSG_DEBUG("Did not reach chamber " << m_idHelperSvc->toStringChamber(mit->identify()) << " hash "
727  << mit->identifyHash());
728  }
729  }
730  std::vector<const MdtPrepData*>* prds = nullptr;
731  std::map<int, std::vector<const MdtPrepData*>>::iterator sectorIt = mdtPrds.begin();
732  if (mdtPrds.empty()) {
733  ATH_MSG_VERBOSE("No hits selected");
734  } else if (mdtPrds.size() == 1) {
735  prds = &sectorIt->second;
736  } else {
738  ATH_MSG_VERBOSE("Multiple sectors selected, using main sector: " << hitSummary.mainSector);
739  std::map<int, std::vector<const MdtPrepData*>>::iterator pos = mdtPrds.find(hitSummary.mainSector);
740  if (pos != mdtPrds.end())
741  prds = &pos->second;
742  else {
743  ATH_MSG_DEBUG("Failed to find prds in main sector: " << hitSummary.mainSector);
744  }
745  }
746  if (prds && exParsFirst) {
747  std::unique_ptr<Trk::SegmentCollection> segments = m_seededSegmentFinder->find(ctx, *exParsFirst, *prds);
748  if (segments) {
749  if (!segments->empty()) ATH_MSG_DEBUG("found segments " << segments->size());
750 
751  MuonSegment* bestSegment = nullptr;
752  std::unique_ptr<const Trk::TrackParameters> bestSegmentPars;
753  for (Trk::Segment* tseg : *segments) {
754  MuonSegment* mseg = dynamic_cast<MuonSegment*>(tseg);
755 
756  if (m_trackSegmentMatchingTool.empty())
757  ATH_MSG_VERBOSE("No track/segment matching");
758  else if (!m_trackSegmentMatchingTool->match(ctx, track, *mseg, true)) {
759  ATH_MSG_DEBUG(" Segment does not match with track ");
760  continue;
761  } else {
762  ATH_MSG_DEBUG(" Segment/track matched successfully using " << m_trackSegmentMatchingTool);
763  }
764  std::unique_ptr<const Trk::TrackParameters> segPars{m_extrapolator->extrapolateDirectly(
765  ctx, *exParsFirst, mseg->associatedSurface(), Trk::anyDirection, false, Trk::muon)};
766  if (segPars) {
767  double resy = mseg->localParameters()[Trk::locY] - segPars->parameters()[Trk::locY];
769  mseg->associatedSurface().globalToLocalDirection(segPars->momentum(), locDir);
770  double dangleYZ = mseg->localDirection().angleYZ() - locDir.angleYZ();
771  ATH_MSG_DEBUG("resy " << resy << " dangleYZ " << dangleYZ << " " << m_printer->print(*mseg));
772  if (std::abs(dangleYZ) < 0.05) {
773  bestSegment = mseg;
774  bestSegmentPars.swap(segPars);
775  }
776  } else {
777  ATH_MSG_DEBUG("Did not reach " << m_printer->print(*mseg));
778  }
779  }
780  if (bestSegment) {
781  for (const Trk::MeasurementBase* hit : bestSegment->containedMeasurements()) {
782  std::unique_ptr<Trk::TrackParameters> hitPars{m_extrapolator->extrapolateDirectly(
783  ctx, *bestSegmentPars, hit->associatedSurface(), Trk::anyDirection, false, Trk::muon)};
784  if (hitPars) {
785  std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern;
786  typePattern.set(Trk::TrackStateOnSurface::Measurement);
788  new Trk::TrackStateOnSurface(hit->uniqueClone(), std::move(hitPars), nullptr, typePattern);
789  states.emplace_back(tsos);
790  const MdtDriftCircleOnTrack* mdt = dynamic_cast<const MdtDriftCircleOnTrack*>(hit);
791  if (mdt) newMdtHashes.insert(mdt->collectionHash());
792  } else {
793  ATH_MSG_WARNING("Failed to extrapolate to MDT hit ");
794  }
795  }
796  }
797  }
798  }
799  }
800  data.mdtCols = std::move(newmcols);
801  } else {
802  unsigned int nstates = states.size();
803  {
804  m_seededSegmentFinder->extractRpcPrdCols(ctx, data.rpc, data.rpcCols);
805  std::vector<const RpcPrepDataCollection*> newtcols;
806  for (const RpcPrepDataCollection* rit : data.rpcCols) {
807  std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, track, *(rit)->front()->detectorElement())};
808  if (exPars) {
809  newtcols.emplace_back(rit);
810  Identifier detElId = m_idHelperSvc->detElId(rit->identify());
811  std::set<Identifier> layIds;
812  createHoleTSOSsForClusterChamber(detElId, ctx, *exPars, layIds, states);
813  if (states.size() != nstates) {
814  nstates = states.size();
815  newRpcHashes.insert(rit->identifyHash());
816  }
817  }
818  }
819  data.rpcCols = std::move(newtcols);
820  }
821  {
822  m_seededSegmentFinder->extractTgcPrdCols(ctx, data.tgc, data.tgcCols);
823  std::vector<const TgcPrepDataCollection*> newtcols;
824  for (const TgcPrepDataCollection* tgcit : data.tgcCols) {
825  std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, track, *(tgcit)->front()->detectorElement())};
826  if (exPars) {
827  newtcols.emplace_back(tgcit);
828  Identifier detElId = m_idHelperSvc->detElId(tgcit->identify());
829  std::set<Identifier> layIds;
830  createHoleTSOSsForClusterChamber(detElId, ctx, *exPars, layIds, states);
831  if (states.size() != nstates) {
832  nstates = states.size();
833  newTgcHashes.insert(tgcit->identifyHash());
834  }
835  }
836  }
837  data.tgcCols = std::move(newtcols);
838  }
839 
840  m_seededSegmentFinder->extractCscPrdCols(data.csc, data.cscCols);
841  std::vector<const CscPrepDataCollection*> newccols;
842  for (const CscPrepDataCollection* cit : data.cscCols) {
843  std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, track, *(cit)->front()->detectorElement())};
844  if (exPars) {
845  newccols.push_back(cit);
846  Identifier detElId = m_idHelperSvc->detElId(cit->identify());
847  std::set<Identifier> layIds;
848  createHoleTSOSsForClusterChamber(detElId, ctx, *exPars, layIds, states);
849  if (states.size() != nstates) {
850  nstates = states.size();
851  newCscHashes.insert(cit->identifyHash());
852  }
853  }
854  }
855  data.cscCols = std::move(newccols);
856 
857  nstates = states.size();
858  if (m_recoverSTGC) {
859  m_seededSegmentFinder->extractsTgcPrdCols(ctx, data.stgc, data.stgcCols);
860  std::vector<const sTgcPrepDataCollection*> newstcols;
861  ATH_MSG_DEBUG(" extractsTgcPrdCols data.stgcCols.size() " << data.stgcCols.size());
862  for (const sTgcPrepDataCollection* stgcit : data.stgcCols) {
863  std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, track, *(stgcit)->front()->detectorElement())};
864  if (exPars) {
865  newstcols.push_back(stgcit);
866  Identifier detElId = m_idHelperSvc->detElId(stgcit->identify());
867  std::set<Identifier> layIds;
868  createHoleTSOSsForClusterChamber(detElId, ctx, *exPars, layIds, states);
869  ATH_MSG_DEBUG("Collected new sTgc states: " << states.size());
870  if (states.size() != nstates) {
871  nstates = states.size();
872  newsTgcHashes.insert(stgcit->identifyHash());
873  }
874  }
875  }
876  data.stgcCols = std::move(newstcols);
877  }
878 
879  if (m_recoverMM) {
880  m_seededSegmentFinder->extractMMPrdCols(data.mm, data.mmCols);
881  ATH_MSG_DEBUG(" extractMMPrdCols data.mmCols.size() " << data.mmCols.size());
882  std::vector<const MMPrepDataCollection*> newmcols;
883  for (const MMPrepDataCollection* mit : data.mmCols) {
884  std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, track, *mit->front()->detectorElement())};
885  if (exPars) {
886  newmcols.push_back(mit);
887  Identifier detElId = m_idHelperSvc->detElId(mit->identify());
888  std::set<Identifier> layIds;
889  createHoleTSOSsForClusterChamber(detElId, ctx, *exPars, layIds, states);
890  ATH_MSG_DEBUG("Collected new Mm states: " << states.size());
891  if (states.size() != nstates) {
892  nstates = states.size();
893  newMMHashes.insert(mit->identifyHash());
894  }
895  }
896  }
897  data.mmCols = std::move(newmcols);
898  }
899  }
900  if (!states.empty()) {
901  ATH_MSG_DEBUG("Collected new states: " << states.size());
902 
903  const Trk::TrackStates* oldStates = track.trackStateOnSurfaces();
904  if (!oldStates) {
905  ATH_MSG_WARNING(" track without states, cannot perform cleaning ");
906  return nullptr;
907  }
908 
909  ATH_MSG_DEBUG("Copying old TSOSs " << oldStates->size());
910  for (const Trk::TrackStateOnSurface* tsit : *oldStates) states.emplace_back(tsit->clone());
911 
912  std::stable_sort(states.begin(), states.end(), SortTSOSs(m_edmHelperSvc.get(), m_idHelperSvc.get()));
913  ATH_MSG_DEBUG("Filling DataVector with TSOSs " << states.size());
914  auto trackStateOnSurfaces = std::make_unique<Trk::TrackStates>();
915  trackStateOnSurfaces->reserve(states.size());
916  for (std::unique_ptr<const Trk::TrackStateOnSurface>& sorted : states) { trackStateOnSurfaces->push_back(sorted.release()); }
917  ATH_MSG_DEBUG("Creating new Track " << states.size());
918  std::unique_ptr<Trk::Track> newTrack = std::make_unique<Trk::Track>(track.info(), std::move(trackStateOnSurfaces),
919  track.fitQuality() ? track.fitQuality()->uniqueClone() : nullptr);
920  std::unique_ptr<Trk::Track> refittedTrack;
921  if (m_onlyEO)
922  refittedTrack = std::unique_ptr<Trk::Track>(m_fitter->fit(ctx, *newTrack, m_useFitterOutlierLogic, Trk::muon));
923  else
924  refittedTrack = std::unique_ptr<Trk::Track>(m_builder->fit(ctx, *newTrack, m_useFitterOutlierLogic, Trk::muon));
925  if (refittedTrack) {
926  ATH_MSG_DEBUG("New Track " << m_printer->print(*refittedTrack) << std::endl << m_printer->printStations(*refittedTrack));
927 
928  // fit ok, add new hashs to lists
929  data.mdtTrack.insert(newMdtHashes.begin(), newMdtHashes.end());
930  data.rpcTrack.insert(newRpcHashes.begin(), newRpcHashes.end());
931  data.tgcTrack.insert(newTgcHashes.begin(), newTgcHashes.end());
932  data.cscTrack.insert(newCscHashes.begin(), newCscHashes.end());
933  // New Small Wheel
934  data.stgcTrack.insert(newsTgcHashes.begin(), newsTgcHashes.end());
935  data.mmTrack.insert(newMMHashes.begin(), newMMHashes.end());
936  }
937  return refittedTrack;
938  }
939  return nullptr;
940  }
941 
942  std::unique_ptr<const Trk::TrackParameters> MuonSegmentRegionRecoveryTool::reachableDetEl(const EventContext& ctx,
943  const Trk::Track& track,
944  const Trk::TrkDetElementBase& detEl,
945  bool smallerBounds) const {
946  ATH_MSG_VERBOSE("reachableDetEl() " << m_idHelperSvc->toStringDetEl(detEl.identify()) << " at " << detEl.center());
947  std::unique_ptr<const Trk::TrackParameters> exPars;
948  std::unique_ptr<const Trk::TrackParameters> closest{MuonGetClosestParameters::closestParameters(track, detEl.surface(), true)};
949  if (closest) {
950  ATH_MSG_VERBOSE("Extrapolating from closest point:\n" << m_printer->print(*closest));
951  exPars = m_extrapolator->extrapolateDirectly(ctx, *closest, detEl.surface(), Trk::anyDirection, false, Trk::muon);
952 
953  } else {
954  ATH_MSG_VERBOSE("Extrapolating from track (no closest point found):\n" << m_printer->print(track));
955  exPars = m_extrapolator->extrapolateTrack(ctx, track, detEl.surface(), Trk::anyDirection, false, Trk::muon);
956  }
957  if (!exPars) {
958  ATH_MSG_DEBUG("Extrapolation did not succeed");
959  return nullptr;
960  }
961  Amg::Vector2D locPos(exPars->parameters()[Trk::locX], exPars->parameters()[Trk::locY]);
962 
963  double tolx = 100.; // positive -> large surface
964  double toly = 100.; // positive -> large surface
965  const AmgSymMatrix(5)* errMat = exPars->covariance();
966  if (errMat) {
967  ATH_MSG_VERBOSE("Extrapolated local Position & Error matrix\n:" << locPos << "\n" << Amg::toString(*errMat));
968  // MJW check validity of errors before using them (fix for bug #82920)
969  double covx = (*errMat)(Trk::locX, Trk::locX);
970  double covy = (*errMat)(Trk::locY, Trk::locY);
971  if (covx > 0.0 && covy > 0.0) {
972  tolx = 3 * covx;
973  toly = 3 * covy;
974  }
975  }
976 
977  // in case we are looking for holes, only ignore stations if we are within 100 mm of the chamber edge
978  // all other holes are counted even if the extrapolation errors are large.
979  if (smallerBounds) {
980  if (tolx > 10.) tolx = 10.;
981  if (toly > 10.) toly = 10.;
982  // refer sign to check 'inside' the bounds
983  tolx *= -1.;
984  toly *= -1.;
985  }
986  bool inbounds = detEl.surface().insideBounds(locPos, tolx, toly);
987  if (msgLvl(MSG::DEBUG)) {
988  std::ostringstream parsType;
989  parsType << "pos=(" << locPos[Trk::locX] << "," << locPos[Trk::locY] << ")";
990  if (errMat) { parsType << " exError=(" << Amg::error(*errMat, Trk::locX) << "," << Amg::error(*errMat, Trk::locY) << ")"; }
991  parsType << " tolerance=(" << tolx << "," << toly << ")";
992  if (inbounds)
993  parsType << " => inbounds";
994  else
995  parsType << " => outbounds";
996  ATH_MSG_DEBUG(" " << m_idHelperSvc->toStringChamber(detEl.identify()) << " pars " << parsType.str());
997  }
998  if (!inbounds) { return nullptr; }
999  return exPars;
1000  }
1001 
1002 } // namespace Muon
python.root_lsr_rank.hashes
hashes
Definition: root_lsr_rank.py:34
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
MuonGM::MuonDetectorManager::getRpcReadoutElement
const RpcReadoutElement * getRpcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:168
Muon::MuonStationIndex::chName
static const std::string & chName(ChIndex index)
convert ChIndex into a string
Definition: MuonStationIndex.cxx:157
Trk::anyDirection
@ anyDirection
Definition: PropDirection.h:22
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
MdtReadoutElement.h
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
Muon::MuonSegmentRegionRecoveryTool::m_useFitterOutlierLogic
Gaudi::Property< bool > m_useFitterOutlierLogic
Definition: MuonSegmentRegionRecoveryTool.h:159
Muon::SortTSOSs
Definition: SortMeasurementsByPosition.h:80
STGC
@ STGC
Definition: RegSelEnums.h:39
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
sendEI_SPB.ch
ch
Definition: sendEI_SPB.py:35
Muon::MuonSegmentRegionRecoveryTool::m_regsel_mdt
ToolHandle< IRegSelTool > m_regsel_mdt
Definition: MuonSegmentRegionRecoveryTool.h:143
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::MuonSegmentRegionRecoveryTool::m_regsel_tgc
ToolHandle< IRegSelTool > m_regsel_tgc
Definition: MuonSegmentRegionRecoveryTool.h:146
sTgcClusterOnTrack.h
StraightLineSurface.h
Muon::MuonClusterOnTrack::collectionHash
virtual IdentifierHash collectionHash() const
Returns the hashID of the PRD collection.
Definition: MuonClusterOnTrack.h:111
MeasurementBase.h
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
Muon::MuonTubeIntersect
Definition: MuonTubeIntersect.h:12
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
Trk::locX
@ locX
Definition: ParamDefs.h:43
Muon::MuonSegmentRegionRecoveryTool::m_chamberHoleRecoveryTool
ToolHandle< MuonChamberHoleRecoveryTool > m_chamberHoleRecoveryTool
Definition: MuonSegmentRegionRecoveryTool.h:138
Trk::locY
@ locY
local cartesian
Definition: ParamDefs.h:44
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::MuonSegmentRegionRecoveryTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonSegmentRegionRecoveryTool.h:131
Muon::MuonSegmentRegionRecoveryTool::fillOnTrackChambers
void fillOnTrackChambers(const Trk::Track &theTrack, MuonData &data) const
Definition: MuonSegmentRegionRecoveryTool.cxx:317
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
Muon::MuonStationIndex::EO
@ EO
Definition: MuonStationIndex.h:26
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
Trk::ParametersBase::associatedSurface
virtual const Surface & associatedSurface() const override=0
Access to the Surface associated to the Parameters.
Muon::MuonSegmentRegionRecoveryTool::initialize
virtual StatusCode initialize() override
AlgTool initialize.
Definition: MuonSegmentRegionRecoveryTool.cxx:53
Muon::MuonGetClosestParameters::closestParameters
static std::unique_ptr< Trk::TrackParameters > closestParameters(const Trk::Track &track, const Amg::Vector3D &pos, bool onlyUseMeasured=false)
Definition: MuonGetClosestParameters.h:19
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
skel.it
it
Definition: skel.GENtoEVGEN.py:423
Muon::MuonSegmentRegionRecoveryTool::m_builder
ToolHandle< Rec::ICombinedMuonTrackFitter > m_builder
Definition: MuonSegmentRegionRecoveryTool.h:140
CompetingMuonClustersOnTrack.h
Muon::TgcClusterOnTrack
Class to represent calibrated clusters formed from TGC strips.
Definition: TgcClusterOnTrack.h:46
Muon::IMuonHitSummaryTool::CompactSummary
Definition: IMuonHitSummaryTool.h:70
MM
@ MM
Definition: RegSelEnums.h:38
TrackStateOnSurfaceComparisonFunction.h
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
MuonGM::RpcReadoutElement
An RpcReadoutElement corresponds to a single RPC module; therefore typicaly a barrel muon station con...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/RpcReadoutElement.h:54
PropDirection.h
Muon::MuonSegmentRegionRecoveryTool::m_seededSegmentFinder
ToolHandle< IMuonSeededSegmentFinder > m_seededSegmentFinder
Definition: MuonSegmentRegionRecoveryTool.h:133
IExtrapolator.h
Trk::TrkDetElementBase
Definition: TrkDetElementBase.h:52
Muon::RpcClusterOnTrack
Class to represent calibrated clusters formed from RPC strips.
Definition: RpcClusterOnTrack.h:35
Trk::locR
@ locR
Definition: ParamDefs.h:50
MuonGM::CscReadoutElement
Definition: CscReadoutElement.h:56
Muon::MuonSegmentRegionRecoveryTool::m_excludeEES
Gaudi::Property< bool > m_excludeEES
Definition: MuonSegmentRegionRecoveryTool.h:157
MuonPrepDataContainer.h
Trk::TrkDetElementBase::identify
virtual Identifier identify() const =0
Identifier.
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
Muon::CompetingMuonClustersOnTrack
Definition: CompetingMuonClustersOnTrack.h:54
MdtDriftCircleOnTrack.h
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:49
Muon::MuonSegmentRegionRecoveryTool::m_dphi
Gaudi::Property< double > m_dphi
Definition: MuonSegmentRegionRecoveryTool.h:156
Muon::MuonSegmentRegionRecoveryTool::m_recoverMM
Gaudi::Property< bool > m_recoverMM
Definition: MuonSegmentRegionRecoveryTool.h:161
Identifier::is_valid
bool is_valid() const
Check if id is in a valid state.
Muon::MuonSegmentRegionRecoveryTool::addMissingChambers
std::unique_ptr< Trk::Track > addMissingChambers(const EventContext &ctx, const Trk::Track &track, MuonData &data, bool addMdt) const
Definition: MuonSegmentRegionRecoveryTool.cxx:694
Muon::MuonSegmentRegionRecoveryTool::m_regsel_rpc
ToolHandle< IRegSelTool > m_regsel_rpc
Definition: MuonSegmentRegionRecoveryTool.h:145
Muon::MuonSegmentRegionRecoveryTool::m_extrapolator
ToolHandle< Trk::IExtrapolator > m_extrapolator
Definition: MuonSegmentRegionRecoveryTool.h:139
Muon::IMuonHitSummaryTool::CompactSummary::mainSector
int mainSector
Definition: IMuonHitSummaryTool.h:83
AmgSymMatrix
#define AmgSymMatrix(dim)
Definition: EventPrimitives.h:52
Muon::MuonSegmentRegionRecoveryTool::reachableDetEl
std::unique_ptr< const Trk::TrackParameters > reachableDetEl(const EventContext &ctx, const Trk::Track &track, const Trk::TrkDetElementBase &detEl, bool smallerBounds=false) const
Definition: MuonSegmentRegionRecoveryTool.cxx:942
MuonTrackMakerStlTools.h
MMClusterOnTrack.h
RpcPrepDataCollection.h
Trk::LocalDirection::angleYZ
double angleYZ() const
access method for angle of local YZ projection
Definition: LocalDirection.h:106
DETID
DETID
An enum to define subdetector names.
Definition: RegSelEnums.h:23
CscPrepDataCollection.h
MuonGM::MuonDetectorManager::getTgcReadoutElement
const TgcReadoutElement * getTgcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:247
TgcClusterOnTrack.h
Muon::MuonSegmentRegionRecoveryTool::MuonSegmentRegionRecoveryTool
MuonSegmentRegionRecoveryTool(const std::string &, const std::string &, const IInterface *)
constructor
Definition: MuonSegmentRegionRecoveryTool.cxx:48
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
MdtPrepDataCollection.h
Muon::MuonSegmentRegionRecoveryTool::m_recoverSTGC
Gaudi::Property< bool > m_recoverSTGC
Definition: MuonSegmentRegionRecoveryTool.h:162
MMPrepDataCollection.h
Muon::MuonSegmentRegionRecoveryTool::m_regsel_csc
ToolHandle< IRegSelTool > m_regsel_csc
Definition: MuonSegmentRegionRecoveryTool.h:144
MuonTSOSHelper.h
Muon::MuonSegmentRegionRecoveryTool::m_trackSegmentMatchingTool
ToolHandle< IMuonTrackSegmentMatchingTool > m_trackSegmentMatchingTool
Definition: MuonSegmentRegionRecoveryTool.h:135
beamspotnt.cols
list cols
Definition: bin/beamspotnt.py:1114
RpcClusterOnTrack.h
Muon::MuonPrepDataCollection::identifyHash
virtual IdentifierHash identifyHash() const override final
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
MuonGM::MuonDetectorManager::getMdtReadoutElement
const MdtReadoutElement * getMdtReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:204
Trk::locZ
@ locZ
local cylindrical
Definition: ParamDefs.h:48
ResidualPull.h
EventPrimitivesToStringConverter.h
MuonGM::MdtReadoutElement
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:50
TGC
Definition: TgcBase.h:6
MuonGM::MuonDetectorManager::getCscReadoutElement
const CscReadoutElement * getCscReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:225
MuonSegmentRegionRecoveryTool.h
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
Muon::MuonSegmentRegionRecoveryTool::m_fitter
ToolHandle< Trk::ITrackFitter > m_fitter
Definition: MuonSegmentRegionRecoveryTool.h:141
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
IRoiDescriptor
Describes the API of the Region of Ineterest geometry.
Definition: IRoiDescriptor.h:23
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
urldecode::states
states
Definition: urldecode.h:39
MuonGM::MdtReadoutElement::getActiveTubeLength
double getActiveTubeLength(const int tubeLayer, const int tube) const
MuonGM::sTgcReadoutElement
An sTgcReadoutElement corresponds to a single STGC module; therefore typicaly a barrel muon station c...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/sTgcReadoutElement.h:28
Muon::MuonSegment::localDirection
const Trk::LocalDirection & localDirection() const
local direction
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:169
Trk::Segment::containedMeasurements
const std::vector< const Trk::MeasurementBase * > & containedMeasurements() const
returns the vector of Trk::MeasurementBase objects
Definition: TrkEvent/TrkSegment/TrkSegment/Segment.h:166
Trk::Segment
Definition: TrkEvent/TrkSegment/TrkSegment/Segment.h:56
Muon::MuonPrepDataCollection::identify
virtual Identifier identify() const override final
CscClusterOnTrack.h
RoiDescriptor.h
MuonGM::TgcReadoutElement
A TgcReadoutElement corresponds to a single TGC chamber; therefore typically a TGC station contains s...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/TgcReadoutElement.h:42
DataVector::front
const T * front() const
Access the first element in the collection as an rvalue.
PseudoMeasurementOnTrack.h
Muon::IMuonHitSummaryTool::CompactSummary::stationLayers
std::map< MuonStationIndex::StIndex, HitSummary > stationLayers
Definition: IMuonHitSummaryTool.h:95
Trk::TrkDetElementBase::surface
virtual const Surface & surface() const =0
Return surface associated with this detector element.
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
RoiDescriptor
Describes the Region of Ineterest geometry It has basically 9 parameters.
Definition: RoiDescriptor.h:40
Trk::PlaneSurface::globalToLocalDirection
void globalToLocalDirection(const Amg::Vector3D &glodir, Trk::LocalDirection &locdir) const
This method transforms the global direction to a local direction wrt the plane.
Definition: PlaneSurface.cxx:260
Trk::ParametersBase
Definition: ParametersBase.h:55
Muon::MuonSegmentRegionRecoveryTool::m_regsel_stgc
ToolHandle< IRegSelTool > m_regsel_stgc
Definition: MuonSegmentRegionRecoveryTool.h:147
Trk::muon
@ muon
Definition: ParticleHypothesis.h:28
Muon::MuonPrepDataCollection
Template to hold collections of MuonPrepRawData objects.
Definition: MuonPrepDataCollection.h:46
DataVector< const Trk::TrackStateOnSurface >
Trk::LocalDirection
represents the three-dimensional global direction with respect to a planar surface frame.
Definition: LocalDirection.h:81
Muon::MuonSegmentRegionRecoveryTool::m_deta
Gaudi::Property< double > m_deta
Definition: MuonSegmentRegionRecoveryTool.h:155
SortMeasurementsByPosition.h
Trk::SurfaceBounds::insideLoc2
virtual bool insideLoc2(const Amg::Vector2D &locpo, double tol2=0.) const =0
Extend the interface to for single inside Loc 1 / Loc2 tests.
Muon::sTgcClusterOnTrack
Class to represent calibrated clusters formed from TGC strips.
Definition: sTgcClusterOnTrack.h:30
DerivationFramework::TriggerMatchingUtils::sorted
std::vector< typename T::value_type > sorted(T begin, T end)
Helper function to create a sorted vector from an unsorted one.
Muon::MuonStationIndex::EES
@ EES
Definition: MuonStationIndex.h:18
Muon::MMClusterOnTrack
Class to represent calibrated clusters formed from TGC strips.
Definition: MMClusterOnTrack.h:26
Trk::MeasurementBase
Definition: MeasurementBase.h:58
Muon::MuonSegmentRegionRecoveryTool::m_chamberGeoKey
SG::ReadCondHandleKey< Muon::MuonIntersectGeoData > m_chamberGeoKey
Definition: MuonSegmentRegionRecoveryTool.h:152
Muon::MuonTubeIntersect::tubeId
Identifier tubeId
Definition: MuonTubeIntersect.h:14
ITrackHoleSearchTool.h
TgcPrepDataCollection.h
RPC
@ RPC
Definition: RegSelEnums.h:32
Trk::TrackStateOnSurface
represents the track state (measurement, material, fit parameters and quality) at a surface.
Definition: TrackStateOnSurface.h:71
Trk::Surface::bounds
virtual const SurfaceBounds & bounds() const =0
Surface Bounds method.
Muon::MuonSegmentRegionRecoveryTool::MuonData
Definition: MuonSegmentRegionRecoveryTool.h:69
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
sTgcPrepDataCollection.h
Muon::MdtDriftCircleOnTrack
This class represents the corrected MDT measurements, where the corrections include the effects of wi...
Definition: MdtDriftCircleOnTrack.h:37
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
Muon::MuonSegmentRegionRecoveryTool::m_trackSummaryTool
ToolHandle< Trk::IExtendedTrackSummaryTool > m_trackSummaryTool
Definition: MuonSegmentRegionRecoveryTool.h:150
Muon::MuonSegmentRegionRecoveryTool::collectCrossedChambers
void collectCrossedChambers(const Trk::Track &track, MuonData &data) const
methods used by recover
Definition: MuonSegmentRegionRecoveryTool.cxx:219
Trk::Surface::insideBounds
virtual bool insideBounds(const Amg::Vector2D &locpos, double tol1=0., double tol2=0.) const =0
virtual methods to be overwritten by the inherited surfaces
query_example.col
col
Definition: query_example.py:7
python.copyTCTOutput.locDir
locDir
Definition: copyTCTOutput.py:113
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
Trk::MeasurementBase::localParameters
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
Definition: MeasurementBase.h:132
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
Muon::MuonStationIntersect
Definition: MuonStationIntersect.h:12
EventPrimitivesCovarianceHelpers.h
Muon::CompetingMuonClustersOnTrack::rioOnTrack
const MuonClusterOnTrack & rioOnTrack(unsigned int) const
returns the RIO_OnTrack (also known as ROT) objects depending on the integer
Definition: CompetingMuonClustersOnTrack.h:190
MuonGetClosestParameters.h
Muon::CscClusterOnTrack
Class to represent the calibrated clusters created from CSC strips.
Definition: CscClusterOnTrack.h:47
Amg::intersect
std::optional< double > intersect(const AmgVector(N)&posA, const AmgVector(N)&dirA, const AmgVector(N)&posB, const AmgVector(N)&dirB)
Calculates the closest approach of two lines.
Definition: GeoPrimitivesHelpers.h:302
MuonGM::MuonDetectorManager
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:49
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Muon::MuonSegmentRegionRecoveryTool::m_edmHelperSvc
ServiceHandle< IMuonEDMHelperSvc > m_edmHelperSvc
Definition: MuonSegmentRegionRecoveryTool.h:128
MuonGM::MuonDetectorManager::getMMReadoutElement
const MMReadoutElement * getMMReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:255
DEBUG
#define DEBUG
Definition: page_access.h:11
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
Muon::MuonSegmentRegionRecoveryTool::recover
virtual std::unique_ptr< Trk::Track > recover(const Trk::Track &track, const EventContext &ctx) const override
returns a new track with segments recovered using RegionSelector
Definition: MuonSegmentRegionRecoveryTool.cxx:102
MuonGM::MdtReadoutElement::surface
virtual const Trk::Surface & surface() const override final
Return surface associated with this detector element.
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:875
Trk::RIO_OnTrack::identify
virtual Identifier identify() const final
return the identifier -extends MeasurementBase
Definition: RIO_OnTrack.h:155
MuonGM::MMReadoutElement
An MMReadoutElement corresponds to a single STGC module; therefore typicaly a barrel muon station con...
Definition: MMReadoutElement.h:23
Muon::MuonSegmentRegionRecoveryTool::createHoleTSOSsForClusterChamber
void createHoleTSOSsForClusterChamber(const Identifier &detElId, const EventContext &ctx, const Trk::TrackParameters &pars, std::set< Identifier > &layIds, std::vector< std::unique_ptr< const Trk::TrackStateOnSurface > > &states) const override
Definition: MuonSegmentRegionRecoveryTool.cxx:89
Muon::MuonStationIndex::ChIndex
ChIndex
enum to classify the different chamber layers in the muon spectrometer
Definition: MuonStationIndex.h:15
MuonSegment.h
Muon::MuonStationIndex::StIndex
StIndex
enum to classify the different station layers in the muon spectrometer
Definition: MuonStationIndex.h:23
Muon::MuonSegmentRegionRecoveryTool::m_regsel_mm
ToolHandle< IRegSelTool > m_regsel_mm
Definition: MuonSegmentRegionRecoveryTool.h:148
Muon::MdtDriftCircleOnTrack::collectionHash
IdentifierHash collectionHash() const
Returns the hashID of the PRD collection.
Definition: MdtDriftCircleOnTrack.h:264
LocalDirection.h
SortTracksByHitNumber.h
MuonGM::MuonReadoutElement::identifyHash
IdentifierHash identifyHash() const override final
Returns the IdentifierHash of the MuonStation, i.e.
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:185
CSC
@ CSC
Definition: RegSelEnums.h:34
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
Muon::MuonSegmentRegionRecoveryTool::findHoles
std::unique_ptr< Trk::Track > findHoles(const EventContext &ctx, const Trk::Track &track, MuonData &data) const
Definition: MuonSegmentRegionRecoveryTool.cxx:390
MuonGM::MuonDetectorManager::getsTgcReadoutElement
const sTgcReadoutElement * getsTgcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:259
Muon::MuonSegment
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:45
AthAlgTool
Definition: AthAlgTool.h:26
Muon::MuonSegmentRegionRecoveryTool::m_onlyEO
Gaudi::Property< bool > m_onlyEO
Definition: MuonSegmentRegionRecoveryTool.h:158
IdentifierHash
Definition: IdentifierHash.h:38
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
LArCellBinning.etamin
etamin
Definition: LArCellBinning.py:137
Trk::TrkDetElementBase::center
virtual const Amg::Vector3D & center() const =0
Return the center of the element.
IdContext
class IdContext
Definition: IdContext.h:34
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
ITrackFitter.h
calibdata.tube
tube
Definition: calibdata.py:31
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.
Trk::TrackStateOnSurface::Measurement
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
Definition: TrackStateOnSurface.h:101
Muon::MuonSegmentRegionRecoveryTool::addHashes
void addHashes(DETID type, const IRoiDescriptor &roi, std::set< IdentifierHash > &hashes, const std::set< IdentifierHash > &exclusion) const
Definition: MuonSegmentRegionRecoveryTool.cxx:165
Muon::MuonSegmentRegionRecoveryTool::m_printer
PublicToolHandle< MuonEDMPrinterTool > m_printer
Definition: MuonSegmentRegionRecoveryTool.h:149
Muon::MuonStationIndex::EM
@ EM
Definition: MuonStationIndex.h:26
SegmentCollection.h
MDT
@ MDT
Definition: RegSelEnums.h:31
Muon::MuonClusterOnTrack
Base class for Muon cluster RIO_OnTracks.
Definition: MuonClusterOnTrack.h:34
Muon::MuonSegment::associatedSurface
virtual const Trk::PlaneSurface & associatedSurface() const override final
returns the surface for the local to global transformation
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:175
Muon::MuonSegmentRegionRecoveryTool::m_hitSummaryTool
ToolHandle< IMuonHitSummaryTool > m_hitSummaryTool
Definition: MuonSegmentRegionRecoveryTool.h:142