ATLAS Offline Software
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Muon::MuonSegmentRegionRecoveryTool Class Reference

Implementation of an IMuonHoleRecoveryTool. More...

#include <MuonSegmentRegionRecoveryTool.h>

Inheritance diagram for Muon::MuonSegmentRegionRecoveryTool:
Collaboration diagram for Muon::MuonSegmentRegionRecoveryTool:

Classes

struct  MuonData
 

Public Member Functions

virtual ~MuonSegmentRegionRecoveryTool ()=default
 destructor More...
 
virtual StatusCode initialize () override
 AlgTool initialize. More...
 
virtual std::unique_ptr< Trk::Trackrecover (const Trk::Track &track, const EventContext &ctx) const override
 returns a new track with segments recovered using RegionSelector More...
 
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
 

Private Member Functions

std::unique_ptr< const Trk::TrackParametersreachableDetEl (const EventContext &ctx, const Trk::Track &track, const Trk::TrkDetElementBase &detEl, bool smallerBounds=false) const
 
void collectCrossedChambers (const EventContext &ctx, const Trk::Track &track, MuonData &data) const
 methods used by recover More...
 
void fillOnTrackChambers (const Trk::Track &theTrack, MuonData &data) const
 
std::unique_ptr< Trk::TrackaddMissingChambers (const EventContext &ctx, const Trk::Track &track, MuonData &data, bool addMdt) const
 
void addHashes (const EventContext &ctx, MuonStationIndex::TechnologyIndex type, const IRoiDescriptor &roi, std::set< IdentifierHash > &hashes, const std::set< IdentifierHash > &exclusion) const
 
std::unique_ptr< Trk::TrackfindHoles (const EventContext &ctx, const Trk::Track &track, MuonData &data) const
 

Private Attributes

ServiceHandle< IMuonEDMHelperSvcm_edmHelperSvc
 
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
 
ToolHandle< IMuonSeededSegmentFinderm_seededSegmentFinder
 
ToolHandle< IMuonTrackSegmentMatchingToolm_trackSegmentMatchingTool
 
ToolHandle< MuonChamberHoleRecoveryToolm_chamberHoleRecoveryTool {this, "ChamberHoleRecoveryTool", "", "hit-based hole search"}
 
ToolHandle< Trk::IExtrapolatorm_extrapolator {this, "Extrapolator", "Trk::Extrapolator/MuonExtrapolator"}
 
ToolHandle< Rec::ICombinedMuonTrackFitterm_builder {this, "Builder", ""}
 
ToolHandle< Trk::ITrackFitterm_fitter {this, "Fitter", "Trk::GlobalChi2Fitter/MCTBSLFitter"}
 
ToolHandle< IMuonHitSummaryToolm_hitSummaryTool {this, "HitSummaryTool", "Muon::MuonHitSummaryTool/MuonHitSummaryTool"}
 
ToolHandle< IRegSelToolm_regsel_mdt {this, "MDTRegionSelector", "RegSelTool/RegSelTool_MDT"}
 
ToolHandle< IRegSelToolm_regsel_csc {this, "CSCRegionSelector", "RegSelTool/RegSelTool_CSC"}
 
ToolHandle< IRegSelToolm_regsel_rpc {this, "RPCRegionSelector", "RegSelTool/RegSelTool_RPC"}
 
ToolHandle< IRegSelToolm_regsel_tgc {this, "TGCRegionSelector", "RegSelTool/RegSelTool_TGC"}
 
ToolHandle< IRegSelToolm_regsel_stgc {this, "STGCRegionSelector", "RegSelTool/RegSelTool_STGC"}
 
ToolHandle< IRegSelToolm_regsel_mm {this, "MMRegionSelector", "RegSelTool/RegSelTool_MM"}
 
PublicToolHandle< MuonEDMPrinterToolm_printer {this, "EDMPrinter", "Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"}
 
ToolHandle< Trk::IExtendedTrackSummaryToolm_trackSummaryTool {this, "TrackSummaryTool", "MuonTrackSummaryTool"}
 
SG::ReadCondHandleKey< Muon::MuonIntersectGeoDatam_chamberGeoKey {this, "ChamberGeoKey", "MuonStationIntersects", "Pointer to hole search service"}
 
SG::ReadCondHandleKey< MuonGM::MuonDetectorManagerm_DetectorManagerKey
 
Gaudi::Property< double > m_deta {this, "DeltaEtaRegion", 0.05}
 
Gaudi::Property< double > m_dphi {this, "DeltaPhiRegion", 0.1}
 
Gaudi::Property< bool > m_excludeEES {this, "ExcludeEES", true}
 
Gaudi::Property< bool > m_onlyEO {this, "OnlyEO", false}
 
Gaudi::Property< bool > m_useFitterOutlierLogic {this, "UseFitterOutlierLogic", true}
 
Gaudi::Property< bool > m_recoverMM {this, "RecoverMM", true, "Pick up dropped micromega chambers"}
 
Gaudi::Property< bool > m_recoverSTGC {this, "RecoverSTGC", true, "Pick up dropped sTGC chambers"}
 

Detailed Description

Implementation of an IMuonHoleRecoveryTool.

It propagates the track to a chamber where no segments where found and runs the SeededSegmentFinder in a region selected by the region selector

Definition at line 67 of file MuonSegmentRegionRecoveryTool.h.

Constructor & Destructor Documentation

◆ ~MuonSegmentRegionRecoveryTool()

virtual Muon::MuonSegmentRegionRecoveryTool::~MuonSegmentRegionRecoveryTool ( )
virtualdefault

destructor

Member Function Documentation

◆ addHashes()

void MuonSegmentRegionRecoveryTool::addHashes ( const EventContext &  ctx,
MuonStationIndex::TechnologyIndex  type,
const IRoiDescriptor roi,
std::set< IdentifierHash > &  hashes,
const std::set< IdentifierHash > &  exclusion 
) const
private

Definition at line 162 of file MuonSegmentRegionRecoveryTool.cxx.

164  {
165  // if only looking at EO, skip all but MDT chambers
166  if (m_onlyEO && type != TechnologyIndex::MDT) return;
167 
168  std::vector<IdentifierHash> crossed;
169 
170  if (type == TechnologyIndex::MDT && m_regsel_mdt->lookup(ctx)) m_regsel_mdt->lookup(ctx)->HashIDList(roi, crossed);
171  if (type == TechnologyIndex::CSC && m_regsel_csc->lookup(ctx)) m_regsel_csc->lookup(ctx)->HashIDList(roi, crossed);
172  if (type == TechnologyIndex::RPC && m_regsel_rpc->lookup(ctx)) m_regsel_rpc->lookup(ctx)->HashIDList(roi, crossed);
173  if (type == TechnologyIndex::TGC && m_regsel_tgc->lookup(ctx)) m_regsel_tgc->lookup(ctx)->HashIDList(roi, crossed);
174  if (type == TechnologyIndex::STGC && m_regsel_stgc->lookup(ctx)) m_regsel_stgc->lookup(ctx)->HashIDList(roi, crossed);
175  if (type == TechnologyIndex::MM && m_regsel_mm->lookup(ctx)) m_regsel_mm->lookup(ctx)->HashIDList(roi, crossed);
176 
177  for (const IdentifierHash& hash : crossed) {
178  if (exclusion.count(hash) || hashes.count(hash)) {
179  continue;
180  }
181  switch (type) {
182  using enum TechnologyIndex;
183  case TechnologyUnknown:
184  case TechnologyIndexMax:
185  break;
186  case RPC:
187  case TGC:{
188  break;
189  }
190  case MDT: {
191  Identifier chId;
192  IdContext otCont = m_idHelperSvc->mdtIdHelper().module_context();
193  m_idHelperSvc->mdtIdHelper().get_id(hash, chId, &otCont);
194 
195  if (m_excludeEES && m_idHelperSvc->chamberIndex(chId) == ChIndex::EES) {
196  ATH_MSG_VERBOSE(" excluding " << hash << " " << m_idHelperSvc->toStringChamber(chId));
197  continue;
198  }
199  if (m_onlyEO && m_idHelperSvc->stationIndex(chId) != StIndex::EO) {
200  ATH_MSG_VERBOSE(" excluding " << hash << " " << m_idHelperSvc->toStringChamber(chId));
201  continue;
202  }
203  ATH_MSG_VERBOSE(" -- hash " << hash << " " << m_idHelperSvc->toStringChamber(chId));
204  break;
205  } case STGC: {
206  Identifier chId;
207  IdContext otCont = m_idHelperSvc->stgcIdHelper().detectorElement_context();
208  m_idHelperSvc->stgcIdHelper().get_id(hash, chId, &otCont);
209  ATH_MSG_VERBOSE(" -- stgc hash " << hash << " " << m_idHelperSvc->toStringChamber(chId));
210  break;
211  } case MM: {
212  Identifier chId;
213  IdContext otCont = m_idHelperSvc->mmIdHelper().detectorElement_context();
214  m_idHelperSvc->mmIdHelper().get_id(hash, chId, &otCont);
215  ATH_MSG_VERBOSE(" -- mm hash " << hash << " " << m_idHelperSvc->toStringChamber(chId));
216  break;
217  } case CSC: {
218  Identifier chId;
219  IdContext otCont = m_idHelperSvc->cscIdHelper().module_context();
220  m_idHelperSvc->cscIdHelper().get_id(hash, chId, &otCont);
221  ATH_MSG_VERBOSE(" -- csc hash " << hash << " " << m_idHelperSvc->toStringChamber(chId));
222  break;
223  }
224  }
225  hashes.insert(hash);
226  }
227  }

◆ addMissingChambers()

std::unique_ptr< Trk::Track > MuonSegmentRegionRecoveryTool::addMissingChambers ( const EventContext &  ctx,
const Trk::Track track,
MuonData data,
bool  addMdt 
) const
private

Definition at line 706 of file MuonSegmentRegionRecoveryTool.cxx.

707  {
708  // states were added, create a new track
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;
714  // New Small Wheel
715  std::set<IdentifierHash> newMMHashes;
716  std::set<IdentifierHash> newsTgcHashes;
717  if (addMdt) {
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) {
721  ATH_MSG_VERBOSE("Region " << MuonStationIndex::chName(chit.first) << " size " << chit.second.size());
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;
726  for (const MdtPrepDataCollection* mit : cols) {
727  std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, track, *mit->front()->detectorElement())};
728  if (exPars) {
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);
736 
737  } else {
738  ATH_MSG_DEBUG("Did not reach chamber " << m_idHelperSvc->toStringChamber(mit->identify()) << " hash "
739  << mit->identifyHash());
740  }
741  }
742  std::vector<const MdtPrepData*>* prds = nullptr;
743  std::map<int, std::vector<const MdtPrepData*>>::iterator sectorIt = mdtPrds.begin();
744  if (mdtPrds.empty()) {
745  ATH_MSG_VERBOSE("No hits selected");
746  } else if (mdtPrds.size() == 1) {
747  prds = &sectorIt->second;
748  } else {
749  IMuonHitSummaryTool::CompactSummary hitSummary = m_hitSummaryTool->summary(track);
750  ATH_MSG_VERBOSE("Multiple sectors selected, using main sector: " << hitSummary.mainSector);
751  std::map<int, std::vector<const MdtPrepData*>>::iterator pos = mdtPrds.find(hitSummary.mainSector);
752  if (pos != mdtPrds.end())
753  prds = &pos->second;
754  else {
755  ATH_MSG_DEBUG("Failed to find prds in main sector: " << hitSummary.mainSector);
756  }
757  }
758  if (prds && exParsFirst) {
759  std::unique_ptr<Trk::SegmentCollection> segments = m_seededSegmentFinder->find(ctx, *exParsFirst, *prds);
760  if (segments) {
761  if (!segments->empty()) ATH_MSG_DEBUG("found segments " << segments->size());
762 
763  MuonSegment* bestSegment = nullptr;
764  std::unique_ptr<const Trk::TrackParameters> bestSegmentPars;
765  for (Trk::Segment* tseg : *segments) {
766  MuonSegment* mseg = dynamic_cast<MuonSegment*>(tseg);
767 
768  if (m_trackSegmentMatchingTool.empty())
769  ATH_MSG_VERBOSE("No track/segment matching");
770  else if (!m_trackSegmentMatchingTool->match(ctx, track, *mseg, true)) {
771  ATH_MSG_DEBUG(" Segment does not match with track ");
772  continue;
773  } else {
774  ATH_MSG_DEBUG(" Segment/track matched successfully using " << m_trackSegmentMatchingTool);
775  }
776  std::unique_ptr<const Trk::TrackParameters> segPars{m_extrapolator->extrapolateDirectly(
777  ctx, *exParsFirst, mseg->associatedSurface(), Trk::anyDirection, false, Trk::muon)};
778  if (segPars) {
779  double resy = mseg->localParameters()[Trk::locY] - segPars->parameters()[Trk::locY];
781  mseg->associatedSurface().globalToLocalDirection(segPars->momentum(), locDir);
782  double dangleYZ = mseg->localDirection().angleYZ() - locDir.angleYZ();
783  ATH_MSG_DEBUG("resy " << resy << " dangleYZ " << dangleYZ << " " << m_printer->print(*mseg));
784  if (std::abs(dangleYZ) < 0.05) {
785  bestSegment = mseg;
786  bestSegmentPars.swap(segPars);
787  }
788  } else {
789  ATH_MSG_DEBUG("Did not reach " << m_printer->print(*mseg));
790  }
791  }
792  if (bestSegment) {
793  for (const Trk::MeasurementBase* hit : bestSegment->containedMeasurements()) {
794  std::unique_ptr<Trk::TrackParameters> hitPars{m_extrapolator->extrapolateDirectly(
795  ctx, *bestSegmentPars, hit->associatedSurface(), Trk::anyDirection, false, Trk::muon)};
796  if (hitPars) {
797  std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern;
798  typePattern.set(Trk::TrackStateOnSurface::Measurement);
800  new Trk::TrackStateOnSurface(hit->uniqueClone(), std::move(hitPars), nullptr, typePattern);
801  states.emplace_back(tsos);
802  const MdtDriftCircleOnTrack* mdt = dynamic_cast<const MdtDriftCircleOnTrack*>(hit);
803  if (mdt) newMdtHashes.insert(mdt->collectionHash());
804  } else {
805  ATH_MSG_WARNING("Failed to extrapolate to MDT hit ");
806  }
807  }
808  }
809  }
810  }
811  }
812  data.mdtCols = std::move(newmcols);
813  } else {
814  unsigned int nstates = states.size();
815  {
816  m_seededSegmentFinder->extractRpcPrdCols(ctx, data.rpc, data.rpcCols);
817  std::vector<const RpcPrepDataCollection*> newtcols;
818  for (const RpcPrepDataCollection* rit : data.rpcCols) {
819  std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, track, *(rit)->front()->detectorElement())};
820  if (exPars) {
821  newtcols.emplace_back(rit);
822  Identifier detElId = m_idHelperSvc->detElId(rit->identify());
823  std::set<Identifier> layIds;
824  createHoleTSOSsForClusterChamber(detElId, ctx, *exPars, layIds, states);
825  if (states.size() != nstates) {
826  nstates = states.size();
827  newRpcHashes.insert(rit->identifyHash());
828  }
829  }
830  }
831  data.rpcCols = std::move(newtcols);
832  }
833  {
834  m_seededSegmentFinder->extractTgcPrdCols(ctx, data.tgc, data.tgcCols);
835  std::vector<const TgcPrepDataCollection*> newtcols;
836  for (const TgcPrepDataCollection* tgcit : data.tgcCols) {
837  std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, track, *(tgcit)->front()->detectorElement())};
838  if (exPars) {
839  newtcols.emplace_back(tgcit);
840  Identifier detElId = m_idHelperSvc->detElId(tgcit->identify());
841  std::set<Identifier> layIds;
842  createHoleTSOSsForClusterChamber(detElId, ctx, *exPars, layIds, states);
843  if (states.size() != nstates) {
844  nstates = states.size();
845  newTgcHashes.insert(tgcit->identifyHash());
846  }
847  }
848  }
849  data.tgcCols = std::move(newtcols);
850  }
851 
852  m_seededSegmentFinder->extractCscPrdCols(data.csc, data.cscCols);
853  std::vector<const CscPrepDataCollection*> newccols;
854  for (const CscPrepDataCollection* cit : data.cscCols) {
855  std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, track, *(cit)->front()->detectorElement())};
856  if (exPars) {
857  newccols.push_back(cit);
858  Identifier detElId = m_idHelperSvc->detElId(cit->identify());
859  std::set<Identifier> layIds;
860  createHoleTSOSsForClusterChamber(detElId, ctx, *exPars, layIds, states);
861  if (states.size() != nstates) {
862  nstates = states.size();
863  newCscHashes.insert(cit->identifyHash());
864  }
865  }
866  }
867  data.cscCols = std::move(newccols);
868 
869  nstates = states.size();
870  if (m_recoverSTGC) {
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());
874  for (const sTgcPrepDataCollection* stgcit : data.stgcCols) {
875  std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, track, *(stgcit)->front()->detectorElement())};
876  if (exPars) {
877  newstcols.push_back(stgcit);
878  Identifier detElId = m_idHelperSvc->detElId(stgcit->identify());
879  std::set<Identifier> layIds;
880  createHoleTSOSsForClusterChamber(detElId, ctx, *exPars, layIds, states);
881  ATH_MSG_DEBUG("Collected new sTgc states: " << states.size());
882  if (states.size() != nstates) {
883  nstates = states.size();
884  newsTgcHashes.insert(stgcit->identifyHash());
885  }
886  }
887  }
888  data.stgcCols = std::move(newstcols);
889  }
890 
891  if (m_recoverMM) {
892  m_seededSegmentFinder->extractMMPrdCols(data.mm, data.mmCols);
893  ATH_MSG_DEBUG(" extractMMPrdCols data.mmCols.size() " << data.mmCols.size());
894  std::vector<const MMPrepDataCollection*> newmcols;
895  for (const MMPrepDataCollection* mit : data.mmCols) {
896  std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, track, *mit->front()->detectorElement())};
897  if (exPars) {
898  newmcols.push_back(mit);
899  Identifier detElId = m_idHelperSvc->detElId(mit->identify());
900  std::set<Identifier> layIds;
901  createHoleTSOSsForClusterChamber(detElId, ctx, *exPars, layIds, states);
902  ATH_MSG_DEBUG("Collected new Mm states: " << states.size());
903  if (states.size() != nstates) {
904  nstates = states.size();
905  newMMHashes.insert(mit->identifyHash());
906  }
907  }
908  }
909  data.mmCols = std::move(newmcols);
910  }
911  }
912  if (!states.empty()) {
913  ATH_MSG_DEBUG("Collected new states: " << states.size());
914 
915  const Trk::TrackStates* oldStates = track.trackStateOnSurfaces();
916  if (!oldStates) {
917  ATH_MSG_WARNING(" track without states, cannot perform cleaning ");
918  return nullptr;
919  }
920 
921  ATH_MSG_DEBUG("Copying old TSOSs " << oldStates->size());
922  for (const Trk::TrackStateOnSurface* tsit : *oldStates) states.emplace_back(tsit->clone());
923 
924  std::stable_sort(states.begin(), states.end(), SortTSOSs(m_edmHelperSvc.get(), m_idHelperSvc.get()));
925  ATH_MSG_DEBUG("Filling DataVector with TSOSs " << states.size());
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()); }
929  ATH_MSG_DEBUG("Creating new Track " << states.size());
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;
933  if (m_onlyEO)
934  refittedTrack = std::unique_ptr<Trk::Track>(m_fitter->fit(ctx, *newTrack, m_useFitterOutlierLogic, Trk::muon));
935  else
936  refittedTrack = std::unique_ptr<Trk::Track>(m_builder->fit(ctx, *newTrack, m_useFitterOutlierLogic, Trk::muon));
937  if (refittedTrack) {
938  ATH_MSG_DEBUG("New Track " << m_printer->print(*refittedTrack) << std::endl << m_printer->printStations(*refittedTrack));
939 
940  // fit ok, add new hashs to lists
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());
945  // New Small Wheel
946  data.stgcTrack.insert(newsTgcHashes.begin(), newsTgcHashes.end());
947  data.mmTrack.insert(newMMHashes.begin(), newMMHashes.end());
948  }
949  return refittedTrack;
950  }
951  return nullptr;
952  }

◆ collectCrossedChambers()

void MuonSegmentRegionRecoveryTool::collectCrossedChambers ( const EventContext &  ctx,
const Trk::Track track,
MuonSegmentRegionRecoveryTool::MuonData data 
) const
private

methods used by recover

Definition at line 229 of file MuonSegmentRegionRecoveryTool.cxx.

230  {
231  ATH_MSG_VERBOSE(" Collecting all crossed chambers");
232 
233  const Trk::TrackStates* states = track.trackStateOnSurfaces();
234  if (!states) {
235  ATH_MSG_WARNING(" track without states, cannot perform cleaning ");
236  return;
237  }
238 
239  std::set<MuonStationIndex::StIndex> stations;
240  double etamin{1e9}, etamax{-1e9}, phimin{1e9}, phimax{-1e9};
241  // loop over TSOSs
243  Trk::TrackStates::const_iterator tsit_end = states->end();
244 
245  for (; tsit != tsit_end; ++tsit) {
246  const Trk::TrackParameters* pars = (*tsit)->trackParameters();
247  if (!pars) continue;
248 
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();
254  if (msgLvl(MSG::DEBUG)) {
255  msg() << "All State parameters: eta: " << eta << " ,phi: " << phi << " pos r " << rpos << " z " << zpos;
256  if (pars->covariance()) msg() << MSG::DEBUG << " extrapolation error " << Amg::error(*pars->covariance(), Trk::locX);
257  msg() << endmsg;
258  }
259 
260  // check whether state is a measurement
261  const Trk::MeasurementBase* meas = (*tsit)->measurementOnTrack();
262  if (!meas) continue;
263 
264  Identifier id = m_edmHelperSvc->getIdentifier(*meas);
265  bool pseudo = !id.is_valid();
266 
267  if (pseudo || !m_idHelperSvc->mdtIdHelper().is_muon(id)) continue;
268 
269  if (eta > etamax) etamax = eta;
270  if (eta < etamin) etamin = eta;
271  if (phi > phimax) phimax = phi;
272  if (phi < phimin) phimin = phi;
273  if (msgLvl(MSG::DEBUG)) {
274  msg() << "Selected State parameters: eta: " << eta << " ,phi: " << phi << " pos r " << rpos << " z " << zpos;
275  if (pars->covariance()) msg() << MSG::DEBUG << " extrapolation error " << Amg::error(*pars->covariance(), Trk::locX);
276  msg() << endmsg;
277  }
278 
279  MuonStationIndex::StIndex stIndex = m_idHelperSvc->stationIndex(id);
280  if (stations.count(stIndex)) continue;
281  stations.insert(stIndex);
282 
283  // At each station launch the Reg Sel and stuff the Id hashes in a vector
284  }
285  etamin -= m_deta;
286  etamax += m_deta;
287  phimin -= m_dphi;
288  phimax += m_dphi;
289 
290  ATH_MSG_DEBUG("Eta range: " << etamin << " " << etamax << " Phi range " << phimin << " " << phimax);
291  if (etamin > etamax) { // something went wrong with the fit and no hits were selected in the loop
292  ATH_MSG_DEBUG("no hits selected, nothing further will be done");
293  return;
294  }
295 
296  RoiDescriptor roi(etamin, etamax, phimin, phimax);
297 
298  if (m_idHelperSvc->hasMDT()) addHashes( ctx, TechnologyIndex::MDT, roi, data.mdt, data.mdtTrack);
299  if (m_idHelperSvc->hasRPC()) addHashes( ctx, TechnologyIndex::RPC, roi, data.rpc, data.rpcTrack);
300  if (m_idHelperSvc->hasTGC()) addHashes( ctx, TechnologyIndex::TGC, roi, data.tgc, data.tgcTrack);
301  if (m_regsel_csc.isEnabled()) addHashes( ctx, TechnologyIndex::CSC, roi, data.csc, data.cscTrack);
302  if (m_recoverSTGC) addHashes( ctx, TechnologyIndex::STGC, roi, data.stgc, data.stgcTrack);
303  if (m_recoverMM) addHashes( ctx, TechnologyIndex::MM, roi, data.mm, data.mmTrack);
304 
305  std::set<IdentifierHash>::iterator hsit = data.mdt.begin();
306  std::set<IdentifierHash>::iterator hsit_end = data.mdt.end();
307  for (; hsit != hsit_end; ++hsit) {
308  Identifier chId;
309  IdContext otCont = m_idHelperSvc->mdtIdHelper().module_context();
310  m_idHelperSvc->mdtIdHelper().get_id(*hsit, chId, &otCont);
311  MuonStationIndex::ChIndex chIndex = m_idHelperSvc->chamberIndex(chId);
312  data.mdtPerStation[chIndex].insert(*hsit);
313  ATH_MSG_VERBOSE(" chamberlayer " << MuonStationIndex::chName(chIndex) << " " << m_idHelperSvc->toStringChamber(chId));
314  }
315  hsit = data.csc.begin();
316  hsit_end = data.csc.end();
317  for (; hsit != hsit_end; ++hsit) {
318  Identifier chId;
319  IdContext otCont = m_idHelperSvc->cscIdHelper().module_context();
320  m_idHelperSvc->cscIdHelper().get_id(*hsit, chId, &otCont);
321  chId = m_idHelperSvc->chamberId(chId);
322  MuonStationIndex::ChIndex chIndex = m_idHelperSvc->chamberIndex(chId);
323  ATH_MSG_VERBOSE(" chamberlayer " << MuonStationIndex::chName(chIndex) << " " << m_idHelperSvc->toString(chId));
324  }
325  }

◆ createHoleTSOSsForClusterChamber()

void MuonSegmentRegionRecoveryTool::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 at line 86 of file MuonSegmentRegionRecoveryTool.cxx.

88  {
89  m_chamberHoleRecoveryTool->createHoleTSOSsForClusterChamber(detElId, ctx, pars, layIds, states);
90  }

◆ fillOnTrackChambers()

void MuonSegmentRegionRecoveryTool::fillOnTrackChambers ( const Trk::Track theTrack,
MuonData data 
) const
private

Definition at line 327 of file MuonSegmentRegionRecoveryTool.cxx.

327  {
328  ATH_MSG_VERBOSE(" making set of already-on-track chambers");
329 
330  // Collect track PRD's
331  const Trk::TrackStates* states = track.trackStateOnSurfaces();
332  if (!states) {
333  ATH_MSG_WARNING(" track without states, cannot perform cleaning ");
334  return;
335  }
336 
337  std::set<MuonStationIndex::StIndex> stations;
338 
339  // loop over TSOSs
341  Trk::TrackStates::const_iterator tsit_end = states->end();
342  for (; tsit != tsit_end; ++tsit) {
343  const Trk::TrackParameters* pars = (*tsit)->trackParameters();
344  if (!pars) continue;
345 
346  // check whether state is a measurement
347  const Trk::MeasurementBase* meas = (*tsit)->measurementOnTrack();
348  if (!meas) continue;
349 
350  const Muon::MdtDriftCircleOnTrack* mdt = dynamic_cast<const Muon::MdtDriftCircleOnTrack*>(meas);
351  if (mdt && !data.mdtTrack.count(mdt->collectionHash())) {
352  data.mdtTrack.insert(mdt->collectionHash());
353  ATH_MSG_VERBOSE("Adding " << m_idHelperSvc->toStringChamber(mdt->identify()) << " hash " << mdt->collectionHash());
354  continue;
355  }
356 
357  const MuonClusterOnTrack* clus = nullptr;
358  const CompetingMuonClustersOnTrack* compRot = dynamic_cast<const CompetingMuonClustersOnTrack*>(meas);
359  if (compRot) {
360  clus = &compRot->rioOnTrack(0);
361  } else {
362  clus = dynamic_cast<const MuonClusterOnTrack*>(meas);
363  }
364  if (!clus) continue;
365 
366  const RpcClusterOnTrack* rpc = dynamic_cast<const RpcClusterOnTrack*>(clus);
367  if (rpc && !data.rpcTrack.count(rpc->collectionHash())) {
368  data.rpcTrack.insert(rpc->collectionHash());
369  ATH_MSG_VERBOSE("Adding " << m_idHelperSvc->toStringChamber(clus->identify()) << " hash " << clus->collectionHash());
370  continue;
371  }
372  const TgcClusterOnTrack* tgc = dynamic_cast<const TgcClusterOnTrack*>(clus);
373  if (tgc && !data.tgcTrack.count(tgc->collectionHash())) {
374  data.tgcTrack.insert(tgc->collectionHash());
375  ATH_MSG_VERBOSE("Adding " << m_idHelperSvc->toStringChamber(clus->identify()) << " hash " << clus->collectionHash());
376  continue;
377  }
378  const CscClusterOnTrack* csc = dynamic_cast<const CscClusterOnTrack*>(clus);
379  if (csc && !data.cscTrack.count(csc->collectionHash())) {
380  data.cscTrack.insert(csc->collectionHash());
381  ATH_MSG_VERBOSE("Adding " << m_idHelperSvc->toStringChamber(clus->identify()) << " hash " << clus->collectionHash());
382  continue;
383  }
384  // New Small Wheel
385  const sTgcClusterOnTrack* stgc = dynamic_cast<const sTgcClusterOnTrack*>(clus);
386  if (stgc && !data.stgcTrack.count(stgc->collectionHash())) {
387  data.stgcTrack.insert(stgc->collectionHash());
388  ATH_MSG_VERBOSE("Adding " << m_idHelperSvc->toStringChamber(clus->identify()) << " hash " << clus->collectionHash());
389  continue;
390  }
391  const MMClusterOnTrack* mm = dynamic_cast<const MMClusterOnTrack*>(clus);
392  if (mm && !data.mmTrack.count(mm->collectionHash())) {
393  data.mmTrack.insert(mm->collectionHash());
394  ATH_MSG_VERBOSE("Adding " << m_idHelperSvc->toStringChamber(clus->identify()) << " hash " << clus->collectionHash());
395  continue;
396  }
397  }
398  }

◆ findHoles()

std::unique_ptr< Trk::Track > MuonSegmentRegionRecoveryTool::findHoles ( const EventContext &  ctx,
const Trk::Track track,
MuonData data 
) const
private

Definition at line 400 of file MuonSegmentRegionRecoveryTool.cxx.

401  {
402  const Trk::TrackStates* oldStates = track.trackStateOnSurfaces();
403  if (!oldStates) {
404  ATH_MSG_WARNING(" track without states, cannot perform mdt hole search ");
405  return nullptr;
406  }
407 
409  if (!InterSectSvc.isValid()) {
410  ATH_MSG_ERROR("Failed to retrieve chamber intersection service");
411  return nullptr;
412  }
413 
415  const MuonGM::MuonDetectorManager* MuonDetMgr = detMgr.cptr();
416 
417  std::vector<std::unique_ptr<const Trk::TrackStateOnSurface>> states;
418  unsigned int nholes = 0;
419  std::set<Identifier> chambersInSearch;
420  for (const IdentifierHash& ith : data.mdt) {
421  // ignore hashes already on track
422  if (data.mdtTrack.count(ith)) {
423  ATH_MSG_VERBOSE("Chamber already on track " << ith);
424  continue;
425  }
426  Identifier chId;
427  IdContext otCont = m_idHelperSvc->mdtIdHelper().module_context();
428  m_idHelperSvc->mdtIdHelper().get_id(ith, chId, &otCont);
429 
430  // ignore chambers that already had a hole search
431  if (chambersInSearch.count(chId)) {
432  ATH_MSG_VERBOSE("Chamber already on track " << ith << " " << m_idHelperSvc->toStringChamber(chId));
433  continue;
434  }
435  const MuonGM::MdtReadoutElement* detEl = MuonDetMgr->getMdtReadoutElement(chId);
436  if (!detEl) {
437  ATH_MSG_WARNING("Found no detector element for " << ith);
438  continue;
439  }
440  std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, track, *detEl, true)};
441  if (!exPars) {
442  ATH_MSG_DEBUG("Did not reach " << m_idHelperSvc->toStringChamber(chId) << " hash " << ith);
443  continue;
444  }
445  ATH_MSG_DEBUG("Reached " << m_idHelperSvc->toStringChamber(chId) << " hash " << ith);
446 
447  // calculate crossed tubes
448  const MuonStationIntersect intersect = InterSectSvc->tubesCrossedByTrack(MuonDetMgr, chId, exPars->position(), exPars->momentum().unit());
449 
450  // clear hole vector
451  for (unsigned int ii = 0; ii < intersect.tubeIntersects().size(); ++ii) {
452  const MuonTubeIntersect& tint = intersect.tubeIntersects()[ii];
453  const Identifier& id = tint.tubeId;
454  const MuonGM::MdtReadoutElement* detElLoc = MuonDetMgr->getMdtReadoutElement(id);
455 
456  // addition skip for cases when the track crosses inbetween two chambers
457  if (data.mdtTrack.count(detElLoc->identifyHash())) continue;
458 
459  Identifier ch = m_idHelperSvc->chamberId(id);
460  chambersInSearch.insert(ch);
461 
462  const Trk::Surface& surf = detElLoc->surface(id);
463  std::unique_ptr<Trk::TrackParameters> tubePars{
464  m_extrapolator->extrapolateDirectly(ctx, *exPars, surf, Trk::anyDirection, false, Trk::muon)};
465  if (!tubePars) {
466  ATH_MSG_WARNING("Failed to extrapolate to tube " << m_idHelperSvc->toString(id));
467  continue;
468  }
469  int lay = m_idHelperSvc->mdtIdHelper().tubeLayer(id);
470  int tube = m_idHelperSvc->mdtIdHelper().tube(id);
471  double tubeLen = detElLoc->getActiveTubeLength(lay, tube);
472  double distEdge = std::abs(tubePars->parameters()[Trk::locZ]) - 0.5 * tubeLen;
473  double pullEdge = tubePars->covariance() && Amg::hasPositiveDiagElems(*tubePars->covariance())
474  ? distEdge / Amg::error(*tubePars->covariance(), Trk::locZ)
475  : distEdge / 20.;
476  std::optional<Amg::Vector2D> locPos = surf.Trk::Surface::globalToLocal(tubePars->position());
477 
478  bool inBounds = false;
479  if (locPos) {
480  // perform bound check do not count holes with 100. mm of bound edge
481  inBounds = surf.bounds().insideLoc2(*locPos, -100.) && std::abs((*locPos)[Trk::locR]) <= detElLoc->innerTubeRadius();
482  }
483  if (!inBounds) {
484  ATH_MSG_VERBOSE(" discarding hole " << m_idHelperSvc->toString(id) << " dist wire " << tubePars->parameters()[Trk::locR]
485  << " outside bounds ");
486  continue;
487  }
488  ATH_MSG_VERBOSE(" new hole " << m_idHelperSvc->toString(id) << " dist wire " << tubePars->parameters()[Trk::locR]
489  << " dist tube edge " << distEdge << " pullEdge " << pullEdge);
490  ++nholes;
491  std::unique_ptr<Trk::TrackStateOnSurface> tsos = MuonTSOSHelper::createHoleTSOS(std::move(tubePars));
492  states.emplace_back(std::move(tsos));
493  }
494  if (!nholes) ATH_MSG_DEBUG("found holes " << nholes);
495  }
496 
497  for (const IdentifierHash& ith : data.csc) {
498  // ignore hashes already on track
499  if (data.cscTrack.count(ith)) {
500  ATH_MSG_VERBOSE("Chamber already on track " << ith);
501  continue;
502  }
503  Identifier chId;
504  IdContext otCont = m_idHelperSvc->cscIdHelper().module_context();
505  m_idHelperSvc->cscIdHelper().get_id(ith, chId, &otCont);
506  chId = m_idHelperSvc->chamberId(chId);
507 
508  const MuonGM::CscReadoutElement* detEl = MuonDetMgr->getCscReadoutElement(chId);
509  if (!detEl) {
510  ATH_MSG_WARNING("Found no detector element for " << ith << " " << m_idHelperSvc->toString(chId));
511  continue;
512  }
513 
514  std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, track, *detEl, true)};
515  if (!exPars) {
516  ATH_MSG_DEBUG("Did not reach " << m_idHelperSvc->toStringChamber(chId) << " hash " << ith);
517  continue;
518  }
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());
524 
525  for (std::unique_ptr<const Trk::TrackStateOnSurface>& cscit : cscstates) {
526  ATH_MSG_VERBOSE("Adding " << cscit.get());
527  states.emplace_back(std::move(cscit));
528  }
529  }
530  for (const IdentifierHash& ith : data.tgc) {
531  // ignore hashes already on track
532  if (data.tgcTrack.count(ith)) {
533  ATH_MSG_VERBOSE("Chamber already on track " << ith);
534  continue;
535  }
536  Identifier chId;
537  IdContext otCont = m_idHelperSvc->tgcIdHelper().module_context();
538  m_idHelperSvc->tgcIdHelper().get_id(ith, chId, &otCont);
539  chId = m_idHelperSvc->chamberId(chId);
540 
541  const MuonGM::TgcReadoutElement* detEl = MuonDetMgr->getTgcReadoutElement(chId);
542  if (!detEl) {
543  ATH_MSG_WARNING("Found no detector element for " << ith << " " << m_idHelperSvc->toString(chId));
544  continue;
545  }
546 
547  std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, track, *detEl, true)};
548  if (!exPars) {
549  ATH_MSG_DEBUG("Did not reach " << m_idHelperSvc->toStringChamber(chId) << " hash " << ith);
550  continue;
551  }
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());
557 
558  for (std::unique_ptr<const Trk::TrackStateOnSurface>& tgcit : tgcstates) {
559  ATH_MSG_VERBOSE("Adding " << tgcit.get());
560  states.emplace_back(std::move(tgcit));
561  }
562  }
563 
564  for (const IdentifierHash& ith : data.rpc) {
565  // ignore hashes already on track
566  if (data.rpcTrack.count(ith)) {
567  ATH_MSG_VERBOSE("Chamber already on track " << ith);
568  continue;
569  }
570  Identifier chId;
571  IdContext otCont = m_idHelperSvc->rpcIdHelper().module_context();
572  m_idHelperSvc->rpcIdHelper().get_id(ith, chId, &otCont);
573  chId = m_idHelperSvc->chamberId(chId);
574 
575  const MuonGM::RpcReadoutElement* detEl = MuonDetMgr->getRpcReadoutElement(chId);
576  if (!detEl) {
577  ATH_MSG_WARNING("Found no detector element for " << ith << " " << m_idHelperSvc->toString(chId));
578  continue;
579  }
580 
581  std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, track, *detEl, true)};
582  if (!exPars) {
583  ATH_MSG_DEBUG("Did not reach " << m_idHelperSvc->toStringChamber(chId) << " hash " << ith);
584  continue;
585  }
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());
591 
592  for (std::unique_ptr<const Trk::TrackStateOnSurface>& rpcit : rpcstates) {
593  ATH_MSG_VERBOSE("Adding " << rpcit.get());
594  states.emplace_back(std::move(rpcit));
595  }
596  }
597 
598  // New Small Wheel
599  // sTGC
600  for (const IdentifierHash& ith : data.stgc) {
601  // ignore hashes already on track
602  if (data.stgcTrack.count(ith)) {
603  ATH_MSG_VERBOSE("Chamber already on track " << ith);
604  continue;
605  }
606  Identifier chId;
607  IdContext otCont = m_idHelperSvc->stgcIdHelper().module_context();
608  m_idHelperSvc->stgcIdHelper().get_id(ith, chId, &otCont);
609 
610  if (!chId.is_valid()) {
611  ATH_MSG_VERBOSE("invalid chId for stgc data " << ith);
612  continue;
613  }
614 
615  chId = m_idHelperSvc->chamberId(chId);
616 
617  const MuonGM::sTgcReadoutElement* detEl = MuonDetMgr->getsTgcReadoutElement(chId);
618  if (!detEl) {
619  ATH_MSG_WARNING("Found no detector element for " << ith << " " << m_idHelperSvc->toString(chId));
620  continue;
621  }
622 
623  std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, track, *detEl, true)};
624  if (!exPars) {
625  ATH_MSG_DEBUG("Did not reach " << m_idHelperSvc->toStringChamber(chId) << " hash " << ith);
626  continue;
627  }
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());
633 
634  for (std::unique_ptr<const Trk::TrackStateOnSurface>& stgcit : stgcstates) {
635  ATH_MSG_VERBOSE("Adding " << stgcit.get());
636  states.push_back(std::move(stgcit));
637  }
638  }
639 
640  // MM
641  for (const IdentifierHash& ith : data.mm) {
642  // ignore hashes already on track
643  if (data.mmTrack.count(ith)) {
644  ATH_MSG_VERBOSE("Chamber already on track " << ith);
645  continue;
646  }
647  Identifier chId;
648  IdContext otCont = m_idHelperSvc->mmIdHelper().module_context();
649  m_idHelperSvc->mmIdHelper().get_id(ith, chId, &otCont);
650 
651  if (!chId.is_valid()) {
652  ATH_MSG_VERBOSE("invalid chId for mm data " << ith);
653  continue;
654  }
655 
656  chId = m_idHelperSvc->chamberId(chId);
657 
658  const MuonGM::MMReadoutElement* detEl = MuonDetMgr->getMMReadoutElement(chId);
659  if (!detEl) {
660  ATH_MSG_WARNING("Found no detector element for " << ith << " " << m_idHelperSvc->toString(chId));
661  continue;
662  }
663 
664  std::unique_ptr<const Trk::TrackParameters> exPars{reachableDetEl(ctx, track, *detEl, true)};
665  if (!exPars) {
666  ATH_MSG_DEBUG("Did not reach " << m_idHelperSvc->toStringChamber(chId) << " hash " << ith);
667  continue;
668  }
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());
674 
675  for (std::unique_ptr<const Trk::TrackStateOnSurface>& mmit : mmstates) {
676  ATH_MSG_VERBOSE("Adding " << mmit.get());
677  states.emplace_back(std::move(mmit));
678  }
679  }
680  if (!states.empty()) {
681  // states were added, create a new track
682  auto trackStateOnSurfaces = std::make_unique<Trk::TrackStates>();
683  trackStateOnSurfaces->reserve(oldStates->size() + states.size());
684 
685  std::vector<std::unique_ptr<const Trk::TrackStateOnSurface>> toBeSorted;
686  toBeSorted.reserve(oldStates->size() + states.size());
687 
688  for (const Trk::TrackStateOnSurface* sit : *oldStates) toBeSorted.emplace_back(sit->clone());
689 
690  for (std::unique_ptr<const Trk::TrackStateOnSurface>& stit : states) toBeSorted.emplace_back(std::move(stit));
691 
692  std::stable_sort(toBeSorted.begin(), toBeSorted.end(), SortTSOSs(&*m_edmHelperSvc, &*m_idHelperSvc));
693 
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);
697  // generate a track summary for this track
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;
702  }
703  return nullptr;
704  }

◆ initialize()

StatusCode MuonSegmentRegionRecoveryTool::initialize ( )
overridevirtual

AlgTool initialize.

Old chamber technologies

Definition at line 49 of file MuonSegmentRegionRecoveryTool.cxx.

49  {
50  ATH_CHECK(m_edmHelperSvc.retrieve());
53  ATH_CHECK(m_printer.retrieve());
54  ATH_CHECK(m_seededSegmentFinder.retrieve());
55 
56  if (!m_trackSegmentMatchingTool.empty()) {
58  ATH_MSG_INFO("Using matching tool " << m_trackSegmentMatchingTool);
59  } else {
60  ATH_MSG_DEBUG("No matching tool selected ");
61  }
62 
64  ATH_CHECK(m_extrapolator.retrieve());
65  if (m_onlyEO) {
66  ATH_CHECK(m_fitter.retrieve());
67  m_builder.disable();
68  } else {
69  m_fitter.disable();
70  ATH_CHECK(m_builder.retrieve());
71  }
72  ATH_CHECK(m_idHelperSvc.retrieve());
73  ATH_CHECK(m_hitSummaryTool.retrieve());
75  ATH_CHECK(m_regsel_mdt.retrieve());
76  ATH_CHECK(m_regsel_rpc.retrieve());
77  ATH_CHECK(m_regsel_tgc.retrieve());
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;
84  }

◆ reachableDetEl()

std::unique_ptr< const Trk::TrackParameters > MuonSegmentRegionRecoveryTool::reachableDetEl ( const EventContext &  ctx,
const Trk::Track track,
const Trk::TrkDetElementBase detEl,
bool  smallerBounds = false 
) const
private

Definition at line 954 of file MuonSegmentRegionRecoveryTool.cxx.

957  {
958  ATH_MSG_VERBOSE("reachableDetEl() " << m_idHelperSvc->toStringDetEl(detEl.identify()) << " at " << detEl.center());
959  std::unique_ptr<const Trk::TrackParameters> exPars;
960  std::unique_ptr<const Trk::TrackParameters> closest{MuonGetClosestParameters::closestParameters(track, detEl.surface(), true)};
961  if (closest) {
962  ATH_MSG_VERBOSE("Extrapolating from closest point:\n" << m_printer->print(*closest));
963  exPars = m_extrapolator->extrapolateDirectly(ctx, *closest, detEl.surface(), Trk::anyDirection, false, Trk::muon);
964 
965  } else {
966  ATH_MSG_VERBOSE("Extrapolating from track (no closest point found):\n" << m_printer->print(track));
967  exPars = m_extrapolator->extrapolateTrack(ctx, track, detEl.surface(), Trk::anyDirection, false, Trk::muon);
968  }
969  if (!exPars) {
970  ATH_MSG_DEBUG("Extrapolation did not succeed");
971  return nullptr;
972  }
973  Amg::Vector2D locPos(exPars->parameters()[Trk::locX], exPars->parameters()[Trk::locY]);
974 
975  double tolx = 100.; // positive -> large surface
976  double toly = 100.; // positive -> large surface
977  const AmgSymMatrix(5)* errMat = exPars->covariance();
978  if (errMat) {
979  ATH_MSG_VERBOSE("Extrapolated local Position & Error matrix\n:" << locPos << "\n" << Amg::toString(*errMat));
980  // MJW check validity of errors before using them (fix for bug #82920)
981  double covx = (*errMat)(Trk::locX, Trk::locX);
982  double covy = (*errMat)(Trk::locY, Trk::locY);
983  if (covx > 0.0 && covy > 0.0) {
984  tolx = 3 * covx;
985  toly = 3 * covy;
986  }
987  }
988 
989  // in case we are looking for holes, only ignore stations if we are within 100 mm of the chamber edge
990  // all other holes are counted even if the extrapolation errors are large.
991  if (smallerBounds) {
992  if (tolx > 10.) tolx = 10.;
993  if (toly > 10.) toly = 10.;
994  // refer sign to check 'inside' the bounds
995  tolx *= -1.;
996  toly *= -1.;
997  }
998  bool inbounds = detEl.surface().insideBounds(locPos, tolx, toly);
999  if (msgLvl(MSG::DEBUG)) {
1000  std::ostringstream parsType;
1001  parsType << "pos=(" << locPos[Trk::locX] << "," << locPos[Trk::locY] << ")";
1002  if (errMat) { parsType << " exError=(" << Amg::error(*errMat, Trk::locX) << "," << Amg::error(*errMat, Trk::locY) << ")"; }
1003  parsType << " tolerance=(" << tolx << "," << toly << ")";
1004  if (inbounds)
1005  parsType << " => inbounds";
1006  else
1007  parsType << " => outbounds";
1008  ATH_MSG_DEBUG(" " << m_idHelperSvc->toStringChamber(detEl.identify()) << " pars " << parsType.str());
1009  }
1010  if (!inbounds) { return nullptr; }
1011  return exPars;
1012  }

◆ recover()

std::unique_ptr< Trk::Track > MuonSegmentRegionRecoveryTool::recover ( const Trk::Track track,
const EventContext &  ctx 
) const
overridevirtual

returns a new track with segments recovered using RegionSelector

Algorithmic part Strategy: 1) Extrapolate back to MS entry record 2) Collect hashes of chambers close to where the track passed 3) Compare collected Hashes with the ones already on track 4) Recover segments on the missing chambers by launching the SeededSegmentFinder.

2) Collect hashes of chambers close to where the track passed 2a) Extrapolate forward to the next station 2b) Launch selector to get IDHashes 2c) push_back hashes for this station into a set 2d) stop where outer layers are 2e) the outcome of all of this is a std::set of collected hashes (some are already on the track, no need to recover)

Definition at line 99 of file MuonSegmentRegionRecoveryTool.cxx.

99  {
100  // Welcome into the implementation of the recovery method
101  ATH_MSG_VERBOSE(" Entering segment recovery method " << m_printer->print(track) << std::endl << m_printer->printStations(track));
102 
103  // First run the MuonChamberHoleRecoveryTool on the input track
104  std::unique_ptr<Trk::Track> chRecTrack(m_chamberHoleRecoveryTool->recover(track, ctx));
105  if (!chRecTrack) {
106  ATH_MSG_DEBUG(" MuonChamberHoleRecoveryTool failed to create a new track "
107  << " Returning input (unrecovered) track ");
108  return std::make_unique<Trk::Track>(track);
109  }
110  ATH_MSG_VERBOSE(" After chamber hole recovery " << m_printer->print(*chRecTrack) << std::endl
111  << m_printer->printStations(*chRecTrack));
112  // only run this on single station EM tracks
113  if (m_onlyEO) {
114  // should be a sl track
115  // using release until parent tools use unique_ptr
116  if (!m_edmHelperSvc->isSLTrack(*chRecTrack)) return chRecTrack;
117 
118  // get hit summary
119  IMuonHitSummaryTool::CompactSummary hitSummary = m_hitSummaryTool->summary(*chRecTrack);
120  // should be single station
121  // using release until parent tools use unique_ptr
122  if (hitSummary.stationLayers.size() != 1 || !hitSummary.stationLayers.count(StIndex::EM)) return chRecTrack;
123  ATH_MSG_DEBUG("Single station track, checking for EO hits");
124  }
125 
126  // 1) Extrapolate back to MS entry record
127  // const Trk::TrackParameters* msEntryPars = goToMSEntryRecord( *chRecTrack );
128  // if(!msEntryPars) return chRecTrack;
129 
138  MuonData muonData;
139  // extract the hashes already on track
140  fillOnTrackChambers(*chRecTrack, muonData);
141 
142  // collect the hashes not in track close to the track
143  collectCrossedChambers( ctx, *chRecTrack, muonData);
144 
145  // 3b) compare the two std::sets and make a final std::set of not-yet-on-track Hashes
146  std::unique_ptr<Trk::Track> triggerRecTrack = addMissingChambers(ctx, *chRecTrack, muonData, false);
147  if (triggerRecTrack) chRecTrack.swap(triggerRecTrack);
148 
149  std::unique_ptr<Trk::Track> mdtRecTrack = addMissingChambers(ctx, *chRecTrack, muonData, true);
150  if (mdtRecTrack) chRecTrack.swap(mdtRecTrack);
151 
152  std::unique_ptr<Trk::Track> mdtRecTrackWithHoles = findHoles(ctx, *chRecTrack, muonData);
153  if (mdtRecTrackWithHoles) chRecTrack.swap(mdtRecTrackWithHoles);
154 
155  // recovered track, success!
156  // use release until calling tools also use unique_ptr
157  return chRecTrack;
158  }

Member Data Documentation

◆ m_builder

ToolHandle<Rec::ICombinedMuonTrackFitter> Muon::MuonSegmentRegionRecoveryTool::m_builder {this, "Builder", ""}
private

Definition at line 139 of file MuonSegmentRegionRecoveryTool.h.

◆ m_chamberGeoKey

SG::ReadCondHandleKey<Muon::MuonIntersectGeoData> Muon::MuonSegmentRegionRecoveryTool::m_chamberGeoKey {this, "ChamberGeoKey", "MuonStationIntersects", "Pointer to hole search service"}
private

Definition at line 151 of file MuonSegmentRegionRecoveryTool.h.

◆ m_chamberHoleRecoveryTool

ToolHandle<MuonChamberHoleRecoveryTool> Muon::MuonSegmentRegionRecoveryTool::m_chamberHoleRecoveryTool {this, "ChamberHoleRecoveryTool", "", "hit-based hole search"}
private

Definition at line 137 of file MuonSegmentRegionRecoveryTool.h.

◆ m_deta

Gaudi::Property<double> Muon::MuonSegmentRegionRecoveryTool::m_deta {this, "DeltaEtaRegion", 0.05}
private

Definition at line 156 of file MuonSegmentRegionRecoveryTool.h.

◆ m_DetectorManagerKey

SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> Muon::MuonSegmentRegionRecoveryTool::m_DetectorManagerKey
private
Initial value:
{this, "DetectorManagerKey", "MuonDetectorManager",
"Key of input MuonDetectorManager condition data"}

Definition at line 152 of file MuonSegmentRegionRecoveryTool.h.

◆ m_dphi

Gaudi::Property<double> Muon::MuonSegmentRegionRecoveryTool::m_dphi {this, "DeltaPhiRegion", 0.1}
private

Definition at line 157 of file MuonSegmentRegionRecoveryTool.h.

◆ m_edmHelperSvc

ServiceHandle<IMuonEDMHelperSvc> Muon::MuonSegmentRegionRecoveryTool::m_edmHelperSvc
private
Initial value:
{this, "edmHelper", "Muon::MuonEDMHelperSvc/MuonEDMHelperSvc",
"Handle to the service providing the IMuonEDMHelperSvc interface"}

Definition at line 127 of file MuonSegmentRegionRecoveryTool.h.

◆ m_excludeEES

Gaudi::Property<bool> Muon::MuonSegmentRegionRecoveryTool::m_excludeEES {this, "ExcludeEES", true}
private

Definition at line 158 of file MuonSegmentRegionRecoveryTool.h.

◆ m_extrapolator

ToolHandle<Trk::IExtrapolator> Muon::MuonSegmentRegionRecoveryTool::m_extrapolator {this, "Extrapolator", "Trk::Extrapolator/MuonExtrapolator"}
private

Definition at line 138 of file MuonSegmentRegionRecoveryTool.h.

◆ m_fitter

ToolHandle<Trk::ITrackFitter> Muon::MuonSegmentRegionRecoveryTool::m_fitter {this, "Fitter", "Trk::GlobalChi2Fitter/MCTBSLFitter"}
private

Definition at line 140 of file MuonSegmentRegionRecoveryTool.h.

◆ m_hitSummaryTool

ToolHandle<IMuonHitSummaryTool> Muon::MuonSegmentRegionRecoveryTool::m_hitSummaryTool {this, "HitSummaryTool", "Muon::MuonHitSummaryTool/MuonHitSummaryTool"}
private

Definition at line 141 of file MuonSegmentRegionRecoveryTool.h.

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> Muon::MuonSegmentRegionRecoveryTool::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 130 of file MuonSegmentRegionRecoveryTool.h.

◆ m_onlyEO

Gaudi::Property<bool> Muon::MuonSegmentRegionRecoveryTool::m_onlyEO {this, "OnlyEO", false}
private

Definition at line 159 of file MuonSegmentRegionRecoveryTool.h.

◆ m_printer

PublicToolHandle<MuonEDMPrinterTool> Muon::MuonSegmentRegionRecoveryTool::m_printer {this, "EDMPrinter", "Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"}
private

Definition at line 148 of file MuonSegmentRegionRecoveryTool.h.

◆ m_recoverMM

Gaudi::Property<bool> Muon::MuonSegmentRegionRecoveryTool::m_recoverMM {this, "RecoverMM", true, "Pick up dropped micromega chambers"}
private

Definition at line 162 of file MuonSegmentRegionRecoveryTool.h.

◆ m_recoverSTGC

Gaudi::Property<bool> Muon::MuonSegmentRegionRecoveryTool::m_recoverSTGC {this, "RecoverSTGC", true, "Pick up dropped sTGC chambers"}
private

Definition at line 163 of file MuonSegmentRegionRecoveryTool.h.

◆ m_regsel_csc

ToolHandle<IRegSelTool> Muon::MuonSegmentRegionRecoveryTool::m_regsel_csc {this, "CSCRegionSelector", "RegSelTool/RegSelTool_CSC"}
private

Definition at line 143 of file MuonSegmentRegionRecoveryTool.h.

◆ m_regsel_mdt

ToolHandle<IRegSelTool> Muon::MuonSegmentRegionRecoveryTool::m_regsel_mdt {this, "MDTRegionSelector", "RegSelTool/RegSelTool_MDT"}
private

Definition at line 142 of file MuonSegmentRegionRecoveryTool.h.

◆ m_regsel_mm

ToolHandle<IRegSelTool> Muon::MuonSegmentRegionRecoveryTool::m_regsel_mm {this, "MMRegionSelector", "RegSelTool/RegSelTool_MM"}
private

Definition at line 147 of file MuonSegmentRegionRecoveryTool.h.

◆ m_regsel_rpc

ToolHandle<IRegSelTool> Muon::MuonSegmentRegionRecoveryTool::m_regsel_rpc {this, "RPCRegionSelector", "RegSelTool/RegSelTool_RPC"}
private

Definition at line 144 of file MuonSegmentRegionRecoveryTool.h.

◆ m_regsel_stgc

ToolHandle<IRegSelTool> Muon::MuonSegmentRegionRecoveryTool::m_regsel_stgc {this, "STGCRegionSelector", "RegSelTool/RegSelTool_STGC"}
private

Definition at line 146 of file MuonSegmentRegionRecoveryTool.h.

◆ m_regsel_tgc

ToolHandle<IRegSelTool> Muon::MuonSegmentRegionRecoveryTool::m_regsel_tgc {this, "TGCRegionSelector", "RegSelTool/RegSelTool_TGC"}
private

Definition at line 145 of file MuonSegmentRegionRecoveryTool.h.

◆ m_seededSegmentFinder

ToolHandle<IMuonSeededSegmentFinder> Muon::MuonSegmentRegionRecoveryTool::m_seededSegmentFinder
private
Initial value:
{this, "SeededSegmentFinder",
"Muon::MuonSeededSegmentFinder/MuonSeededSegmentFinder"}

Definition at line 132 of file MuonSegmentRegionRecoveryTool.h.

◆ m_trackSegmentMatchingTool

ToolHandle<IMuonTrackSegmentMatchingTool> Muon::MuonSegmentRegionRecoveryTool::m_trackSegmentMatchingTool
private
Initial value:
{this, "TrackSegmentMatchingTool",
"Muon::MooCandidateMatchingTool/MooCandidateMatchingTool"}

Definition at line 134 of file MuonSegmentRegionRecoveryTool.h.

◆ m_trackSummaryTool

ToolHandle<Trk::IExtendedTrackSummaryTool> Muon::MuonSegmentRegionRecoveryTool::m_trackSummaryTool {this, "TrackSummaryTool", "MuonTrackSummaryTool"}
private

Definition at line 149 of file MuonSegmentRegionRecoveryTool.h.

◆ m_useFitterOutlierLogic

Gaudi::Property<bool> Muon::MuonSegmentRegionRecoveryTool::m_useFitterOutlierLogic {this, "UseFitterOutlierLogic", true}
private

Definition at line 160 of file MuonSegmentRegionRecoveryTool.h.


The documentation for this class was generated from the following files:
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:170
Trk::anyDirection
@ anyDirection
Definition: PropDirection.h:22
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
DerivationFramework::TriggerMatchingUtils::sorted
std::vector< typename R::value_type > sorted(const R &r, PROJ proj={})
Helper function to create a sorted vector from an unsorted range.
test_pyathena.eta
eta
Definition: test_pyathena.py:10
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
Muon::MuonSegmentRegionRecoveryTool::m_useFitterOutlierLogic
Gaudi::Property< bool > m_useFitterOutlierLogic
Definition: MuonSegmentRegionRecoveryTool.h:160
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:142
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:145
python.SystemOfUnits.mm
float mm
Definition: SystemOfUnits.py:98
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
Trk::locX
@ locX
Definition: ParamDefs.h:37
Muon::MuonSegmentRegionRecoveryTool::m_chamberHoleRecoveryTool
ToolHandle< MuonChamberHoleRecoveryTool > m_chamberHoleRecoveryTool
Definition: MuonSegmentRegionRecoveryTool.h:137
Trk::locY
@ locY
local cartesian
Definition: ParamDefs.h:38
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:130
Muon::MuonSegmentRegionRecoveryTool::fillOnTrackChambers
void fillOnTrackChambers(const Trk::Track &theTrack, MuonData &data) const
Definition: MuonSegmentRegionRecoveryTool.cxx:327
Muon::MuonStationIndex::TechnologyIndex::RPC
@ RPC
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
TRT_PAI_gasdata::EO
const float EO[NO]
Energy levels for Oxygen.
Definition: TRT_PAI_gasdata.h:301
Muon::MuonStationIndex::StIndex::EM
@ EM
Muon::RpcPrepDataCollection
MuonPrepDataCollection< RpcPrepData > RpcPrepDataCollection
Definition: MuonPrepDataCollection.h:107
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
Muon::MuonStationIndex::TechnologyIndex
TechnologyIndex
enum to classify the different layers in the muon spectrometer
Definition: MuonStationIndex.h:54
Muon::MdtPrepDataCollection
MuonPrepDataCollection< MdtPrepData > MdtPrepDataCollection
Definition: MuonPrepDataCollection.h:106
Muon::MuonSegmentRegionRecoveryTool::m_builder
ToolHandle< Rec::ICombinedMuonTrackFitter > m_builder
Definition: MuonSegmentRegionRecoveryTool.h:139
Muon::MuonSegmentRegionRecoveryTool::addHashes
void addHashes(const EventContext &ctx, MuonStationIndex::TechnologyIndex type, const IRoiDescriptor &roi, std::set< IdentifierHash > &hashes, const std::set< IdentifierHash > &exclusion) const
Definition: MuonSegmentRegionRecoveryTool.cxx:162
MM
@ MM
Definition: RegSelEnums.h:38
MuonGM::RpcReadoutElement
An RpcReadoutElement corresponds to a single RPC module; therefore typicaly a barrel muon station con...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/RpcReadoutElement.h:55
Muon::MuonSegmentRegionRecoveryTool::m_seededSegmentFinder
ToolHandle< IMuonSeededSegmentFinder > m_seededSegmentFinder
Definition: MuonSegmentRegionRecoveryTool.h:132
Trk::locR
@ locR
Definition: ParamDefs.h:44
MuonGM::CscReadoutElement
Definition: CscReadoutElement.h:56
Muon::MuonSegmentRegionRecoveryTool::m_excludeEES
Gaudi::Property< bool > m_excludeEES
Definition: MuonSegmentRegionRecoveryTool.h:158
Trk::TrkDetElementBase::identify
virtual Identifier identify() const =0
Identifier.
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
Muon::MuonSegmentRegionRecoveryTool::m_dphi
Gaudi::Property< double > m_dphi
Definition: MuonSegmentRegionRecoveryTool.h:157
Muon::MuonSegmentRegionRecoveryTool::m_recoverMM
Gaudi::Property< bool > m_recoverMM
Definition: MuonSegmentRegionRecoveryTool.h:162
Muon::MuonStationIndex::TechnologyIndex::MDT
@ MDT
xAOD::MuonSegment
MuonSegment_v1 MuonSegment
Reference the current persistent version:
Definition: Event/xAOD/xAODMuon/xAODMuon/MuonSegment.h:13
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:706
Muon::MuonSegmentRegionRecoveryTool::m_regsel_rpc
ToolHandle< IRegSelTool > m_regsel_rpc
Definition: MuonSegmentRegionRecoveryTool.h:144
Muon::MuonSegmentRegionRecoveryTool::m_extrapolator
ToolHandle< Trk::IExtrapolator > m_extrapolator
Definition: MuonSegmentRegionRecoveryTool.h:138
AmgSymMatrix
#define AmgSymMatrix(dim)
Definition: EventPrimitives.h:50
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:954
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
Muon::MuonStationIndex::TechnologyIndex::TechnologyIndexMax
@ TechnologyIndexMax
std::stable_sort
void stable_sort(std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, std::reverse_iterator< DataModel_detail::iterator< DVL > > end, Compare comp)
Specialization of stable_sort for DataVector/List.
Definition: DVL_algorithms.h:711
xAOD::phi
setEt phi
Definition: TrigEMCluster_v1.cxx:29
MuonGM::MuonDetectorManager::getTgcReadoutElement
const TgcReadoutElement * getTgcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:249
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
Muon::MuonSegmentRegionRecoveryTool::m_recoverSTGC
Gaudi::Property< bool > m_recoverSTGC
Definition: MuonSegmentRegionRecoveryTool.h:163
Muon::MuonSegmentRegionRecoveryTool::m_regsel_csc
ToolHandle< IRegSelTool > m_regsel_csc
Definition: MuonSegmentRegionRecoveryTool.h:143
Muon::MuonSegmentRegionRecoveryTool::m_trackSegmentMatchingTool
ToolHandle< IMuonTrackSegmentMatchingTool > m_trackSegmentMatchingTool
Definition: MuonSegmentRegionRecoveryTool.h:134
beamspotnt.cols
list cols
Definition: bin/beamspotnt.py:1113
Muon::MuonStationIndex::TechnologyIndex::MM
@ MM
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:206
Trk::locZ
@ locZ
local cylindrical
Definition: ParamDefs.h:42
MuonGM::MdtReadoutElement
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:51
Muon::MuonStationIndex::TechnologyIndex::TGC
@ TGC
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:227
Muon::MuonStationIndex::chIndex
ChIndex chIndex(const std::string &index)
convert ChIndex name string to enum
Definition: MuonStationIndex.cxx:11
Muon::MuonSegmentRegionRecoveryTool::m_fitter
ToolHandle< Trk::ITrackFitter > m_fitter
Definition: MuonSegmentRegionRecoveryTool.h:140
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
Muon::MuonStationIndex::chName
const std::string & chName(ChIndex index)
convert ChIndex into a string
Definition: MuonStationIndex.cxx:119
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
urldecode::states
states
Definition: urldecode.h:39
Muon::MuonSegmentRegionRecoveryTool::collectCrossedChambers
void collectCrossedChambers(const EventContext &ctx, const Trk::Track &track, MuonData &data) const
methods used by recover
Definition: MuonSegmentRegionRecoveryTool.cxx:229
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:30
Trk::Segment
Definition: Tracking/TrkEvent/TrkSegment/TrkSegment/Segment.h:56
MuonGM::TgcReadoutElement
A TgcReadoutElement corresponds to a single TGC chamber; therefore typically a TGC station contains s...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/TgcReadoutElement.h:42
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
Muon::MuonSegmentRegionRecoveryTool::m_DetectorManagerKey
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_DetectorManagerKey
Definition: MuonSegmentRegionRecoveryTool.h:152
Trk::ParametersBase
Definition: ParametersBase.h:55
Muon::MuonSegmentRegionRecoveryTool::m_regsel_stgc
ToolHandle< IRegSelTool > m_regsel_stgc
Definition: MuonSegmentRegionRecoveryTool.h:146
Trk::muon
@ muon
Definition: ParticleHypothesis.h:31
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:156
Muon::MuonStationIndex::ChIndex::EES
@ EES
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::MuonStationIndex::StIndex
StIndex
enum to classify the different station layers in the muon spectrometer
Definition: MuonStationIndex.h:23
Trk::MeasurementBase
Definition: MeasurementBase.h:58
Muon::MuonSegmentRegionRecoveryTool::m_chamberGeoKey
SG::ReadCondHandleKey< Muon::MuonIntersectGeoData > m_chamberGeoKey
Definition: MuonSegmentRegionRecoveryTool.h:151
Muon::CscPrepDataCollection
MuonPrepDataCollection< CscPrepData > CscPrepDataCollection
Definition: MuonPrepDataCollection.h:109
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.
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
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:149
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
python.copyTCTOutput.locDir
locDir
Definition: copyTCTOutput.py:112
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:16
Muon::MMPrepDataCollection
MuonPrepDataCollection< MMPrepData > MMPrepDataCollection
Definition: MuonPrepDataCollection.h:113
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:108
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 B' along the line B that's closest to a second line A.
Definition: GeoPrimitivesHelpers.h:347
MuonGM::MuonDetectorManager
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:51
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Muon::MuonStationIndex::TechnologyIndex::CSC
@ CSC
Muon::MuonSegmentRegionRecoveryTool::m_edmHelperSvc
ServiceHandle< IMuonEDMHelperSvc > m_edmHelperSvc
Definition: MuonSegmentRegionRecoveryTool.h:127
Muon::sTgcPrepDataCollection
MuonPrepDataCollection< sTgcPrepData > sTgcPrepDataCollection
Definition: MuonPrepDataCollection.h:112
MuonGM::MuonDetectorManager::getMMReadoutElement
const MMReadoutElement * getMMReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:257
Trk::RIO_OnTrack::identify
Identifier identify() const
return the identifier -extends MeasurementBase
Definition: RIO_OnTrack.h:152
DEBUG
#define DEBUG
Definition: page_access.h:11
Muon::MuonStationIndex::TechnologyIndex::STGC
@ STGC
Muon::MuonStationIndex::TechnologyIndex::TechnologyUnknown
@ TechnologyUnknown
MuonGM::MdtReadoutElement::surface
virtual const Trk::Surface & surface() const override final
Return surface associated with this detector element.
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:885
MuonGM::MMReadoutElement
An MMReadoutElement corresponds to a single STGC module; therefore typicaly a barrel muon station con...
Definition: MMReadoutElement.h:25
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:86
Muon::MuonSegmentRegionRecoveryTool::m_regsel_mm
ToolHandle< IRegSelTool > m_regsel_mm
Definition: MuonSegmentRegionRecoveryTool.h:147
Muon::MdtDriftCircleOnTrack::collectionHash
IdentifierHash collectionHash() const
Returns the hashID of the PRD collection.
Definition: MdtDriftCircleOnTrack.h:264
Muon::MuonStationIndex::ChIndex
ChIndex
enum to classify the different chamber layers in the muon spectrometer
Definition: MuonStationIndex.h:15
Muon::TgcPrepDataCollection
MuonPrepDataCollection< TgcPrepData > TgcPrepDataCollection
Definition: MuonPrepDataCollection.h:108
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:513
Muon::MuonSegmentRegionRecoveryTool::findHoles
std::unique_ptr< Trk::Track > findHoles(const EventContext &ctx, const Trk::Track &track, MuonData &data) const
Definition: MuonSegmentRegionRecoveryTool.cxx:400
MuonGM::MuonDetectorManager::getsTgcReadoutElement
const sTgcReadoutElement * getsTgcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:261
Muon::MuonSegmentRegionRecoveryTool::m_onlyEO
Gaudi::Property< bool > m_onlyEO
Definition: MuonSegmentRegionRecoveryTool.h:159
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:79
LArCellBinning.etamin
etamin
Definition: LArCellBinning.py:137
Trk::TrkDetElementBase::center
virtual const Amg::Vector3D & center() const =0
Return the center of the element.
IdContext
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
Definition: IdContext.h:26
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
calibdata.tube
tube
Definition: calibdata.py:30
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::m_printer
PublicToolHandle< MuonEDMPrinterTool > m_printer
Definition: MuonSegmentRegionRecoveryTool.h:148
MDT
@ MDT
Definition: RegSelEnums.h:31
Muon::MuonSegmentRegionRecoveryTool::m_hitSummaryTool
ToolHandle< IMuonHitSummaryTool > m_hitSummaryTool
Definition: MuonSegmentRegionRecoveryTool.h:141
Identifier
Definition: IdentifierFieldParser.cxx:14