ATLAS Offline Software
HedgehogBoard.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 MUONMDT_CABLING_HEDGEHOGBOARD_H
5 #define MUONMDT_CABLING_HEDGEHOGBOARD_H
6 
7 #include <array>
8 #include <string>
9 #include <cinttypes>
10 #include <optional>
11 #include <memory>
12 #include <iosfwd>
13 #include <CxxUtils/ArrayHelper.h>
14 
15 namespace Muon{
33  public:
34  using HedgehogBoardPtr = std::shared_ptr<const HedgehogBoard>;
35 
36  static constexpr unsigned nChPerBoard = 24;
37  using Mapping = std::array<uint8_t, nChPerBoard>;
38 
40  HedgehogBoard() = default;
45  HedgehogBoard(const Mapping& map,
46  const uint8_t nTubeLay,
47  const uint16_t boardId);
49  bool operator<(const HedgehogBoard& other) const;
51  uint16_t boardId() const;
53  uint8_t numTubeLayers() const;
55  uint8_t numTubesPerLayer() const;
57  struct TubeLayer {
63  bool operator==(const TubeLayer& other) const {
64  return tube == other.tube && layer == other.layer;
65  }
67  bool operator!=(const TubeLayer& other) const {
68  return tube != other.tube || layer != other.layer;
69  }
70  friend std::ostream& operator<<(std::ostream& ostr, const TubeLayer& tubeLay){
71  ostr<<"layer: "<<static_cast<int>(tubeLay.layer)
72  <<", tube: "<<static_cast<int>(tubeLay.tube);
73  return ostr;
74  }
75  };
78  uint8_t pinNumber(const TubeLayer& tubeLay) const;
87  uint8_t pairPin(const TubeLayer& tubeLay) const;
96  TubeLayer twinPair(const TubeLayer& tubeLay) const;
104  void setHVDelayTime(const double hvTime);
106  bool hasHVDelayTime() const;
108  double hvDelayTime() const;
110  const Mapping& data() const;
111  private:
112  Mapping m_hedgePins{make_array<uint8_t, nChPerBoard>(-1)};
116  std::optional<double> m_hvDelay{std::nullopt};
117  };
118  std::ostream& operator<<(std::ostream& ostr, const Muon::HedgehogBoard& board);
119 }
120 
121 
122 #endif
Muon::HedgehogBoard::TubeLayer::operator==
bool operator==(const TubeLayer &other) const
Equality operator with another TubeLayer object.
Definition: HedgehogBoard.h:63
Muon::HedgehogBoard::twinPair
TubeLayer twinPair(const TubeLayer &tubeLay) const
Returns the tube & layer short circuited with the given tubeLayer.
Definition: HedgehogBoard.cxx:59
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
Muon::HedgehogBoard::HedgehogBoard
HedgehogBoard()=default
Default constructor.
Muon::HedgehogBoard::setHVDelayTime
void setHVDelayTime(const double hvTime)
Define a HV delay in the time of arrival between the primary & twin electronics signal.
Definition: HedgehogBoard.cxx:75
Muon::HedgehogBoard::TubeLayer::operator<<
friend std::ostream & operator<<(std::ostream &ostr, const TubeLayer &tubeLay)
Definition: HedgehogBoard.h:70
Muon::HedgehogBoard::m_id
uint16_t m_id
Definition: HedgehogBoard.h:115
Muon::HedgehogBoard::m_hvDelay
std::optional< double > m_hvDelay
Definition: HedgehogBoard.h:116
Muon::HedgehogBoard::operator<
bool operator<(const HedgehogBoard &other) const
Ordering of hedgehog boards, performed by Identifier.
Definition: HedgehogBoard.cxx:37
Muon::HedgehogBoard::pinNumber
uint8_t pinNumber(const TubeLayer &tubeLay) const
Returns the pinNumber of the tubeLayer.
Definition: HedgehogBoard.cxx:44
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition: TrackSystemController.h:45
Muon::HedgehogBoard::pairPin
uint8_t pairPin(const TubeLayer &tubeLay) const
Returns the number of the pin that's twin to the tubeLayer If the pin is not short circuited,...
Definition: HedgehogBoard.cxx:52
Muon::HedgehogBoard::Mapping
std::array< uint8_t, nChPerBoard > Mapping
Definition: HedgehogBoard.h:37
Muon::HedgehogBoard::m_nTubeLay
uint8_t m_nTubeLay
Definition: HedgehogBoard.h:113
Muon::HedgehogBoard::boardId
uint16_t boardId() const
Returns the identifier of the hedgehog board.
Definition: HedgehogBoard.cxx:40
Muon::HedgehogBoard::TubeLayer::layer
uint8_t layer
Layer number [1- numTubeLayers()].
Definition: HedgehogBoard.h:61
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
Muon::HedgehogBoard
Helper struct to represent the High-voltage pins and a possible connection between them.
Definition: HedgehogBoard.h:32
ArrayHelper.h
Muon::HedgehogBoard::HedgehogBoardPtr
std::shared_ptr< const HedgehogBoard > HedgehogBoardPtr
Definition: HedgehogBoard.h:34
Muon::HedgehogBoard::m_hedgePins
Mapping m_hedgePins
Definition: HedgehogBoard.h:112
Muon::HedgehogBoard::TubeLayer::operator!=
bool operator!=(const TubeLayer &other) const
Inequality operator with another TubeLayer object.
Definition: HedgehogBoard.h:67
Muon::operator<<
std::ostream & operator<<(std::ostream &ostr, const Muon::HedgehogBoard &board)
Definition: HedgehogBoard.cxx:11
Muon::HedgehogBoard::data
const Mapping & data() const
Returns the underlying map.
Definition: HedgehogBoard.cxx:43
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
Muon::HedgehogBoard::nChPerBoard
static constexpr unsigned nChPerBoard
Definition: HedgehogBoard.h:36
Muon::HedgehogBoard::hvDelayTime
double hvDelayTime() const
Returns the HV delay time.
Definition: HedgehogBoard.cxx:81
Muon::HedgehogBoard::m_nTubePerLay
uint8_t m_nTubePerLay
Definition: HedgehogBoard.h:114
Muon::HedgehogBoard::TubeLayer
Helper struct to return a tube & tube layer pair.
Definition: HedgehogBoard.h:57
Muon::HedgehogBoard::hasHVDelayTime
bool hasHVDelayTime() const
Returns whether the HedgehogBoard has a specifc delay time.
Definition: HedgehogBoard.cxx:78
Muon::HedgehogBoard::numTubeLayers
uint8_t numTubeLayers() const
Returns the number of tube layers 3 or 4.
Definition: HedgehogBoard.cxx:41
calibdata.tube
tube
Definition: calibdata.py:31
Muon::HedgehogBoard::TubeLayer::tube
uint8_t tube
Tube number [1- 24/numTubeLayers()].
Definition: HedgehogBoard.h:59
Muon::HedgehogBoard::numTubesPerLayer
uint8_t numTubesPerLayer() const
Returns the number of tubes per layer.
Definition: HedgehogBoard.cxx:42