ATLAS Offline Software
MuonInsideOutRecoTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef MUON_MUONINSIDEOUTRECOTOOL_H
6 #define MUON_MUONINSIDEOUTRECOTOOL_H
7 
8 #include <string>
9 #include <vector>
10 
12 #include "GaudiKernel/ServiceHandle.h"
13 #include "GaudiKernel/ToolHandle.h"
30 
31 namespace Muon {
32  struct MuonCandidate;
33  struct MuonLayerPrepRawData;
34 } // namespace Muon
35 
36 namespace Trk {
37  class Track;
38  class IExtendedTrackSummaryTool;
39 } // namespace Trk
40 
41 static const InterfaceID IID_MuonInsideOutRecoTool("MuonCombined::MuonInsideOutRecoTool", 1, 0);
42 
43 namespace MuonCombined {
44 
46  public:
48  MuonInsideOutRecoTool(const std::string& type, const std::string& name, const IInterface* parent);
49  virtual ~MuonInsideOutRecoTool() = default;
50  virtual StatusCode initialize() override;
51 
53  static const InterfaceID& interfaceID() { return IID_MuonInsideOutRecoTool; }
54 
56  virtual void extendWithPRDs(const InDetCandidateCollection& inDetCandidates, InDetCandidateToTagMap* tagMap,
58  TrackCollection* meTracks, Trk::SegmentCollection* segments, const EventContext& ctx) const override;
59 
61  virtual void extend(const InDetCandidateCollection& inDetCandidates, InDetCandidateToTagMap* tagMap, TrackCollection* combTracks,
62  TrackCollection* meTracks, Trk::SegmentCollection* segments, const EventContext& ctx) const override;
63 
65  std::pair<std::unique_ptr<const Muon::MuonCandidate>, std::unique_ptr<Trk::Track>> findBestCandidate(
66  const EventContext& ctx, const xAOD::TrackParticle& indetTrackParticle,
67  const std::vector<Muon::MuonLayerRecoData>& allLayers) const;
68 
69  private:
71  void handleCandidate(const InDetCandidate& inDetCandidate, InDetCandidateToTagMap* tagMap,
73  Trk::SegmentCollection* segments, const EventContext& ctx) const;
74 
76  void addTag(const EventContext& ctx, const InDetCandidate& indetCandidate, InDetCandidateToTagMap* tagMap,
77  const Muon::MuonCandidate& candidate, std::unique_ptr<Trk::Track>& selectedTrack, TrackCollection* combTracks,
78  TrackCollection* meTracks, Trk::SegmentCollection* segments) const;
79 
81  bool getLayerData(const Muon::MuonLayerSurface& surf, Muon::MuonLayerPrepRawData& layerPrepRawData,
83 
85  template <class COL>
88  std::vector<const Muon::MuonPrepDataCollection<COL>*>& output) const;
89 
90  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
91  ServiceHandle<Muon::IMuonEDMHelperSvc> m_edmHelperSvc{this, "edmHelper", "Muon::MuonEDMHelperSvc/MuonEDMHelperSvc",
92  "Handle to the service providing the IMuonEDMHelperSvc interface"};
93  PublicToolHandle<Muon::MuonEDMPrinterTool> m_printer{this, "MuonEDMPrinterTool", ""};
94  ToolHandle<Muon::IMuonLayerSegmentFinderTool> m_segmentFinder{this, "MuonLayerSegmentFinderTool",
95  "Muon::MuonLayerSegmentFinderTool/MuonLayerSegmentFinderTool"};
96  ToolHandle<Muon::IMuonLayerSegmentMatchingTool> m_segmentMatchingTool{
97  this, "MuonLayerSegmentMatchingTool", "Muon::MuonLayerSegmentMatchingTool/MuonLayerSegmentMatchingTool"};
98  ToolHandle<Muon::IMuonLayerAmbiguitySolverTool> m_ambiguityResolver{
99  this, "MuonLayerAmbiguitySolverTool", "Muon::MuonLayerAmbiguitySolverTool/MuonLayerAmbiguitySolverTool"};
100  ToolHandle<Muon::IMuonCandidateTrackBuilderTool> m_candidateTrackBuilder{
101  this, "MuonCandidateTrackBuilderTool", "Muon::MuonCandidateTrackBuilderTool/MuonCandidateTrackBuilderTool"};
102  ToolHandle<Rec::ICombinedMuonTrackBuilder> m_trackFitter{this, "MuonTrackBuilder",
103  "Rec::CombinedMuonTrackBuilder/CombinedMuonTrackBuilder"};
104  ToolHandle<Trk::ITrackAmbiguityProcessorTool> m_trackAmbiguityResolver{this, "TrackAmbiguityProcessor",
105  "Trk::TrackSelectionProcessorTool/MuonAmbiProcessor"};
106  ToolHandle<Muon::MuonLayerHashProviderTool> m_layerHashProvider{this, "MuonLayerHashProviderTool",
107  "Muon::MuonLayerHashProviderTool"};
108  ToolHandle<Trk::IExtendedTrackSummaryTool> m_trackSummaryTool{this, "TrackSummaryTool", "MuonTrackSummaryTool"};
109  ToolHandle<Muon::IMuonRecoValidationTool> m_recoValidationTool{this, "MuonRecoValidationTool", ""};
110 
111  Gaudi::Property<double> m_idTrackMinPt{this, "IDTrackMinPt", 2500};
112  Gaudi::Property<bool> m_ignoreSiAssocated{this, "IgnoreSiAssociatedCandidates", true};
113 
114  // vertex container key
115  SG::ReadHandleKey<xAOD::VertexContainer> m_vertexKey{this, "VertexContainer", "PrimaryVertices", "vertex container key"};
116  };
117 } // namespace MuonCombined
118 
119 #endif
Muon::MuonCandidate
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonLayerEvent/MuonLayerEvent/MuonCandidate.h:14
IMuonLayerAmbiguitySolverTool.h
ICombinedMuonTrackBuilder.h
MuonCombined::MuonInsideOutRecoTool::m_ignoreSiAssocated
Gaudi::Property< bool > m_ignoreSiAssocated
Definition: MuonInsideOutRecoTool.h:112
Muon::MuonPrepDataContainer
Template for Muon PRD containers (which are basically collections of MuonPrepDataCollections).
Definition: MuonPrepDataContainer.h:42
MuonTrackSummary.h
MuonEDMPrinterTool.h
MuonCombined::InDetCandidateToTagMap
Definition: InDetCandidateToTagMap.h:15
MuonCombined::MuonInsideOutRecoTool::m_ambiguityResolver
ToolHandle< Muon::IMuonLayerAmbiguitySolverTool > m_ambiguityResolver
Definition: MuonInsideOutRecoTool.h:98
MuonCombined::InDetCandidate
Definition: InDetCandidate.h:18
IMuonLayerSegmentMatchingTool.h
Muon::MuonLayerPrepRawData
Struct to hold all PrepRawData collections in a given layer.
Definition: MuonLayerPrepRawData.h:22
MuonCombined::MuonInsideOutRecoTool::extendWithPRDs
virtual void extendWithPRDs(const InDetCandidateCollection &inDetCandidates, InDetCandidateToTagMap *tagMap, IMuonCombinedInDetExtensionTool::MuonPrdData prdData, TrackCollection *combTracks, TrackCollection *meTracks, Trk::SegmentCollection *segments, const EventContext &ctx) const override
IMuonCombinedInDetExtensionTool interface: extend ID candidate with PRDs for segment-finding.
Definition: MuonInsideOutRecoTool.cxx:48
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:45
MuonCombined::MuonInsideOutRecoTool::m_segmentMatchingTool
ToolHandle< Muon::IMuonLayerSegmentMatchingTool > m_segmentMatchingTool
Definition: MuonInsideOutRecoTool.h:96
MuonCombined::MuonInsideOutRecoTool::interfaceID
static const InterfaceID & interfaceID()
access to tool interface
Definition: MuonInsideOutRecoTool.h:53
IMuonCandidateTrackBuilderTool.h
ITrackAmbiguityProcessorTool.h
MuonCombined::MuonInsideOutRecoTool::handleCandidate
void handleCandidate(const InDetCandidate &inDetCandidate, InDetCandidateToTagMap *tagMap, const IMuonCombinedInDetExtensionTool::MuonPrdData &prdData, TrackCollection *combTracks, TrackCollection *meTracks, Trk::SegmentCollection *segments, const EventContext &ctx) const
handle a single candidate
Definition: MuonInsideOutRecoTool.cxx:55
MuonCombined::MuonInsideOutRecoTool::m_segmentFinder
ToolHandle< Muon::IMuonLayerSegmentFinderTool > m_segmentFinder
Definition: MuonInsideOutRecoTool.h:94
MuonCombined::MuonInsideOutRecoTool::m_recoValidationTool
ToolHandle< Muon::IMuonRecoValidationTool > m_recoValidationTool
Definition: MuonInsideOutRecoTool.h:109
MuonCombined::MuonInsideOutRecoTool::m_trackFitter
ToolHandle< Rec::ICombinedMuonTrackBuilder > m_trackFitter
Definition: MuonInsideOutRecoTool.h:102
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
MuonCombined::MuonInsideOutRecoTool::getLayerData
bool getLayerData(const Muon::MuonLayerSurface &surf, Muon::MuonLayerPrepRawData &layerPrepRawData, IMuonCombinedInDetExtensionTool::MuonPrdData prdData) const
access data in layer
Definition: MuonInsideOutRecoTool.cxx:285
Muon::MuonLayerSurface
types
Definition: MuonLayerSurface.h:15
MuonCombined::MuonInsideOutRecoTool::findBestCandidate
std::pair< std::unique_ptr< const Muon::MuonCandidate >, std::unique_ptr< Trk::Track > > findBestCandidate(const EventContext &ctx, const xAOD::TrackParticle &indetTrackParticle, const std::vector< Muon::MuonLayerRecoData > &allLayers) const
find the best candidate for a given set of segments
Definition: MuonInsideOutRecoTool.cxx:131
MuonCombined::MuonInsideOutRecoTool::m_idTrackMinPt
Gaudi::Property< double > m_idTrackMinPt
Definition: MuonInsideOutRecoTool.h:111
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
AthAlgTool.h
IMuonCombinedInDetExtensionTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
MuonCombined::MuonInsideOutRecoTool::m_edmHelperSvc
ServiceHandle< Muon::IMuonEDMHelperSvc > m_edmHelperSvc
Definition: MuonInsideOutRecoTool.h:91
MuonCombined::MuonInsideOutRecoTool::m_vertexKey
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexKey
Definition: MuonInsideOutRecoTool.h:115
MuonCombined::MuonInsideOutRecoTool::addTag
void addTag(const EventContext &ctx, const InDetCandidate &indetCandidate, InDetCandidateToTagMap *tagMap, const Muon::MuonCandidate &candidate, std::unique_ptr< Trk::Track > &selectedTrack, TrackCollection *combTracks, TrackCollection *meTracks, Trk::SegmentCollection *segments) const
add muon candidate to indet candidate
Definition: MuonInsideOutRecoTool.cxx:190
MuonCombined::MuonInsideOutRecoTool::m_printer
PublicToolHandle< Muon::MuonEDMPrinterTool > m_printer
Definition: MuonInsideOutRecoTool.h:93
Muon::MuonPrepDataCollection
Template to hold collections of MuonPrepRawData objects.
Definition: MuonPrepDataCollection.h:46
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
IMuonLayerSegmentFinderTool.h
merge.output
output
Definition: merge.py:17
IMuonEDMHelperSvc.h
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
MuonCombined::MuonInsideOutRecoTool::getLayerDataTech
bool getLayerDataTech(Muon::MuonStationIndex::TechnologyIndex technology, const Muon::MuonLayerSurface &surf, const Muon::MuonPrepDataContainerT< COL > *input, std::vector< const Muon::MuonPrepDataCollection< COL > * > &output) const
access data in layer for a given technology
Definition: MuonInsideOutRecoTool.cxx:337
MuonCombined::MuonInsideOutRecoTool::MuonInsideOutRecoTool
MuonInsideOutRecoTool(const std::string &type, const std::string &name, const IInterface *parent)
Default AlgTool functions.
Definition: MuonInsideOutRecoTool.cxx:17
MuonCombined::MuonInsideOutRecoTool::m_candidateTrackBuilder
ToolHandle< Muon::IMuonCandidateTrackBuilderTool > m_candidateTrackBuilder
Definition: MuonInsideOutRecoTool.h:100
IMuonRecoValidationTool.h
MuonCombined::MuonInsideOutRecoTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonInsideOutRecoTool.h:90
MuonLayerHashProviderTool.h
MuonCombined::IMuonCombinedInDetExtensionTool
interface for tools buildingmuons from ID candidates
Definition: IMuonCombinedInDetExtensionTool.h:25
VertexContainer.h
MuonCombined::MuonInsideOutRecoTool::m_layerHashProvider
ToolHandle< Muon::MuonLayerHashProviderTool > m_layerHashProvider
Definition: MuonInsideOutRecoTool.h:106
IExtendedTrackSummaryTool.h
MuonCombined::MuonInsideOutRecoTool::initialize
virtual StatusCode initialize() override
Definition: MuonInsideOutRecoTool.cxx:23
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
MuonCombined
The MuonTagToSegMap is an auxillary construct that links the MuonSegments associated with a combined ...
Definition: IMuonSystemExtensionTool.h:23
MuonCombined::MuonInsideOutRecoTool::m_trackAmbiguityResolver
ToolHandle< Trk::ITrackAmbiguityProcessorTool > m_trackAmbiguityResolver
Definition: MuonInsideOutRecoTool.h:104
MuonCombined::MuonInsideOutRecoTool::m_trackSummaryTool
ToolHandle< Trk::IExtendedTrackSummaryTool > m_trackSummaryTool
Definition: MuonInsideOutRecoTool.h:108
Track
Definition: TriggerChamberClusterOnTrackCreator.h:21
MuonCombined::MuonInsideOutRecoTool
Definition: MuonInsideOutRecoTool.h:45
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
MuonCombined::IMuonCombinedInDetExtensionTool::MuonPrdData
Definition: IMuonCombinedInDetExtensionTool.h:27
AthAlgTool
Definition: AthAlgTool.h:26
MuonCombined::MuonInsideOutRecoTool::~MuonInsideOutRecoTool
virtual ~MuonInsideOutRecoTool()=default
MuonCombined::MuonInsideOutRecoTool::extend
virtual void extend(const InDetCandidateCollection &inDetCandidates, InDetCandidateToTagMap *tagMap, TrackCollection *combTracks, TrackCollection *meTracks, Trk::SegmentCollection *segments, const EventContext &ctx) const override
IMuonCombinedInDetExtensionTool interface: deprecated.
Definition: MuonInsideOutRecoTool.cxx:40
MuonLayerRecoData.h
Muon::MuonStationIndex::TechnologyIndex
TechnologyIndex
enum to classify the different layers in the muon spectrometer
Definition: MuonStationIndex.h:54
IMuonIdHelperSvc.h
ServiceHandle< Muon::IMuonIdHelperSvc >