ATLAS Offline Software
Loading...
Searching...
No Matches
SegmentSelectionTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
5
7
8namespace {
9 using namespace Muon::MuonStationIndex;
10}
11
12
13namespace MuonR4{
14
16 ATH_CHECK(m_idHelperSvc.retrieve());
17 return StatusCode::SUCCESS;
18 }
19 bool SegmentSelectionTool::passSeedingQuality(const EventContext& /* ctx*/,
20 const xAOD::MuonSegment& segment) const {
21
22 switch (segment.technology()) {
23 using enum TechnologyIndex;
24 case MDT: {
25 if (segment.nPrecisionHits() < m_nMdtSeedHitCut ||
27 return false;
28 }
29 const LayerIndex layIdx {toLayerIndex(segment.chamberIndex())};
31 if (isBarrel(segment.chamberIndex())) {
32 switch (toLayerIndex(segment.chamberIndex())) {
33 using enum LayerIndex;
34 case Inner:
35 case BarrelExtended:
36 return segment.nPhiLayers() >= m_nRpcPhiSeedHitCutBI;
37 case Middle:
38 return segment.nPhiLayers() >= m_nRpcPhiSeedHitCutBM;
39 case Outer:
40 return segment.nPhiLayers() >= m_nRpcPhiSeedHitCutBO;
41 default:
42 break;
43 }
44 } else {
46 switch (layIdx) {
47 using enum LayerIndex;
48 case Extended:
49 return true;
50 case Inner:
51 return segment.nPhiLayers() >= m_nTgcPhiSeedHitCutEI;
52 case Middle:
53 return segment.nPhiLayers() >= m_nTgcPhiSeedHitCutEM;
54 default:
55 break;
56 }
57 }
58 break;
59 }
60 case MM:
61 case STGC: {
62 return segment.nPrecisionHits() >= m_nNswSeedMinHitCut;
63 }
64 default:
65 break;
66 }
67 return false;
68 }
69
70 bool SegmentSelectionTool::passTrackQuality(const EventContext& /*ctx*/,
71 const xAOD::MuonSegment& segment) const {
72 switch (segment.technology()) {
73 using enum TechnologyIndex;
74 case MDT: {
75 return segment.nPrecisionHits() >= m_nMdtMinHitCut;
76 }
77 case MM:
78 case STGC:{
79 return segment.nPrecisionHits() >= m_nNswMinHitCut;
80 }
81 default:
82 break;
83 }
84 return false;
85 }
86 bool SegmentSelectionTool::compatibleForTrack(const EventContext& /*ctx*/,
87 const xAOD::MuonSegment& segA,
88 const xAOD::MuonSegment& segB) const {
90 if(segA.chamberIndex() == segB.chamberIndex() ||
91 segA.etaIndex() * segB.etaIndex() < 0) {
92 return false;
93 }
95 if (!segA.nPhiLayers() && !segB.nPhiLayers()) {
96 return true;
97 }
100 else if (segA.nPhiLayers() && !segB.nPhiLayers()) {
101 if (!ExpandedSector{segA.position().phi()}.isNeighbour(
102 ExpandedSector{static_cast<unsigned>(segB.sector()), ExpandedSector::SectorProjector::center})){
103 return false;
104 }
105 } else if (!segA.nPhiLayers() && segB.nPhiLayers()) {
106 if (!ExpandedSector{segB.position().phi()}.isNeighbour(
107 ExpandedSector{static_cast<unsigned>(segA.sector()), ExpandedSector::SectorProjector::center})){
108 return false;
109 }
110 }
112 else {
114 const double dPhi = std::abs(segA.position().deltaPhi(segB.position()));
115 if (dPhi > 5. * Gaudi::Units::deg) {
116 return false;
117 }
118 }
119 return true;
120 }
121
122}
#define ATH_CHECK
Evaluate an expression and check for errors.
@ STGC
Definition RegSelEnums.h:39
@ MM
Definition RegSelEnums.h:38
@ MDT
Definition RegSelEnums.h:31
@ center
Project the segment onto the overlap with the previous sector.
bool isNeighbour(const ExpandedSector &other) const
Returns true if the expanded sector is a neighbour of the other.
Gaudi::Property< unsigned > m_nMdtSeedHitCut
Cut on minimum number of Mdt hits to consider the segment for seeding.
Gaudi::Property< unsigned > m_nRpcPhiSeedHitCutBI
Minimum number of Rpc phi hits in BI to consider the segment for seeding.
virtual bool compatibleForTrack(const EventContext &ctx, const xAOD::MuonSegment &segA, const xAOD::MuonSegment &segB) const override final
Returns whether two segments are compatible enough to be put both onto the track seed.
virtual bool passSeedingQuality(const EventContext &ctx, const xAOD::MuonSegment &segment) const override final
Returns whether a segment provides enough mdt & phi measurements to use it for track finding seeding.
Gaudi::Property< unsigned > m_nNswMinHitCut
Minimum number of Nsw hits to consider the segment for tracking.
Gaudi::Property< unsigned > m_nTgcPhiSeedHitCutEM
Minimum number of Tgc phi hits in EM to consider the segment for seeding.
Gaudi::Property< unsigned > m_nRpcPhiSeedHitCutBM
Minimum number of Rpc phi hits in BM to consider the segment for seeding.
Gaudi::Property< unsigned > m_nNswSeedMinHitCut
Minimum number of Nsw hits for seeding.
Gaudi::Property< unsigned > m_nTgcPhiSeedHitCutEI
Minimum number of Tgc phi hits in EI to consider the segment for seeding.
Gaudi::Property< unsigned > m_nRpcPhiSeedHitCutBO
Minimum number of Rpc phi hits in BO to consider the segment for seeding.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
IdHelperSvc to decode the Identifiers.
Gaudi::Property< unsigned > m_nMdtMinHitCut
Cut on minimum number of Mdt hits to consider the segment for tracking.
Gaudi::Property< unsigned > m_nMdtSeedOutlierCut
Cont on maximum number of outlies to consider the segment for seeding.
virtual StatusCode initialize() override final
virtual bool passTrackQuality(const EventContext &ctx, const xAOD::MuonSegment &segment) const override final
Returns whether a segment passes the base selection quality in order to be picked up onto a track.
std::uint8_t nPrecisionOutliers() const
Returns the number of precision outliers.
std::uint8_t nPrecisionHits() const
Returns the number of precision hits.
::Muon::MuonStationIndex::TechnologyIndex technology() const
Returns the main technology of the segment.
::Muon::MuonStationIndex::ChIndex chamberIndex() const
Returns the chamber index.
Amg::Vector3D position() const
Returns the position as Amg::Vector.
int etaIndex() const
Returns the eta index, which corresponds to stationEta in the offline identifiers (and the ).
std::uint8_t nPhiLayers() const
Returns the number of trigger phi hits.
This header ties the generic definitions in this package.
TechnologyIndex
enum to classify the different layers in the muon spectrometer
bool isBarrel(const ChIndex index)
Returns true if the chamber index points to a barrel chamber.
LayerIndex
enum to classify the different layers in the muon spectrometer
LayerIndex toLayerIndex(ChIndex index)
convert ChIndex into LayerIndex
MuonSegment_v1 MuonSegment
Reference the current persistent version: