ATLAS Offline Software
Loading...
Searching...
No Matches
MuonR4::SegmentSelectionTool Class Reference

#include <SegmentSelectionTool.h>

Inheritance diagram for MuonR4::SegmentSelectionTool:
Collaboration diagram for MuonR4::SegmentSelectionTool:

Public Member Functions

virtual StatusCode initialize () override final
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.
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.
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.

Private Attributes

ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc {this, "IdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
 IdHelperSvc to decode the Identifiers.
Gaudi::Property< unsigned > m_nMdtSeedHitCut {this, "minMdtSeedHits" , 4}
 Cut on minimum number of Mdt hits to consider the segment for seeding.
Gaudi::Property< unsigned > m_nMdtMinHitCut {this, "minMdtHits" , 3}
 Cut on minimum number of Mdt hits to consider the segment for tracking.
Gaudi::Property< unsigned > m_nNswMinHitCut {this, "minNswHits", 4}
 Minimum number of Nsw hits to consider the segment for tracking.
Gaudi::Property< unsigned > m_nNswSeedMinHitCut {this, "minNswSeedHits", 6}
 Minimum number of Nsw hits for seeding.
Gaudi::Property< unsigned > m_nMdtSeedOutlierCut { this, "maxMdtOutliers", 15}
 Cont on maximum number of outlies to consider the segment for seeding.
Gaudi::Property< unsigned > m_nRpcPhiSeedHitCutBI { this, "minRpcPhiSeedHitsBI", 2}
 Minimum number of Rpc phi hits in BI to consider the segment for seeding.
Gaudi::Property< unsigned > m_nRpcPhiSeedHitCutBM { this, "minRpcPhiSeedHitsBM", 2}
 Minimum number of Rpc phi hits in BM to consider the segment for seeding.
Gaudi::Property< unsigned > m_nRpcPhiSeedHitCutBO { this, "minRpcPhiSeedHitsBO", 1}
 Minimum number of Rpc phi hits in BO to consider the segment for seeding.
Gaudi::Property< unsigned > m_nTgcPhiSeedHitCutEI {this, "minTgcPhiSeedHitsEI", 1}
 Minimum number of Tgc phi hits in EI to consider the segment for seeding.
Gaudi::Property< unsigned > m_nTgcPhiSeedHitCutEM {this, "minTgcPhiSeedHitsEM", 2}
 Minimum number of Tgc phi hits in EM to consider the segment for seeding.
Gaudi::Property< double > m_maxKickViolation

Detailed Description

Definition at line 16 of file SegmentSelectionTool.h.

Member Function Documentation

◆ compatibleForTrack()

bool MuonR4::SegmentSelectionTool::compatibleForTrack ( const EventContext & ctx,
const xAOD::MuonSegment & segA,
const xAOD::MuonSegment & segB ) const
finaloverridevirtual

Returns whether two segments are compatible enough to be put both onto the track seed.

Parameters
ctxEvent context to access conditions & geometry data
segmentReference to the segment to consider

Segment is on the same spectrometer layer

If one segment has phi information and the other doesn't then just check whether it's possible that the segment with phi is also in the same sector as the other

Both segments have phi information. Ensure that their phi is within 5 degrees

One toroid kick between the two segments: in the bending plane the chord between the segments must lie between their directions. If it doesn't, the smaller of the two deviations is the violation

Definition at line 87 of file SegmentSelectionTool.cxx.

89 {
91 if(segA.chamberIndex() == segB.chamberIndex() ||
92 segA.etaIndex() * segB.etaIndex() < 0) {
93 return false;
94 }
95 if (segA.nPhiLayers() || segB.nPhiLayers()) {
98 if (!segB.nPhiLayers()) {
99 if (!ExpandedSector{segA.position().phi()}.isNeighbour(
100 ExpandedSector{static_cast<unsigned>(segB.sector()), ExpandedSector::SectorProjector::center})){
101 return false;
102 }
103 } else if (!segA.nPhiLayers()) {
104 if (!ExpandedSector{segB.position().phi()}.isNeighbour(
105 ExpandedSector{static_cast<unsigned>(segA.sector()), ExpandedSector::SectorProjector::center})){
106 return false;
107 }
108 } else {
110 const double dPhi = std::abs(segA.position().deltaPhi(segB.position()));
111 if (dPhi > 5. * Gaudi::Units::deg) {
112 return false;
113 }
114 }
115 }
116 using namespace Acts::UnitLiterals;
120 const xAOD::MuonSegment& a = segA.position().mag() < segB.position().mag() ? segA : segB;
121 const xAOD::MuonSegment& b = &a == &segA ? segB : segA;
122 const Amg::Vector3D eR{Acts::makeDirectionFromPhiTheta(a.position().phi(), 90._degree)};
123 const Amg::Vector3D chord{b.position() - a.position()};
124 auto angle = [&eR](const Amg::Vector3D& v) {
125 return std::atan2(v.dot(eR), v.z());
126 };
127 const double thetaA {angle(a.direction())};
128 const double thetaB {angle(b.direction())};
129 const double thetaC {angle(chord)};
130 const double dA {std::remainder(thetaC - thetaA, 360._degree)};
131 const double dB {std::remainder(thetaB - thetaC, 360._degree)};
132 if (dA * dB >= 0.) {
133 return true;
134 }
135 const double violation {std::min(std::abs(dA), std::abs(dB))};
136 return violation < m_maxKickViolation;
137 }
static Double_t a
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
@ center
Project the segment onto the overlap with the previous sector.
Gaudi::Property< double > m_maxKickViolation
::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.
Eigen::Matrix< double, 3, 1 > Vector3D
bool dPhi(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
MuonSegment_v1 MuonSegment
Reference the current persistent version:

◆ initialize()

StatusCode MuonR4::SegmentSelectionTool::initialize ( )
finaloverridevirtual

Definition at line 16 of file SegmentSelectionTool.cxx.

16 {
17 ATH_CHECK(m_idHelperSvc.retrieve());
18 return StatusCode::SUCCESS;
19 }
#define ATH_CHECK
Evaluate an expression and check for errors.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
IdHelperSvc to decode the Identifiers.

◆ passSeedingQuality()

bool MuonR4::SegmentSelectionTool::passSeedingQuality ( const EventContext & ctx,
const xAOD::MuonSegment & segment ) const
finaloverridevirtual

Returns whether a segment provides enough mdt & phi measurements to use it for track finding seeding.

Parameters
ctxEvent context to access conditions & geometry data
segmentReference to the segment to consider

Apply a minimal threshold on the rpc phi trigger hits

Apply another threshold on the TGC trigger hits

Definition at line 20 of file SegmentSelectionTool.cxx.

21 {
22
23 switch (segment.technology()) {
24 using enum TechnologyIndex;
25 case MDT: {
26 if (segment.nPrecisionHits() < m_nMdtSeedHitCut ||
28 return false;
29 }
30 const LayerIndex layIdx {toLayerIndex(segment.chamberIndex())};
32 if (isBarrel(segment.chamberIndex())) {
33 switch (toLayerIndex(segment.chamberIndex())) {
34 using enum LayerIndex;
35 case Inner:
36 case BarrelExtended:
37 return segment.nPhiLayers() >= m_nRpcPhiSeedHitCutBI;
38 case Middle:
39 return segment.nPhiLayers() >= m_nRpcPhiSeedHitCutBM;
40 case Outer:
41 return segment.nPhiLayers() >= m_nRpcPhiSeedHitCutBO;
42 default:
43 break;
44 }
45 } else {
47 switch (layIdx) {
48 using enum LayerIndex;
49 case Extended:
50 return true;
51 case Inner:
52 return segment.nPhiLayers() >= m_nTgcPhiSeedHitCutEI;
53 case Middle:
54 return segment.nPhiLayers() >= m_nTgcPhiSeedHitCutEM;
55 default:
56 break;
57 }
58 }
59 break;
60 }
61 case MM:
62 case STGC: {
63 return segment.nPrecisionHits() >= m_nNswSeedMinHitCut;
64 }
65 default:
66 break;
67 }
68 return false;
69 }
@ STGC
Definition RegSelEnums.h:39
@ MM
Definition RegSelEnums.h:38
@ MDT
Definition RegSelEnums.h:31
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_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.
Gaudi::Property< unsigned > m_nMdtSeedOutlierCut
Cont on maximum number of outlies to consider the segment for seeding.
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.
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

◆ passTrackQuality()

bool MuonR4::SegmentSelectionTool::passTrackQuality ( const EventContext & ctx,
const xAOD::MuonSegment & segment ) const
finaloverridevirtual

Returns whether a segment passes the base selection quality in order to be picked up onto a track.

Parameters
ctxEvent context to access conditions & geometry data
segmentReference to the segment to consider

Definition at line 71 of file SegmentSelectionTool.cxx.

72 {
73 switch (segment.technology()) {
74 using enum TechnologyIndex;
75 case MDT: {
76 return segment.nPrecisionHits() >= m_nMdtMinHitCut;
77 }
78 case MM:
79 case STGC:{
80 return segment.nPrecisionHits() >= m_nNswMinHitCut;
81 }
82 default:
83 break;
84 }
85 return false;
86 }
Gaudi::Property< unsigned > m_nNswMinHitCut
Minimum number of Nsw hits to consider the segment for tracking.
Gaudi::Property< unsigned > m_nMdtMinHitCut
Cut on minimum number of Mdt hits to consider the segment for tracking.

Member Data Documentation

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> MuonR4::SegmentSelectionTool::m_idHelperSvc {this, "IdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

IdHelperSvc to decode the Identifiers.

Definition at line 35 of file SegmentSelectionTool.h.

35{this, "IdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};

◆ m_maxKickViolation

Gaudi::Property<double> MuonR4::SegmentSelectionTool::m_maxKickViolation
private
Initial value:
{this, "MaxKickViolation", 50. * Gaudi::Units::mrad,
"Maximum angle by which the chord between two segments may lie outside their directions (kick between them)"}

Definition at line 56 of file SegmentSelectionTool.h.

56 {this, "MaxKickViolation", 50. * Gaudi::Units::mrad,
57 "Maximum angle by which the chord between two segments may lie outside their directions (kick between them)"};

◆ m_nMdtMinHitCut

Gaudi::Property<unsigned> MuonR4::SegmentSelectionTool::m_nMdtMinHitCut {this, "minMdtHits" , 3}
private

Cut on minimum number of Mdt hits to consider the segment for tracking.

Definition at line 39 of file SegmentSelectionTool.h.

39{this, "minMdtHits" , 3};

◆ m_nMdtSeedHitCut

Gaudi::Property<unsigned> MuonR4::SegmentSelectionTool::m_nMdtSeedHitCut {this, "minMdtSeedHits" , 4}
private

Cut on minimum number of Mdt hits to consider the segment for seeding.

Definition at line 37 of file SegmentSelectionTool.h.

37{this, "minMdtSeedHits" , 4};

◆ m_nMdtSeedOutlierCut

Gaudi::Property<unsigned> MuonR4::SegmentSelectionTool::m_nMdtSeedOutlierCut { this, "maxMdtOutliers", 15}
private

Cont on maximum number of outlies to consider the segment for seeding.

Definition at line 45 of file SegmentSelectionTool.h.

45{ this, "maxMdtOutliers", 15};

◆ m_nNswMinHitCut

Gaudi::Property<unsigned> MuonR4::SegmentSelectionTool::m_nNswMinHitCut {this, "minNswHits", 4}
private

Minimum number of Nsw hits to consider the segment for tracking.

Definition at line 41 of file SegmentSelectionTool.h.

41{this, "minNswHits", 4};

◆ m_nNswSeedMinHitCut

Gaudi::Property<unsigned> MuonR4::SegmentSelectionTool::m_nNswSeedMinHitCut {this, "minNswSeedHits", 6}
private

Minimum number of Nsw hits for seeding.

Definition at line 43 of file SegmentSelectionTool.h.

43{this, "minNswSeedHits", 6};

◆ m_nRpcPhiSeedHitCutBI

Gaudi::Property<unsigned> MuonR4::SegmentSelectionTool::m_nRpcPhiSeedHitCutBI { this, "minRpcPhiSeedHitsBI", 2}
private

Minimum number of Rpc phi hits in BI to consider the segment for seeding.

Definition at line 47 of file SegmentSelectionTool.h.

47{ this, "minRpcPhiSeedHitsBI", 2};

◆ m_nRpcPhiSeedHitCutBM

Gaudi::Property<unsigned> MuonR4::SegmentSelectionTool::m_nRpcPhiSeedHitCutBM { this, "minRpcPhiSeedHitsBM", 2}
private

Minimum number of Rpc phi hits in BM to consider the segment for seeding.

Definition at line 49 of file SegmentSelectionTool.h.

49{ this, "minRpcPhiSeedHitsBM", 2};

◆ m_nRpcPhiSeedHitCutBO

Gaudi::Property<unsigned> MuonR4::SegmentSelectionTool::m_nRpcPhiSeedHitCutBO { this, "minRpcPhiSeedHitsBO", 1}
private

Minimum number of Rpc phi hits in BO to consider the segment for seeding.

Definition at line 51 of file SegmentSelectionTool.h.

51{ this, "minRpcPhiSeedHitsBO", 1};

◆ m_nTgcPhiSeedHitCutEI

Gaudi::Property<unsigned> MuonR4::SegmentSelectionTool::m_nTgcPhiSeedHitCutEI {this, "minTgcPhiSeedHitsEI", 1}
private

Minimum number of Tgc phi hits in EI to consider the segment for seeding.

Definition at line 53 of file SegmentSelectionTool.h.

53{this, "minTgcPhiSeedHitsEI", 1};

◆ m_nTgcPhiSeedHitCutEM

Gaudi::Property<unsigned> MuonR4::SegmentSelectionTool::m_nTgcPhiSeedHitCutEM {this, "minTgcPhiSeedHitsEM", 2}
private

Minimum number of Tgc phi hits in EM to consider the segment for seeding.

Definition at line 55 of file SegmentSelectionTool.h.

55{this, "minTgcPhiSeedHitsEM", 2};

The documentation for this class was generated from the following files: