ATLAS Offline Software
RpcFlatCableTranslator.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef MUONCABLINGDATA_ROCCABLINGTRANSLATOR_H
5 #define MUONCABLINGDATA_ROCCABLINGTRANSLATOR_H
6 
7 #include <array>
8 #include <cstdint>
9 #include <optional>
10 #include <iostream>
11 #include <CxxUtils/ArrayHelper.h>
12 
16 class MsgStream;
17 namespace Muon{
19  public:
21  static constexpr uint8_t readStrips = 32;
23  static constexpr uint8_t notSet = 250;
25  static constexpr uint8_t firstStrip = 1;
27  static constexpr uint8_t firstTdc = 0;
29  using Storage_t = std::array<uint8_t, readStrips>;
31  RpcFlatCableTranslator(const uint8_t cardId);
33  uint8_t id() const;
38  std::optional<uint8_t> tdcChannel(uint8_t strip, MsgStream& log) const;
43  std::optional<uint8_t> stripChannel(uint8_t tdcChannel, MsgStream& log) const;
49  bool mapChannels(uint8_t strip, uint8_t tdc, MsgStream& log);
51  const Storage_t& stripMap() const;
53  const Storage_t& tdcMap() const;
55  uint8_t connectedChannels() const;
56  private:
57  Storage_t m_stripToTdc{make_array<uint8_t, readStrips>(notSet)};
58  Storage_t m_tdcToStrip{make_array<uint8_t, readStrips>(notSet)};
62  };
63  std::ostream& operator<<(std::ostream& ostr, const RpcFlatCableTranslator& translator);
64 }
65 #endif
Muon::RpcFlatCableTranslator::readStrips
static constexpr uint8_t readStrips
Number of channels covered by one chip.
Definition: RpcFlatCableTranslator.h:21
Muon::RpcFlatCableTranslator::m_stripToTdc
Storage_t m_stripToTdc
Definition: RpcFlatCableTranslator.h:57
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
Muon::RpcFlatCableTranslator::mapChannels
bool mapChannels(uint8_t strip, uint8_t tdc, MsgStream &log)
Connect the strip with a tdc channel.
Definition: RpcFlatCableTranslator.cxx:69
Muon::RpcFlatCableTranslator::notSet
static constexpr uint8_t notSet
Default value indicating that the channel is not set.
Definition: RpcFlatCableTranslator.h:23
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition: TrackSystemController.h:45
Muon::RpcFlatCableTranslator::connectedChannels
uint8_t connectedChannels() const
Number of connected channels.
Definition: RpcFlatCableTranslator.cxx:32
Muon::RpcFlatCableTranslator::firstTdc
static constexpr uint8_t firstTdc
Convention of the lowest tdc number.
Definition: RpcFlatCableTranslator.h:27
Muon::RpcFlatCableTranslator::tdcChannel
std::optional< uint8_t > tdcChannel(uint8_t strip, MsgStream &log) const
Returns the connected tdc channel connected to a strip.
Definition: RpcFlatCableTranslator.cxx:38
Muon::RpcFlatCableTranslator::Storage_t
std::array< uint8_t, readStrips > Storage_t
Internal storage array.
Definition: RpcFlatCableTranslator.h:29
ArrayHelper.h
Muon::RpcFlatCableTranslator::m_id
uint8_t m_id
Definition: RpcFlatCableTranslator.h:59
Muon::RpcFlatCableTranslator::id
uint8_t id() const
Identifier of the card layout.
Definition: RpcFlatCableTranslator.cxx:37
Muon::RpcFlatCableTranslator::m_tdcToStrip
Storage_t m_tdcToStrip
Definition: RpcFlatCableTranslator.h:58
Muon::RpcFlatCableTranslator::RpcFlatCableTranslator
RpcFlatCableTranslator(const uint8_t cardId)
Standard constructor taking the card ID as input.
Definition: RpcFlatCableTranslator.cxx:29
Muon::operator<<
std::ostream & operator<<(std::ostream &ostr, const Muon::HedgehogBoard &board)
Definition: HedgehogBoard.cxx:11
Muon::RpcFlatCableTranslator::firstStrip
static constexpr uint8_t firstStrip
Convention of the lowest strip number.
Definition: RpcFlatCableTranslator.h:25
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
Muon::RpcFlatCableTranslator::stripChannel
std::optional< uint8_t > stripChannel(uint8_t tdcChannel, MsgStream &log) const
Returns the strip channel connected to a strip.
Definition: RpcFlatCableTranslator.cxx:53
Muon::RpcFlatCableTranslator::tdcMap
const Storage_t & tdcMap() const
Returns the underlying tdc mapping storage.
Definition: RpcFlatCableTranslator.cxx:35
Muon::RpcFlatCableTranslator::stripMap
const Storage_t & stripMap() const
Returns underlying strip mapping storage.
Definition: RpcFlatCableTranslator.cxx:34
Muon::RpcFlatCableTranslator::m_nCh
uint8_t m_nCh
Number of channels that are connected to the cable.
Definition: RpcFlatCableTranslator.h:61
Muon::RpcFlatCableTranslator
Definition: RpcFlatCableTranslator.h:18