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

#include <MuonCandidateTrackBuilderTool.h>

Collaboration diagram for Muon::SortMeas:

Public Member Functions

bool operator() (const Trk::MeasurementBase *mst1, const Trk::MeasurementBase *mst2) const
 SortMeas (const IMuonEDMHelperSvc *h, const IMuonIdHelperSvc *idh, bool end)

Public Attributes

const IMuonEDMHelperSvcm_edmHelperSvc
const IMuonIdHelperSvcm_idHelperSvc
bool isEndcap

Detailed Description

Definition at line 24 of file MuonCandidateTrackBuilderTool.h.

Constructor & Destructor Documentation

◆ SortMeas()

Muon::SortMeas::SortMeas ( const IMuonEDMHelperSvc * h,
const IMuonIdHelperSvc * idh,
bool end )
inline

Definition at line 68 of file MuonCandidateTrackBuilderTool.h.

68 :
69 m_edmHelperSvc(h), m_idHelperSvc(idh), isEndcap(end) {}
const IMuonEDMHelperSvc * m_edmHelperSvc
const IMuonIdHelperSvc * m_idHelperSvc

Member Function Documentation

◆ operator()()

bool Muon::SortMeas::operator() ( const Trk::MeasurementBase * mst1,
const Trk::MeasurementBase * mst2 ) const
inline

Definition at line 26 of file MuonCandidateTrackBuilderTool.h.

26 {
27 if (isEndcap) {
28 return std::abs(mst1->globalPosition().z()) < std::abs(mst2->globalPosition().z());
29 } else {
30 Identifier id1 = m_edmHelperSvc->getIdentifier(*mst1);
31 Identifier id2 = m_edmHelperSvc->getIdentifier(*mst2);
32 // for pseudomeasurements
33 if (!id1.is_valid() || !id2.is_valid())
34 return std::abs(mst1->globalPosition().perp()) < std::abs(mst2->globalPosition().perp());
35 // use r value if both are mdts or if they belong to different chambers
36 // for the case where it's rpc and mdt from the same chamber, use the doublet R
37 if ((m_idHelperSvc->isMdt(id1) && m_idHelperSvc->isMdt(id2)) ||
38 m_idHelperSvc->chamberIndex(id1) != m_idHelperSvc->chamberIndex(id2))
39 return mst1->globalPosition().perp() < mst2->globalPosition().perp();
40 else if (m_idHelperSvc->isRpc(id1) && m_idHelperSvc->isMdt(id2)) {
41 if (m_idHelperSvc->rpcIdHelper().doubletR(id1) == 1) {
42 if (m_idHelperSvc->stationIndex(id2) == MuonStationIndex::StIndex::BM || m_idHelperSvc->isSmallChamber(id2))
43 return true;
44 else
45 return false;
46 } else
47 return false;
48 } else if (m_idHelperSvc->isRpc(id2) && m_idHelperSvc->isMdt(id1)) {
49 if (m_idHelperSvc->rpcIdHelper().doubletR(id2) == 1) {
50 if (m_idHelperSvc->stationIndex(id1) == MuonStationIndex::StIndex::BM || m_idHelperSvc->isSmallChamber(id1))
51 return false;
52 else
53 return true;
54 } else
55 return true;
56 } else {
57 if (m_idHelperSvc->rpcIdHelper().doubletR(id1) != m_idHelperSvc->rpcIdHelper().doubletR(id2)) {
58 return m_idHelperSvc->rpcIdHelper().doubletR(id1) < m_idHelperSvc->rpcIdHelper().doubletR(id2);
59 } else if (m_idHelperSvc->rpcIdHelper().doubletZ(id1) != m_idHelperSvc->rpcIdHelper().doubletZ(id2)) {
60 return m_idHelperSvc->rpcIdHelper().doubletZ(id1) < m_idHelperSvc->rpcIdHelper().doubletZ(id2);
61 } else if (m_idHelperSvc->rpcIdHelper().doubletPhi(id1) != m_idHelperSvc->rpcIdHelper().doubletPhi(id2)) {
62 return m_idHelperSvc->rpcIdHelper().doubletPhi(id1) < m_idHelperSvc->rpcIdHelper().doubletPhi(id2);
63 } else
64 return mst1->globalPosition().perp() < mst2->globalPosition().perp();
65 }
66 }
67 }
HWIdentifier id2
bool is_valid() const
Check if id is in a valid state.
virtual const Amg::Vector3D & globalPosition() const =0
Interface method to get the global Position.

Member Data Documentation

◆ isEndcap

bool Muon::SortMeas::isEndcap

Definition at line 73 of file MuonCandidateTrackBuilderTool.h.

◆ m_edmHelperSvc

const IMuonEDMHelperSvc* Muon::SortMeas::m_edmHelperSvc

Definition at line 71 of file MuonCandidateTrackBuilderTool.h.

◆ m_idHelperSvc

const IMuonIdHelperSvc* Muon::SortMeas::m_idHelperSvc

Definition at line 72 of file MuonCandidateTrackBuilderTool.h.


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