Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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>
15 #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 
32 namespace Muon{
41 
42  int8_t& stationIndex{m_cache.cache[0]};
43  int8_t& eta{m_cache.cache[1]};
44  int8_t& phi{m_cache.cache[2]};
45  int8_t& doubletR{m_cache.cache[3]};
46 
47  int8_t& doubletPhi{m_cache.cache[4]};
48  int8_t& doubletZ{m_cache.cache[5]};
49  int8_t& gasGap{m_cache.cache[6]};
50 
54  static constexpr int8_t measPhiBit = 1 << 0;
55  static constexpr int8_t stripSideBit = 1 << 1;
56 
58  bool measuresPhi() const { return m_measPhiStrip & measPhiBit; }
60  bool stripSide() const { return m_measPhiStrip & stripSideBit; }
62  void setMeasPhiAndSide(bool measPhi, bool stripSide) {
64  }
65  private:
66  union {
67  long int hash{0};
68  int8_t cache[8];
69  } m_cache{};
70  int8_t& m_measPhiStrip{m_cache.cache[7]};
71 
72  };
73 
84  int16_t& board{m_cache.cache[2]};
85  private:
86  union {
87  int64_t hash{0};
89  } m_cache{};
90  };
91 
96  RpcCablingData() = default;
102  bool operator<(const RpcCablingData&) const = delete;
104  bool operator==(const RpcCablingData& other) const {
105  return strip == other.strip && channelId == other.channelId &&
106  static_cast<const RpcCablingOfflineID&>(*this) == other &&
107  static_cast<const RpcCablingOnlineID&>(*this) == other;
108  }
111  return !((*this) == other);
112  }
113  };
114  std::ostream& operator<<(std::ostream& ostr, const RpcCablingOfflineID& obj);
115  std::ostream& operator<<(std::ostream& ostr, const RpcCablingOnlineID& obj);
116  std::ostream& operator<<(std::ostream& ostr, const RpcCablingData& obj);
117 
118 }
119 
120 #undef CABLING_OPERATORS
121 #endif
Muon::RpcCablingOfflineID::doubletZ
int8_t & doubletZ
doublet Phi -> 1,2
Definition: RpcCablingData.h:48
Muon::RpcCablingOfflineID::stationIndex
int8_t & stationIndex
Definition: RpcCablingData.h:42
Muon::RpcCablingOnlineID::subDetector
int16_t & subDetector
Identifier of the subdetector region in the readout BA / BC etc.
Definition: RpcCablingData.h:80
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
Muon::RpcCablingData::channelId
uint8_t channelId
Online board channel number.
Definition: RpcCablingData.h:100
Muon::RpcCablingOfflineID::m_cache
union Muon::RpcCablingOfflineID::@168 m_cache
Muon::RpcCablingOfflineID::measuresPhi
bool measuresPhi() const
: Does the channel measure phi
Definition: RpcCablingData.h:58
Muon::RpcCablingData::operator!=
bool operator!=(RpcCablingData &other) const
Inequality operator.
Definition: RpcCablingData.h:110
Muon::RpcCablingOfflineID::setMeasPhiAndSide
void setMeasPhiAndSide(bool measPhi, bool stripSide)
Sets the measuresPhi & stripSide fields of the cabling data object.
Definition: RpcCablingData.h:62
Muon::RpcCablingOfflineID::stripSide
bool stripSide() const
: Is the strip readout on the opposite side
Definition: RpcCablingData.h:60
Muon::RpcCablingOfflineID
Struct to represent the offline identifier of the Rpc measurement decomposed into the particular fiel...
Definition: RpcCablingData.h:39
Muon::RpcCablingOfflineID::cache
int8_t cache[8]
Definition: RpcCablingData.h:68
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition: TrackSystemController.h:45
Muon::RpcCablingOfflineID::measPhiBit
static constexpr int8_t measPhiBit
gas gap -> 1-3
Definition: RpcCablingData.h:54
xAOD::int16_t
setScaleOne setStatusOne setSaturated int16_t
Definition: gFexGlobalRoI_v1.cxx:55
Muon::RpcCablingOnlineID::m_cache
union Muon::RpcCablingOnlineID::@169 m_cache
Muon::RpcCablingOfflineID::eta
int8_t & eta
Station of the chamber (i.e, BIL,BIS,etc.)
Definition: RpcCablingData.h:43
Muon::RpcCablingOnlineID::boardSector
int16_t & boardSector
Unique Identifier of the Rpc chamber from an online perspective
Definition: RpcCablingData.h:82
Muon::RpcCablingOnlineID::board
int16_t & board
Unique identifier of the tdc chip.
Definition: RpcCablingData.h:84
CABLING_OPERATORS
#define CABLING_OPERATORS(CL_NAME)
: Helper structs to convert the Identifier of a Rpc measurement from its offline representation into ...
Definition: RpcCablingData.h:17
Muon::RpcCablingOfflineID::gasGap
int8_t & gasGap
doublet Z -> 1,2
Definition: RpcCablingData.h:49
Muon::RpcCablingData::operator==
bool operator==(const RpcCablingData &other) const
Equality in terms of all offline & online fields are matching.
Definition: RpcCablingData.h:104
Muon::RpcCablingOfflineID::doubletR
int8_t & doubletR
Station phi of the RPC station.
Definition: RpcCablingData.h:45
Muon::RpcCablingOnlineID::hash
int64_t hash
Definition: RpcCablingData.h:87
Muon::RpcCablingData::strip
uint8_t strip
Offline strip number.
Definition: RpcCablingData.h:98
Muon::RpcCablingData
Helper struct that is parsed to the cabling map to translate between the offline & online Identifiers...
Definition: RpcCablingData.h:94
Muon::RpcCablingOfflineID::stripSideBit
static constexpr int8_t stripSideBit
Definition: RpcCablingData.h:55
Muon::RpcCablingOnlineID
In an analogous way to the RpcCablingOfflineID, the RpcCablingOnlineID, holds all information needed ...
Definition: RpcCablingData.h:77
Muon::RpcCablingOfflineID::doubletPhi
int8_t & doubletPhi
doublet R -> 1,2
Definition: RpcCablingData.h:47
Muon::operator<<
std::ostream & operator<<(std::ostream &ostr, const Muon::HedgehogBoard &board)
Definition: HedgehogBoard.cxx:11
Muon::RpcCablingData::RpcCablingData
RpcCablingData()=default
Default constructor.
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
Muon::RpcCablingOfflineID::m_measPhiStrip
int8_t & m_measPhiStrip
Definition: RpcCablingData.h:70
Muon::RpcCablingOfflineID::phi
int8_t & phi
Eta index of the RPC station.
Definition: RpcCablingData.h:44
Muon::RpcCablingData::operator<
bool operator<(const RpcCablingData &) const =delete
No sorting operator.
python.PyAthena.obj
obj
Definition: PyAthena.py:132
Muon::RpcCablingOnlineID::cache
int16_t cache[4]
Definition: RpcCablingData.h:88
Muon::RpcCablingOfflineID::hash
long int hash
Definition: RpcCablingData.h:67