ATLAS Offline Software
MuonSegmentRegionRecoveryTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
12 #ifndef MUON_MUONSEGMENTREGIONRECOVERYTOOL_H
13 #define MUON_MUONSEGMENTREGIONRECOVERYTOOL_H
14 
15 #include <map>
16 #include <set>
17 
46 #include "TrkTrack/Track.h"
49 
50 class IRoiDescriptor;
51 
52 namespace Trk {
53  class Track;
54  class TrkDetElementBase;
55  class MeasurementBase;
56 } // namespace Trk
57 
58 namespace Muon {
59 
67  class MuonSegmentRegionRecoveryTool : public extends<AthAlgTool, IMuonHoleRecoveryTool> {
68  public:
69  struct MuonData {
70  std::set<IdentifierHash> mdt;
71  std::map<MuonStationIndex::ChIndex, std::set<IdentifierHash> > mdtPerStation;
72  std::set<IdentifierHash> mdtTrack;
73  std::vector<const MdtPrepDataCollection*> mdtCols;
74  std::set<IdentifierHash> rpc;
75  std::set<IdentifierHash> rpcTrack;
76  std::vector<const RpcPrepDataCollection*> rpcCols;
77  std::set<IdentifierHash> tgc;
78  std::set<IdentifierHash> tgcTrack;
79  std::vector<const TgcPrepDataCollection*> tgcCols;
80  std::set<IdentifierHash> csc;
81  std::set<IdentifierHash> cscTrack;
82  std::vector<const CscPrepDataCollection*> cscCols;
83  // New Small Wheel
84  std::set<IdentifierHash> stgc;
85  std::set<IdentifierHash> stgcTrack;
86  std::vector<const sTgcPrepDataCollection*> stgcCols;
87  std::set<IdentifierHash> mm;
88  std::set<IdentifierHash> mmTrack;
89  std::vector<const MMPrepDataCollection*> mmCols;
90  };
91 
92  public:
94  using base_class::base_class;
96  virtual ~MuonSegmentRegionRecoveryTool() = default;
97 
99  virtual StatusCode initialize() override;
100 
102  virtual std::unique_ptr<Trk::Track> recover(const Trk::Track& track, const EventContext& ctx) const override;
103 
104  void createHoleTSOSsForClusterChamber(const Identifier& detElId, const EventContext& ctx, const Trk::TrackParameters& pars,
105  std::set<Identifier>& layIds,
106  std::vector<std::unique_ptr<const Trk::TrackStateOnSurface> >& states) const override;
107 
108  private:
109  std::unique_ptr<const Trk::TrackParameters> reachableDetEl(const EventContext& ctx, const Trk::Track& track,
110  const Trk::TrkDetElementBase& detEl, bool smallerBounds = false) const;
113  // Collect hashes through extrapolation
114  void collectCrossedChambers( const EventContext& ctx, const Trk::Track& track, MuonData& data) const;
115 
116  // Fill already on track chamber std::set
117  void fillOnTrackChambers(const Trk::Track& theTrack, MuonData& data) const;
118  // Select hashes of chambers not yet on track
119  std::unique_ptr<Trk::Track> addMissingChambers(const EventContext& ctx, const Trk::Track& track, MuonData& data, bool addMdt) const;
120 
121  void addHashes( const EventContext& ctx, MuonStationIndex::TechnologyIndex type, const IRoiDescriptor& roi, std::set<IdentifierHash>& hashes,
122  const std::set<IdentifierHash>& exclusion) const;
123 
124  std::unique_ptr<Trk::Track> findHoles(const EventContext& ctx, const Trk::Track& track, MuonData& data) const;
125 
126 
127  ServiceHandle<IMuonEDMHelperSvc> m_edmHelperSvc{this, "edmHelper", "Muon::MuonEDMHelperSvc/MuonEDMHelperSvc",
128  "Handle to the service providing the IMuonEDMHelperSvc interface"};
129 
130  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
131 
132  ToolHandle<IMuonSeededSegmentFinder> m_seededSegmentFinder{this, "SeededSegmentFinder",
133  "Muon::MuonSeededSegmentFinder/MuonSeededSegmentFinder"};
134  ToolHandle<IMuonTrackSegmentMatchingTool> m_trackSegmentMatchingTool{this, "TrackSegmentMatchingTool",
135  "Muon::MooCandidateMatchingTool/MooCandidateMatchingTool"};
136 
137  ToolHandle<MuonChamberHoleRecoveryTool> m_chamberHoleRecoveryTool{this, "ChamberHoleRecoveryTool", "", "hit-based hole search"};
138  ToolHandle<Trk::IExtrapolator> m_extrapolator{this, "Extrapolator", "Trk::Extrapolator/MuonExtrapolator"};
139  ToolHandle<Rec::ICombinedMuonTrackFitter> m_builder{this, "Builder", ""};
140  ToolHandle<Trk::ITrackFitter> m_fitter{this, "Fitter", "Trk::GlobalChi2Fitter/MCTBSLFitter"};
141  ToolHandle<IMuonHitSummaryTool> m_hitSummaryTool{this, "HitSummaryTool", "Muon::MuonHitSummaryTool/MuonHitSummaryTool"};
142  ToolHandle<IRegSelTool> m_regsel_mdt{this, "MDTRegionSelector", "RegSelTool/RegSelTool_MDT"};
143  ToolHandle<IRegSelTool> m_regsel_csc{this, "CSCRegionSelector", "RegSelTool/RegSelTool_CSC"};
144  ToolHandle<IRegSelTool> m_regsel_rpc{this, "RPCRegionSelector", "RegSelTool/RegSelTool_RPC"};
145  ToolHandle<IRegSelTool> m_regsel_tgc{this, "TGCRegionSelector", "RegSelTool/RegSelTool_TGC"};
146  ToolHandle<IRegSelTool> m_regsel_stgc{this, "STGCRegionSelector", "RegSelTool/RegSelTool_STGC"};
147  ToolHandle<IRegSelTool> m_regsel_mm{this, "MMRegionSelector", "RegSelTool/RegSelTool_MM"};
148  PublicToolHandle<MuonEDMPrinterTool> m_printer{this, "EDMPrinter", "Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"};
149  ToolHandle<Trk::IExtendedTrackSummaryTool> m_trackSummaryTool{this, "TrackSummaryTool", "MuonTrackSummaryTool"};
150 
151  SG::ReadCondHandleKey<Muon::MuonIntersectGeoData> m_chamberGeoKey{this, "ChamberGeoKey", "MuonStationIntersects", "Pointer to hole search service"};
152  SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_DetectorManagerKey{this, "DetectorManagerKey", "MuonDetectorManager",
153  "Key of input MuonDetectorManager condition data"};
154 
155  // properties
156  Gaudi::Property<double> m_deta{this, "DeltaEtaRegion", 0.05};
157  Gaudi::Property<double> m_dphi{this, "DeltaPhiRegion", 0.1};
158  Gaudi::Property<bool> m_excludeEES{this, "ExcludeEES", true};
159  Gaudi::Property<bool> m_onlyEO{this, "OnlyEO", false};
160  Gaudi::Property<bool> m_useFitterOutlierLogic{this, "UseFitterOutlierLogic", true};
161 
162  Gaudi::Property<bool> m_recoverMM{this, "RecoverMM", true, "Pick up dropped micromega chambers"};
163  Gaudi::Property<bool> m_recoverSTGC{this, "RecoverSTGC", true, "Pick up dropped sTGC chambers"};
164  };
165 } // namespace Muon
166 
167 #endif
python.root_lsr_rank.hashes
hashes
Definition: root_lsr_rank.py:34
Muon::MuonSegmentRegionRecoveryTool::MuonData::stgc
std::set< IdentifierHash > stgc
Definition: MuonSegmentRegionRecoveryTool.h:84
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
IRegSelTool.h
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
Muon::MuonSegmentRegionRecoveryTool::m_useFitterOutlierLogic
Gaudi::Property< bool > m_useFitterOutlierLogic
Definition: MuonSegmentRegionRecoveryTool.h:160
Muon::MuonSegmentRegionRecoveryTool::m_regsel_mdt
ToolHandle< IRegSelTool > m_regsel_mdt
Definition: MuonSegmentRegionRecoveryTool.h:142
Muon::MuonSegmentRegionRecoveryTool::m_regsel_tgc
ToolHandle< IRegSelTool > m_regsel_tgc
Definition: MuonSegmentRegionRecoveryTool.h:145
TrackParameters.h
Muon::MuonSegmentRegionRecoveryTool::MuonData::stgcTrack
std::set< IdentifierHash > stgcTrack
Definition: MuonSegmentRegionRecoveryTool.h:85
Muon::MuonSegmentRegionRecoveryTool::m_chamberHoleRecoveryTool
ToolHandle< MuonChamberHoleRecoveryTool > m_chamberHoleRecoveryTool
Definition: MuonSegmentRegionRecoveryTool.h:137
MuonTrackSummary.h
IMuonHitSummaryTool.h
Muon::MuonSegmentRegionRecoveryTool::MuonData::cscCols
std::vector< const CscPrepDataCollection * > cscCols
Definition: MuonSegmentRegionRecoveryTool.h:82
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
MuonEDMPrinterTool.h
Muon::MuonSegmentRegionRecoveryTool
Implementation of an IMuonHoleRecoveryTool.
Definition: MuonSegmentRegionRecoveryTool.h:67
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::MuonSegmentRegionRecoveryTool::MuonData::rpcTrack
std::set< IdentifierHash > rpcTrack
Definition: MuonSegmentRegionRecoveryTool.h:75
Muon::MuonSegmentRegionRecoveryTool::initialize
virtual StatusCode initialize() override
AlgTool initialize.
Definition: MuonSegmentRegionRecoveryTool.cxx:49
Muon::MuonSegmentRegionRecoveryTool::MuonData::mm
std::set< IdentifierHash > mm
Definition: MuonSegmentRegionRecoveryTool.h:87
Muon::MuonSegmentRegionRecoveryTool::MuonData::mdtTrack
std::set< IdentifierHash > mdtTrack
Definition: MuonSegmentRegionRecoveryTool.h:72
Muon::MuonStationIndex::TechnologyIndex
TechnologyIndex
enum to classify the different layers in the muon spectrometer
Definition: MuonStationIndex.h:54
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
Muon::MuonSegmentRegionRecoveryTool::MuonData::mdt
std::set< IdentifierHash > mdt
Definition: MuonSegmentRegionRecoveryTool.h:70
Muon::MuonSegmentRegionRecoveryTool::m_seededSegmentFinder
ToolHandle< IMuonSeededSegmentFinder > m_seededSegmentFinder
Definition: MuonSegmentRegionRecoveryTool.h:132
IExtrapolator.h
Trk::TrkDetElementBase
Definition: TrkDetElementBase.h:52
Muon::MuonSegmentRegionRecoveryTool::m_excludeEES
Gaudi::Property< bool > m_excludeEES
Definition: MuonSegmentRegionRecoveryTool.h:158
MuonPrepDataContainer.h
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition: TrackSystemController.h:45
IMuonTrackSegmentMatchingTool.h
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::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
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
RpcPrepDataCollection.h
Track.h
Muon::MuonSegmentRegionRecoveryTool::MuonData::stgcCols
std::vector< const sTgcPrepDataCollection * > stgcCols
Definition: MuonSegmentRegionRecoveryTool.h:86
CscPrepDataCollection.h
IMuonSeededSegmentFinder.h
MuonIntersectGeoData.h
MdtPrepDataCollection.h
Muon::MuonSegmentRegionRecoveryTool::m_recoverSTGC
Gaudi::Property< bool > m_recoverSTGC
Definition: MuonSegmentRegionRecoveryTool.h:163
MMPrepDataCollection.h
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
Muon::MuonSegmentRegionRecoveryTool::MuonData::cscTrack
std::set< IdentifierHash > cscTrack
Definition: MuonSegmentRegionRecoveryTool.h:81
Muon::MuonSegmentRegionRecoveryTool::m_fitter
ToolHandle< Trk::ITrackFitter > m_fitter
Definition: MuonSegmentRegionRecoveryTool.h:140
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
IRoiDescriptor
Describes the API of the Region of Ineterest geometry.
Definition: IRoiDescriptor.h:23
Muon::MuonSegmentRegionRecoveryTool::MuonData::mdtCols
std::vector< const MdtPrepDataCollection * > mdtCols
Definition: MuonSegmentRegionRecoveryTool.h:73
urldecode::states
states
Definition: urldecode.h:39
MuonChamberHoleRecoveryTool.h
Muon::MuonSegmentRegionRecoveryTool::collectCrossedChambers
void collectCrossedChambers(const EventContext &ctx, const Trk::Track &track, MuonData &data) const
methods used by recover
Definition: MuonSegmentRegionRecoveryTool.cxx:229
IMuonClusterOnTrackCreator.h
AthAlgTool.h
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
Muon::MuonSegmentRegionRecoveryTool::m_deta
Gaudi::Property< double > m_deta
Definition: MuonSegmentRegionRecoveryTool.h:156
Muon::MuonSegmentRegionRecoveryTool::m_chamberGeoKey
SG::ReadCondHandleKey< Muon::MuonIntersectGeoData > m_chamberGeoKey
Definition: MuonSegmentRegionRecoveryTool.h:151
IMuonEDMHelperSvc.h
ITrackHoleSearchTool.h
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Muon::MuonSegmentRegionRecoveryTool::MuonData::tgcTrack
std::set< IdentifierHash > tgcTrack
Definition: MuonSegmentRegionRecoveryTool.h:78
TgcPrepDataCollection.h
Muon::MuonSegmentRegionRecoveryTool::MuonData
Definition: MuonSegmentRegionRecoveryTool.h:69
Muon::MuonSegmentRegionRecoveryTool::MuonData::tgcCols
std::vector< const TgcPrepDataCollection * > tgcCols
Definition: MuonSegmentRegionRecoveryTool.h:79
IMdtDriftCircleOnTrackCreator.h
Muon::MuonSegmentRegionRecoveryTool::MuonData::mmTrack
std::set< IdentifierHash > mmTrack
Definition: MuonSegmentRegionRecoveryTool.h:88
Muon::MuonSegmentRegionRecoveryTool::MuonData::rpcCols
std::vector< const RpcPrepDataCollection * > rpcCols
Definition: MuonSegmentRegionRecoveryTool.h:76
sTgcPrepDataCollection.h
Muon::MuonSegmentRegionRecoveryTool::~MuonSegmentRegionRecoveryTool
virtual ~MuonSegmentRegionRecoveryTool()=default
destructor
Muon::MuonSegmentRegionRecoveryTool::m_trackSummaryTool
ToolHandle< Trk::IExtendedTrackSummaryTool > m_trackSummaryTool
Definition: MuonSegmentRegionRecoveryTool.h:149
MuonDetectorManager.h
SG::ReadCondHandleKey< Muon::MuonIntersectGeoData >
Muon::MuonSegmentRegionRecoveryTool::MuonData::csc
std::set< IdentifierHash > csc
Definition: MuonSegmentRegionRecoveryTool.h:80
Muon::MuonSegmentRegionRecoveryTool::MuonData::tgc
std::set< IdentifierHash > tgc
Definition: MuonSegmentRegionRecoveryTool.h:77
IExtendedTrackSummaryTool.h
Muon::MuonSegmentRegionRecoveryTool::m_edmHelperSvc
ServiceHandle< IMuonEDMHelperSvc > m_edmHelperSvc
Definition: MuonSegmentRegionRecoveryTool.h:127
Muon::MuonSegmentRegionRecoveryTool::recover
virtual std::unique_ptr< Trk::Track > recover(const Trk::Track &track, const EventContext &ctx) const override
returns a new track with segments recovered using RegionSelector
Definition: MuonSegmentRegionRecoveryTool.cxx:99
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
Track
Definition: TriggerChamberClusterOnTrackCreator.h:21
Muon::MuonSegmentRegionRecoveryTool::m_regsel_mm
ToolHandle< IRegSelTool > m_regsel_mm
Definition: MuonSegmentRegionRecoveryTool.h:147
xAOD::track
@ track
Definition: TrackingPrimitives.h:513
IMuonHoleRecoveryTool.h
Muon::MuonSegmentRegionRecoveryTool::findHoles
std::unique_ptr< Trk::Track > findHoles(const EventContext &ctx, const Trk::Track &track, MuonData &data) const
Definition: MuonSegmentRegionRecoveryTool.cxx:400
Muon::MuonSegmentRegionRecoveryTool::m_onlyEO
Gaudi::Property< bool > m_onlyEO
Definition: MuonSegmentRegionRecoveryTool.h:159
ITrackSelectorTool.h
ITrackFitter.h
RegSelEnums.h
IMuonIdHelperSvc.h
Muon::MuonSegmentRegionRecoveryTool::m_printer
PublicToolHandle< MuonEDMPrinterTool > m_printer
Definition: MuonSegmentRegionRecoveryTool.h:148
Muon::MuonSegmentRegionRecoveryTool::MuonData::rpc
std::set< IdentifierHash > rpc
Definition: MuonSegmentRegionRecoveryTool.h:74
Muon::MuonSegmentRegionRecoveryTool::MuonData::mdtPerStation
std::map< MuonStationIndex::ChIndex, std::set< IdentifierHash > > mdtPerStation
Definition: MuonSegmentRegionRecoveryTool.h:71
ServiceHandle
Definition: ClusterMakerTool.h:37
Muon::MuonSegmentRegionRecoveryTool::m_hitSummaryTool
ToolHandle< IMuonHitSummaryTool > m_hitSummaryTool
Definition: MuonSegmentRegionRecoveryTool.h:141
ICombinedMuonTrackFitter.h
Identifier
Definition: IdentifierFieldParser.cxx:14
Muon::MuonSegmentRegionRecoveryTool::MuonData::mmCols
std::vector< const MMPrepDataCollection * > mmCols
Definition: MuonSegmentRegionRecoveryTool.h:89