ATLAS Offline Software
Loading...
Searching...
No Matches
MuonR4::SegmentQualitySorter Struct Reference

Auxiliary class to rank segments by quality: more precision hits first, then more phi layers, more trigger eta layers, lower chi2/nDoF (NaN last) and finally the container index for a stable order. More...

#include <TrackingHelpers.h>

Collaboration diagram for MuonR4::SegmentQualitySorter:

Public Member Functions

bool operator() (const xAOD::MuonSegment *a, const xAOD::MuonSegment *b) const

Detailed Description

Auxiliary class to rank segments by quality: more precision hits first, then more phi layers, more trigger eta layers, lower chi2/nDoF (NaN last) and finally the container index for a stable order.

Definition at line 72 of file TrackingHelpers.h.

Member Function Documentation

◆ operator()()

bool MuonR4::SegmentQualitySorter::operator() ( const xAOD::MuonSegment * a,
const xAOD::MuonSegment * b ) const

Definition at line 136 of file TrackingHelpers.cxx.

137 {
138 if (a->nPrecisionHits() != b->nPrecisionHits()) {
139 return a->nPrecisionHits() > b->nPrecisionHits();
140 }
141 if (a->nPhiLayers() != b->nPhiLayers()) {
142 return a->nPhiLayers() > b->nPhiLayers();
143 }
144 if (a->nTrigEtaLayers() != b->nTrigEtaLayers()) {
145 return a->nTrigEtaLayers() > b->nTrigEtaLayers();
146 }
147 const float chi2A = a->chiSquared() / std::max(1.f, a->numberDoF());
148 const float chi2B = b->chiSquared() / std::max(1.f, b->numberDoF());
149 if (std::isnan(chi2A) != std::isnan(chi2B)) {
150 return std::isnan(chi2B);
151 }
152 if (chi2A != chi2B && !std::isnan(chi2A)) {
153 return chi2A < chi2B;
154 }
155 return a->index() < b->index();
156 }
static Double_t a

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