ATLAS Offline Software
MdtMezzanineCard.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 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 #include <memory>
14 
36  public:
37  static constexpr uint8_t NOTSET = 250;
38 
39  using MezzCardPtr = std::shared_ptr<const MdtMezzanineCard>;
40  using Mapping = std::array<uint8_t, 24>;
48  uint8_t mezz_id);
49 
53  uint8_t tdcChannel(uint8_t tubeLay, uint8_t tube, MsgStream& msg) const;
57  uint8_t tubeNumber(uint8_t tubeLay, uint8_t tube) const;
58 
62  bool checkConsistency(MsgStream& msg) const;
63 
65  uint8_t id() const { return m_mezzId; }
67  uint8_t numTubeLayers() const { return m_nlay; }
69  uint8_t numTubesPerLayer() const { return m_nTubes; }
70 
73  struct OfflineCh {
76  bool isValid{false};
77  };
78  OfflineCh offlineTube(uint8_t tdc, MsgStream& msg) const;
79 
81  const Mapping& tdcToTubeMap() const { return m_tdcToTubes; }
83  const Mapping& tubeToTdcMap() const { return m_tubesToTdc; }
84 
85  private:
87  Mapping m_tdcToTubes{make_array<uint8_t, 24>(NOTSET)};
89  Mapping m_tubesToTdc{make_array<uint8_t, 24>(NOTSET)};
96 };
97 std::ostream& operator<<(std::ostream& ostr, const MdtMezzanineCard& map);
98 
99 #endif
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:558
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:81
MdtMezzanineCard::numTubesPerLayer
uint8_t numTubesPerLayer() const
returns the number of tubes per layer;
Definition: MdtMezzanineCard.h:69
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:40
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:67
MdtMezzanineCard::m_tdcToTubes
Mapping m_tdcToTubes
Mapping of the tdc channels to the mezzanine tube number.
Definition: MdtMezzanineCard.h:87
operator<<
std::ostream & operator<<(std::ostream &ostr, const MdtMezzanineCard &map)
Definition: MdtMezzanineCard.cxx:22
MdtMezzanineCard::NOTSET
static constexpr uint8_t NOTSET
Definition: MdtMezzanineCard.h:37
MdtMezzanineCard::id
uint8_t id() const
returns mezzanine database identifier
Definition: MdtMezzanineCard.h:65
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:35
MdtMezzanineCard::OfflineCh::layer
uint8_t layer
Definition: MdtMezzanineCard.h:75
MdtMezzanineCard::m_nlay
uint8_t m_nlay
Number of tube layers.
Definition: MdtMezzanineCard.h:91
MdtMezzanineCard::OfflineCh
Helper struct to pipe the result from the tdc -> offline channel translation.
Definition: MdtMezzanineCard.h:73
MdtMezzanineCard::MezzCardPtr
std::shared_ptr< const MdtMezzanineCard > MezzCardPtr
Definition: MdtMezzanineCard.h:39
MdtMezzanineCard::OfflineCh::tube
uint8_t tube
Definition: MdtMezzanineCard.h:74
ArrayHelper.h
MdtMezzanineCard::m_mezzId
uint8_t m_mezzId
Mezzanine database identifier.
Definition: MdtMezzanineCard.h:95
MdtMezzanineCard::tubeToTdcMap
const Mapping & tubeToTdcMap() const
Returns the underlying Tube -> Tdc conversion map.
Definition: MdtMezzanineCard.h:83
MdtMezzanineCard::m_nTubes
uint8_t m_nTubes
Number of tubes per layer.
Definition: MdtMezzanineCard.h:93
MdtMezzanineCard::m_tubesToTdc
Mapping m_tubesToTdc
Mapping of the mezzanine tube number to the tdc channel.
Definition: MdtMezzanineCard.h:89
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:76
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
calibdata.tube
tube
Definition: calibdata.py:30
doL1CaloHVCorrections.num_layers
num_layers
retrieve num layers and layer names (from new or ref hv input)
Definition: doL1CaloHVCorrections.py:379