ATLAS Offline Software
SegmentSelectionTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 #include "SegmentSelectionTool.h"
6 
7 namespace {
8  using LayIdx_t = Muon::MuonStationIndex::LayerIndex;
9 
10  // std::string print(0)
11 }
12 
13 
14 namespace 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 }
Muon::MuonStationIndex::LayerIndex
LayerIndex
enum to classify the different layers in the muon spectrometer
Definition: MuonStationIndex.h:38
MuonR4::Segment::summary
const HitSummary & summary() const
Returns the hit summary.
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonPatternEvent/MuonPatternEvent/Segment.h:74
MuonGMR4::SpectrometerSector::sector
int sector() const
Returns the sector of the MS-sector.
Definition: SpectrometerSector.cxx:64
MuonR4::SegmentSelectionTool::m_nMdtSeedOutlierCut
Gaudi::Property< unsigned > m_nMdtSeedOutlierCut
Minimun.
Definition: SegmentSelectionTool.h:46
MuonR4::SegmentSelectionTool::compatibleForTrack
virtual bool compatibleForTrack(const EventContext &ctx, const Segment &segA, const Segment &segB) const override final
Definition: SegmentSelectionTool.cxx:86
SegmentSelectionTool.h
MuonR4::SegmentSelectionTool::m_nStgcSeedMinHitCut
Gaudi::Property< unsigned > m_nStgcSeedMinHitCut
Definition: SegmentSelectionTool.h:43
MuonR4::Segment
Placeholder for what will later be the muon segment EDM representation.
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonPatternEvent/MuonPatternEvent/Segment.h:19
xAOD::UncalibMeasType::MMClusterType
@ MMClusterType
deg
#define deg
Definition: SbPolyhedron.cxx:17
MuonR4::SegmentSelectionTool::passTrackQuality
virtual bool passTrackQuality(const EventContext &ctx, const Segment &segment) const override final
Definition: SegmentSelectionTool.cxx:70
xAOD::UncalibMeasType::sTgcStripType
@ sTgcStripType
TauClusterVars::dPhi
bool dPhi(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
Definition: ConstituentLoaderTauCluster.cxx:119
MuonR4::Segment::position
const Amg::Vector3D & position() const
Returns the global segment position.
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonPatternEvent/MuonPatternEvent/Segment.h:41
Muon::MuonSectorMapping::insideSector
bool insideSector(int sector, double phi) const
checks whether the phi position is consistent with sector
Definition: MuonSectorMapping.h:74
MuonGMR4::SpectrometerSector::chamberIndex
Muon::MuonStationIndex::ChIndex chamberIndex() const
Returns the chamber index scheme.
Definition: SpectrometerSector.cxx:62
MuonR4::SegmentSelectionTool::m_nRpcPhiSeedHitCutBI
Gaudi::Property< unsigned > m_nRpcPhiSeedHitCutBI
Minimum number of Rpc phi hits in BI to consider the segment for seeding.
Definition: SegmentSelectionTool.h:48
MuonR4::SegmentSelectionTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
IdHelperSvc to decode the Identifiers.
Definition: SegmentSelectionTool.h:34
MuonR4::SegmentSelectionTool::m_sectorMap
const Muon::MuonSectorMapping m_sectorMap
Definition: SegmentSelectionTool.h:58
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
MuonGMR4::SpectrometerSector::barrel
bool barrel() const
Returns whether the sector is placed in the barrel.
Definition: SpectrometerSector.cxx:65
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MuonR4::SegmentSelectionTool::passSeedingQuality
virtual bool passSeedingQuality(const EventContext &ctx, const Segment &segment) const override final
Definition: SegmentSelectionTool.cxx:20
MuonR4::Segment::msSector
const MuonGMR4::SpectrometerSector * msSector() const
Returns the associated MS sector.
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonPatternEvent/MuonPatternEvent/Segment.h:39
MuonR4::SegmentSelectionTool::m_nMdtSeedHitCut
Gaudi::Property< unsigned > m_nMdtSeedHitCut
Cut on minimum number of Mdt hits to consider the segment for seeding
Definition: SegmentSelectionTool.h:36
MuonR4::SegmentSelectionTool::m_nRpcPhiSeedHitCutBO
Gaudi::Property< unsigned > m_nRpcPhiSeedHitCutBO
Minimum number of Rpc phi hits in BO to consider the segment for seeding.
Definition: SegmentSelectionTool.h:52
MuonR4::SegmentSelectionTool::m_nRpcPhiSeedHitCutBM
Gaudi::Property< unsigned > m_nRpcPhiSeedHitCutBM
Minimum number of Rpc phi hits in BM to consider the segment for seeding.
Definition: SegmentSelectionTool.h:50
sTgcMeasurement.h
MuonR4::SegmentSelectionTool::initialize
virtual StatusCode initialize() override final
Definition: SegmentSelectionTool.cxx:16
MuonR4::SegmentSelectionTool::m_nMmSeedMinHitCut
Gaudi::Property< unsigned > m_nMmSeedMinHitCut
Minimum number of Nsw hits for seeding.
Definition: SegmentSelectionTool.h:42
MuonR4
This header ties the generic definitions in this package.
Definition: HoughEventData.h:16
MuonR4::Segment::HitSummary
Helper struct to summarize the hit count
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonPatternEvent/MuonPatternEvent/Segment.h:61
Muon::MuonStationIndex::toLayerIndex
LayerIndex toLayerIndex(ChIndex index)
convert ChIndex into LayerIndex
MuonR4::Segment::HitSummary::nPhiHits
unsigned nPhiHits
Number of good Rpc / Tgc / sTgc phi hits.
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonPatternEvent/MuonPatternEvent/Segment.h:67
MuonR4::SegmentSelectionTool::m_nTgcPhiSeedHitCutEM
Gaudi::Property< unsigned > m_nTgcPhiSeedHitCutEM
Minimum number of Tgc phi hits in EM to consider the segment for seeding.
Definition: SegmentSelectionTool.h:56
xAOD::UncalibMeasType::MdtDriftCircleType
@ MdtDriftCircleType
MuonR4::SegmentSelectionTool::m_nMdtMinHitCut
Gaudi::Property< unsigned > m_nMdtMinHitCut
Cut on minimum number of Mdt hits to consider the segment for tracking.
Definition: SegmentSelectionTool.h:38
MuonR4::SegmentSelectionTool::m_nTgcPhiSeedHitCutEI
Gaudi::Property< unsigned > m_nTgcPhiSeedHitCutEI
Minimum number of Tgc phi hits in EI to consider the segment for seeding.
Definition: SegmentSelectionTool.h:54
SCT_Monitoring::summary
@ summary
Definition: SCT_MonitoringNumbers.h:65