ATLAS Offline Software
MdtTdcMap.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef MUONMDT_CABLING_MDTAMTMAP_H
6 #define MUONMDT_CABLING_MDTAMTMAP_H
7 
19 #include <stdint.h>
20 
21 #include <array>
22 
23 #include "GaudiKernel/MsgStream.h"
26 
27 class MdtIdHelper;
28 class MdtTdcMap {
29  public:
36  MdtTdcMap(const MezzCardPtr mezType, const MdtCablingData& cabling_data);
37 
39  ~MdtTdcMap() = default;
40 
42  bool offlineId(MdtCablingData& cabling_data, MsgStream& log) const;
44  bool onlineId(MdtCablingData& cabling_data, MsgStream& log) const;
45 
47  uint8_t mezzanineType() const { return m_mezzCard->id(); }
48 
50  uint8_t moduleId() const { return m_statId.tdcId; }
52  uint8_t mrod() const { return m_statId.mrod; }
54  uint8_t csm() const { return m_statId.csm; }
55 
57  const MdtCablingOffData& offId() const { return m_statId; }
59  const MdtCablingOnData& onlineId() const { return m_statId; }
61  int multiLayer() const { return m_statId.multilayer; }
62  /* get the station Name */
63  int stationName() const { return m_statId.stationIndex; }
64  /* get the station Eta */
65  int stationEta() const { return m_statId.eta; }
66  /* get the station Phi */
67  int stationPhi() const { return m_statId.phi; }
68 
69  /* get the zero channels */
70  uint8_t tdcZero() const { return m_statId.channelId; }
71  /* tube zero */
72  uint8_t tubeZero() const { return m_statId.tube; }
73 
74  uint8_t maxTube() const { return m_maxTube; }
75  uint8_t minTube() const { return m_minTube; }
76 
77  private:
81 
82  int8_t m_minTube{24};
83  int8_t m_maxTube{-24};
84 };
85 
89  MdtTdcOffSorter() = default;
91  const MdtTdcMap* operator->() const { return m_ptr; }
92  bool operator!() const { return !m_ptr; }
93  operator bool() const { return m_ptr; }
94 
95  private:
96  const MdtTdcMap* m_ptr{nullptr};
97 };
101  MdtTdcOnlSorter() = default;
103  const MdtTdcMap* operator->() const { return m_ptr; }
104  bool operator!() const { return !m_ptr; }
105  operator bool() const { return m_ptr; }
106 
107  private:
108  const MdtTdcMap* m_ptr{nullptr};
109 };
111 
115 inline bool operator<(const MdtTdcOffSorter& a, const MdtCablingData& b) {
116  return a->maxTube() < b.tube;
117 }
118 inline bool operator<(const MdtCablingData& a, const MdtTdcOffSorter& b) {
119  return a.tube < b->minTube();
120 }
122 inline bool operator<(const MdtTdcOffSorter& a, const MdtTdcOffSorter& b) {
123  return a->minTube() < b->minTube();
124 }
125 
126 inline bool operator<(const MdtTdcOnlSorter& a, const MdtTdcOnlSorter& b) {
127  return a->moduleId() < b->moduleId();
128 }
129 inline bool operator<(const MdtTdcOnlSorter& a, const MdtCablingData& b) {
130  return a->moduleId() < b.tdcId;
131 }
132 inline bool operator<(const MdtCablingData& a, const MdtTdcOnlSorter& b) {
133  return a.tdcId < b->moduleId();
134 }
135 
136 #endif // MUONMDT_CABLING_MDTAMTMAP_H
MdtTdcMap::csm
uint8_t csm() const
return the csm of the associated tdc
Definition: MdtTdcMap.h:54
MdtTdcMap
Definition: MdtTdcMap.h:28
MdtMezzanineCard.h
MdtTdcMap::stationPhi
int stationPhi() const
Definition: MdtTdcMap.h:67
MdtTdcOffSorter
Helper struct to search through the std::set if a conversion from offline -> online is needed.
Definition: MdtTdcMap.h:88
MdtTdcMap::maxTube
uint8_t maxTube() const
Definition: MdtTdcMap.h:74
MdtTdcMap::offlineId
bool offlineId(MdtCablingData &cabling_data, MsgStream &log) const
retrieve the full information
Definition: MdtTdcMap.cxx:24
MdtTdcOnlSorter::operator!
bool operator!() const
Definition: MdtTdcMap.h:104
MdtCablingData::tube
int tube
Layer inside the multilayer.
Definition: MdtCablingData.h:86
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
MdtCablingOffData::eta
int8_t & eta
Station of the chamber (i.e, BIL,BIS,etc.)
Definition: MdtCablingData.h:28
MdtTdcMap::mrod
uint8_t mrod() const
return the mrod associated to the tdc
Definition: MdtTdcMap.h:52
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
MdtTdcOffSorter::MdtTdcOffSorter
MdtTdcOffSorter()=default
MdtCablingData.h
createCablingJSON.cabling_data
dictionary cabling_data
Definition: createCablingJSON.py:46
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
MdtTdcOnlSorter
Helper struct to search through the std::set if a conversion from online -> offline is needed.
Definition: MdtTdcMap.h:100
MdtMezzanineCard::NOTSET
static constexpr uint8_t NOTSET
Definition: MdtMezzanineCard.h:36
MdtCablingOffData::phi
int8_t & phi
Eta of the MDT station.
Definition: MdtCablingData.h:29
MdtTdcMap::MdtTdcMap
MdtTdcMap(const MezzCardPtr mezType, const MdtCablingData &cabling_data)
constructor
Definition: MdtTdcMap.cxx:10
MdtTdcMap::mezzanineType
uint8_t mezzanineType() const
get the mezzanine type
Definition: MdtTdcMap.h:47
MdtTdcMap::MezzCardPtr
MdtMezzanineCard::MezzCardPtr MezzCardPtr
Definition: MdtTdcMap.h:31
MdtCablingOffData
Split the offline part of the cabling apart to use it later for sorting.
Definition: MdtCablingData.h:16
MdtTdcMap::stationName
int stationName() const
Definition: MdtTdcMap.h:63
MdtMezzanineCard::MezzCardPtr
std::shared_ptr< const MdtMezzanineCard > MezzCardPtr
Definition: MdtMezzanineCard.h:38
MdtTdcMap::offId
const MdtCablingOffData & offId() const
get the offline identifier
Definition: MdtTdcMap.h:57
MdtTdcMap::~MdtTdcMap
~MdtTdcMap()=default
destructor
MdtIdHelper
Definition: MdtIdHelper.h:61
MdtCablingData
Definition: MdtCablingData.h:82
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
MdtTdcOffSorter::m_ptr
const MdtTdcMap * m_ptr
Definition: MdtTdcMap.h:96
MdtTdcMap::stationEta
int stationEta() const
Definition: MdtTdcMap.h:65
MdtCablingData::tdcId
uint8_t tdcId
Mezzanine type.
Definition: MdtCablingData.h:90
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
MdtTdcMap::tubeZero
uint8_t tubeZero() const
Definition: MdtTdcMap.h:72
operator<
bool operator<(const MdtTdcOffSorter &a, const MdtCablingData &b)
Operators used for navigation later.
Definition: MdtTdcMap.h:115
MdtTdcOnlSorter::operator->
const MdtTdcMap * operator->() const
Definition: MdtTdcMap.h:103
MdtCablingOnData::csm
uint8_t & csm
MROD number.
Definition: MdtCablingData.h:53
MdtTdcMap::tdcZero
uint8_t tdcZero() const
Definition: MdtTdcMap.h:70
MdtTdcOnlSorter::MdtTdcOnlSorter
MdtTdcOnlSorter()=default
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
MdtTdcOnlSorter::m_ptr
const MdtTdcMap * m_ptr
Definition: MdtTdcMap.h:108
a
TList * a
Definition: liststreamerinfos.cxx:10
MdtTdcOnlSorter::MdtTdcOnlSorter
MdtTdcOnlSorter(const MdtTdcMap *ptr)
Definition: MdtTdcMap.h:102
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
MdtTdcOffSorter::operator->
const MdtTdcMap * operator->() const
Definition: MdtTdcMap.h:91
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
MdtTdcMap::multiLayer
int multiLayer() const
get the multilayer (independent of the channel)
Definition: MdtTdcMap.h:61
MdtTdcOffSorter::operator!
bool operator!() const
Definition: MdtTdcMap.h:92
MdtTdcOffSorter::MdtTdcOffSorter
MdtTdcOffSorter(const MdtTdcMap *ptr)
Definition: MdtTdcMap.h:90
xAOD::bool
setBGCode setTAP setLVL2ErrorBits bool
Definition: TrigDecision_v1.cxx:60
MdtTdcMap::m_statId
MdtCablingData m_statId
tube corresponding to each tdc channel
Definition: MdtTdcMap.h:79