ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
MuonR4::SpacePointPerLayerSorter Class Reference

The SpacePointPerLayerSorter sort two given space points by their layer Identifier. More...

#include <SpacePointPerLayerSorter.h>

Collaboration diagram for MuonR4::SpacePointPerLayerSorter:

Public Member Functions

 SpacePointPerLayerSorter (const Muon::IMuonIdHelperSvc *idHelperSvc)
 
bool operator() (const std::shared_ptr< SpacePoint > &sp1, const std::shared_ptr< SpacePoint > &sp2) const
 
bool operator() (const std::unique_ptr< SpacePoint > &sp1, const std::unique_ptr< SpacePoint > &sp2) const
 
bool operator() (const SpacePoint *sp1, const SpacePoint *sp2) const
 
bool operator() (const SpacePoint &sp1, const SpacePoint &sp2) const
 
Identifier detectorLayerId (const Identifier &id) const
 

Private Attributes

const Muon::IMuonIdHelperSvcm_idHelperSvc {nullptr}
 

Detailed Description

The SpacePointPerLayerSorter sort two given space points by their layer Identifier.

It is defined as the Identifier of the first tube in layer for the Mdts or as the Identifier of the first strip in a gasGap expressed in an eta view. First, all hits are sorted by layer Identifier - i.e. going outwards the detector. Then, hits in the same layer are sorted by y position (precision axis) in the sector frame and, if they have also the same y, they are sorted by x position (phi direction).

Definition at line 18 of file SpacePointPerLayerSorter.h.

Constructor & Destructor Documentation

◆ SpacePointPerLayerSorter()

MuonR4::SpacePointPerLayerSorter::SpacePointPerLayerSorter ( const Muon::IMuonIdHelperSvc idHelperSvc)

Definition at line 10 of file SpacePointPerLayerSorter.cxx.

11  : m_idHelperSvc{idHelperSvc} {}

Member Function Documentation

◆ detectorLayerId()

Identifier MuonR4::SpacePointPerLayerSorter::detectorLayerId ( const Identifier id) const

Definition at line 13 of file SpacePointPerLayerSorter.cxx.

13  {
14 
16 
17  switch (techIdx){
19  const MdtIdHelper& idHelper {m_idHelperSvc->mdtIdHelper()};
20 
21  Identifier detLayId {idHelper.channelID(idHelper.stationName(id), 1,
22  idHelper.stationPhi(id),
23  idHelper.multilayer(id),
24  idHelper.tubeLayer(id), 1)};
25  return detLayId;
26  }
28  const RpcIdHelper& idHelper {m_idHelperSvc->rpcIdHelper()};
29 
30  Identifier detLayId {idHelper.channelID(idHelper.stationName(id), 1,
31  idHelper.stationPhi(id),
32  idHelper.doubletR(id), 1, 1,
33  idHelper.gasGap(id), 0, 1)};
34  return detLayId;
35  }
37  const TgcIdHelper& idHelper {m_idHelperSvc->tgcIdHelper()};
38 
39  Identifier detLayId {idHelper.channelID(idHelper.stationName(id), 1,
40  idHelper.stationPhi(id),
41  idHelper.gasGap(id), 0, 1)};
42  return detLayId;
43  }
45  const sTgcIdHelper& idHelper {m_idHelperSvc->stgcIdHelper()};
46 
47  Identifier detLayId {idHelper.channelID(idHelper.stationName(id), 1,
48  idHelper.stationPhi(id),
49  idHelper.multilayer(id),
50  idHelper.gasGap(id),
51  idHelper.channelType(id), 1)};
52  return detLayId;
53  }
55  const MmIdHelper& idHelper {m_idHelperSvc->mmIdHelper()};
56 
57  Identifier detLayId {idHelper.channelID(idHelper.stationName(id), 1,
58  idHelper.stationPhi(id),
59  idHelper.multilayer(id),
60  idHelper.gasGap(id), 1)};
61  return detLayId;
62  }
63  default:
64  return id;
65  }
66  }

◆ operator()() [1/4]

bool MuonR4::SpacePointPerLayerSorter::operator() ( const SpacePoint sp1,
const SpacePoint sp2 
) const

Definition at line 68 of file SpacePointPerLayerSorter.cxx.

68  {
69 
70  const Identifier& id1 = sp1.identify();
71  const Identifier& id2 = sp2.identify();
72 
73  const Identifier lay1 {detectorLayerId(id1)};
74  const Identifier lay2 {detectorLayerId(id2)};
75 
76  if (lay1 == lay2) {
77  const double dy = sp1.positionInChamber().y() - sp2.positionInChamber().y();
78  if ( std::abs(dy) > 20 * Gaudi::Units::micrometer ){
79  return dy < 0;
80  }
81  return sp1.positionInChamber().x() < sp2.positionInChamber().x();
82  }
83  return sp1.positionInChamber().z() < sp2.positionInChamber().z();
84  }

◆ operator()() [2/4]

bool MuonR4::SpacePointPerLayerSorter::operator() ( const SpacePoint sp1,
const SpacePoint sp2 
) const

Definition at line 93 of file SpacePointPerLayerSorter.cxx.

93  {
94  return (*this)(*sp1, *sp2);
95  }

◆ operator()() [3/4]

bool MuonR4::SpacePointPerLayerSorter::operator() ( const std::shared_ptr< SpacePoint > &  sp1,
const std::shared_ptr< SpacePoint > &  sp2 
) const

Definition at line 86 of file SpacePointPerLayerSorter.cxx.

86  {
87  return (*this)(*sp1, *sp2);
88  }

◆ operator()() [4/4]

bool MuonR4::SpacePointPerLayerSorter::operator() ( const std::unique_ptr< SpacePoint > &  sp1,
const std::unique_ptr< SpacePoint > &  sp2 
) const

Definition at line 90 of file SpacePointPerLayerSorter.cxx.

90  {
91  return (*this)(*sp1, *sp2);
92  }

Member Data Documentation

◆ m_idHelperSvc

const Muon::IMuonIdHelperSvc* MuonR4::SpacePointPerLayerSorter::m_idHelperSvc {nullptr}
private

Definition at line 33 of file SpacePointPerLayerSorter.h.


The documentation for this class was generated from the following files:
Muon::IMuonIdHelperSvc::stgcIdHelper
virtual const sTgcIdHelper & stgcIdHelper() const =0
access to TgcIdHelper
TgcIdHelper
Definition: TgcIdHelper.h:50
MuonR4::SpacePointPerLayerSorter::detectorLayerId
Identifier detectorLayerId(const Identifier &id) const
Definition: SpacePointPerLayerSorter.cxx:13
Muon::IMuonIdHelperSvc::mmIdHelper
virtual const MmIdHelper & mmIdHelper() const =0
access to CscIdHelper
Muon::MuonStationIndex::MM
@ MM
Definition: MuonStationIndex.h:56
RpcIdHelper
Definition: RpcIdHelper.h:51
id2
HWIdentifier id2
Definition: LArRodBlockPhysicsV0.cxx:562
Muon::MuonStationIndex::STGC
@ STGC
Definition: MuonStationIndex.h:56
MdtIdHelper
Definition: MdtIdHelper.h:61
python.SystemOfUnits.micrometer
int micrometer
Definition: SystemOfUnits.py:71
Muon::IMuonIdHelperSvc::technologyIndex
virtual MuonStationIndex::TechnologyIndex technologyIndex(const Identifier &id) const =0
calculate layer index from Identifier
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:239
Muon::IMuonIdHelperSvc::mdtIdHelper
virtual const MdtIdHelper & mdtIdHelper() const =0
access to MdtIdHelper
sTgcIdHelper
Definition: sTgcIdHelper.h:55
Muon::IMuonIdHelperSvc::tgcIdHelper
virtual const TgcIdHelper & tgcIdHelper() const =0
access to TgcIdHelper
makeTRTBarrelCans.dy
tuple dy
Definition: makeTRTBarrelCans.py:21
Muon::MuonStationIndex::MDT
@ MDT
Definition: MuonStationIndex.h:56
MmIdHelper
Definition: MmIdHelper.h:54
MuonR4::SpacePointPerLayerSorter::m_idHelperSvc
const Muon::IMuonIdHelperSvc * m_idHelperSvc
Definition: SpacePointPerLayerSorter.h:33
Muon::MuonStationIndex::TGC
@ TGC
Definition: MuonStationIndex.h:56
Muon::MuonStationIndex::RPC
@ RPC
Definition: MuonStationIndex.h:56
Muon::MuonStationIndex::TechnologyIndex
TechnologyIndex
enum to classify the different layers in the muon spectrometer
Definition: MuonStationIndex.h:54
Muon::IMuonIdHelperSvc::rpcIdHelper
virtual const RpcIdHelper & rpcIdHelper() const =0
access to RpcIdHelper
Identifier
Definition: IdentifierFieldParser.cxx:14