ATLAS Offline Software
Loading...
Searching...
No Matches
MuonSegmentMatchingTool.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_MUONSEGMENTMATCHINGTOOL_H
6#define MUON_MUONSEGMENTMATCHINGTOOL_H
7
8#include <atomic>
9
11#include "GaudiKernel/ServiceHandle.h"
12#include "GaudiKernel/ToolHandle.h"
20
21namespace Muon {
22
23class MuonSegment;
24
33class MuonSegmentMatchingTool : public extends<AthAlgTool, IMuonSegmentMatchingTool> {
34 public:
36 MuonSegmentMatchingTool(const std::string&, const std::string&, const IInterface*);
37
39 virtual ~MuonSegmentMatchingTool() = default;
40
42 StatusCode initialize();
43
45 StatusCode finalize();
46
48 bool match(const EventContext& ctx, const MuonSegment& seg1, const MuonSegment& seg2) const;
49
50 private:
52 bool straightLineMatch(const MuonSegment& seg1, const MuonSegment& seg2) const;
53
55 bool curvedMatch(const MuonSegment& seg1, const MuonSegment& seg2) const;
56
58 bool overlapMatch(const EventContext& ctx, const MuonSegment& seg1, const MuonSegment& seg2) const;
59
61 bool initializeField() const;
62
64 bool hasStereoAngle(const Identifier& id1, const Identifier& id2) const;
65
67 bool isSLMatch(const Identifier& chid1, const Identifier& chid2) const;
68
70 bool suppressNoise(const MuonSegment& seg1, const MuonSegment& seg2, const bool& useTightCuts) const;
71
73 bool suppressNoisePhi(const MuonSegment& seg1, const MuonSegment& seg2, const bool& useTightCuts) const;
74
77 void simpleEndcapExtrapolate(double x_segment, double y_segment, double z_segment, double theta_segment,
78 double z_extrapolated, double& r_expected, double& theta_expected,
79 double& rhoInv) const;
80
81
84 bool endcapExtrapolationMatch(const MuonSegment& seg1, const MuonSegment& seg2, bool useTightCuts) const;
85
87 this,
88 "MuonIdHelperSvc",
89 "Muon::MuonIdHelperSvc/MuonIdHelperSvc",
90 };
92 this,
93 "edmHelper",
94 "Muon::MuonEDMHelperSvc/MuonEDMHelperSvc",
95 "Handle to the service providing the IMuonEDMHelperSvc interface",
96 };
97
98 PublicToolHandle<Muon::MuonEDMPrinterTool> m_printer{
99 this,
100 "Printer",
101 "Muon::MuonEDMPrinterTool/MuonEDMPrinterTool",
102 };
103 ToolHandle<Muon::IMuonSegmentInOverlapResolvingTool> m_overlapResolvingTool{
104 this,
105 "MuonSegmentInOverlapResolvingTool",
106 "Muon::MuonSegmentInOverlapResolvingTool/MuonSegmentInOverlapResolvingTool",
107 };
108 ToolHandle<Muon::IMuonSegmentPairMatchingTool> m_pairMatchingTool{
109 this,
110 "MuonSegmentPairMatchingTool",
111 "Muon::MuonSegmentPairMatchingTool/MuonSegmentPairMatchingTool",
112 };
113
114 Gaudi::Property<bool> m_toroidOn{this, "ToroidOn", true, "Status of toroidal B-Field"};
115
116 mutable std::atomic_uint m_straightLineMatches{0};
117 mutable std::atomic_uint m_straightLineMatchesGood{0};
118 mutable std::atomic_uint m_overlapMatches{0};
119 mutable std::atomic_uint m_overlapMatchesGood{0};
120 mutable std::atomic_uint m_curvedMatches{0};
121 mutable std::atomic_uint m_curvedMatchesGood{0};
122 mutable std::atomic_uint m_duplicateHitUses{0};
123
131
132 // cuts for straight line match
135
136 // cuts for sl overlap match
139 double
144
145 // cuts for matching segments from different stations
146 double m_angleABCut{};
162
164
167
172};
173
174} // namespace Muon
175
176#endif
HWIdentifier id2
ServiceHandle< Muon::IMuonEDMHelperSvc > m_edmHelperSvc
EDM Helper tool.
StatusCode finalize()
AlgTool finalize.
bool endcapExtrapolationMatch(const MuonSegment &seg1, const MuonSegment &seg2, bool useTightCuts) const
match an endcap middle or outer segment with an inner segment using a simple analytic extrapolation m...
double m_minDistSegmentsCosmics
cut on the minimum distance between the segments, if the distance is larger
StatusCode initialize()
AlgTool initilize.
bool straightLineMatch(const MuonSegment &seg1, const MuonSegment &seg2) const
perform straight line matching using SL extrapolation
bool overlapMatch(const EventContext &ctx, const MuonSegment &seg1, const MuonSegment &seg2) const
perform overlap matching
double m_maxDistSegments
cut on the maximum distance between the segments
bool suppressNoise(const MuonSegment &seg1, const MuonSegment &seg2, const bool &useTightCuts) const
Suppress noise from cavern background/pile up using basic cuts.
bool match(const EventContext &ctx, const MuonSegment &seg1, const MuonSegment &seg2) const
match two segments
void simpleEndcapExtrapolate(double x_segment, double y_segment, double z_segment, double theta_segment, double z_extrapolated, double &r_expected, double &theta_expected, double &rhoInv) const
extrapolate segment in middle or outer endcap station to inner layer assuming the particle came from ...
bool isSLMatch(const Identifier &chid1, const Identifier &chid2) const
check whether we should perform a straight line match
bool m_useTightCuts
only apply tight selection for busy combinations
bool m_onlySameSectorIfTight
reject all segments in different sectors if in tight matching
virtual ~MuonSegmentMatchingTool()=default
destructor
MuonSegmentMatchingTool(const std::string &, const std::string &, const IInterface *)
constructor
ToolHandle< Muon::IMuonSegmentInOverlapResolvingTool > m_overlapResolvingTool
matching tool to handle the overlaps
PublicToolHandle< Muon::MuonEDMPrinterTool > m_printer
EDM printer tool.
bool curvedMatch(const MuonSegment &seg1, const MuonSegment &seg2) const
perform curved matching
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
ToolHandle< Muon::IMuonSegmentPairMatchingTool > m_pairMatchingTool
matching tool to handle the pairs of segments
double m_overlapMatchPhiHitPullCut
cut on the average pull of the phi hits with the new segment parameters
double m_overlapMatchPositionResidualCut
cut on the position residual for the best position match
bool initializeField() const
setup field
double m_overlapMatchAngleDYZCut
cut of the angular difference between phi from phi match and phi from positions
bool suppressNoisePhi(const MuonSegment &seg1, const MuonSegment &seg2, const bool &useTightCuts) const
Suppress noise from cavern background/pile up using basic cuts in phi.
bool hasStereoAngle(const Identifier &id1, const Identifier &id2) const
check whether the two segments have a stereo angle
double m_overlapMatchAngleDPhiCut
cut of the angular difference between phi from phi match and phi from positions
double m_overlapMatchPositionCut
cut on the distance of best position from the chamber bounds
This is the common class for 3D segments used in the muon spectrometer.
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.