ATLAS Offline Software
Loading...
Searching...
No Matches
CompactSegmentFinderTool.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 L0MuonMDTTools_COMPACTSEGMENTFINDERTOOL_H
6#define L0MuonMDTTools_COMPACTSEGMENTFINDERTOOL_H
8
9// local includes
16#include <optional>
17
18// namespace for the L0MDTS related classes
19namespace L0MDT {
20
34class CompactSegmentFinderTool : public extends<AthAlgTool, IL0MDTSegmentFinderTool> {
35
36public:
37 using base_class::base_class;
38 virtual ~CompactSegmentFinderTool() override = default;
39
41 virtual StatusCode initialize() override;
42
52 virtual StatusCode findSegments(const std::vector<const xAOD::MdtDriftCircle*>& driftCircles,
53 const ActsTrk::GeometryContext& gctx, float m, float b,
54 std::vector<L0MDT::Segment>& segments) const override;
55
56private:
57
59 Gaudi::Property<float> m_clusterTolerance{this, "ClusterTolerance", 5.f,
60 "Maximum allowed distance in intercept space when attaching a hit to an existing cluster"};
61
63 Gaudi::Property<int> m_maxClusters{this, "MaxClusters", 6,
64 "Maximum number of temporary clusters allowed during clustering"};
65
67 Gaudi::Property<bool> m_debugClusters{this, "DebugClusters", false,
68 "Enable debug printout of cluster content and selection"};
69
83 struct HitInfo {
84 const xAOD::MdtDriftCircle* dc{nullptr};
85 float z{0.f};
86 float r{0.f};
87 float driftRadius{0.f};
88 float bPlus{0.f};
89 float bMinus{0.f};
90 float deltaZ{0.f};
91 float deltaR{0.f};
92 int multilayer{0};
93 };
94
103 struct Cluster {
104 float refB{0.f};
105 std::vector<std::size_t> hitIndices;
106 std::vector<bool> plusFlags;
107 };
108
117 struct FitResult {
118 float m{0.f};
119 float b{0.f};
120 float chi2{0.f};
121 bool valid{false};
122 };
123
133 virtual StatusCode buildHitInfo(const std::vector<const xAOD::MdtDriftCircle*>& driftCircles,
134 const ActsTrk::GeometryContext& gctx, float m,
135 std::vector<HitInfo>& hitInfos) const;
136
144 void clusterHits(const std::vector<HitInfo>& hitInfos,
145 const std::vector<std::size_t>& orderedIndices,
146 std::vector<Cluster>& clusters) const;
147
150 this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
151
159 std::optional<Cluster> chooseBestCluster(const std::vector<Cluster>& clusters, float b) const;
160
171 FitResult fitLine(const std::vector<float>& zVals,
172 const std::vector<float>& rVals,
173 float sigma = 1.f / 8.f) const;
174};
175
176} // end of namespace
177#endif
virtual StatusCode findSegments(const std::vector< const xAOD::MdtDriftCircle * > &driftCircles, const ActsTrk::GeometryContext &gctx, float m, float b, std::vector< L0MDT::Segment > &segments) const override
Main segment finding entry point.
std::optional< Cluster > chooseBestCluster(const std::vector< Cluster > &clusters, float b) const
Select the best cluster among the available candidates.
virtual ~CompactSegmentFinderTool() override=default
Gaudi::Property< int > m_maxClusters
Maximum number of temporary clusters allowed during clustering.
virtual StatusCode buildHitInfo(const std::vector< const xAOD::MdtDriftCircle * > &driftCircles, const ActsTrk::GeometryContext &gctx, float m, std::vector< HitInfo > &hitInfos) const
Build the compact per-hit representation used by the algorithm.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
MDT identifier helper service.
FitResult fitLine(const std::vector< float > &zVals, const std::vector< float > &rVals, float sigma=1.f/8.f) const
Fit a straight line in the (z, R) plane.
Gaudi::Property< bool > m_debugClusters
Debug flag for printing cluster content and selection.
void clusterHits(const std::vector< HitInfo > &hitInfos, const std::vector< std::size_t > &orderedIndices, std::vector< Cluster > &clusters) const
Cluster ordered hits in intercept space.
Gaudi::Property< float > m_clusterTolerance
Maximum allowed distance in intercept space when attaching a hit to an existing cluster.
virtual StatusCode initialize() override
Standard Athena initialize method.
Compact Segment Finder algorithm overview.
MdtDriftCircle_v1 MdtDriftCircle
Temporary cluster of hit intercept hypotheses.
Output of the final straight-line fit.
Compact representation of one MDT hit used by the clustering and fit steps.