ATLAS Offline Software
Public Types | Public Member Functions | Static Public Attributes | Private Attributes | List of all members
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 More...
 
 ~MdtTdcMap ()=default
 destructor More...
 
bool offlineId (MdtCablingData &cabling_data, MsgStream &log) const
 retrieve the full information More...
 
bool onlineId (MdtCablingData &cabling_data, MsgStream &log) const
 retrieve the full information for online More...
 
uint8_t mezzanineType () const
 get the mezzanine type More...
 
uint8_t moduleId () const
 return the tdc id More...
 
uint8_t mrod () const
 return the mrod associated to the tdc More...
 
uint8_t csm () const
 return the csm of the associated tdc More...
 
const MdtCablingOffDataoffId () const
 get the offline identifier More...
 
const MdtCablingOnDataonlineId () const
 get the online identiifer More...
 
int multiLayer () const
 get the multilayer (independent of the channel) More...
 
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 More...
 
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

Definition at line 31 of file MdtTdcMap.h.

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{mezType} {
12  for (uint8_t globTube : m_mezzCard->tdcToTubeMap()) {
13  if (globTube == NOTSET)
14  continue;
15  int8_t tube = globTube % m_mezzCard->numTubesPerLayer();
18  }
19  m_minTube += tubeZero();
20  m_maxTube += tubeZero();
21 }

◆ ~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 }

◆ 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 }

◆ 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.

◆ m_mezzCard

MezzCardPtr MdtTdcMap::m_mezzCard {nullptr}
private

Definition at line 80 of file MdtTdcMap.h.

◆ m_minTube

int8_t MdtTdcMap::m_minTube {24}
private

Definition at line 82 of file MdtTdcMap.h.

◆ m_statId

MdtCablingData MdtTdcMap::m_statId {}
private

tube corresponding to each tdc channel

Definition at line 79 of file MdtTdcMap.h.

◆ NOTSET

constexpr 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:
MdtTdcMap::maxTube
uint8_t maxTube() const
Definition: MdtTdcMap.h:74
max
#define max(a, b)
Definition: cfImp.cxx:41
MdtCablingData::tube
int tube
Layer inside the multilayer.
Definition: MdtCablingData.h:86
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:575
MdtCablingOffData::eta
int8_t & eta
Station of the chamber (i.e, BIL,BIS,etc.)
Definition: MdtCablingData.h:28
MdtTdcMap::m_mezzCard
MezzCardPtr m_mezzCard
Definition: MdtTdcMap.h:80
MdtCablingOnData
Definition: MdtCablingData.h:50
MdtCablingOffData::stationIndex
int8_t & stationIndex
Definition: MdtCablingData.h:26
MdtCablingOnData::mrod
uint8_t & mrod
Definition: MdtCablingData.h:52
createCablingJSON.cabling_data
dictionary cabling_data
Definition: createCablingJSON.py:18
MdtCablingOffData::phi
int8_t & phi
Eta of the MDT station.
Definition: MdtCablingData.h:29
MdtCablingOffData
Split the offline part of the cabling apart to use it later for sorting.
Definition: MdtCablingData.h:16
MdtMezzanineCard::OfflineCh
Helper struct to pipe the result from the tdc -> offline channel translation.
Definition: MdtMezzanineCard.h:72
MdtTdcMap::offId
const MdtCablingOffData & offId() const
get the offline identifier
Definition: MdtTdcMap.h:57
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
MdtTdcMap::NOTSET
static constexpr uint8_t NOTSET
Definition: MdtTdcMap.h:30
MdtTdcMap::onlineId
const MdtCablingOnData & onlineId() const
get the online identiifer
Definition: MdtTdcMap.h:59
min
#define min(a, b)
Definition: cfImp.cxx:40
MdtCablingData::tdcId
uint8_t tdcId
Mezzanine type.
Definition: MdtCablingData.h:90
debug
const bool debug
Definition: MakeUncertaintyPlots.cxx:53
MdtTdcMap::tubeZero
uint8_t tubeZero() const
Definition: MdtTdcMap.h:72
MdtCablingOnData::csm
uint8_t & csm
MROD number.
Definition: MdtCablingData.h:53
MdtTdcMap::m_maxTube
int8_t m_maxTube
Definition: MdtTdcMap.h:83
MdtCablingData::channelId
uint8_t channelId
Identifier of the corresponding tdc.
Definition: MdtCablingData.h:92
MdtCablingOffData::multilayer
int8_t & multilayer
Phi sector of the MDT station.
Definition: MdtCablingData.h:30
MdtTdcMap::minTube
uint8_t minTube() const
Definition: MdtTdcMap.h:75
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
MdtTdcMap::moduleId
uint8_t moduleId() const
return the tdc id
Definition: MdtTdcMap.h:50
MdtTdcMap::m_minTube
int8_t m_minTube
Definition: MdtTdcMap.h:82
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
calibdata.tube
tube
Definition: calibdata.py:31
MdtTdcMap::m_statId
MdtCablingData m_statId
tube corresponding to each tdc channel
Definition: MdtTdcMap.h:79