ATLAS Offline Software
Loading...
Searching...
No Matches
Muon::SortByIPMuPatHits Class Reference

#include <SortMuPatHits.h>

Collaboration diagram for Muon::SortByIPMuPatHits:

Public Member Functions

 SortByIPMuPatHits (const IMuonIdHelperSvc *idh)
bool operator() (const MuPatHitPtr &hit1, const MuPatHitPtr &hit2) const
 Sort the mu pat hits using their associated surfaces.
bool operator() (const MuPatHit *hit1, const MuPatHit *hit2) const

Public Attributes

const IMuonIdHelperSvcm_idh {nullptr}
 DistanceAlongParameters distanceCalculator;.

Detailed Description

Definition at line 40 of file SortMuPatHits.h.

Constructor & Destructor Documentation

◆ SortByIPMuPatHits()

Muon::SortByIPMuPatHits::SortByIPMuPatHits ( const IMuonIdHelperSvc * idh)
inline

Definition at line 43 of file SortMuPatHits.h.

43: m_idh{idh} {}
const IMuonIdHelperSvc * m_idh
DistanceAlongParameters distanceCalculator;.

Member Function Documentation

◆ operator()() [1/2]

bool Muon::SortByIPMuPatHits::operator() ( const MuPatHit * hit1,
const MuPatHit * hit2 ) const
inline

large small overlap

Definition at line 48 of file SortMuPatHits.h.

48 {
49 // first, check if both hits are in the same chamber, and at least one is an RPC
50
51 const MuPatHit::Info& info1 = hit1->info();
52 const MuPatHit::Info& info2 = hit2->info();
53 const Identifier& id1 = info1.id;
54 const Identifier& id2 = info2.id;
55
56 const Trk::Surface& surf1{hit1->measurement().associatedSurface()};
57 const Trk::Surface& surf2{hit2->measurement().associatedSurface()};
58
59 if (info1.isEndcap && info2.isEndcap) {
60 const double absZ1 = std::abs(surf1.center().z());
61 const double absZ2 = std::abs(surf2.center().z());
62 if (std::abs(absZ1 - absZ2) > std::numeric_limits<float>::epsilon()) { return absZ1 < absZ2; }
63 } else if (!info1.isEndcap && !info2.isEndcap) {
64 const double perp1 = surf1.center().perp2();
65 const double perp2 = surf2.center().perp2();
66 if (std::abs(perp1 - perp2) > std::numeric_limits<float>::epsilon()) {return perp1 < perp2; }
67 }
69 else if (info1.isEndcap || info2.isEndcap) {
70 const MuonStationIndex::StIndex& st1 = info1.stIdx;
71 const MuonStationIndex::StIndex& st2 = info2.stIdx;
72 if (st1 != st2) return st1 < st2;
73 }
74 if (info1.type == info2.type) {
75 if (info1.type == MuPatHit::sTGC) {
76 const sTgcIdHelper& id_helper = m_idh->stgcIdHelper();
77 const int type1 =id_helper.channelType(id1);
78 const int type2 =id_helper.channelType(id2);
79 if (type1 != type2) return type1 > type2;
80 }
81 if (info1.status != info2.status) {
82 return info1.status < info2.status;
83 }
84 if (info1.measuresPhi == info2.measuresPhi) {
85 return hit1->pull() < hit2->pull();
86 }
87 }
88 // phi measurements larger than eta measurements
89 return !info1.measuresPhi;
90 }
Scalar perp2() const
perp2 method - perpendicular length squared
HWIdentifier id2
const Amg::Vector3D & center() const
Returns the center position of the Surface.
int channelType(const Identifier &id) const
StIndex
enum to classify the different station layers in the muon spectrometer

◆ operator()() [2/2]

bool Muon::SortByIPMuPatHits::operator() ( const MuPatHitPtr & hit1,
const MuPatHitPtr & hit2 ) const
inline

Sort the mu pat hits using their associated surfaces.

Definition at line 45 of file SortMuPatHits.h.

45 {
46 return operator()(hit1.get(), hit2.get());
47 }
bool operator()(const MuPatHitPtr &hit1, const MuPatHitPtr &hit2) const
Sort the mu pat hits using their associated surfaces.

Member Data Documentation

◆ m_idh

const IMuonIdHelperSvc* Muon::SortByIPMuPatHits::m_idh {nullptr}

DistanceAlongParameters distanceCalculator;.

Definition at line 93 of file SortMuPatHits.h.

93{nullptr};

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