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 return segment.nPrecisionHits() >= m_nMmSeedMinHitCut;
62 }
63 case STGC: {
64 return segment.nPrecisionHits() >= m_nStgcSeedMinHitCut;
65 }
66 default:
67 break;
68 }
69 return false;
70 }
71
72 bool SegmentSelectionTool::passTrackQuality(const EventContext& /*ctx*/,
73 const xAOD::MuonSegment& segment) const {
74 switch (segment.technology()) {
75 using enum TechnologyIndex;
76 case MDT: {
77 return segment.nPrecisionHits() >= m_nMdtMinHitCut;
78 }
79 case MM:
80 case STGC:{
81 return segment.nPrecisionHits() >= m_nMdtMinHitCut;
82 }
83 default:
84 break;
85 }
86 return false;
87 }
88 bool SegmentSelectionTool::compatibleForTrack(const EventContext& /*ctx*/,
89 const xAOD::MuonSegment& segA,
90 const xAOD::MuonSegment& segB) const {
92 if(segA.chamberIndex() == segB.chamberIndex() ||
93 segA.etaIndex() * segB.etaIndex() < 0) {
94 return false;
95 }
97 if (!segA.nPhiLayers() && !segB.nPhiLayers()) {
98 return true;
99 }
102 else if (segA.nPhiLayers() && !segB.nPhiLayers()) {
103 if (!ExpandedSector{segA.position().phi()}.isNeighbour(
104 ExpandedSector{static_cast<unsigned>(segB.sector()), ExpandedSector::SectorProjector::center})){
105 return false;
106 }
107 } else if (!segA.nPhiLayers() && segB.nPhiLayers()) {
108 if (!ExpandedSector{segB.position().phi()}.isNeighbour(
109 ExpandedSector{static_cast<unsigned>(segA.sector()), ExpandedSector::SectorProjector::center})){
110 return false;
111 }
112 }
114 else {
116 const double dPhi = std::abs(segA.position().deltaPhi(segB.position()));
117 if (dPhi > 5. * Gaudi::Units::deg) {
118 return false;
119 }
120 }
121 return true;
122 }
123
124}
#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
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_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_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_nStgcSeedMinHitCut
Gaudi::Property< unsigned > m_nMdtMinHitCut
Cut on minimum number of Mdt hits to consider the segment for tracking.
Gaudi::Property< unsigned > m_nMmSeedMinHitCut
Minimum number of Nsw hits for seeding.
Gaudi::Property< unsigned > m_nMdtSeedOutlierCut
Minimun.
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: