ATLAS Offline Software
MuonSegmentMatchingTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 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 
21 namespace Muon {
22 
23 class MuonSegment;
24 
34  public:
36  MuonSegmentMatchingTool(const std::string&, const std::string&, const IInterface*);
37 
39  virtual ~MuonSegmentMatchingTool() = default;
40 
43 
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
138  double
144 
145  // cuts for matching segments from different stations
146  double m_angleABCut{};
149  double m_matchingbibm_lphisec;
162 
164 
168 
173 };
174 
175 } // namespace Muon
176 
177 #endif
Muon::MuonSegmentMatchingTool::m_doOverlapMatch
bool m_doOverlapMatch
Definition: MuonSegmentMatchingTool.h:125
Muon::MuonSegmentMatchingTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonSegmentMatchingTool.h:86
Muon::MuonSegmentMatchingTool::MuonSegmentMatchingTool
MuonSegmentMatchingTool(const std::string &, const std::string &, const IInterface *)
constructor
Definition: MuonSegmentMatchingTool.cxx:14
Muon::MuonSegmentMatchingTool::m_matchingbibo_lphisec
double m_matchingbibo_lphisec
Definition: MuonSegmentMatchingTool.h:151
Muon::MuonSegmentMatchingTool::suppressNoise
bool suppressNoise(const MuonSegment &seg1, const MuonSegment &seg2, const bool &useTightCuts) const
Suppress noise from cavern background/pile up using basic cuts
Definition: MuonSegmentMatchingTool.cxx:325
Muon::MuonSegmentMatchingTool::m_overlapMatchPositionCut
double m_overlapMatchPositionCut
cut on the distance of best position from the chamber bounds
Definition: MuonSegmentMatchingTool.h:141
Muon::MuonSegmentMatchingTool::m_matchingemeo_lphisec
double m_matchingemeo_lphisec
Definition: MuonSegmentMatchingTool.h:155
Muon::MuonSegmentMatchingTool::m_maxDistSegments
double m_maxDistSegments
cut on the maximum distance between the segments
Definition: MuonSegmentMatchingTool.h:147
Muon::MuonSegmentMatchingTool::m_straightLineMatchPositionCut
double m_straightLineMatchPositionCut
Definition: MuonSegmentMatchingTool.h:134
IMuonSegmentMatchingTool.h
MuonEDMPrinterTool.h
Muon::MuonSegmentMatchingTool
tool to match segments using a curved trajectory.
Definition: MuonSegmentMatchingTool.h:33
Muon::MuonSegmentMatchingTool::hasStereoAngle
bool hasStereoAngle(const Identifier &id1, const Identifier &id2) const
check whether the two segments have a stereo angle
Definition: MuonSegmentMatchingTool.cxx:304
Muon::MuonSegmentMatchingTool::m_matchingbmbo_lphisec
double m_matchingbmbo_lphisec
Definition: MuonSegmentMatchingTool.h:152
Muon::MuonSegmentMatchingTool::m_duplicateHitUses
std::atomic_uint m_duplicateHitUses
Definition: MuonSegmentMatchingTool.h:122
Muon::MuonSegmentMatchingTool::m_printer
PublicToolHandle< Muon::MuonEDMPrinterTool > m_printer
EDM printer tool.
Definition: MuonSegmentMatchingTool.h:98
Muon::MuonSegmentMatchingTool::m_matchingbee_sphisec
double m_matchingbee_sphisec
Definition: MuonSegmentMatchingTool.h:163
Muon::MuonSegmentMatchingTool::m_overlapMatches
std::atomic_uint m_overlapMatches
Definition: MuonSegmentMatchingTool.h:118
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition: TrackSystemController.h:45
xAOD::MuonSegment
MuonSegment_v1 MuonSegment
Reference the current persistent version:
Definition: Event/xAOD/xAODMuon/xAODMuon/MuonSegment.h:13
Muon::MuonSegmentMatchingTool::m_matchingeiem_sphisec
double m_matchingeiem_sphisec
Definition: MuonSegmentMatchingTool.h:159
Muon::MuonSegmentMatchingTool::m_drExtrapRMS
double m_drExtrapRMS
Definition: MuonSegmentMatchingTool.h:170
Muon::MuonSegmentMatchingTool::m_doCurvedMatch
bool m_doCurvedMatch
Definition: MuonSegmentMatchingTool.h:127
MagneticFieldProperties.h
Muon::MuonSegmentMatchingTool::m_phiMatch
bool m_phiMatch
Definition: MuonSegmentMatchingTool.h:129
Muon::MuonSegmentMatchingTool::m_isCosmics
bool m_isCosmics
Definition: MuonSegmentMatchingTool.h:124
Muon::MuonSegmentMatchingTool::m_matchingbibo_sphisec
double m_matchingbibo_sphisec
Definition: MuonSegmentMatchingTool.h:157
Muon::MuonSegmentMatchingTool::m_straightLineMatches
std::atomic_uint m_straightLineMatches
Definition: MuonSegmentMatchingTool.h:116
Muon::MuonSegmentMatchingTool::m_matchingemeo_sphisec
double m_matchingemeo_sphisec
Definition: MuonSegmentMatchingTool.h:161
Muon::MuonSegmentMatchingTool::m_curvedMatches
std::atomic_uint m_curvedMatches
Definition: MuonSegmentMatchingTool.h:120
Muon::MuonSegmentMatchingTool::isSLMatch
bool isSLMatch(const Identifier &chid1, const Identifier &chid2) const
check whether we should perform a straight line match
Definition: MuonSegmentMatchingTool.cxx:282
id2
HWIdentifier id2
Definition: LArRodBlockPhysicsV0.cxx:562
IMuonSegmentInOverlapResolvingTool.h
Muon::MuonSegmentMatchingTool::m_matchingbibm_lphisec
double m_matchingbibm_lphisec
Definition: MuonSegmentMatchingTool.h:150
Muon::MuonSegmentMatchingTool::m_onlySameSectorIfTight
bool m_onlySameSectorIfTight
reject all segments in different sectors if in tight matching
Definition: MuonSegmentMatchingTool.h:165
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
Muon::MuonSegmentMatchingTool::m_matchingeieo_sphisec
double m_matchingeieo_sphisec
Definition: MuonSegmentMatchingTool.h:160
Muon::MuonSegmentMatchingTool::m_useEndcapExtrapolationMatching
bool m_useEndcapExtrapolationMatching
Definition: MuonSegmentMatchingTool.h:169
Muon::MuonSegmentMatchingTool::m_drExtrapAlignmentOffset
double m_drExtrapAlignmentOffset
Definition: MuonSegmentMatchingTool.h:171
Muon::MuonSegmentMatchingTool::initialize
StatusCode initialize()
AlgTool initilize.
Definition: MuonSegmentMatchingTool.cxx:84
Muon::MuonSegmentMatchingTool::finalize
StatusCode finalize()
AlgTool finalize.
Definition: MuonSegmentMatchingTool.cxx:96
IMuonEDMHelperSvc.h
Muon::MuonSegmentMatchingTool::initializeField
bool initializeField() const
setup field
Muon::MuonSegmentMatchingTool::overlapMatch
bool overlapMatch(const EventContext &ctx, const MuonSegment &seg1, const MuonSegment &seg2) const
perform overlap matching
Definition: MuonSegmentMatchingTool.cxx:214
Muon::MuonSegmentMatchingTool::m_overlapResolvingTool
ToolHandle< Muon::IMuonSegmentInOverlapResolvingTool > m_overlapResolvingTool
matching tool to handle the overlaps
Definition: MuonSegmentMatchingTool.h:103
Muon::MuonSegmentMatchingTool::m_straightLineMatchesGood
std::atomic_uint m_straightLineMatchesGood
Definition: MuonSegmentMatchingTool.h:117
Muon::MuonSegmentMatchingTool::m_matchingeiem_lphisec
double m_matchingeiem_lphisec
Definition: MuonSegmentMatchingTool.h:153
Muon::MuonSegmentMatchingTool::m_overlapMatchAngleDPhiCut
double m_overlapMatchAngleDPhiCut
cut of the angular difference between phi from phi match and phi from positions
Definition: MuonSegmentMatchingTool.h:137
Muon::MuonSegmentMatchingTool::m_matchingbmbo_sphisec
double m_matchingbmbo_sphisec
Definition: MuonSegmentMatchingTool.h:158
Muon::MuonSegmentMatchingTool::m_dthetaExtrapRMS
double m_dthetaExtrapRMS
Definition: MuonSegmentMatchingTool.h:172
Muon::MuonSegmentMatchingTool::m_toroidOn
Gaudi::Property< bool > m_toroidOn
Definition: MuonSegmentMatchingTool.h:114
Muon::MuonSegmentMatchingTool::m_thetaMatch
bool m_thetaMatch
Definition: MuonSegmentMatchingTool.h:128
Muon::MuonSegmentMatchingTool::m_pairMatchingTool
ToolHandle< Muon::IMuonSegmentPairMatchingTool > m_pairMatchingTool
matching tool to handle the pairs of segments
Definition: MuonSegmentMatchingTool.h:108
IMuonSegmentPairMatchingTool.h
Muon::MuonSegmentMatchingTool::m_overlapMatchPositionResidualCut
double m_overlapMatchPositionResidualCut
cut on the position residual for the best position match
Definition: MuonSegmentMatchingTool.h:142
Muon::MuonSegmentMatchingTool::endcapExtrapolationMatch
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...
Definition: MuonSegmentMatchingTool.cxx:780
Muon::MuonSegmentMatchingTool::m_doStraightLineMatch
bool m_doStraightLineMatch
Definition: MuonSegmentMatchingTool.h:126
Muon::MuonSegmentMatchingTool::m_straightLineMatchAngleCut
double m_straightLineMatchAngleCut
Definition: MuonSegmentMatchingTool.h:133
Muon::MuonSegmentMatchingTool::simpleEndcapExtrapolate
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 ...
Definition: MuonSegmentMatchingTool.cxx:851
Muon::IMuonSegmentMatchingTool
tool to match segments
Definition: IMuonSegmentMatchingTool.h:26
Muon::MuonSegmentMatchingTool::m_overlapMatchAngleDYZCut
double m_overlapMatchAngleDYZCut
cut of the angular difference between phi from phi match and phi from positions
Definition: MuonSegmentMatchingTool.h:140
Muon::MuonSegmentMatchingTool::curvedMatch
bool curvedMatch(const MuonSegment &seg1, const MuonSegment &seg2) const
perform curved matching
Definition: MuonSegmentMatchingTool.cxx:192
Muon::MuonSegmentMatchingTool::~MuonSegmentMatchingTool
virtual ~MuonSegmentMatchingTool()=default
destructor
Muon::MuonSegmentMatchingTool::m_angleABCut
double m_angleABCut
Definition: MuonSegmentMatchingTool.h:146
Muon::MuonSegmentMatchingTool::m_curvedMatchesGood
std::atomic_uint m_curvedMatchesGood
Definition: MuonSegmentMatchingTool.h:121
Muon::MuonSegment
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:45
AthAlgTool
Definition: AthAlgTool.h:26
Muon::MuonSegmentMatchingTool::m_overlapMatchesGood
std::atomic_uint m_overlapMatchesGood
Definition: MuonSegmentMatchingTool.h:119
Muon::MuonSegmentMatchingTool::m_useLocalAngles
bool m_useLocalAngles
Definition: MuonSegmentMatchingTool.h:130
Muon::MuonSegmentMatchingTool::m_edmHelperSvc
ServiceHandle< Muon::IMuonEDMHelperSvc > m_edmHelperSvc
EDM Helper tool.
Definition: MuonSegmentMatchingTool.h:91
Muon::MuonSegmentMatchingTool::suppressNoisePhi
bool suppressNoisePhi(const MuonSegment &seg1, const MuonSegment &seg2, const bool &useTightCuts) const
Suppress noise from cavern background/pile up using basic cuts in phi.
Definition: MuonSegmentMatchingTool.cxx:608
Muon::MuonSegmentMatchingTool::m_dumpAngles
bool m_dumpAngles
dump matching angle info to screen
Definition: MuonSegmentMatchingTool.h:167
Muon::MuonSegmentMatchingTool::m_matchingeieo_lphisec
double m_matchingeieo_lphisec
Definition: MuonSegmentMatchingTool.h:154
Muon::MuonSegmentMatchingTool::m_useTightCuts
bool m_useTightCuts
only apply tight selection for busy combinations
Definition: MuonSegmentMatchingTool.h:166
Muon::MuonSegmentMatchingTool::straightLineMatch
bool straightLineMatch(const MuonSegment &seg1, const MuonSegment &seg2) const
perform straight line matching using SL extrapolation
Definition: MuonSegmentMatchingTool.cxx:170
Muon::MuonSegmentMatchingTool::m_minDistSegmentsCosmics
double m_minDistSegmentsCosmics
cut on the minimum distance between the segments, if the distance is larger
Definition: MuonSegmentMatchingTool.h:148
IMuonIdHelperSvc.h
Muon::MuonSegmentMatchingTool::m_overlapMatchPhiHitPullCut
double m_overlapMatchPhiHitPullCut
cut on the average pull of the phi hits with the new segment parameters
Definition: MuonSegmentMatchingTool.h:143
ServiceHandle< Muon::IMuonIdHelperSvc >
Muon::MuonSegmentMatchingTool::m_matchingbibm_sphisec
double m_matchingbibm_sphisec
Definition: MuonSegmentMatchingTool.h:156
Muon::MuonSegmentMatchingTool::match
bool match(const EventContext &ctx, const MuonSegment &seg1, const MuonSegment &seg2) const
match two segments
Definition: MuonSegmentMatchingTool.cxx:120
Identifier
Definition: IdentifierFieldParser.cxx:14