ATLAS Offline Software
MdtMezzanineCard.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef MUONCABLINGDATA_MDTMEZZANINECARD_H
6 #define MUONCABLINGDATA_MDTMEZZANINECARD_H
7 
8 #include <GaudiKernel/MsgStream.h>
9 #include <CxxUtils/ArrayHelper.h>
10 
11 #include <array>
12 #include <iostream>
13 
35  public:
36  static constexpr uint8_t NOTSET = 250;
37 
38  using MezzCardPtr = std::shared_ptr<const MdtMezzanineCard>;
39  using Mapping = std::array<uint8_t, 24>;
47  uint8_t mezz_id);
48 
52  uint8_t tdcChannel(uint8_t tubeLay, uint8_t tube, MsgStream& msg) const;
56  uint8_t tubeNumber(uint8_t tubeLay, uint8_t tube) const;
57 
61  bool checkConsistency(MsgStream& msg) const;
62 
64  uint8_t id() const { return m_mezzId; }
66  uint8_t numTubeLayers() const { return m_nlay; }
68  uint8_t numTubesPerLayer() const { return m_nTubes; }
69 
72  struct OfflineCh {
75  bool isValid{false};
76  };
77  OfflineCh offlineTube(uint8_t tdc, MsgStream& msg) const;
78 
80  const Mapping& tdcToTubeMap() const { return m_tdcToTubes; }
82  const Mapping& tubeToTdcMap() const { return m_tubesToTdc; }
83 
84  private:
86  Mapping m_tdcToTubes{make_array<uint8_t, 24>(NOTSET)};
88  Mapping m_tubesToTdc{make_array<uint8_t, 24>(NOTSET)};
95 };
96 std::ostream& operator<<(std::ostream& ostr, const MdtMezzanineCard& map);
97 
98 #endif
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:575
MdtMezzanineCard::checkConsistency
bool checkConsistency(MsgStream &msg) const
checks whether the tdc mapping is complete.
Definition: MdtMezzanineCard.cxx:52
MdtMezzanineCard::tdcToTubeMap
const Mapping & tdcToTubeMap() const
Returns the underlying TDC -> Tube conversion map.
Definition: MdtMezzanineCard.h:80
MdtMezzanineCard::numTubesPerLayer
uint8_t numTubesPerLayer() const
returns the number of tubes per layer;
Definition: MdtMezzanineCard.h:68
MdtMezzanineCard::tdcChannel
uint8_t tdcChannel(uint8_t tubeLay, uint8_t tube, MsgStream &msg) const
returns the tdc channel number
Definition: MdtMezzanineCard.cxx:106
MdtMezzanineCard::Mapping
std::array< uint8_t, 24 > Mapping
Definition: MdtMezzanineCard.h:39
MdtMezzanineCard::offlineTube
OfflineCh offlineTube(uint8_t tdc, MsgStream &msg) const
Definition: MdtMezzanineCard.cxx:126
MdtMezzanineCard::numTubeLayers
uint8_t numTubeLayers() const
returns the number of layers
Definition: MdtMezzanineCard.h:66
MdtMezzanineCard::m_tdcToTubes
Mapping m_tdcToTubes
Mapping of the tdc channels to the mezzanine tube number.
Definition: MdtMezzanineCard.h:86
operator<<
std::ostream & operator<<(std::ostream &ostr, const MdtMezzanineCard &map)
Definition: MdtMezzanineCard.cxx:22
MdtMezzanineCard::NOTSET
static constexpr uint8_t NOTSET
Definition: MdtMezzanineCard.h:36
MdtMezzanineCard::id
uint8_t id() const
returns mezzanine database identifier
Definition: MdtMezzanineCard.h:64
MdtMezzanineCard::tubeNumber
uint8_t tubeNumber(uint8_t tubeLay, uint8_t tube) const
returns the tube number
Definition: MdtMezzanineCard.cxx:122
MdtMezzanineCard
MdtMezzanineCard - Helper struct to represent the structure of a mezzanine card in a consistent way E...
Definition: MdtMezzanineCard.h:34
MdtMezzanineCard::OfflineCh::layer
uint8_t layer
Definition: MdtMezzanineCard.h:74
MdtMezzanineCard::m_nlay
uint8_t m_nlay
Number of tube layers.
Definition: MdtMezzanineCard.h:90
MdtMezzanineCard::OfflineCh
Helper struct to pipe the result from the tdc -> offline channel translation.
Definition: MdtMezzanineCard.h:72
MdtMezzanineCard::MezzCardPtr
std::shared_ptr< const MdtMezzanineCard > MezzCardPtr
Definition: MdtMezzanineCard.h:38
MdtMezzanineCard::OfflineCh::tube
uint8_t tube
Definition: MdtMezzanineCard.h:73
ArrayHelper.h
MdtMezzanineCard::m_mezzId
uint8_t m_mezzId
Mezzanine database identifier.
Definition: MdtMezzanineCard.h:94
MdtMezzanineCard::tubeToTdcMap
const Mapping & tubeToTdcMap() const
Returns the underlying Tube -> Tdc conversion map.
Definition: MdtMezzanineCard.h:82
MdtMezzanineCard::m_nTubes
uint8_t m_nTubes
Number of tubes per layer.
Definition: MdtMezzanineCard.h:92
MdtMezzanineCard::m_tubesToTdc
Mapping m_tubesToTdc
Mapping of the mezzanine tube number to the tdc channel.
Definition: MdtMezzanineCard.h:88
MdtMezzanineCard::MdtMezzanineCard
MdtMezzanineCard(const Mapping &tdcToTubeMap, uint8_t num_layers, uint8_t mezz_id)
Standard constructor of the mezzanine card.
Definition: MdtMezzanineCard.cxx:39
MdtMezzanineCard::OfflineCh::isValid
bool isValid
Definition: MdtMezzanineCard.h:75
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
calibdata.tube
tube
Definition: calibdata.py:31
doL1CaloHVCorrections.num_layers
num_layers
retrieve num layers and layer names (from new or ref hv input)
Definition: doL1CaloHVCorrections.py:379