ATLAS Offline Software
MuonSegmentRegionRecoveryTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 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 
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  MuonSegmentRegionRecoveryTool(const std::string&, const std::string&, const IInterface*);
95 
97  virtual ~MuonSegmentRegionRecoveryTool() = default;
98 
100  virtual StatusCode initialize() override;
101 
103  virtual std::unique_ptr<Trk::Track> recover(const Trk::Track& track, const EventContext& ctx) const override;
104 
105  void createHoleTSOSsForClusterChamber(const Identifier& detElId, const EventContext& ctx, const Trk::TrackParameters& pars,
106  std::set<Identifier>& layIds,
107  std::vector<std::unique_ptr<const Trk::TrackStateOnSurface> >& states) const override;
108 
109  private:
110  std::unique_ptr<const Trk::TrackParameters> reachableDetEl(const EventContext& ctx, const Trk::Track& track,
111  const Trk::TrkDetElementBase& detEl, bool smallerBounds = false) const;
114  // Collect hashes through extrapolation
115  void collectCrossedChambers(const Trk::Track& track, MuonData& data) const;
116 
117  // Fill already on track chamber std::set
118  void fillOnTrackChambers(const Trk::Track& theTrack, MuonData& data) const;
119  // Select hashes of chambers not yet on track
120  std::unique_ptr<Trk::Track> addMissingChambers(const EventContext& ctx, const Trk::Track& track, MuonData& data, bool addMdt) const;
121 
122  void addHashes(DETID type, const IRoiDescriptor& roi, std::set<IdentifierHash>& hashes,
123  const std::set<IdentifierHash>& exclusion) const;
124 
125  std::unique_ptr<Trk::Track> findHoles(const EventContext& ctx, const Trk::Track& track, MuonData& data) const;
126 
127 
128  ServiceHandle<IMuonEDMHelperSvc> m_edmHelperSvc{this, "edmHelper", "Muon::MuonEDMHelperSvc/MuonEDMHelperSvc",
129  "Handle to the service providing the IMuonEDMHelperSvc interface"};
130 
131  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
132 
133  ToolHandle<IMuonSeededSegmentFinder> m_seededSegmentFinder{this, "SeededSegmentFinder",
134  "Muon::MuonSeededSegmentFinder/MuonSeededSegmentFinder"};
135  ToolHandle<IMuonTrackSegmentMatchingTool> m_trackSegmentMatchingTool{this, "TrackSegmentMatchingTool",
136  "Muon::MooCandidateMatchingTool/MooCandidateMatchingTool"};
137 
138  ToolHandle<MuonChamberHoleRecoveryTool> m_chamberHoleRecoveryTool{this, "ChamberHoleRecoveryTool", "", "hit-based hole search"};
139  ToolHandle<Trk::IExtrapolator> m_extrapolator{this, "Extrapolator", "Trk::Extrapolator/MuonExtrapolator"};
140  ToolHandle<Rec::ICombinedMuonTrackFitter> m_builder{this, "Builder", ""};
141  ToolHandle<Trk::ITrackFitter> m_fitter{this, "Fitter", "Trk::GlobalChi2Fitter/MCTBSLFitter"};
142  ToolHandle<IMuonHitSummaryTool> m_hitSummaryTool{this, "HitSummaryTool", "Muon::MuonHitSummaryTool/MuonHitSummaryTool"};
143  ToolHandle<IRegSelTool> m_regsel_mdt{this, "MDTRegionSelector", "RegSelTool/RegSelTool_MDT"};
144  ToolHandle<IRegSelTool> m_regsel_csc{this, "CSCRegionSelector", "RegSelTool/RegSelTool_CSC"};
145  ToolHandle<IRegSelTool> m_regsel_rpc{this, "RPCRegionSelector", "RegSelTool/RegSelTool_RPC"};
146  ToolHandle<IRegSelTool> m_regsel_tgc{this, "TGCRegionSelector", "RegSelTool/RegSelTool_TGC"};
147  ToolHandle<IRegSelTool> m_regsel_stgc{this, "STGCRegionSelector", "RegSelTool/RegSelTool_STGC"};
148  ToolHandle<IRegSelTool> m_regsel_mm{this, "MMRegionSelector", "RegSelTool/RegSelTool_MM"};
149  PublicToolHandle<MuonEDMPrinterTool> m_printer{this, "EDMPrinter", "Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"};
150  ToolHandle<Trk::IExtendedTrackSummaryTool> m_trackSummaryTool{this, "TrackSummaryTool", "MuonTrackSummaryTool"};
151 
152  SG::ReadCondHandleKey<Muon::MuonIntersectGeoData> m_chamberGeoKey{this, "ChamberGeoKey", "MuonStationIntersects", "Pointer to hole search service"};
153 
154  // properties
155  Gaudi::Property<double> m_deta{this, "DeltaEtaRegion", 0.05};
156  Gaudi::Property<double> m_dphi{this, "DeltaPhiRegion", 0.1};
157  Gaudi::Property<bool> m_excludeEES{this, "ExcludeEES", true};
158  Gaudi::Property<bool> m_onlyEO{this, "OnlyEO", false};
159  Gaudi::Property<bool> m_useFitterOutlierLogic{this, "UseFitterOutlierLogic", true};
160 
161  Gaudi::Property<bool> m_recoverMM{this, "RecoverMM", true, "Pick up dropped micromega chambers"};
162  Gaudi::Property<bool> m_recoverSTGC{this, "RecoverSTGC", true, "Pick up dropped sTGC chambers"};
163  };
164 } // namespace Muon
165 
166 #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:159
Muon::MuonSegmentRegionRecoveryTool::m_regsel_mdt
ToolHandle< IRegSelTool > m_regsel_mdt
Definition: MuonSegmentRegionRecoveryTool.h:143
Muon::MuonSegmentRegionRecoveryTool::m_regsel_tgc
ToolHandle< IRegSelTool > m_regsel_tgc
Definition: MuonSegmentRegionRecoveryTool.h:146
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:138
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:131
Muon::MuonSegmentRegionRecoveryTool::fillOnTrackChambers
void fillOnTrackChambers(const Trk::Track &theTrack, MuonData &data) const
Definition: MuonSegmentRegionRecoveryTool.cxx:317
Muon::MuonSegmentRegionRecoveryTool::MuonData::rpcTrack
std::set< IdentifierHash > rpcTrack
Definition: MuonSegmentRegionRecoveryTool.h:75
Muon::MuonSegmentRegionRecoveryTool::initialize
virtual StatusCode initialize() override
AlgTool initialize.
Definition: MuonSegmentRegionRecoveryTool.cxx:53
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::MuonSegmentRegionRecoveryTool::m_builder
ToolHandle< Rec::ICombinedMuonTrackFitter > m_builder
Definition: MuonSegmentRegionRecoveryTool.h:140
Muon::MuonSegmentRegionRecoveryTool::MuonData::mdt
std::set< IdentifierHash > mdt
Definition: MuonSegmentRegionRecoveryTool.h:70
Muon::MuonSegmentRegionRecoveryTool::m_seededSegmentFinder
ToolHandle< IMuonSeededSegmentFinder > m_seededSegmentFinder
Definition: MuonSegmentRegionRecoveryTool.h:133
IExtrapolator.h
Trk::TrkDetElementBase
Definition: TrkDetElementBase.h:52
Muon::MuonSegmentRegionRecoveryTool::m_excludeEES
Gaudi::Property< bool > m_excludeEES
Definition: MuonSegmentRegionRecoveryTool.h:157
MuonPrepDataContainer.h
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:49
IMuonTrackSegmentMatchingTool.h
Muon::MuonSegmentRegionRecoveryTool::m_dphi
Gaudi::Property< double > m_dphi
Definition: MuonSegmentRegionRecoveryTool.h:156
Muon::MuonSegmentRegionRecoveryTool::m_recoverMM
Gaudi::Property< bool > m_recoverMM
Definition: MuonSegmentRegionRecoveryTool.h:161
Muon::MuonSegmentRegionRecoveryTool::addMissingChambers
std::unique_ptr< Trk::Track > addMissingChambers(const EventContext &ctx, const Trk::Track &track, MuonData &data, bool addMdt) const
Definition: MuonSegmentRegionRecoveryTool.cxx:694
Muon::MuonSegmentRegionRecoveryTool::m_regsel_rpc
ToolHandle< IRegSelTool > m_regsel_rpc
Definition: MuonSegmentRegionRecoveryTool.h:145
Muon::MuonSegmentRegionRecoveryTool::m_extrapolator
ToolHandle< Trk::IExtrapolator > m_extrapolator
Definition: MuonSegmentRegionRecoveryTool.h:139
Muon::MuonSegmentRegionRecoveryTool::reachableDetEl
std::unique_ptr< const Trk::TrackParameters > reachableDetEl(const EventContext &ctx, const Trk::Track &track, const Trk::TrkDetElementBase &detEl, bool smallerBounds=false) const
Definition: MuonSegmentRegionRecoveryTool.cxx:942
RpcPrepDataCollection.h
Track.h
Muon::MuonSegmentRegionRecoveryTool::MuonData::stgcCols
std::vector< const sTgcPrepDataCollection * > stgcCols
Definition: MuonSegmentRegionRecoveryTool.h:86
DETID
DETID
An enum to define subdetector names.
Definition: RegSelEnums.h:23
CscPrepDataCollection.h
IMuonSeededSegmentFinder.h
Muon::MuonSegmentRegionRecoveryTool::MuonSegmentRegionRecoveryTool
MuonSegmentRegionRecoveryTool(const std::string &, const std::string &, const IInterface *)
constructor
Definition: MuonSegmentRegionRecoveryTool.cxx:48
MuonIntersectGeoData.h
MdtPrepDataCollection.h
Muon::MuonSegmentRegionRecoveryTool::m_recoverSTGC
Gaudi::Property< bool > m_recoverSTGC
Definition: MuonSegmentRegionRecoveryTool.h:162
MMPrepDataCollection.h
Muon::MuonSegmentRegionRecoveryTool::m_regsel_csc
ToolHandle< IRegSelTool > m_regsel_csc
Definition: MuonSegmentRegionRecoveryTool.h:144
Muon::MuonSegmentRegionRecoveryTool::m_trackSegmentMatchingTool
ToolHandle< IMuonTrackSegmentMatchingTool > m_trackSegmentMatchingTool
Definition: MuonSegmentRegionRecoveryTool.h:135
Muon::MuonSegmentRegionRecoveryTool::MuonData::cscTrack
std::set< IdentifierHash > cscTrack
Definition: MuonSegmentRegionRecoveryTool.h:81
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
Muon::MuonSegmentRegionRecoveryTool::m_fitter
ToolHandle< Trk::ITrackFitter > m_fitter
Definition: MuonSegmentRegionRecoveryTool.h:141
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
IMuonClusterOnTrackCreator.h
AthAlgTool.h
Trk::ParametersBase
Definition: ParametersBase.h:55
Muon::MuonSegmentRegionRecoveryTool::m_regsel_stgc
ToolHandle< IRegSelTool > m_regsel_stgc
Definition: MuonSegmentRegionRecoveryTool.h:147
Muon::MuonSegmentRegionRecoveryTool::m_deta
Gaudi::Property< double > m_deta
Definition: MuonSegmentRegionRecoveryTool.h:155
Muon::MuonSegmentRegionRecoveryTool::m_chamberGeoKey
SG::ReadCondHandleKey< Muon::MuonIntersectGeoData > m_chamberGeoKey
Definition: MuonSegmentRegionRecoveryTool.h:152
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:150
Muon::MuonSegmentRegionRecoveryTool::collectCrossedChambers
void collectCrossedChambers(const Trk::Track &track, MuonData &data) const
methods used by recover
Definition: MuonSegmentRegionRecoveryTool.cxx:219
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
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Muon::MuonSegmentRegionRecoveryTool::m_edmHelperSvc
ServiceHandle< IMuonEDMHelperSvc > m_edmHelperSvc
Definition: MuonSegmentRegionRecoveryTool.h:128
Muon::MuonSegmentRegionRecoveryTool::recover
virtual std::unique_ptr< Trk::Track > recover(const Trk::Track &track, const EventContext &ctx) const override
returns a new track with segments recovered using RegionSelector
Definition: MuonSegmentRegionRecoveryTool.cxx:102
Muon::MuonSegmentRegionRecoveryTool::createHoleTSOSsForClusterChamber
void createHoleTSOSsForClusterChamber(const Identifier &detElId, const EventContext &ctx, const Trk::TrackParameters &pars, std::set< Identifier > &layIds, std::vector< std::unique_ptr< const Trk::TrackStateOnSurface > > &states) const override
Definition: MuonSegmentRegionRecoveryTool.cxx:89
Track
Definition: TriggerChamberClusterOnTrackCreator.h:21
Muon::MuonSegmentRegionRecoveryTool::m_regsel_mm
ToolHandle< IRegSelTool > m_regsel_mm
Definition: MuonSegmentRegionRecoveryTool.h:148
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
IMuonHoleRecoveryTool.h
Muon::MuonSegmentRegionRecoveryTool::findHoles
std::unique_ptr< Trk::Track > findHoles(const EventContext &ctx, const Trk::Track &track, MuonData &data) const
Definition: MuonSegmentRegionRecoveryTool.cxx:390
AthAlgTool
Definition: AthAlgTool.h:26
Muon::MuonSegmentRegionRecoveryTool::m_onlyEO
Gaudi::Property< bool > m_onlyEO
Definition: MuonSegmentRegionRecoveryTool.h:158
ITrackSelectorTool.h
Muon::IMuonHoleRecoveryTool
The IMuonHoleRecoveryTool is a pure virtual interface for tools that recover hole on a track.
Definition: IMuonHoleRecoveryTool.h:20
ITrackFitter.h
RegSelEnums.h
Muon::MuonSegmentRegionRecoveryTool::addHashes
void addHashes(DETID type, const IRoiDescriptor &roi, std::set< IdentifierHash > &hashes, const std::set< IdentifierHash > &exclusion) const
Definition: MuonSegmentRegionRecoveryTool.cxx:165
IMuonIdHelperSvc.h
Muon::MuonSegmentRegionRecoveryTool::m_printer
PublicToolHandle< MuonEDMPrinterTool > m_printer
Definition: MuonSegmentRegionRecoveryTool.h:149
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:142
ICombinedMuonTrackFitter.h
Muon::MuonSegmentRegionRecoveryTool::MuonData::mmCols
std::vector< const MMPrepDataCollection * > mmCols
Definition: MuonSegmentRegionRecoveryTool.h:89