ATLAS Offline Software
Loading...
Searching...
No Matches
MuonCreatorTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MUONCOMBINEDBASETOOLS_MUONCREATORTOOL_H
6#define MUONCOMBINEDBASETOOLS_MUONCREATORTOOL_H
7
12#include "GaudiKernel/ServiceHandle.h"
13#include "GaudiKernel/ToolHandle.h"
34#include "TrkSegment/Segment.h"
42#include "xAODMuon/Muon.h"
46#include "xAODMuon/SlowMuon.h"
51
52namespace MuonCombined {
53 class StacoTag;
54 class CombinedFitTag;
55 class MuGirlTag;
56 class MuGirlLowBetaTag;
57 class SegmentTag;
58 class CaloTag;
59
60 class MuonCreatorTool : public extends<AthAlgTool, IMuonCreatorTool> {
61 public:
62 using InDetCandidateTagsMap = std::vector<InDetCandidateTags>;
63
64 using base_class::base_class;
65 ~MuonCreatorTool() = default;
66
67 virtual StatusCode initialize() override final;
68
70 virtual void create(const EventContext& ctx, const MuonCandidateCollection* muonCandidates,
71 const std::vector<const InDetCandidateToTagMap*>& tagMaps, OutputData& outputData) const override final;
72
74 virtual xAOD::Muon* create(const EventContext& ctx, const MuonCandidate& candidate, OutputData& outputData) const override final;
75
77 virtual xAOD::Muon* create(const EventContext& ctx, InDetCandidateTags& candidate, OutputData& outputData) const override final;
78
79 private:
80
82 void decorateDummyValues(const EventContext& ctx, xAOD::Muon& muon, OutputData& outputData) const;
83
84 void addStatisticalCombination(const EventContext& ctx, xAOD::Muon& muon, const InDetCandidate* candidate, const StacoTag* tag,
85 OutputData& outputData) const;
86
87 void addCombinedFit(const EventContext& ctx, xAOD::Muon& muon, const CombinedFitTag* tag, OutputData& outputData) const;
88
89 void addMuGirl(const EventContext& ctx, xAOD::Muon& muon, const MuGirlTag* tag, OutputData& outputData) const;
90
91 void addMuGirlLowBeta(const EventContext& ctx, xAOD::Muon& muon, const MuGirlLowBetaTag* tag, xAOD::SlowMuon* slowMuon,
92 OutputData& outputData) const;
93
94 void addSegmentTag(const EventContext& ctx, xAOD::Muon& muon, const SegmentTag* tag, OutputData& outputData) const;
95 void addCaloTag(xAOD::Muon& muon, const CaloTag* tag) const;
96
103 void addMuonCandidate(const EventContext& ctx, const MuonCandidate& candidate, xAOD::Muon& muon, OutputData& outputData,
105
109 ElementLink<xAOD::TrackParticleContainer> createTrackParticleElementLink(const EventContext& ctx,
111 xAOD::TrackParticleContainer& trackParticleContainer,
112 TrackCollection* trackCollection = 0) const;
113
114 ElementLink<xAOD::MuonSegmentContainer> createMuonSegmentElementLink(const EventContext& ctx, const Muon::MuonSegment* segLink,
115 const OutputData& outData) const;
116
117 private:
118 void resolveOverlaps(const EventContext& ctx, const MuonCandidateCollection* muonCandidates,
119 const std::vector<const InDetCandidateToTagMap*>& tagMaps, InDetCandidateTagsMap& resolvedInDetCandidates,
120 std::vector<const MuonCombined::MuonCandidate*>& resolvedMuonCandidates) const;
121
122 void selectStaus(InDetCandidateTagsMap& resolvedInDetCandidates, const std::vector<const InDetCandidateToTagMap*>& tagMaps) const;
123
124 std::unique_ptr<Trk::Track> createDummyTrack(const EventContext& ctx, const std::vector<const Muon::MuonSegment*>& segments,
125 const Trk::Track& indetTrack) const;
127
128 bool dressMuon(xAOD::Muon& muon) const;
129
130 void addEnergyLossToMuon(xAOD::Muon& muon) const;
131
132 void fillEnergyLossFromTrack(xAOD::Muon& muon, const std::vector<const Trk::TrackStateOnSurface*>* tsosVector) const;
133
134 void setP4(xAOD::Muon& muon, const xAOD::TrackParticle& tp) const;
135
136 void collectCells(const EventContext& ctx, xAOD::Muon& muon, xAOD::CaloClusterContainer* clusterContainer,
137 const Trk::CaloExtension* inputCaloExt = nullptr) const;
138
139 ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
140 ServiceHandle<Muon::IMuonEDMHelperSvc> m_edmHelperSvc{this, "edmHelper", "Muon::MuonEDMHelperSvc/MuonEDMHelperSvc",
141 "Handle to the service providing the IMuonEDMHelperSvc interface"};
142
143 PublicToolHandle<Muon::MuonEDMPrinterTool> m_printer{this, "Printer", "Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"};
144 ToolHandle<Rec::IMuonPrintingTool> m_muonPrinter{this, "MuonPrinter", "Rec::MuonPrintingTool/MuonPrintingTool"};
145
146 ToolHandle<Trk::IParticleCaloExtensionTool> m_caloExtTool{this, "ParticleCaloExtensionTool",
147 "Trk::ParticleCaloExtensionTool/ParticleCaloExtensionTool"};
148 ToolHandle<Trk::ITrackParticleCreatorTool> m_particleCreator{this, "TrackParticleCreator",
149 "Trk::TrackParticleCreatorTool/MuonCombinedTrackParticleCreator"};
150 ToolHandle<Trk::ITrackAmbiguityProcessorTool> m_ambiguityProcessor{this, "AmbiguityProcessor", ""};
151 ToolHandle<Trk::IPropagator> m_propagator{this, "Propagator", "Trk::RungeKuttaPropagator/AtlasRungeKuttaPropagator"};
152 ToolHandle<xAOD::IMuonDressingTool> m_muonDressingTool{this, "MuonDressingTool", "MuonCombined::MuonDressingTool/MuonDressingTool"};
153 ToolHandle<Rec::IMuonMomentumBalanceSignificance> m_momentumBalanceTool{this, "MomentumBalanceTool",
154 "Rec::MuonMomentumBalanceSignificanceTool/"
155 "MuonMomentumBalanceSignificanceTool"};
156 ToolHandle<Rec::IMuonScatteringAngleSignificance> m_scatteringAngleTool{this, "ScatteringAngleTool",
157 "Rec::MuonScatteringAngleSignificanceTool/"
158 "MuonScatteringAngleSignificanceTool"};
159 ToolHandle<CP::IMuonSelectionTool> m_selectorTool{this, "MuonSelectionTool", "CP::MuonSelectionTool/MuonSelectionTool"};
160
161 ToolHandle<Rec::IMuonMeanMDTdADCFiller> m_meanMDTdADCTool{this, "MeanMDTdADCTool",
162 "Rec::MuonMeanMDTdADCFillerTool/MuonMeanMDTdADCFillerTool"};
163 ToolHandle<Trk::ITrkMaterialProviderTool> m_caloMaterialProvider{this, "CaloMaterialProvider",
164 "Trk::TrkMaterialProviderTool/TrkMaterialProviderTool"};
165
166 ToolHandle<Rec::IMuonTrackQuery> m_trackQuery{this, "TrackQuery", "Rec::MuonTrackQuery/MuonTrackQuery"};
167 ToolHandle<Trk::IExtendedTrackSummaryTool> m_trackSummaryTool{this, "TrackSummaryTool", "MuonTrackSummaryTool"};
168
170
171 SG::ReadHandleKey<CaloCellContainer> m_cellContainerName{this, "CaloCellContainer", "AllCalo", "calo cells"};
172 SG::ReadCondHandleKey<CaloNoise> m_caloNoiseKey{this, "CaloNoise", "", "CaloNoise object to use, or blank."};
173
174 Gaudi::Property<bool> m_buildStauContainer{this, "BuildStauContainer", false, "flag to decide whether to build stau or not"};
175 Gaudi::Property<bool> m_addMDTExtrasMuGirlLowBeta{this, "AddMDTExtrasMuGirlLowBeta", false};
176 Gaudi::Property<bool> m_fillEnergyLossFromTrack{this, "FillEnergyLossFromTrack", true,
177 "Decide whether to try to extract the calo energy loss from tracks "};
178
179 Gaudi::Property<bool> m_fillExtraELossInfo{this, "FillExtraELossInfo", true,
180 "Can enabled this for debugging - will add extra information not for "
181 "production"};
182 Gaudi::Property<bool> m_printSummary{this, "PrintSummary", false, "flag to print muon edm"};
183 Gaudi::Property<bool> m_useUpdatedExtrapolatedTrack{this, "UseUpdatedExtrapolatedTrack", true,
184 "configure whether to use the updated extrapolated track for a combined "
185 "fit or not"};
186 Gaudi::Property<bool> m_segLowBeta{this, "AssociateSegmentsToLowBetaMuons", false, "associate segments to MuGirlLowBeta muons"};
187 Gaudi::Property<bool> m_useCaloCells{this, "UseCaloCells", true};
188 Gaudi::Property<bool> m_doSA{this, "MakeSAMuons", false};
192 Gaudi::Property<bool> m_requireIDTracks{this, "RequireIDTrack", false};
193
194 Gaudi::Property<float> m_sigmaCaloNoiseCut{this, "SigmaCaloNoiseCut", 3.4};
195
196 Gaudi::Property< std::vector<std::string> > m_copyFloatSummaryKeys
197 {this,"CopyFloatSummaryKeys",{"TRTTrackOccupancy","eProbabilityComb","eProbabilityHT","pixeldEdx","TRTdEdx","eProbabilityNN"},
198 "List of float aux element names to copy over from ID track particle summaries."};
199 Gaudi::Property< std::vector<std::string> > m_copyCharSummaryKeys
200 {this,"CopyUInt8SummaryKeys",
201 {"numberOfUsedHitsdEdx","numberOfIBLOverflowsdEdx","TRTdEdxUsedHits",
202 "expectInnermostPixelLayerHit", "expectNextToInnermostPixelLayerHit",
203 "numberOfPixelOutliers", "numberOfInnermostPixelLayerOutliers", "numberOfNextToInnermostPixelLayerOutliers", "numberOfSCTOutliers"},
204 "List of uint8_t aux element names to copy over from ID track particle summaries."};
205
206 Gaudi::Property<bool> m_requireMSOEforSA{this, "RequireMSOEforSA", true,
207 "Flag to accept muons with SA track only but not MSOE. Interesting for BSM?"};
208
209 Gaudi::Property<bool> m_requireCaloDepositForSA{this, "RequireCaloForSA", true,
210 "Flag to discard SA muons that have no calorimeter loss associated."};
211 std::vector< std::unique_ptr<SG::AuxElement::Accessor<float> > > m_copyFloatSummaryAccessors;
212 std::vector< std::unique_ptr<SG::AuxElement::Accessor<uint8_t> > > m_copyCharSummaryAccessors;
213
214 SG::ReadCondHandleKey<CaloDetDescrManager> m_caloMgrKey{this, "CaloDetDescrManager", "CaloDetDescrManager"};
215
216
217
218 };
219
220} // namespace MuonCombined
221
222#endif
Definition of CaloDetDescrManager.
DataVector< MuonCombined::MuonCandidate > MuonCandidateCollection
This typedef represents a collection of MuonCandidate objects.
Property holding a SG store/key/clid from which a ReadHandle is made.
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
TagBase implementation for a calo tag.
Definition CaloTag.h:17
TagBase implementation for a combined fit.
TagBase implementation for a combined fit.
TagBase implementation for a combined fit.
Definition MuGirlTag.h:23
void setP4(xAOD::Muon &muon, const xAOD::TrackParticle &tp) const
ToolHandle< Trk::ITrackParticleCreatorTool > m_particleCreator
void addCaloTag(xAOD::Muon &muon, const CaloTag *tag) const
void addSegmentTag(const EventContext &ctx, xAOD::Muon &muon, const SegmentTag *tag, OutputData &outputData) const
ToolHandle< Trk::IParticleCaloExtensionTool > m_caloExtTool
ToolHandle< Trk::ITrackAmbiguityProcessorTool > m_ambiguityProcessor
void fillEnergyLossFromTrack(xAOD::Muon &muon, const std::vector< const Trk::TrackStateOnSurface * > *tsosVector) const
std::vector< std::unique_ptr< SG::AuxElement::Accessor< float > > > m_copyFloatSummaryAccessors
PublicToolHandle< Muon::MuonEDMPrinterTool > m_printer
Gaudi::Property< bool > m_useCaloCells
ToolHandle< Rec::IMuonScatteringAngleSignificance > m_scatteringAngleTool
virtual void create(const EventContext &ctx, const MuonCandidateCollection *muonCandidates, const std::vector< const InDetCandidateToTagMap * > &tagMaps, OutputData &outputData) const override final
IMuonCreatorTool interface: build muons from ID and MS candidates.
SG::ReadHandleKey< CaloCellContainer > m_cellContainerName
ToolHandle< xAOD::IMuonDressingTool > m_muonDressingTool
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
Gaudi::Property< bool > m_fillExtraELossInfo
std::vector< InDetCandidateTags > InDetCandidateTagsMap
void addMuonCandidate(const EventContext &ctx, const MuonCandidate &candidate, xAOD::Muon &muon, OutputData &outputData, const ElementLink< TrackCollection > &meLink=ElementLink< TrackCollection >()) const
add muon candidate info to a muon, if an updateExtrapolatedTrack is provided, the routine takes owner...
void addMuGirlLowBeta(const EventContext &ctx, xAOD::Muon &muon, const MuGirlLowBetaTag *tag, xAOD::SlowMuon *slowMuon, OutputData &outputData) const
ToolHandle< Trk::IPropagator > m_propagator
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
bool dressMuon(xAOD::Muon &muon) const
Gaudi::Property< float > m_sigmaCaloNoiseCut
ToolHandle< Rec::IMuonPrintingTool > m_muonPrinter
Gaudi::Property< std::vector< std::string > > m_copyCharSummaryKeys
void setMuonHitCounts(xAOD::Muon &muon) const
ToolHandle< CP::IMuonSelectionTool > m_selectorTool
ToolHandle< Rec::IMuonMomentumBalanceSignificance > m_momentumBalanceTool
ElementLink< xAOD::TrackParticleContainer > createTrackParticleElementLink(const EventContext &ctx, const ElementLink< TrackCollection > &trackLink, xAOD::TrackParticleContainer &trackParticleContainer, TrackCollection *trackCollection=0) const
function creates an element link to a track particle from the track and the TrackParticle collection.
ToolHandle< Trk::ITrkMaterialProviderTool > m_caloMaterialProvider
void addEnergyLossToMuon(xAOD::Muon &muon) const
std::vector< std::unique_ptr< SG::AuxElement::Accessor< uint8_t > > > m_copyCharSummaryAccessors
ElementLink< xAOD::MuonSegmentContainer > createMuonSegmentElementLink(const EventContext &ctx, const Muon::MuonSegment *segLink, const OutputData &outData) const
void addCombinedFit(const EventContext &ctx, xAOD::Muon &muon, const CombinedFitTag *tag, OutputData &outputData) const
Gaudi::Property< std::vector< std::string > > m_copyFloatSummaryKeys
void selectStaus(InDetCandidateTagsMap &resolvedInDetCandidates, const std::vector< const InDetCandidateToTagMap * > &tagMaps) const
void resolveOverlaps(const EventContext &ctx, const MuonCandidateCollection *muonCandidates, const std::vector< const InDetCandidateToTagMap * > &tagMaps, InDetCandidateTagsMap &resolvedInDetCandidates, std::vector< const MuonCombined::MuonCandidate * > &resolvedMuonCandidates) const
void collectCells(const EventContext &ctx, xAOD::Muon &muon, xAOD::CaloClusterContainer *clusterContainer, const Trk::CaloExtension *inputCaloExt=nullptr) const
Gaudi::Property< bool > m_fillEnergyLossFromTrack
virtual StatusCode initialize() override final
Gaudi::Property< bool > m_segLowBeta
ServiceHandle< Muon::IMuonEDMHelperSvc > m_edmHelperSvc
Gaudi::Property< bool > m_addMDTExtrasMuGirlLowBeta
Gaudi::Property< bool > m_printSummary
ToolHandle< Rec::IMuonMeanMDTdADCFiller > m_meanMDTdADCTool
Gaudi::Property< bool > m_requireCaloDepositForSA
Gaudi::Property< bool > m_requireMSOEforSA
SG::ReadCondHandleKey< CaloNoise > m_caloNoiseKey
Gaudi::Property< bool > m_buildStauContainer
Rec::CaloCellCollector m_cellCollector
std::unique_ptr< Trk::Track > createDummyTrack(const EventContext &ctx, const std::vector< const Muon::MuonSegment * > &segments, const Trk::Track &indetTrack) const
Gaudi::Property< bool > m_useUpdatedExtrapolatedTrack
void decorateDummyValues(const EventContext &ctx, xAOD::Muon &muon, OutputData &outputData) const
De^corated a bunch of dummy values to the muon to ensure data consistency in the xAOD.
void addMuGirl(const EventContext &ctx, xAOD::Muon &muon, const MuGirlTag *tag, OutputData &outputData) const
Gaudi::Property< bool > m_doSA
Gaudi::Property< bool > m_requireIDTracks
In case of running the muon reconstruction with LRT tracks this property removes the overlap of muons...
void addStatisticalCombination(const EventContext &ctx, xAOD::Muon &muon, const InDetCandidate *candidate, const StacoTag *tag, OutputData &outputData) const
ToolHandle< Rec::IMuonTrackQuery > m_trackQuery
ToolHandle< Trk::IExtendedTrackSummaryTool > m_trackSummaryTool
TagBase implementation for a segment tagger.
Definition SegmentTag.h:14
TagBase implementation for a combined fit.
Definition StacoTag.h:22
This is the common class for 3D segments used in the muon spectrometer.
Property holding a SG store/key/clid from which a ReadHandle is made.
STL class.
The MuonTagToSegMap is an auxillary construct that links the MuonSegments associated with a combined ...
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Ensure that the ATLAS eigen extensions are properly loaded.
STL namespace.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
#define private