ATLAS Offline Software
Loading...
Searching...
No Matches
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
17 MdtCablingOffData() = default;
19 m_cache.hash = other.m_cache.hash;
20 }
21 // cppcheck-suppress operatorEqVarError; stationIndex, etc intentionally not copied.
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];
50};
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
58 m_cache.hash = other.m_cache.hash;
59 }
60 // cppcheck-suppress operatorEqVarError; subDetectorId, etc intentionally not copied.
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];
83};
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
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
131std::ostream& operator<<(std::ostream& ostr, const MdtCablingData& obj);
132
133std::ostream& operator<<(std::ostream& ostr, const MdtCablingOffData& obj);
134std::ostream& operator<<(std::ostream& ostr, const MdtCablingOnData& obj);
135
136#endif
std::ostream & operator<<(std::ostream &ostr, const MdtCablingData &obj)
static constexpr int legacy_tube_block_size
Identifier of the corresponding channel on the tdc.
uint8_t tdcId
Mezzanine type.
int tubes_per_layer
Helper constants to extract tube,layer, multilayer information.
uint8_t mezzanine_type
Tube number in the layer.
bool operator==(const MdtCablingData &other) const
Equality operator.
static constexpr int legacy_layer_block_size
int tube
Layer inside the multilayer.
bool operator!=(const MdtCablingData &other) const
MdtCablingData()=default
bool operator<(const MdtCablingData &other) const
uint8_t channelId
Identifier of the corresponding tdc.
Split the offline part of the cabling apart to use it later for sorting.
bool operator==(const MdtCablingOffData &other) const
Multilayer inside the MDT station.
bool operator!() const
union MdtCablingOffData::@146136140275166024214125374003135312065142355135 m_cache
bool operator<(const MdtCablingOffData &other) const
int8_t & multilayer
Phi sector of the MDT station.
bool operator!=(const MdtCablingOffData &other) const
int8_t & eta
Station of the chamber (i.e, BIL,BIS,etc.)
MdtCablingOffData & operator=(const MdtCablingOffData &other)
MdtCablingOffData(const MdtCablingOffData &other)
MdtCablingOffData()=default
int8_t & phi
Eta of the MDT station.
bool operator!() const
MdtCablingOnData()=default
bool operator!=(const MdtCablingOnData &other) const
bool operator==(const MdtCablingOnData &other) const
uint8_t & subdetectorId
CSM number.
MdtCablingOnData & operator=(const MdtCablingOnData &other)
union MdtCablingOnData::@254320377220212070036216362204234153063321322235 m_cache
uint8_t & csm
MROD number.
MdtCablingOnData(const MdtCablingOnData &other)
Subdetector number.
bool operator<(const MdtCablingOnData &other) const