ATLAS Offline Software
Loading...
Searching...
No Matches
SegmentSelectionTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
6
7namespace {
9
10 // std::string print(0)
11}
12
13
14namespace MuonR4{
15
17 ATH_CHECK(m_idHelperSvc.retrieve());
18 return StatusCode::SUCCESS;
19 }
20 bool SegmentSelectionTool::passSeedingQuality(const EventContext& /* ctx*/,
21 const Segment& segment) const {
22 const HitSummary& summary = segment.summary();
23
24 switch (summary.tech) {
26 if (summary.nPrecHits < m_nMdtSeedHitCut || summary.nPrecOutlier > m_nMdtSeedOutlierCut){
27 return false;
28 }
29 const LayIdx_t layIdx {Muon::MuonStationIndex::toLayerIndex(segment.msSector()->chamberIndex())};
31 if (segment.msSector()->barrel()) {
32 switch (layIdx) {
33 case LayIdx_t::Inner:
34 case LayIdx_t::BarrelExtended:
35 return summary.nPhiHits >= m_nRpcPhiSeedHitCutBI;
36 case LayIdx_t::Middle:
37 return summary.nPhiHits >= m_nRpcPhiSeedHitCutBM;
38 case LayIdx_t::Outer:
39 return summary.nPhiHits >= m_nRpcPhiSeedHitCutBO;
40 default:
41 break;
42 }
43 } else {
45 switch (layIdx) {
46 case LayIdx_t::Extended:
47 return true;
48 case LayIdx_t::Inner:
49 return summary.nPhiHits >= m_nTgcPhiSeedHitCutEI;
50 case LayIdx_t::Middle:
51 return summary.nPhiHits >= m_nTgcPhiSeedHitCutEM;
52 default:
53 break;
54 }
55 }
56 break;
57 }
59 return summary.nPrecHits >= m_nMmSeedMinHitCut;
60 }
62 return summary.nPrecHits >= m_nStgcSeedMinHitCut;
63 }
64 default:
65 break;
66 }
67 return false;
68 }
69
70 bool SegmentSelectionTool::passTrackQuality(const EventContext& /*ctx*/,
71 const Segment& segment) const {
72 const HitSummary& summary = segment.summary();
73 switch (summary.tech) {
75 return summary.nPrecHits >= m_nMdtMinHitCut;
76 }
79 return summary.nPrecHits >= m_nMdtMinHitCut;
80 }
81 default:
82 break;
83 }
84 return false;
85 }
86 bool SegmentSelectionTool::compatibleForTrack(const EventContext& /*ctx*/,
87 const Segment& segA,
88 const Segment& segB) const {
90 if(segA.msSector() == segB.msSector()) {
91 return false;
92 }
93 const HitSummary& sumA = segA.summary();
94 const HitSummary& sumB = segB.summary();
96 if (!sumA.nPhiHits && !sumB.nPhiHits) {
97 return true;
98 }
101 else if (sumA.nPhiHits && !sumB.nPhiHits) {
102 if (!m_sectorMap.insideSector(segB.msSector()->sector(), segA.position().phi())){
103 return false;
104 }
105 } else if (!sumA.nPhiHits && sumB.nPhiHits) {
106 if (!m_sectorMap.insideSector(segA.msSector()->sector(), segB.position().phi())) {
107 return false;
108 }
109 }
111 else {
113 const double dPhi = std::abs(segA.position().deltaPhi(segB.position()));
114 if (dPhi > 5. * Gaudi::Units::deg) {
115 return false;
116 }
117 }
118 return true;
119 }
120
121}
#define ATH_CHECK
Evaluate an expression and check for errors.
bool barrel() const
Returns whether the sector is placed in the barrel.
int sector() const
Returns the sector of the MS-sector.
Muon::MuonStationIndex::ChIndex chamberIndex() const
Returns the chamber index scheme.
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.
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
virtual bool passTrackQuality(const EventContext &ctx, const Segment &segment) const override final
virtual bool compatibleForTrack(const EventContext &ctx, const Segment &segA, const Segment &segB) const override final
virtual bool passSeedingQuality(const EventContext &ctx, const Segment &segment) const override final
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.
const Muon::MuonSectorMapping m_sectorMap
virtual StatusCode initialize() override final
Placeholder for what will later be the muon segment EDM representation.
const MuonGMR4::SpectrometerSector * msSector() const
Returns the associated MS sector.
const Amg::Vector3D & position() const
Returns the global segment position.
This header ties the generic definitions in this package.
LayerIndex toLayerIndex(ChIndex index)
convert ChIndex into LayerIndex
LayerIndex
enum to classify the different layers in the muon spectrometer