ATLAS Offline Software
Loading...
Searching...
No Matches
MuonChamberHoleRecoveryTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MUON_MUONCHAMBERHOLERECOVERYTOOL_H
6#define MUON_MUONCHAMBERHOLERECOVERYTOOL_H
7
8#include <set>
9#include <string>
10#include <vector>
11
26#include "TrkTrack/Track.h"
28
29
30namespace Muon {
35
36 public:
37 MuonChamberHoleRecoveryTool(const std::string&, const std::string&, const IInterface*);
38 virtual ~MuonChamberHoleRecoveryTool() = default;
39
40 using NewTrackStates = std::vector<std::unique_ptr<const Trk::TrackStateOnSurface>>;
41
42 StatusCode initialize() override;
43
45 std::unique_ptr<Trk::Track> recover(const Trk::Track& track, const EventContext& ctx) const override;
46
47 // made public
48 void createHoleTSOSsForClusterChamber(const Identifier& detElId, const EventContext& ctx, const Trk::TrackParameters& pars,
49 std::set<Identifier>& layIds,
50 NewTrackStates& states) const override;
51
52 private:
54 RecoveryState(const Trk::Track& trk);
55
58
59 const Trk::TrackStateOnSurface* tsos() const;
60
62 bool nextState();
65 // vector once a new chamber is reached
70 void copyState(CopyTarget target);
71
73 std::set<Identifier> layersOnTrk{};
76
81 const Trk::TrackParameters* chamberPars() const;
85 void finalizeChamber();
86
89 std::unique_ptr<Trk::TrackStates> releaseStates();
90
91 private:
94 bool m_nextCalled{false};
97 std::set<const Trk::TrackStateOnSurface*> m_copiedStates{};
98
99 };
100
103 bool getNextMuonMeasurement(RecoveryState& trkRecov, RecoveryState::CopyTarget target) const;
104
108 void recoverHitsInChamber(const EventContext& ctx, RecoveryState& trkRecov) const;
109
110
117 std::set<Identifier> holesInMdtChamber(const EventContext& ctx, const Amg::Vector3D& position, const Amg::Vector3D& direction,
118 const Identifier& chId, const std::set<Identifier>& tubeIds) const;
119
120 void recoverMdtHits(const EventContext& ctx,
121 const Identifier& chId,
122 const Trk::TrackParameters& pars,
123 NewTrackStates& newStates,
124 std::set<Identifier>& knownLayers) const;
125
126
127 void recoverClusterHits(const EventContext& ctx,
128 const Identifier& chId,
129 const Trk::TrackParameters& chambPars,
130 NewTrackStates& newStates,
131 std::set<Identifier>& knownLayers) const;
132
133
134
136 std::set<Identifier> layersOnTrkIds(const Trk::Track& track) const;
137
139 const Trk::TrkDetElementBase* getDetectorElement(const EventContext& ctx, const Identifier& id) const;
140
143 std::set<Identifier> getHoleLayerIds(const Identifier& detElId,
144 const std::set<Identifier>& knownLayers) const;
145
147 template <class Prd> NewTrackStates recoverChamberClusters(const EventContext& ctx,
149 const Identifier& chambId,
150 const Trk::TrackParameters& parsInChamb,
151 std::set<Identifier>& knownLayers) const;
152
153 template <class Prd> std::vector<const Prd*> loadPrepDataHits(const EventContext& ctx,
155 const std::set<Identifier>& layerIds) const;
156
157 ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
158 ServiceHandle<Muon::IMuonEDMHelperSvc> m_edmHelperSvc{this, "edmHelper", "Muon::MuonEDMHelperSvc/MuonEDMHelperSvc",
159 "Handle to the service providing the IMuonEDMHelperSvc interface"};
160
161 ServiceHandle<Trk::ITrackingVolumesSvc> m_trackingVolumesSvc{this, "TrackingVolumesSvc", "Trk::TrackingVolumesSvc/TrackingVolumesSvc"};
162
163
164
165
166 PublicToolHandle<Muon::MuonEDMPrinterTool> m_printer{this, "EDMPrinter", "Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"};
167 ToolHandle<Trk::IExtrapolator> m_extrapolator{this, "Extrapolator", "Trk::Extrapolator/MuonExtrapolator"};
168 ToolHandle<Muon::IMdtDriftCircleOnTrackCreator> m_mdtRotCreator{this, "MdtRotCreator",
169 "Muon::MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator",
170 "IMdtDriftCircleOnTrackCreator full calibration"};
171 ToolHandle<Muon::IMuonClusterOnTrackCreator> m_cscRotCreator{
172 this, "CscRotCreator", "", "IMuonClusterOnTrackCreator for cscs"};
173 ToolHandle<Muon::IMuonClusterOnTrackCreator> m_clusRotCreator{this, "ClusterRotCreator",
174 "Muon::MuonClusterOnTrackCreator/MuonClusterOnTrackCreator",
175 "IMuonClusterOnTrackCreator for RPC, TGC, NSW hits"};
176 ToolHandle<Trk::IResidualPullCalculator> m_pullCalculator{this, "PullCalculator",
177 "Trk::ResidualPullCalculator/ResidualPullCalculator"};
178
179 SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_DetectorManagerKey{this, "DetectorManagerKey", "MuonDetectorManager",
180 "Key of input MuonDetectorManager condition data"};
181
182 SG::ReadHandleKey<Muon::MdtPrepDataContainer> m_key_mdt{this, "MdtPrepDataContainer", "MDT_DriftCircles", "MDT PRDs"};
183 SG::ReadHandleKey<Muon::CscPrepDataContainer> m_key_csc{this, "CscPrepDataContainer", "CSC_Clusters", "CSC PRDS"};
184 SG::ReadHandleKey<Muon::TgcPrepDataContainer> m_key_tgc{this, "TgcPrepDataContainer", "TGC_Measurements", "TGC PRDs"};
185 SG::ReadHandleKey<Muon::RpcPrepDataContainer> m_key_rpc{this, "RpcPrepDataContainer", "RPC_Measurements", "RPC PRDs"};
186 SG::ReadHandleKey<Muon::sTgcPrepDataContainer> m_key_stgc{this, "sTgcPrepDataContainer", "STGC_Measurements", "sTGC PRDs"};
187 SG::ReadHandleKey<Muon::MMPrepDataContainer> m_key_mm{this, "MMPrepDataContainer", "MM_Measurements", "MM PRDs"};
188
189
190 SG::ReadCondHandleKey<Muon::MuonIntersectGeoData> m_chamberGeoKey{this, "ChamberGeoKey", "MuonStationIntersects", "Pointer to hole search service"};
191
192 Gaudi::Property<bool> m_addMeasurements{this, "AddMeasurements", true};
193 Gaudi::Property<bool> m_detectBadSort{this, "DetectBadSorting", false};
194
195 Gaudi::Property<double> m_associationPullCutEta{this, "AssociationPullCutEta", 3};
196 Gaudi::Property<double> m_associationPullCutPhi{this, "AssociationPullCutPhi", 10};
197 Gaudi::Property<double> m_adcCut{this, "AdcCut", 50};
198 };
199
200} // namespace Muon
201
202#endif
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
The IMuonHoleRecoveryTool is a pure virtual interface for tools that recover hole on a track.
SG::ReadHandleKey< Muon::RpcPrepDataContainer > m_key_rpc
SG::ReadHandleKey< Muon::TgcPrepDataContainer > m_key_tgc
void recoverClusterHits(const EventContext &ctx, const Identifier &chId, const Trk::TrackParameters &chambPars, NewTrackStates &newStates, std::set< Identifier > &knownLayers) const
ToolHandle< Trk::IExtrapolator > m_extrapolator
const Trk::TrkDetElementBase * getDetectorElement(const EventContext &ctx, const Identifier &id) const
Returns the detector element associated with the muon Identifier.
void recoverMdtHits(const EventContext &ctx, const Identifier &chId, const Trk::TrackParameters &pars, NewTrackStates &newStates, std::set< Identifier > &knownLayers) const
virtual ~MuonChamberHoleRecoveryTool()=default
std::set< Identifier > layersOnTrkIds(const Trk::Track &track) const
Returns a set of all layer Identifiers of the associated track hits.
std::unique_ptr< Trk::Track > recover(const Trk::Track &track, const EventContext &ctx) const override
returns a new track with holes recovered
ServiceHandle< Muon::IMuonEDMHelperSvc > m_edmHelperSvc
void recoverHitsInChamber(const EventContext &ctx, RecoveryState &trkRecov) const
Loops over all muon hits in a muon chamber and tries to find missed ones by checking each tracking la...
std::set< Identifier > getHoleLayerIds(const Identifier &detElId, const std::set< Identifier > &knownLayers) const
Returns a set of all layer Identifiers (GasGap + channel orientation) in a muon chamber of type X exc...
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
SG::ReadHandleKey< Muon::MdtPrepDataContainer > m_key_mdt
SG::ReadHandleKey< Muon::sTgcPrepDataContainer > m_key_stgc
ToolHandle< Muon::IMuonClusterOnTrackCreator > m_clusRotCreator
std::set< Identifier > holesInMdtChamber(const EventContext &ctx, const Amg::Vector3D &position, const Amg::Vector3D &direction, const Identifier &chId, const std::set< Identifier > &tubeIds) const
calculate holes in a given chamber using local straight line extrapolation
std::vector< const Prd * > loadPrepDataHits(const EventContext &ctx, const SG::ReadHandleKey< MuonPrepDataContainerT< Prd > > &key, const std::set< Identifier > &layerIds) const
bool getNextMuonMeasurement(RecoveryState &trkRecov, RecoveryState::CopyTarget target) const
Increments the internal iterator of the RecoveryState until the next muon measurement on track is fou...
NewTrackStates recoverChamberClusters(const EventContext &ctx, const SG::ReadHandleKey< MuonPrepDataContainerT< Prd > > &prdKey, const Identifier &chambId, const Trk::TrackParameters &parsInChamb, std::set< Identifier > &knownLayers) const
Attempts to recover all missing hits in a chamber.
SG::ReadHandleKey< Muon::CscPrepDataContainer > m_key_csc
std::vector< std::unique_ptr< const Trk::TrackStateOnSurface > > NewTrackStates
ToolHandle< Muon::IMuonClusterOnTrackCreator > m_cscRotCreator
PublicToolHandle< Muon::MuonEDMPrinterTool > m_printer
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_DetectorManagerKey
SG::ReadCondHandleKey< Muon::MuonIntersectGeoData > m_chamberGeoKey
ToolHandle< Trk::IResidualPullCalculator > m_pullCalculator
ToolHandle< Muon::IMdtDriftCircleOnTrackCreator > m_mdtRotCreator
void createHoleTSOSsForClusterChamber(const Identifier &detElId, const EventContext &ctx, const Trk::TrackParameters &pars, std::set< Identifier > &layIds, NewTrackStates &states) const override
MuonChamberHoleRecoveryTool(const std::string &, const std::string &, const IInterface *)
ServiceHandle< Trk::ITrackingVolumesSvc > m_trackingVolumesSvc
SG::ReadHandleKey< Muon::MMPrepDataContainer > m_key_mm
Property holding a SG store/key/clid from which a ReadHandle is made.
represents the track state (measurement, material, fit parameters and quality) at a surface.
This is the base class for all tracking detector elements with read-out relevant information.
Eigen::Matrix< double, 3, 1 > Vector3D
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
MuonChamberHoleRecoveryTool::NewTrackStates NewTrackStates
MuonPrepDataContainer< MuonPrepDataCollection< PrdType > > MuonPrepDataContainerT
ParametersBase< TrackParametersDim, Charged > TrackParameters
const Trk::TrackParameters * chamberPars() const
Track parameters of the chamber.
void finalizeChamber()
Sorts the hits accumulated in the current chamber using the first track parameters in that chamber.
std::set< Identifier > layersOnTrk
List of all measurement layers on track.
NewTrackStates chamberStates
Vector of the track states on surface in the current chamber.
Identifier tsosId
Identifier of the current trackStateOnSurface.
std::set< const Trk::TrackStateOnSurface * > m_copiedStates
CopyTarget
Switch indicating whether the track states are copied onto the global cache vector or onto the chambe...
std::unique_ptr< Trk::TrackStates > releaseStates()
Moves the recovered track states on surface onto a Trk::TrackStates to be piped into a new Trk::Track...