ATLAS Offline Software
SpacePointPerLayerSorter.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
7 
8 namespace MuonR4 {
9 
11  : m_idHelperSvc{idHelperSvc} {}
12 
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  }
67 
68  bool SpacePointPerLayerSorter::operator()(const SpacePoint& sp1, const SpacePoint& sp2) const{
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  }
85 
86  bool SpacePointPerLayerSorter::operator()(const std::shared_ptr<SpacePoint>& sp1, const std::shared_ptr<SpacePoint>& sp2) const {
87  return (*this)(*sp1, *sp2);
88  }
89 
90  bool SpacePointPerLayerSorter::operator()(const std::unique_ptr<SpacePoint>& sp1, const std::unique_ptr<SpacePoint>& sp2) const {
91  return (*this)(*sp1, *sp2);
92  }
93  bool SpacePointPerLayerSorter::operator()(const SpacePoint* sp1, const SpacePoint* sp2) const {
94  return (*this)(*sp1, *sp2);
95  }
96 
97 }
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
MuonR4::SpacePointPerLayerSorter::SpacePointPerLayerSorter
SpacePointPerLayerSorter(const Muon::IMuonIdHelperSvc *idHelperSvc)
Definition: SpacePointPerLayerSorter.cxx:10
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
MuonR4::SpacePoint
The muon space point is the combination of two uncalibrated measurements one of them measures the eta...
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/MuonSpacePoint/SpacePoint.h:18
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
MuonR4::SpacePointPerLayerSorter::operator()
bool operator()(const std::shared_ptr< SpacePoint > &sp1, const std::shared_ptr< SpacePoint > &sp2) const
Definition: SpacePointPerLayerSorter.cxx:86
Muon::IMuonIdHelperSvc::tgcIdHelper
virtual const TgcIdHelper & tgcIdHelper() const =0
access to TgcIdHelper
MuonR4
This header ties the generic definitions in this package.
Definition: HoughEventData.h:16
makeTRTBarrelCans.dy
tuple dy
Definition: makeTRTBarrelCans.py:21
Muon::MuonStationIndex::MDT
@ MDT
Definition: MuonStationIndex.h:56
MuonR4::SpacePoint::positionInChamber
const Amg::Vector3D & positionInChamber() const
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/SpacePoint.cxx:119
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::IMuonIdHelperSvc
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
Definition: IMuonIdHelperSvc.h:27
MuonStationIndex.h
Muon::MuonStationIndex::TechnologyIndex
TechnologyIndex
enum to classify the different layers in the muon spectrometer
Definition: MuonStationIndex.h:54
SpacePointPerLayerSorter.h
IMuonIdHelperSvc.h
MuonR4::SpacePoint::identify
const Identifier & identify() const
: Identifier of the primary measurement
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/SpacePoint.cxx:140
Muon::IMuonIdHelperSvc::rpcIdHelper
virtual const RpcIdHelper & rpcIdHelper() const =0
access to RpcIdHelper
Identifier
Definition: IdentifierFieldParser.cxx:14