ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonCablings
MuonCablingData
MuonCablingData
MdtCablingData.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef MUONMDT_CABLING_MDTCABLINGDATA_H
6
#define MUONMDT_CABLING_MDTCABLINGDATA_H
7
8
#include <cstdint>
9
#include <iosfwd>
10
/*
11
* @brief: Helper struct containing all information to convert from the offline
12
* identifiers to the online identifiers
13
*/
14
16
struct
MdtCablingOffData
{
17
MdtCablingOffData
() =
default
;
18
MdtCablingOffData
(
const
MdtCablingOffData
& other) :
MdtCablingOffData
() {
19
m_cache
.hash = other.m_cache.hash;
20
}
21
// cppcheck-suppress operatorEqVarError; stationIndex, etc intentionally not copied.
22
MdtCablingOffData
&
operator=
(
const
MdtCablingOffData
& other) {
23
if
(&other !=
this
)
24
m_cache
.hash = other.m_cache.hash;
25
return
*
this
;
26
}
27
int8_t&
stationIndex
{
28
m_cache
.cache[0]};
29
int8_t&
eta
{
m_cache
.cache[1]};
30
int8_t&
phi
{
m_cache
.cache[2]};
31
int8_t&
multilayer
{
m_cache
.cache[3]};
32
34
bool
operator==
(
const
MdtCablingOffData
& other)
const
{
35
return
m_cache
.hash == other.m_cache.hash;
36
}
37
bool
operator!=
(
const
MdtCablingOffData
& other)
const
{
38
return
m_cache
.hash != other.m_cache.hash;
39
}
40
bool
operator<
(
const
MdtCablingOffData
& other)
const
{
41
return
m_cache
.hash < other.m_cache.hash;
42
}
43
bool
operator!
()
const
{
return
!
m_cache
.hash; }
44
45
private
:
46
union
{
47
int
hash
{0};
48
int8_t
cache
[4];
49
}
m_cache
{};
50
};
51
struct
MdtCablingOnData
{
52
MdtCablingOnData
() =
default
;
53
uint8_t&
mrod
{
m_cache
.cache[0]};
54
uint8_t&
csm
{
m_cache
.cache[1]};
55
uint8_t&
subdetectorId
{
m_cache
.cache[2]};
56
57
MdtCablingOnData
(
const
MdtCablingOnData
& other) :
MdtCablingOnData
() {
58
m_cache
.hash = other.m_cache.hash;
59
}
60
// cppcheck-suppress operatorEqVarError; subDetectorId, etc intentionally not copied.
61
MdtCablingOnData
&
operator=
(
const
MdtCablingOnData
& other) {
62
if
(&other !=
this
)
63
m_cache
.hash = other.m_cache.hash;
64
return
*
this
;
65
}
66
67
bool
operator==
(
const
MdtCablingOnData
& other)
const
{
68
return
m_cache
.hash == other.m_cache.hash;
69
}
70
bool
operator!=
(
const
MdtCablingOnData
& other)
const
{
71
return
m_cache
.hash != other.m_cache.hash;
72
}
73
bool
operator<
(
const
MdtCablingOnData
& other)
const
{
74
return
m_cache
.hash < other.m_cache.hash;
75
}
76
bool
operator!
()
const
{
return
!
m_cache
.hash; }
77
78
private
:
79
union
{
80
int
hash
{0};
81
uint8_t
cache
[4];
82
}
m_cache
{};
83
};
84
struct
MdtCablingData
:
public
MdtCablingOffData
,
MdtCablingOnData
{
85
MdtCablingData
() =
default
;
86
87
int
layer
{-99};
88
int
tube
{-99};
89
90
uint8_t
mezzanine_type
{0};
92
uint8_t
tdcId
{0xFF};
93
94
uint8_t
channelId
{
95
0xff};
96
103
static
constexpr
int
legacy_tube_block_size
= 100;
104
static
constexpr
int
legacy_layer_block_size
= 10;
105
107
int
tubes_per_layer
{
legacy_tube_block_size
};
108
int
layer_block
{
legacy_layer_block_size
};
109
111
bool
operator==
(
const
MdtCablingData
& other)
const
{
112
return
this->
MdtCablingOffData::operator==
(other) &&
113
this->
MdtCablingOnData::operator==
(other) &&
114
tdcId
== other.tdcId &&
layer
== other.layer &&
115
tube
== other.tube &&
channelId
== other.channelId;
116
}
117
bool
operator!=
(
const
MdtCablingData
& other)
const
{
118
return
!((*this) == other);
119
}
120
bool
operator<
(
const
MdtCablingData
& other)
const
{
121
if
(this->MdtCablingOffData::operator!=(other))
122
return
this->
MdtCablingOffData::operator<
(other);
123
if
(this->MdtCablingOnData::operator!=(other))
124
return
this->
MdtCablingOnData::operator<
(other);
125
if
(
tdcId
!= other.tdcId)
126
return
tdcId
< other.tdcId;
127
return
channelId
< other.channelId;
128
}
129
};
130
131
std::ostream&
operator<<
(std::ostream& ostr,
const
MdtCablingData
& obj);
132
133
std::ostream&
operator<<
(std::ostream& ostr,
const
MdtCablingOffData
& obj);
134
std::ostream&
operator<<
(std::ostream& ostr,
const
MdtCablingOnData
& obj);
135
136
#endif
operator<<
std::ostream & operator<<(std::ostream &ostr, const MdtCablingData &obj)
Definition
MdtCablingData.cxx:23
MdtCablingData
Definition
MdtCablingData.h:84
MdtCablingData::legacy_tube_block_size
static constexpr int legacy_tube_block_size
Identifier of the corresponding channel on the tdc.
Definition
MdtCablingData.h:103
MdtCablingData::tdcId
uint8_t tdcId
Mezzanine type.
Definition
MdtCablingData.h:92
MdtCablingData::layer
int layer
Definition
MdtCablingData.h:87
MdtCablingData::tubes_per_layer
int tubes_per_layer
Helper constants to extract tube,layer, multilayer information.
Definition
MdtCablingData.h:107
MdtCablingData::mezzanine_type
uint8_t mezzanine_type
Tube number in the layer.
Definition
MdtCablingData.h:90
MdtCablingData::operator==
bool operator==(const MdtCablingData &other) const
Equality operator.
Definition
MdtCablingData.h:111
MdtCablingData::legacy_layer_block_size
static constexpr int legacy_layer_block_size
Definition
MdtCablingData.h:104
MdtCablingData::tube
int tube
Layer inside the multilayer.
Definition
MdtCablingData.h:88
MdtCablingData::layer_block
int layer_block
Definition
MdtCablingData.h:108
MdtCablingData::operator!=
bool operator!=(const MdtCablingData &other) const
Definition
MdtCablingData.h:117
MdtCablingData::MdtCablingData
MdtCablingData()=default
MdtCablingData::operator<
bool operator<(const MdtCablingData &other) const
Definition
MdtCablingData.h:120
MdtCablingData::channelId
uint8_t channelId
Identifier of the corresponding tdc.
Definition
MdtCablingData.h:94
MdtCablingOffData
Split the offline part of the cabling apart to use it later for sorting.
Definition
MdtCablingData.h:16
MdtCablingOffData::stationIndex
int8_t & stationIndex
Definition
MdtCablingData.h:27
MdtCablingOffData::operator==
bool operator==(const MdtCablingOffData &other) const
Multilayer inside the MDT station.
Definition
MdtCablingData.h:34
MdtCablingOffData::hash
int hash
Definition
MdtCablingData.h:47
MdtCablingOffData::operator!
bool operator!() const
Definition
MdtCablingData.h:43
MdtCablingOffData::m_cache
union MdtCablingOffData::@146136140275166024214125374003135312065142355135 m_cache
MdtCablingOffData::operator<
bool operator<(const MdtCablingOffData &other) const
Definition
MdtCablingData.h:40
MdtCablingOffData::multilayer
int8_t & multilayer
Phi sector of the MDT station.
Definition
MdtCablingData.h:31
MdtCablingOffData::operator!=
bool operator!=(const MdtCablingOffData &other) const
Definition
MdtCablingData.h:37
MdtCablingOffData::eta
int8_t & eta
Station of the chamber (i.e, BIL,BIS,etc.).
Definition
MdtCablingData.h:29
MdtCablingOffData::operator=
MdtCablingOffData & operator=(const MdtCablingOffData &other)
Definition
MdtCablingData.h:22
MdtCablingOffData::MdtCablingOffData
MdtCablingOffData(const MdtCablingOffData &other)
Definition
MdtCablingData.h:18
MdtCablingOffData::cache
int8_t cache[4]
Definition
MdtCablingData.h:48
MdtCablingOffData::MdtCablingOffData
MdtCablingOffData()=default
MdtCablingOffData::phi
int8_t & phi
Eta of the MDT station.
Definition
MdtCablingData.h:30
MdtCablingOnData
Definition
MdtCablingData.h:51
MdtCablingOnData::operator!
bool operator!() const
Definition
MdtCablingData.h:76
MdtCablingOnData::cache
uint8_t cache[4]
Definition
MdtCablingData.h:81
MdtCablingOnData::MdtCablingOnData
MdtCablingOnData()=default
MdtCablingOnData::operator!=
bool operator!=(const MdtCablingOnData &other) const
Definition
MdtCablingData.h:70
MdtCablingOnData::operator==
bool operator==(const MdtCablingOnData &other) const
Definition
MdtCablingData.h:67
MdtCablingOnData::subdetectorId
uint8_t & subdetectorId
CSM number.
Definition
MdtCablingData.h:55
MdtCablingOnData::operator=
MdtCablingOnData & operator=(const MdtCablingOnData &other)
Definition
MdtCablingData.h:61
MdtCablingOnData::m_cache
union MdtCablingOnData::@254320377220212070036216362204234153063321322235 m_cache
MdtCablingOnData::hash
int hash
Definition
MdtCablingData.h:80
MdtCablingOnData::csm
uint8_t & csm
MROD number.
Definition
MdtCablingData.h:54
MdtCablingOnData::mrod
uint8_t & mrod
Definition
MdtCablingData.h:53
MdtCablingOnData::MdtCablingOnData
MdtCablingOnData(const MdtCablingOnData &other)
Subdetector number.
Definition
MdtCablingData.h:57
MdtCablingOnData::operator<
bool operator<(const MdtCablingOnData &other) const
Definition
MdtCablingData.h:73
Generated on
for ATLAS Offline Software by
1.17.0