ATLAS Offline Software
Loading...
Searching...
No Matches
RpcCablingData.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef MUONCABLINGDATA_RPCCABLINGDATA_H
5#define MUONCABLINGDATA_RPCCABLINGDATA_H
6
7
8#include <cstdint>
9#include <iostream>
10#include <set>
17#define CABLING_OPERATORS(CL_NAME) \
18 bool operator<(const CL_NAME& other) const { return m_cache.hash < other.m_cache.hash; } \
19 bool operator==(const CL_NAME& other) const {return m_cache.hash == other.m_cache.hash; } \
20 bool operator!=(const CL_NAME& other) const { return m_cache.hash != other.m_cache.hash; } \
21 bool operator!() const {return !m_cache.hash;} \
22 \
23 CL_NAME() = default; \
24 CL_NAME(const CL_NAME& other): CL_NAME{} { \
25 m_cache.hash = other.m_cache.hash; \
26 } \
27 CL_NAME& operator=(const CL_NAME& other) { \
28 if (&other != this) m_cache.hash = other.m_cache.hash; \
29 return *this; \
30 }
31
32namespace Muon{
40 // cppcheck-suppress operatorEqVarError; stationIndex, etc intentionally not copied.
42
43 int8_t& stationIndex{m_cache.cache[0]};
44 int8_t& eta{m_cache.cache[1]};
45 int8_t& phi{m_cache.cache[2]};
46 int8_t& doubletR{m_cache.cache[3]};
47
48 int8_t& doubletPhi{m_cache.cache[4]};
49 int8_t& doubletZ{m_cache.cache[5]};
50 int8_t& gasGap{m_cache.cache[6]};
55 static constexpr int8_t measPhiBit = 1 << 0;
56 static constexpr int8_t stripSideBit = 1 << 1;
57
59 bool measuresPhi() const { return m_measPhiStrip & measPhiBit; }
61 bool stripSide() const { return m_measPhiStrip & stripSideBit; }
63 void setMeasPhiAndSide(bool measPhi, bool stripSide) {
65 }
66 private:
67 union {
68 long int hash{0};
69 int8_t cache[8];
71 int8_t& m_measPhiStrip{m_cache.cache[7]};
72
73 };
74
79 // cppcheck-suppress operatorEqVarError; subDetector, etc intentionally not copied.
82 int16_t& subDetector{m_cache.cache[0]};
84 int16_t& boardSector{m_cache.cache[1]};
86 int16_t& board{m_cache.cache[2]};
87 private:
88 union {
89 int64_t hash{0};
90 int16_t cache[4];
92 };
93
98 RpcCablingData() = default;
100 uint8_t strip{0};
102 uint8_t channelId{0};
104 bool operator<(const RpcCablingData&) const = delete;
106 bool operator==(const RpcCablingData& other) const {
107 return strip == other.strip && channelId == other.channelId &&
108 static_cast<const RpcCablingOfflineID&>(*this) == other &&
109 static_cast<const RpcCablingOnlineID&>(*this) == other;
110 }
111
112 bool operator!=(RpcCablingData& other) const {
113 return !((*this) == other);
114 }
115 };
116 std::ostream& operator<<(std::ostream& ostr, const RpcCablingOfflineID& obj);
117 std::ostream& operator<<(std::ostream& ostr, const RpcCablingOnlineID& obj);
118 std::ostream& operator<<(std::ostream& ostr, const RpcCablingData& obj);
119
120}
121
122#undef CABLING_OPERATORS
123#endif
#define CABLING_OPERATORS(CL_NAME)
: Helper structs to convert the Identifier of a Rpc measurement from its offline representation into ...
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
std::ostream & operator<<(std::ostream &ostr, const Muon::HedgehogBoard &board)
uint8_t channelId
Online board channel number.
bool operator==(const RpcCablingData &other) const
Equality in terms of all offline & online fields are matching.
bool operator<(const RpcCablingData &) const =delete
No sorting operator.
bool operator!=(RpcCablingData &other) const
Inequality operator.
RpcCablingData()=default
Default constructor.
uint8_t strip
Offline strip number.
Struct to represent the offline identifier of the Rpc measurement decomposed into the particular fiel...
union Muon::RpcCablingOfflineID::@310011236274336217137144365313106374211200256350 m_cache
int8_t & phi
Eta index of the RPC station.
int8_t & eta
Station of the chamber (i.e, BIL,BIS,etc.)
int8_t & doubletZ
doublet Phi -> 1,2
int8_t & doubletPhi
doublet R -> 1,2
static constexpr int8_t measPhiBit
gas gap -> 1-3
int8_t & doubletR
Station phi of the RPC station.
int8_t & gasGap
doublet Z -> 1,2
bool measuresPhi() const
: Does the channel measure phi
static constexpr int8_t stripSideBit
bool stripSide() const
: Is the strip readout on the opposite side
void setMeasPhiAndSide(bool measPhi, bool stripSide)
Sets the measuresPhi & stripSide fields of the cabling data object.
In an analogous way to the RpcCablingOfflineID, the RpcCablingOnlineID, holds all information needed ...
int16_t & board
Unique identifier of the tdc chip.
int16_t & boardSector
Unique Identifier of the Rpc chamber from an online perspective.
int16_t & subDetector
Identifier of the subdetector region in the readout BA / BC etc.
union Muon::RpcCablingOnlineID::@060274027202166101037372020013200265211022004064 m_cache