|
ATLAS Offline Software
|
Go to the documentation of this file.
13 std::ostream&
operator<<(std::ostream& ostr,
const Mapping& map) {
14 for (
unsigned int ch = 0;
ch < map.size(); ++
ch) {
15 ostr <<
ch <<
" -> " <<
static_cast<int>(map[
ch]);
16 if (
ch != (map.size() - 1))
23 ostr <<
"MezzId: " <<
static_cast<int>(map.
id()) <<
", ";
24 ostr <<
"nTubeLayer: " <<
static_cast<int>(map.
numTubeLayers()) <<
", ";
26 ostr <<
"tubeToTdcMap: " << std::endl;
45 for (
unsigned int tdc = 0; tdc < m_tdcToTubes.size(); ++tdc) {
47 if (
tube < m_tubesToTdc.size())
48 m_tubesToTdc[
tube] = tdc;
56 <<
static_cast<int>(
id()) <<
"." <<
endmsg;
59 log << MSG::ERROR <<
"Mezzanine card " <<
static_cast<int>(
id())
60 <<
" has invalid many tube layers "
65 std::set<uint8_t> uniqueSet{};
67 std::inserter(uniqueSet, uniqueSet.end()),
68 [](
const uint8_t ch) { return ch != NOTSET; });
71 [](
const uint8_t ch) { return ch == NOTSET; });
74 <<
"Mezzanine card has unassigned tdc -> tube channels " <<
endmsg;
75 log << MSG::ERROR <<
"Mapped channels " << uniqueSet.size()
76 <<
" dead channels: " <<
unmapped << std::endl;
77 log << MSG::ERROR <<
"Please check " << (*this) <<
endmsg;
82 <<
"Mezzanine card does not have any associated channel " <<
endmsg;
83 log << MSG::ERROR <<
"Please check " << (*this) <<
endmsg;
87 std::inserter(uniqueSet, uniqueSet.end()),
88 [](
const uint8_t ch) { return ch != NOTSET; });
90 [](
const uint8_t ch) { return ch == NOTSET; });
92 log << MSG::ERROR <<
" Mezzanine card maps tubes -> tdc inconsitently "
94 log << MSG::ERROR <<
"Mapped channels " << uniqueSet.size()
95 <<
" dead channels: " <<
unmapped << std::endl;
96 log << MSG::ERROR <<
" Please check " << (*this) <<
endmsg;
107 MsgStream&
msg)
const {
109 msg << MSG::WARNING <<
"MdtMezzanineCard::tdcChannel() -- Tube layer "
110 <<
static_cast<int>(tubeLay) <<
" is out of range. Max allowed "
116 msg <<
"MdtMezzanineCard::tdcChannel() -- Resolved layer "
117 <<
static_cast<int>(tubeLay) <<
" & tube " <<
static_cast<int>(
tube)
118 <<
" to " <<
static_cast<int>(globTubeNum) <<
endmsg;
128 msg << MSG::WARNING <<
" Tdc channel is out of range "
129 <<
static_cast<int>(tdc) <<
endmsg;
140 ret.isValid = globTubeNum !=
NOTSET;
bool checkConsistency(MsgStream &msg) const
checks whether the tdc mapping is complete.
const Mapping & tdcToTubeMap() const
Returns the underlying TDC -> Tube conversion map.
uint8_t numTubesPerLayer() const
returns the number of tubes per layer;
uint8_t tdcChannel(uint8_t tubeLay, uint8_t tube, MsgStream &msg) const
returns the tdc channel number
std::array< uint8_t, 24 > Mapping
OfflineCh offlineTube(uint8_t tdc, MsgStream &msg) const
uint8_t numTubeLayers() const
returns the number of layers
Mapping m_tdcToTubes
Mapping of the tdc channels to the mezzanine tube number.
static constexpr uint8_t NOTSET
uint8_t id() const
returns mezzanine database identifier
uint8_t tubeNumber(uint8_t tubeLay, uint8_t tube) const
returns the tube number
MdtMezzanineCard - Helper struct to represent the structure of a mezzanine card in a consistent way E...
Helper struct to pipe the result from the tdc -> offline channel translation.
Out copy_if(In first, const In &last, Out res, const Pred &p)
const Mapping & tubeToTdcMap() const
Returns the underlying Tube -> Tdc conversion map.
Mapping m_tubesToTdc
Mapping of the mezzanine tube number to the tdc channel.
MdtMezzanineCard(const Mapping &tdcToTubeMap, uint8_t num_layers, uint8_t mezz_id)
Standard constructor of the mezzanine card.
num_layers
retrieve num layers and layer names (from new or ref hv input)
std::ostream & operator<<(std::ostream &ostr, const MdtMezzanineCard &map)