47     using namespace MuonStationIndex;
 
   52         ATH_CHECK(m_DetectorManagerKey.initialize());
 
   54         ATH_CHECK(m_seededSegmentFinder.retrieve());
 
   56         if (!m_trackSegmentMatchingTool.empty()) {
 
   57             ATH_CHECK(m_trackSegmentMatchingTool.retrieve());
 
   58             ATH_MSG_INFO(
"Using matching tool " << m_trackSegmentMatchingTool);
 
   63         ATH_CHECK(m_chamberHoleRecoveryTool.retrieve());
 
   78         m_recoverSTGC =  m_recoverSTGC && !m_regsel_stgc.empty();
 
   79         m_recoverMM =  m_recoverMM && !m_regsel_mm.empty();
 
   80         ATH_CHECK(m_regsel_csc.retrieve(DisableTool{m_regsel_csc.empty()}));
 
   81         ATH_CHECK(m_regsel_stgc.retrieve(DisableTool{!m_recoverSTGC}));
 
   82         ATH_CHECK(m_regsel_mm.retrieve(DisableTool{!m_recoverMM}));
 
   83         return StatusCode::SUCCESS;
 
   88         std::vector<std::unique_ptr<const Trk::TrackStateOnSurface>>& 
states)
 const {
 
   89         m_chamberHoleRecoveryTool->createHoleTSOSsForClusterChamber(detElId, ctx, 
pars, layIds, 
states);
 
  101         ATH_MSG_VERBOSE(
" Entering segment recovery method " << m_printer->print(
track) << std::endl << m_printer->printStations(
track));
 
  104         std::unique_ptr<Trk::Track> chRecTrack(m_chamberHoleRecoveryTool->recover(
track, ctx));
 
  106             ATH_MSG_DEBUG(
" MuonChamberHoleRecoveryTool failed to create a new track " 
  107                           << 
" Returning input (unrecovered) track ");
 
  108             return std::make_unique<Trk::Track>(
track);
 
  110         ATH_MSG_VERBOSE(
" After chamber hole recovery " << m_printer->print(*chRecTrack) << std::endl
 
  111                                                         << m_printer->printStations(*chRecTrack));
 
  116             if (!m_edmHelperSvc->isSLTrack(*chRecTrack)) 
return chRecTrack;
 
  140         fillOnTrackChambers(*chRecTrack, muonData);
 
  143         collectCrossedChambers( ctx, *chRecTrack, muonData);
 
  146         std::unique_ptr<Trk::Track> triggerRecTrack = addMissingChambers(ctx, *chRecTrack, muonData, 
false);
 
  147         if (triggerRecTrack) chRecTrack.swap(triggerRecTrack);
 
  149         std::unique_ptr<Trk::Track> mdtRecTrack = addMissingChambers(ctx, *chRecTrack, muonData, 
true);
 
  150         if (mdtRecTrack) chRecTrack.swap(mdtRecTrack);
 
  152         std::unique_ptr<Trk::Track> mdtRecTrackWithHoles = findHoles(ctx, *chRecTrack, muonData);
 
  153         if (mdtRecTrackWithHoles) chRecTrack.swap(mdtRecTrackWithHoles);
 
  164                          const std::set<IdentifierHash>& exclusion)
 const {
 
  168         std::vector<IdentifierHash> crossed;
 
  175         if (
type == 
TechnologyIndex::MM && m_regsel_mm->lookup(ctx)) m_regsel_mm->lookup(ctx)->HashIDList(roi, crossed);
 
  192                     IdContext otCont = m_idHelperSvc->mdtIdHelper().module_context();
 
  193                     m_idHelperSvc->mdtIdHelper().get_id(
hash, chId, &otCont);
 
  195                     if (m_excludeEES && m_idHelperSvc->chamberIndex(chId) == 
ChIndex::EES) {
 
  199                     if (m_onlyEO && m_idHelperSvc->stationIndex(chId) != 
StIndex::EO) {
 
  207                     IdContext otCont = m_idHelperSvc->stgcIdHelper().detectorElement_context();
 
  208                     m_idHelperSvc->stgcIdHelper().get_id(
hash, chId, &otCont);
 
  213                     IdContext otCont = m_idHelperSvc->mmIdHelper().detectorElement_context();
 
  214                     m_idHelperSvc->mmIdHelper().get_id(
hash, chId, &otCont);
 
  219                     IdContext otCont = m_idHelperSvc->cscIdHelper().module_context();
 
  220                     m_idHelperSvc->cscIdHelper().get_id(
hash, chId, &otCont);
 
  239         std::set<MuonStationIndex::StIndex> stations;
 
  240         double etamin{1e9}, etamax{-1e9}, phimin{1e9}, phimax{-1e9};
 
  245         for (; tsit != tsit_end; ++tsit) {
 
  249             double rpos = 
pars->position().perp();
 
  250             double zpos = std::abs(
pars->position().z());
 
  251             if (rpos < 2500 && zpos < 4000) 
continue;
 
  252             double eta = 
pars->position().eta();
 
  253             double phi = 
pars->position().phi();
 
  255                 msg() << 
"All State parameters: eta: " << 
eta << 
" ,phi: " << 
phi << 
" pos r " << rpos << 
" z " << zpos;
 
  264             Identifier id = m_edmHelperSvc->getIdentifier(*meas);
 
  265             bool pseudo = !
id.is_valid();
 
  267             if (pseudo || !m_idHelperSvc->mdtIdHelper().is_muon(
id)) 
continue;
 
  269             if (
eta > etamax) etamax = 
eta;
 
  271             if (
phi > phimax) phimax = 
phi;
 
  272             if (
phi < phimin) phimin = 
phi;
 
  274                 msg() << 
"Selected State parameters: eta: " << 
eta << 
" ,phi: " << 
phi << 
" pos r " << rpos << 
" z " << zpos;
 
  280             if (stations.count(stIndex)) 
continue;
 
  281             stations.insert(stIndex);
 
  290         ATH_MSG_DEBUG(
"Eta range: " << 
etamin << 
" " << etamax << 
" Phi range " << phimin << 
" " << phimax);
 
  292             ATH_MSG_DEBUG(
"no hits selected, nothing further will be done");
 
  307         for (; hsit != hsit_end; ++hsit) {
 
  309             IdContext otCont = m_idHelperSvc->mdtIdHelper().module_context();
 
  310             m_idHelperSvc->mdtIdHelper().get_id(*hsit, chId, &otCont);
 
  315         hsit = 
data.csc.begin();
 
  316         hsit_end = 
data.csc.end();
 
  317         for (; hsit != hsit_end; ++hsit) {
 
  319             IdContext otCont = m_idHelperSvc->cscIdHelper().module_context();
 
  320             m_idHelperSvc->cscIdHelper().get_id(*hsit, chId, &otCont);
 
  321             chId = m_idHelperSvc->chamberId(chId);
 
  337         std::set<MuonStationIndex::StIndex> stations;
 
  342         for (; tsit != tsit_end; ++tsit) {
 
  392             if (
mm && !
data.mmTrack.count(
mm->collectionHash())) {
 
  393                 data.mmTrack.insert(
mm->collectionHash());
 
  404             ATH_MSG_WARNING(
" track without states, cannot perform mdt hole search ");
 
  409         if (!InterSectSvc.isValid())   {
 
  410             ATH_MSG_ERROR(
"Failed to retrieve chamber intersection service");
 
  417         std::vector<std::unique_ptr<const Trk::TrackStateOnSurface>> 
states;
 
  418         unsigned int nholes = 0;
 
  419         std::set<Identifier> chambersInSearch;
 
  422             if (
data.mdtTrack.count(ith)) {
 
  427             IdContext otCont = m_idHelperSvc->mdtIdHelper().module_context();
 
  428             m_idHelperSvc->mdtIdHelper().get_id(ith, chId, &otCont);
 
  431             if (chambersInSearch.count(chId)) {
 
  432                 ATH_MSG_VERBOSE(
"Chamber already on track " << ith << 
" " << m_idHelperSvc->toStringChamber(chId));
 
  440             std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, 
track, *detEl, 
true)};
 
  442                 ATH_MSG_DEBUG(
"Did not reach " << m_idHelperSvc->toStringChamber(chId) << 
" hash " << ith);
 
  445             ATH_MSG_DEBUG(
"Reached " << m_idHelperSvc->toStringChamber(chId) << 
" hash " << ith);
 
  451             for (
unsigned int ii = 0; ii < 
intersect.tubeIntersects().
size(); ++ii) {
 
  460                 chambersInSearch.insert(
ch);
 
  463                 std::unique_ptr<Trk::TrackParameters> tubePars{
 
  466                     ATH_MSG_WARNING(
"Failed to extrapolate to tube " << m_idHelperSvc->toString(
id));
 
  469                 int lay = m_idHelperSvc->mdtIdHelper().tubeLayer(
id);
 
  470                 int tube = m_idHelperSvc->mdtIdHelper().tube(
id);
 
  472                 double distEdge = std::abs(tubePars->parameters()[
Trk::locZ]) - 0.5 * tubeLen;
 
  476                 std::optional<Amg::Vector2D> locPos = surf.Trk::Surface::globalToLocal(tubePars->position());
 
  478                 bool inBounds = 
false;
 
  484                     ATH_MSG_VERBOSE(
" discarding hole " << m_idHelperSvc->toString(
id) << 
" dist wire " << tubePars->parameters()[
Trk::locR]
 
  485                                                         << 
" outside bounds ");
 
  489                                              << 
" dist tube edge " << distEdge << 
" pullEdge " << pullEdge);
 
  492                 states.emplace_back(std::move(tsos));
 
  499             if (
data.cscTrack.count(ith)) {
 
  504             IdContext otCont = m_idHelperSvc->cscIdHelper().module_context();
 
  505             m_idHelperSvc->cscIdHelper().get_id(ith, chId, &otCont);
 
  506             chId = m_idHelperSvc->chamberId(chId);
 
  510                 ATH_MSG_WARNING(
"Found no detector element for " << ith << 
" " << m_idHelperSvc->toString(chId));
 
  514             std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, 
track, *detEl, 
true)};
 
  516                 ATH_MSG_DEBUG(
"Did not reach " << m_idHelperSvc->toStringChamber(chId) << 
" hash " << ith);
 
  519             Identifier detElId = m_idHelperSvc->detElId(chId);
 
  520             std::set<Identifier> layIds;
 
  521             std::vector<std::unique_ptr<const Trk::TrackStateOnSurface>> cscstates;
 
  522             createHoleTSOSsForClusterChamber(detElId, ctx, *exPars, layIds, cscstates);
 
  523             ATH_MSG_DEBUG(
"Reached " << m_idHelperSvc->toString(chId) << 
" hash " << ith << 
" holes " << cscstates.size());
 
  525             for (std::unique_ptr<const Trk::TrackStateOnSurface>& cscit : cscstates) {
 
  527                 states.emplace_back(std::move(cscit));
 
  532             if (
data.tgcTrack.count(ith)) {
 
  537             IdContext otCont = m_idHelperSvc->tgcIdHelper().module_context();
 
  538             m_idHelperSvc->tgcIdHelper().get_id(ith, chId, &otCont);
 
  539             chId = m_idHelperSvc->chamberId(chId);
 
  543                 ATH_MSG_WARNING(
"Found no detector element for " << ith << 
" " << m_idHelperSvc->toString(chId));
 
  547             std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, 
track, *detEl, 
true)};
 
  549                 ATH_MSG_DEBUG(
"Did not reach " << m_idHelperSvc->toStringChamber(chId) << 
" hash " << ith);
 
  552             Identifier detElId = m_idHelperSvc->detElId(chId);
 
  553             std::set<Identifier> layIds;
 
  554             std::vector<std::unique_ptr<const Trk::TrackStateOnSurface>> tgcstates;
 
  555             createHoleTSOSsForClusterChamber(detElId, ctx, *exPars, layIds, tgcstates);
 
  556             ATH_MSG_DEBUG(
"Reached " << m_idHelperSvc->toString(chId) << 
" hash " << ith << 
" holes " << tgcstates.size());
 
  558             for (std::unique_ptr<const Trk::TrackStateOnSurface>& tgcit : tgcstates) {
 
  560                 states.emplace_back(std::move(tgcit));
 
  566             if (
data.rpcTrack.count(ith)) {
 
  571             IdContext otCont = m_idHelperSvc->rpcIdHelper().module_context();
 
  572             m_idHelperSvc->rpcIdHelper().get_id(ith, chId, &otCont);
 
  573             chId = m_idHelperSvc->chamberId(chId);
 
  577                 ATH_MSG_WARNING(
"Found no detector element for " << ith << 
" " << m_idHelperSvc->toString(chId));
 
  581             std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, 
track, *detEl, 
true)};
 
  583                 ATH_MSG_DEBUG(
"Did not reach " << m_idHelperSvc->toStringChamber(chId) << 
" hash " << ith);
 
  586             Identifier detElId = m_idHelperSvc->detElId(chId);
 
  587             std::set<Identifier> layIds;
 
  588             std::vector<std::unique_ptr<const Trk::TrackStateOnSurface>> rpcstates;
 
  589             createHoleTSOSsForClusterChamber(detElId, ctx, *exPars, layIds, rpcstates);
 
  590             ATH_MSG_DEBUG(
"Reached " << m_idHelperSvc->toString(chId) << 
" hash " << ith << 
" holes " << rpcstates.size());
 
  592             for (std::unique_ptr<const Trk::TrackStateOnSurface>& rpcit : rpcstates) {
 
  594                 states.emplace_back(std::move(rpcit));
 
  602             if (
data.stgcTrack.count(ith)) {
 
  607             IdContext otCont = m_idHelperSvc->stgcIdHelper().module_context();
 
  608             m_idHelperSvc->stgcIdHelper().get_id(ith, chId, &otCont);
 
  615             chId = m_idHelperSvc->chamberId(chId);
 
  619                 ATH_MSG_WARNING(
"Found no detector element for " << ith << 
" " << m_idHelperSvc->toString(chId));
 
  623             std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, 
track, *detEl, 
true)};
 
  625                 ATH_MSG_DEBUG(
"Did not reach " << m_idHelperSvc->toStringChamber(chId) << 
" hash " << ith);
 
  628             Identifier detElId = m_idHelperSvc->detElId(chId);
 
  629             std::set<Identifier> layIds;
 
  630             std::vector<std::unique_ptr<const Trk::TrackStateOnSurface>> stgcstates;
 
  631             createHoleTSOSsForClusterChamber(detElId, ctx, *exPars, layIds, stgcstates);
 
  632             ATH_MSG_DEBUG(
"Reached " << m_idHelperSvc->toString(chId) << 
" hash " << ith << 
" holes " << stgcstates.size());
 
  634             for (std::unique_ptr<const Trk::TrackStateOnSurface>& stgcit : stgcstates) {
 
  636                 states.push_back(std::move(stgcit));
 
  643             if (
data.mmTrack.count(ith)) {
 
  648             IdContext otCont = m_idHelperSvc->mmIdHelper().module_context();
 
  649             m_idHelperSvc->mmIdHelper().get_id(ith, chId, &otCont);
 
  656             chId = m_idHelperSvc->chamberId(chId);
 
  660                 ATH_MSG_WARNING(
"Found no detector element for " << ith << 
" " << m_idHelperSvc->toString(chId));
 
  664             std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, 
track, *detEl, 
true)};
 
  666                 ATH_MSG_DEBUG(
"Did not reach " << m_idHelperSvc->toStringChamber(chId) << 
" hash " << ith);
 
  669             Identifier detElId = m_idHelperSvc->detElId(chId);
 
  670             std::set<Identifier> layIds;
 
  671             std::vector<std::unique_ptr<const Trk::TrackStateOnSurface>> mmstates;
 
  672             createHoleTSOSsForClusterChamber(detElId, ctx, *exPars, layIds, mmstates);
 
  673             ATH_MSG_DEBUG(
"Reached " << m_idHelperSvc->toString(chId) << 
" hash " << ith << 
" holes " << mmstates.size());
 
  675             for (std::unique_ptr<const Trk::TrackStateOnSurface>& mmit : mmstates) {
 
  677                 states.emplace_back(std::move(mmit));
 
  682             auto trackStateOnSurfaces = std::make_unique<Trk::TrackStates>();
 
  683             trackStateOnSurfaces->reserve(oldStates->
size() + 
states.size());
 
  685             std::vector<std::unique_ptr<const Trk::TrackStateOnSurface>> toBeSorted;
 
  686             toBeSorted.reserve(oldStates->
size() + 
states.size());
 
  690             for (std::unique_ptr<const Trk::TrackStateOnSurface>& stit : 
states) toBeSorted.emplace_back(std::move(stit));
 
  692             std::stable_sort(toBeSorted.begin(), toBeSorted.end(), 
SortTSOSs(&*m_edmHelperSvc, &*m_idHelperSvc));
 
  694             for (std::unique_ptr<const Trk::TrackStateOnSurface>& 
sorted : toBeSorted) { trackStateOnSurfaces->push_back(
sorted.release()); }
 
  695             std::unique_ptr<Trk::Track> trackWithHoles = std::make_unique<Trk::Track>(
 
  696                 track.info(), std::move(trackStateOnSurfaces), 
track.fitQuality() ? 
track.fitQuality()->uniqueClone() : 
nullptr);
 
  698             if (m_trackSummaryTool.isEnabled()) { m_trackSummaryTool->computeAndReplaceTrackSummary(ctx, *trackWithHoles, 
false); }
 
  699             ATH_MSG_DEBUG(
"Track with holes " << m_printer->print(*trackWithHoles) << std::endl
 
  700                                               << m_printer->printStations(*trackWithHoles));
 
  701             return trackWithHoles;
 
  709         std::vector<std::unique_ptr<const Trk::TrackStateOnSurface>> 
states;
 
  710         std::set<IdentifierHash> newMdtHashes;
 
  711         std::set<IdentifierHash> newRpcHashes;
 
  712         std::set<IdentifierHash> newTgcHashes;
 
  713         std::set<IdentifierHash> newCscHashes;
 
  715         std::set<IdentifierHash> newMMHashes;
 
  716         std::set<IdentifierHash> newsTgcHashes;
 
  718             ATH_MSG_DEBUG(
"Adding Missing MDT chambers: regions " << 
data.mdtPerStation.size());
 
  719             std::vector<const MdtPrepDataCollection*> newmcols;
 
  720             for (
const auto& chit : 
data.mdtPerStation) {
 
  722                 std::vector<const MdtPrepDataCollection*> 
cols;
 
  723                 m_seededSegmentFinder->extractMdtPrdCols(ctx, chit.second, 
cols);
 
  724                 std::map<int, std::vector<const MdtPrepData*>> mdtPrds;
 
  725                 std::unique_ptr<const Trk::TrackParameters> exParsFirst;
 
  727                     std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, 
track, *mit->front()->detectorElement())};
 
  729                         int sector = m_idHelperSvc->sector(mit->identify());
 
  730                         ATH_MSG_DEBUG(
"New chamber " << m_idHelperSvc->toStringChamber(mit->identify()) << 
" hash " << mit->identifyHash()
 
  731                                                      << 
" sector " << sector);
 
  732                         newmcols.emplace_back(mit);
 
  733                         std::vector<const MdtPrepData*>& col = mdtPrds[sector];
 
  734                         col.insert(col.end(), mit->begin(), mit->end());
 
  735                         if (!exParsFirst) exParsFirst.swap(exPars);
 
  738                         ATH_MSG_DEBUG(
"Did not reach chamber " << m_idHelperSvc->toStringChamber(mit->identify()) << 
" hash " 
  739                                                                << mit->identifyHash());
 
  742                 std::vector<const MdtPrepData*>* prds = 
nullptr;
 
  743                 std::map<int, std::vector<const MdtPrepData*>>
::iterator sectorIt = mdtPrds.begin();
 
  744                 if (mdtPrds.empty()) {
 
  746                 } 
else if (mdtPrds.size() == 1) {
 
  747                     prds = §orIt->second;
 
  752                     if (
pos != mdtPrds.end())
 
  758                 if (prds && exParsFirst) {
 
  759                     std::unique_ptr<Trk::SegmentCollection> segments = m_seededSegmentFinder->find(ctx, *exParsFirst, *prds);
 
  764                         std::unique_ptr<const Trk::TrackParameters> bestSegmentPars;
 
  768                             if (m_trackSegmentMatchingTool.empty())
 
  770                             else if (!m_trackSegmentMatchingTool->match(ctx, 
track, *mseg, 
true)) {
 
  774                                 ATH_MSG_DEBUG(
" Segment/track matched successfully using " << m_trackSegmentMatchingTool);
 
  776                             std::unique_ptr<const Trk::TrackParameters> segPars{m_extrapolator->extrapolateDirectly(
 
  783                                 ATH_MSG_DEBUG(
"resy " << resy << 
" dangleYZ " << dangleYZ << 
" " << m_printer->print(*mseg));
 
  784                                 if (std::abs(dangleYZ) < 0.05) {
 
  786                                     bestSegmentPars.swap(segPars);
 
  794                                 std::unique_ptr<Trk::TrackParameters> hitPars{m_extrapolator->extrapolateDirectly(
 
  797                                     std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern;
 
  801                                     states.emplace_back(tsos);
 
  812             data.mdtCols = std::move(newmcols);
 
  814             unsigned int nstates = 
states.size();
 
  816                 m_seededSegmentFinder->extractRpcPrdCols(ctx, 
data.rpc, 
data.rpcCols);
 
  817                 std::vector<const RpcPrepDataCollection*> newtcols;
 
  819                     std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, 
track, *(rit)->front()->detectorElement())};
 
  821                         newtcols.emplace_back(rit);
 
  823                         std::set<Identifier> layIds;
 
  824                         createHoleTSOSsForClusterChamber(detElId, ctx, *exPars, layIds, 
states);
 
  825                         if (
states.size() != nstates) {
 
  831                 data.rpcCols = std::move(newtcols);
 
  834                 m_seededSegmentFinder->extractTgcPrdCols(ctx, 
data.tgc, 
data.tgcCols);
 
  835                 std::vector<const TgcPrepDataCollection*> newtcols;
 
  837                     std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, 
track, *(tgcit)->front()->detectorElement())};
 
  839                         newtcols.emplace_back(tgcit);
 
  841                         std::set<Identifier> layIds;
 
  842                         createHoleTSOSsForClusterChamber(detElId, ctx, *exPars, layIds, 
states);
 
  843                         if (
states.size() != nstates) {
 
  849                 data.tgcCols = std::move(newtcols);
 
  852             m_seededSegmentFinder->extractCscPrdCols(
data.csc, 
data.cscCols);
 
  853             std::vector<const CscPrepDataCollection*> newccols;
 
  855                 std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, 
track, *(cit)->front()->detectorElement())};
 
  857                     newccols.push_back(cit);
 
  859                     std::set<Identifier> layIds;
 
  860                     createHoleTSOSsForClusterChamber(detElId, ctx, *exPars, layIds, 
states);
 
  861                     if (
states.size() != nstates) {
 
  867             data.cscCols = std::move(newccols);
 
  871                 m_seededSegmentFinder->extractsTgcPrdCols(ctx, 
data.stgc, 
data.stgcCols);
 
  872                 std::vector<const sTgcPrepDataCollection*> newstcols;
 
  873                 ATH_MSG_DEBUG(
" extractsTgcPrdCols data.stgcCols.size() " << 
data.stgcCols.size());
 
  875                     std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, 
track, *(stgcit)->front()->detectorElement())};
 
  877                         newstcols.push_back(stgcit);
 
  879                         std::set<Identifier> layIds;
 
  880                         createHoleTSOSsForClusterChamber(detElId, ctx, *exPars, layIds, 
states);
 
  882                         if (
states.size() != nstates) {
 
  888                 data.stgcCols = std::move(newstcols);
 
  892                 m_seededSegmentFinder->extractMMPrdCols(
data.mm, 
data.mmCols);
 
  894                 std::vector<const MMPrepDataCollection*> newmcols;
 
  896                     std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, 
track, *mit->
front()->detectorElement())};
 
  898                         newmcols.push_back(mit);
 
  900                         std::set<Identifier> layIds;
 
  901                         createHoleTSOSsForClusterChamber(detElId, ctx, *exPars, layIds, 
states);
 
  903                         if (
states.size() != nstates) {
 
  909                 data.mmCols = std::move(newmcols);
 
  924             std::stable_sort(
states.begin(), 
states.end(), 
SortTSOSs(m_edmHelperSvc.get(), m_idHelperSvc.get()));
 
  926             auto trackStateOnSurfaces = std::make_unique<Trk::TrackStates>();
 
  927             trackStateOnSurfaces->reserve(
states.size());
 
  928             for (std::unique_ptr<const Trk::TrackStateOnSurface>& 
sorted : 
states) { trackStateOnSurfaces->push_back(
sorted.release()); }
 
  930             std::unique_ptr<Trk::Track> newTrack = std::make_unique<Trk::Track>(
track.info(), std::move(trackStateOnSurfaces),
 
  931                                                                                 track.fitQuality() ? 
track.fitQuality()->uniqueClone() : 
nullptr);
 
  932             std::unique_ptr<Trk::Track> refittedTrack;
 
  934                 refittedTrack = std::unique_ptr<Trk::Track>(m_fitter->fit(ctx, *newTrack, m_useFitterOutlierLogic, 
Trk::muon));
 
  936                 refittedTrack = std::unique_ptr<Trk::Track>(m_builder->fit(ctx, *newTrack, m_useFitterOutlierLogic, 
Trk::muon));
 
  938                 ATH_MSG_DEBUG(
"New Track " << m_printer->print(*refittedTrack) << std::endl << m_printer->printStations(*refittedTrack));
 
  941                 data.mdtTrack.insert(newMdtHashes.begin(), newMdtHashes.end());
 
  942                 data.rpcTrack.insert(newRpcHashes.begin(), newRpcHashes.end());
 
  943                 data.tgcTrack.insert(newTgcHashes.begin(), newTgcHashes.end());
 
  944                 data.cscTrack.insert(newCscHashes.begin(), newCscHashes.end());
 
  946                 data.stgcTrack.insert(newsTgcHashes.begin(), newsTgcHashes.end());
 
  947                 data.mmTrack.insert(newMMHashes.begin(), newMMHashes.end());
 
  949             return refittedTrack;
 
  957                                                                                               bool smallerBounds)
 const {
 
  959         std::unique_ptr<const Trk::TrackParameters> exPars;
 
  962             ATH_MSG_VERBOSE(
"Extrapolating from closest point:\n" << m_printer->print(*closest));
 
  966             ATH_MSG_VERBOSE(
"Extrapolating from track (no closest point found):\n" << m_printer->print(
track));
 
  983             if (covx > 0.0 && covy > 0.0) {
 
  992             if (tolx > 10.) tolx = 10.;
 
  993             if (toly > 10.) toly = 10.;
 
 1000             std::ostringstream parsType;
 
 1003             parsType << 
"  tolerance=(" << tolx << 
"," << toly << 
")";
 
 1005                 parsType << 
" => inbounds";
 
 1007                 parsType << 
" => outbounds";
 
 1008             ATH_MSG_DEBUG(
" " << m_idHelperSvc->toStringChamber(detEl.
identify()) << 
" pars  " << parsType.str());
 
 1010         if (!inbounds) { 
return nullptr; }