ATLAS Offline Software
Loading...
Searching...
No Matches
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>
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>;
47 MdtMezzanineCard(const Mapping& tdcToTubeMap, uint8_t num_layers,
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 {
74 uint8_t tube{0};
75 uint8_t layer{0};
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:
91 uint8_t m_nlay{0};
93 uint8_t m_nTubes{0};
95 uint8_t m_mezzId{0};
96};
97std::ostream& operator<<(std::ostream& ostr, const MdtMezzanineCard& map);
98
99#endif
constexpr std::array< T, N > make_array(const T &def_val)
Helper function to initialize in-place arrays with non-zero values.
Definition ArrayHelper.h:10
std::ostream & operator<<(std::ostream &ostr, const MdtMezzanineCard &map)
MdtMezzanineCard - Helper struct to represent the structure of a mezzanine card in a consistent way E...
static constexpr uint8_t NOTSET
bool checkConsistency(MsgStream &msg) const
checks whether the tdc mapping is complete.
OfflineCh offlineTube(uint8_t tdc, MsgStream &msg) const
uint8_t m_mezzId
Mezzanine database identifier.
Mapping m_tubesToTdc
Mapping of the mezzanine tube number to the tdc channel.
uint8_t numTubesPerLayer() const
returns the number of tubes per layer;
const Mapping & tdcToTubeMap() const
Returns the underlying TDC -> Tube conversion map.
uint8_t id() const
returns mezzanine database identifier
Mapping m_tdcToTubes
Mapping of the tdc channels to the mezzanine tube number.
uint8_t m_nlay
Number of tube layers.
uint8_t tdcChannel(uint8_t tubeLay, uint8_t tube, MsgStream &msg) const
returns the tdc channel number
const Mapping & tubeToTdcMap() const
Returns the underlying Tube -> Tdc conversion map.
std::shared_ptr< const MdtMezzanineCard > MezzCardPtr
std::array< uint8_t, 24 > Mapping
uint8_t numTubeLayers() const
returns the number of layers
MdtMezzanineCard(const Mapping &tdcToTubeMap, uint8_t num_layers, uint8_t mezz_id)
Standard constructor of the mezzanine card.
uint8_t tubeNumber(uint8_t tubeLay, uint8_t tube) const
returns the tube number
uint8_t m_nTubes
Number of tubes per layer.
STL class.
Helper struct to pipe the result from the tdc -> offline channel translation.
MsgStream & msg
Definition testRead.cxx:32