ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonPhaseII
Event
MuonSpacePoint
src
SpacePointPerLayerSorter.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
#include "
MuonSpacePoint/SpacePointPerLayerSorter.h
"
5
#include "
xAODMuonPrepData/MMCluster.h
"
6
#include "
xAODMuonPrepData/MdtDriftCircle.h
"
7
#include "
xAODMuonPrepData/RpcMeasurement.h
"
8
#include "
xAODMuonPrepData/TgcStrip.h
"
9
#include "
xAODMuonPrepData/sTgcMeasurement.h
"
10
11
namespace
MuonR4
{
12
13
unsigned
int
SpacePointPerLayerSorter::sectorLayerNum
(
const
SpacePoint
&
sp
)
const
{
14
15
switch
(
sp
.primaryMeasurement()->type()){
16
case
xAOD::UncalibMeasType::MdtDriftCircleType
:{
17
auto
mdtMeas =
static_cast<
const
xAOD::MdtDriftCircle
*
>
(
sp
.primaryMeasurement());
18
return
sp
.msSector()->logicalLayerIdx(mdtMeas->readoutElement()).at(mdtMeas->tubeLayer()-1);
19
}
20
case
xAOD::UncalibMeasType::RpcStripType
:{
21
auto
rpcMeas =
static_cast<
const
xAOD::RpcMeasurement
*
>
(
sp
.primaryMeasurement());
22
return
sp
.msSector()->logicalLayerIdx(rpcMeas->readoutElement()).at(rpcMeas->gasGap()-1);
23
}
24
case
xAOD::UncalibMeasType::TgcStripType
:{
25
auto
tgcMeas =
static_cast<
const
xAOD::TgcStrip
*
>
(
sp
.primaryMeasurement());
26
return
sp
.msSector()->logicalLayerIdx(tgcMeas->readoutElement()).at(tgcMeas->gasGap()-1);
27
}
28
case
xAOD::UncalibMeasType::sTgcStripType
:{
29
auto
stgcMeas =
static_cast<
const
xAOD::sTgcMeasurement
*
>
(
sp
.primaryMeasurement());
30
return
sp
.msSector()->logicalLayerIdx(stgcMeas->readoutElement()).at(stgcMeas->gasGap()-1);
31
}
32
case
xAOD::UncalibMeasType::MMClusterType
:{
33
auto
mmMeas =
static_cast<
const
xAOD::MMCluster
*
>
(
sp
.primaryMeasurement());
34
return
sp
.msSector()->logicalLayerIdx(mmMeas->readoutElement()).at(mmMeas->gasGap()-1);
35
}
36
default
:
37
THROW_EXCEPTION
(
"Unexpected Measurement Type in sectorLayerNum()"
);
38
}
39
}
40
41
bool
SpacePointPerLayerSorter::operator()
(
const
SpacePoint
& sp1,
const
SpacePoint
& sp2)
const
{
42
43
const
unsigned
int
lay1 {
sectorLayerNum
(sp1)};
44
const
unsigned
int
lay2 {
sectorLayerNum
(sp2)};
45
46
if
(lay1 == lay2) {
47
const
double
dy = sp1.
localPosition
().y() - sp2.
localPosition
().y();
48
if
( std::abs(dy) > 20 * Gaudi::Units::micrometer ){
49
return
dy < 0;
50
}
51
return
sp1.
localPosition
().x() < sp2.
localPosition
().x();
52
}
53
return
lay1 < lay2;
54
}
55
56
bool
SpacePointPerLayerSorter::operator()
(
const
std::shared_ptr<SpacePoint>& sp1,
const
std::shared_ptr<SpacePoint>& sp2)
const
{
57
return
(*
this
)(*sp1, *sp2);
58
}
59
60
bool
SpacePointPerLayerSorter::operator()
(
const
std::unique_ptr<SpacePoint>& sp1,
const
std::unique_ptr<SpacePoint>& sp2)
const
{
61
return
(*
this
)(*sp1, *sp2);
62
}
63
bool
SpacePointPerLayerSorter::operator()
(
const
SpacePoint
* sp1,
const
SpacePoint
* sp2)
const
{
64
return
(*
this
)(*sp1, *sp2);
65
}
66
67
}
sp
static Double_t sp
Definition
LArPhysWaveHECTool.cxx:37
MMCluster.h
MdtDriftCircle.h
RpcMeasurement.h
SpacePointPerLayerSorter.h
TgcStrip.h
MuonR4::SpacePointPerLayerSorter::operator()
bool operator()(const std::shared_ptr< SpacePoint > &sp1, const std::shared_ptr< SpacePoint > &sp2) const
Definition
SpacePointPerLayerSorter.cxx:56
MuonR4::SpacePointPerLayerSorter::sectorLayerNum
unsigned int sectorLayerNum(const SpacePoint &sp) const
method returning the logic layer number
Definition
SpacePointPerLayerSorter.cxx:13
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:25
MuonR4::SpacePoint::localPosition
const Amg::Vector3D & localPosition() const
Definition
MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/SpacePoint.cxx:46
MuonR4
This header ties the generic definitions in this package.
Definition
GlobalPattern.h:14
xAOD::MdtDriftCircle
MdtDriftCircle_v1 MdtDriftCircle
Definition
MdtDriftCircleFwd.h:11
xAOD::TgcStrip
TgcStrip_v1 TgcStrip
Definition
TgcStripFwd.h:9
xAOD::UncalibMeasType::TgcStripType
@ TgcStripType
Definition
MeasurementDefs.h:32
xAOD::UncalibMeasType::MdtDriftCircleType
@ MdtDriftCircleType
Definition
MeasurementDefs.h:30
xAOD::UncalibMeasType::MMClusterType
@ MMClusterType
Definition
MeasurementDefs.h:33
xAOD::UncalibMeasType::RpcStripType
@ RpcStripType
Definition
MeasurementDefs.h:31
xAOD::UncalibMeasType::sTgcStripType
@ sTgcStripType
Definition
MeasurementDefs.h:34
xAOD::RpcMeasurement
RpcMeasurement_v1 RpcMeasurement
Definition
RpcMeasurementFwd.h:11
xAOD::MMCluster
MMCluster_v1 MMCluster
Definition
MMClusterFwd.h:11
xAOD::sTgcMeasurement
sTgcMeasurement_v1 sTgcMeasurement
Definition
sTgcMeasurementFwd.h:11
sTgcMeasurement.h
THROW_EXCEPTION
#define THROW_EXCEPTION(MESSAGE)
Definition
throwExcept.h:10
Generated on
for ATLAS Offline Software by
1.17.0