ATLAS Offline Software
Loading...
Searching...
No Matches
MdtTdcMap Class Reference

#include <MdtTdcMap.h>

Collaboration diagram for MdtTdcMap:

Public Types

using MezzCardPtr = MdtMezzanineCard::MezzCardPtr

Public Member Functions

 MdtTdcMap (const MezzCardPtr mezType, const MdtCablingData &cabling_data)
 constructor
 ~MdtTdcMap ()=default
 destructor
bool offlineId (MdtCablingData &cabling_data, MsgStream &log) const
 retrieve the full information
bool onlineId (MdtCablingData &cabling_data, MsgStream &log) const
 retrieve the full information for online
uint8_t mezzanineType () const
 get the mezzanine type
uint8_t moduleId () const
 return the tdc id
uint8_t mrod () const
 return the mrod associated to the tdc
uint8_t csm () const
 return the csm of the associated tdc
const MdtCablingOffDataoffId () const
 get the offline identifier
const MdtCablingOnDataonlineId () const
 get the online identiifer
int multiLayer () const
 get the multilayer (independent of the channel)
int stationName () const
int stationEta () const
int stationPhi () const
uint8_t tdcZero () const
uint8_t tubeZero () const
uint8_t maxTube () const
uint8_t minTube () const

Static Public Attributes

static constexpr uint8_t NOTSET = MdtMezzanineCard::NOTSET

Private Attributes

MdtCablingData m_statId {}
 tube corresponding to each tdc channel
MezzCardPtr m_mezzCard {nullptr}
int8_t m_minTube {24}
int8_t m_maxTube {-24}

Detailed Description

Definition at line 28 of file MdtTdcMap.h.

Member Typedef Documentation

◆ MezzCardPtr

Constructor & Destructor Documentation

◆ MdtTdcMap()

MdtTdcMap::MdtTdcMap ( const MezzCardPtr mezType,
const MdtCablingData & cabling_data )

constructor

arguments are the mezzanine type, one channel (usually chan 0) and the corresponding offline informations

Definition at line 10 of file MdtTdcMap.cxx.

11 : m_statId{cabling_data}, m_mezzCard{std::move(mezType)} {
12 for (uint8_t globTube : m_mezzCard->tdcToTubeMap()) {
13 if (globTube == NOTSET)
14 continue;
15 int8_t tube = globTube % m_mezzCard->numTubesPerLayer();
16 m_minTube = std::min(m_minTube, tube);
17 m_maxTube = std::max(m_maxTube, tube);
18 }
21}
MezzCardPtr m_mezzCard
Definition MdtTdcMap.h:80
int8_t m_maxTube
Definition MdtTdcMap.h:83
MdtCablingData m_statId
tube corresponding to each tdc channel
Definition MdtTdcMap.h:79
int8_t m_minTube
Definition MdtTdcMap.h:82
uint8_t tubeZero() const
Definition MdtTdcMap.h:72
static constexpr uint8_t NOTSET
Definition MdtTdcMap.h:30

◆ ~MdtTdcMap()

MdtTdcMap::~MdtTdcMap ( )
default

destructor

Member Function Documentation

◆ csm()

uint8_t MdtTdcMap::csm ( ) const
inline

return the csm of the associated tdc

Definition at line 54 of file MdtTdcMap.h.

54{ return m_statId.csm; }

◆ maxTube()

uint8_t MdtTdcMap::maxTube ( ) const
inline

Definition at line 74 of file MdtTdcMap.h.

74{ return m_maxTube; }

◆ mezzanineType()

uint8_t MdtTdcMap::mezzanineType ( ) const
inline

get the mezzanine type

Definition at line 47 of file MdtTdcMap.h.

47{ return m_mezzCard->id(); }

◆ minTube()

uint8_t MdtTdcMap::minTube ( ) const
inline

Definition at line 75 of file MdtTdcMap.h.

75{ return m_minTube; }

◆ moduleId()

uint8_t MdtTdcMap::moduleId ( ) const
inline

return the tdc id

Definition at line 50 of file MdtTdcMap.h.

50{ return m_statId.tdcId; }

◆ mrod()

uint8_t MdtTdcMap::mrod ( ) const
inline

return the mrod associated to the tdc

Definition at line 52 of file MdtTdcMap.h.

52{ return m_statId.mrod; }

◆ multiLayer()

int MdtTdcMap::multiLayer ( ) const
inline

get the multilayer (independent of the channel)

Definition at line 61 of file MdtTdcMap.h.

61{ return m_statId.multilayer; }

◆ offId()

const MdtCablingOffData & MdtTdcMap::offId ( ) const
inline

get the offline identifier

Definition at line 57 of file MdtTdcMap.h.

57{ return m_statId; }

◆ offlineId()

bool MdtTdcMap::offlineId ( MdtCablingData & cabling_data,
MsgStream & log ) const

retrieve the full information

Definition at line 24 of file MdtTdcMap.cxx.

24 {
25 if (onlineId() != cabling_map) {
26 if (log.level() <= MSG::VERBOSE) {
27 log << MSG::VERBOSE << cabling_map
28 << " does not have the same online Id " << onlineId() << endmsg;
29 return false;
30 }
31 }
32 using OfflineCh = MdtMezzanineCard::OfflineCh;
33 OfflineCh tubeLayer = m_mezzCard->offlineTube(cabling_map.channelId, log);
34 static_cast<MdtCablingOffData&>(cabling_map) = offId();
35 cabling_map.tube = tubeZero() + tubeLayer.tube;
36 cabling_map.layer = tubeLayer.layer;
37 return tubeLayer.isValid;
38}
#define endmsg
const MdtCablingOffData & offId() const
get the offline identifier
Definition MdtTdcMap.h:57
const MdtCablingOnData & onlineId() const
get the online identiifer
Definition MdtTdcMap.h:59

◆ onlineId() [1/2]

const MdtCablingOnData & MdtTdcMap::onlineId ( ) const
inline

get the online identiifer

Definition at line 59 of file MdtTdcMap.h.

59{ return m_statId; }

◆ onlineId() [2/2]

bool MdtTdcMap::onlineId ( MdtCablingData & cabling_data,
MsgStream & log ) const

retrieve the full information for online

Definition at line 39 of file MdtTdcMap.cxx.

39 {
40 if (offId() != cabling_data) {
41 log << MSG::WARNING << "The cabling data " << cabling_data
42 << " does not share the same offline id as the Tdc " << offId()
43 << ". " << endmsg;
44 return false;
45 }
46 const bool debug = true || log.level() <= MSG::VERBOSE;
47 const uint8_t tubeOffSet =
48 (tubeZero() - 1) % m_mezzCard->numTubesPerLayer();
49 if (debug) {
50 log << MSG::VERBOSE << "Try to match " << cabling_data << endmsg;
51 }
52 if (cabling_data.tube < minTube() || cabling_data.tube > maxTube()) {
53 if (debug) {
54 log << MSG::VERBOSE << "The requested tube "
55 << static_cast<int>(cabling_data.tube) << " is out of range "
56 << static_cast<int>(minTube()) << " -- "
57 << static_cast<int>(maxTube()) << endmsg;
58 }
59 return false;
60 }
61 cabling_data.channelId = m_mezzCard->tdcChannel(
62 cabling_data.layer, cabling_data.tube - tubeOffSet, log);
63 static_cast<MdtCablingOnData&>(cabling_data) = m_statId;
64 cabling_data.tdcId = moduleId();
65 if (debug) {
66 log << MSG::VERBOSE << "Mapped to " << m_statId << ", channel "
67 << static_cast<int>(cabling_data.channelId) << endmsg;
68 }
69 return cabling_data.channelId != NOTSET;
70}
const bool debug
uint8_t moduleId() const
return the tdc id
Definition MdtTdcMap.h:50
uint8_t maxTube() const
Definition MdtTdcMap.h:74
uint8_t minTube() const
Definition MdtTdcMap.h:75

◆ stationEta()

int MdtTdcMap::stationEta ( ) const
inline

Definition at line 65 of file MdtTdcMap.h.

65{ return m_statId.eta; }

◆ stationName()

int MdtTdcMap::stationName ( ) const
inline

Definition at line 63 of file MdtTdcMap.h.

63{ return m_statId.stationIndex; }

◆ stationPhi()

int MdtTdcMap::stationPhi ( ) const
inline

Definition at line 67 of file MdtTdcMap.h.

67{ return m_statId.phi; }

◆ tdcZero()

uint8_t MdtTdcMap::tdcZero ( ) const
inline

Definition at line 70 of file MdtTdcMap.h.

70{ return m_statId.channelId; }

◆ tubeZero()

uint8_t MdtTdcMap::tubeZero ( ) const
inline

Definition at line 72 of file MdtTdcMap.h.

72{ return m_statId.tube; }

Member Data Documentation

◆ m_maxTube

int8_t MdtTdcMap::m_maxTube {-24}
private

Definition at line 83 of file MdtTdcMap.h.

83{-24};

◆ m_mezzCard

MezzCardPtr MdtTdcMap::m_mezzCard {nullptr}
private

Definition at line 80 of file MdtTdcMap.h.

80{nullptr};

◆ m_minTube

int8_t MdtTdcMap::m_minTube {24}
private

Definition at line 82 of file MdtTdcMap.h.

82{24};

◆ m_statId

MdtCablingData MdtTdcMap::m_statId {}
private

tube corresponding to each tdc channel

Definition at line 79 of file MdtTdcMap.h.

79{};

◆ NOTSET

uint8_t MdtTdcMap::NOTSET = MdtMezzanineCard::NOTSET
staticconstexpr

Definition at line 30 of file MdtTdcMap.h.


The documentation for this class was generated from the following files: