ATLAS Offline Software
Loading...
Searching...
No Matches
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
18
19#include <stdint.h>
20
21#include <array>
22
23#include "GaudiKernel/MsgStream.h"
26
27class MdtIdHelper;
28class MdtTdcMap {
29 public:
30 static constexpr uint8_t NOTSET = MdtMezzanineCard::NOTSET;
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;
90 MdtTdcOffSorter(const MdtTdcMap* ptr) : m_ptr{ptr} {}
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};
98
101 MdtTdcOnlSorter() = default;
102 MdtTdcOnlSorter(const MdtTdcMap* ptr) : m_ptr{ptr} {}
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};
110
111
115inline bool operator<(const MdtTdcOffSorter& a, const MdtCablingData& b) {
116 return a->maxTube() < b.tube;
117}
118inline bool operator<(const MdtCablingData& a, const MdtTdcOffSorter& b) {
119 return a.tube < b->minTube();
120}
121
122inline bool operator<(const MdtTdcOffSorter& a, const MdtTdcOffSorter& b) {
123 return a->minTube() < b->minTube();
124}
125
126inline bool operator<(const MdtTdcOnlSorter& a, const MdtTdcOnlSorter& b) {
127 return a->moduleId() < b->moduleId();
128}
129inline bool operator<(const MdtTdcOnlSorter& a, const MdtCablingData& b) {
130 return a->moduleId() < b.tdcId;
131}
132inline bool operator<(const MdtCablingData& a, const MdtTdcOnlSorter& b) {
133 return a.tdcId < b->moduleId();
134}
135
136#endif // MUONMDT_CABLING_MDTAMTMAP_H
static Double_t a
bool operator<(const MdtTdcOffSorter &a, const MdtCablingData &b)
Operators used for navigation later.
Definition MdtTdcMap.h:115
static constexpr uint8_t NOTSET
std::shared_ptr< const MdtMezzanineCard > MezzCardPtr
int stationName() const
Definition MdtTdcMap.h:63
MezzCardPtr m_mezzCard
Definition MdtTdcMap.h:80
int8_t m_maxTube
Definition MdtTdcMap.h:83
bool offlineId(MdtCablingData &cabling_data, MsgStream &log) const
retrieve the full information
Definition MdtTdcMap.cxx:24
uint8_t moduleId() const
return the tdc id
Definition MdtTdcMap.h:50
uint8_t csm() const
return the csm of the associated tdc
Definition MdtTdcMap.h:54
const MdtCablingOffData & offId() const
get the offline identifier
Definition MdtTdcMap.h:57
MdtCablingData m_statId
tube corresponding to each tdc channel
Definition MdtTdcMap.h:79
uint8_t mrod() const
return the mrod associated to the tdc
Definition MdtTdcMap.h:52
~MdtTdcMap()=default
destructor
MdtMezzanineCard::MezzCardPtr MezzCardPtr
Definition MdtTdcMap.h:31
int8_t m_minTube
Definition MdtTdcMap.h:82
uint8_t mezzanineType() const
get the mezzanine type
Definition MdtTdcMap.h:47
int multiLayer() const
get the multilayer (independent of the channel)
Definition MdtTdcMap.h:61
uint8_t maxTube() const
Definition MdtTdcMap.h:74
uint8_t minTube() const
Definition MdtTdcMap.h:75
int stationEta() const
Definition MdtTdcMap.h:65
MdtTdcMap(const MezzCardPtr mezType, const MdtCablingData &cabling_data)
constructor
Definition MdtTdcMap.cxx:10
uint8_t tubeZero() const
Definition MdtTdcMap.h:72
static constexpr uint8_t NOTSET
Definition MdtTdcMap.h:30
uint8_t tdcZero() const
Definition MdtTdcMap.h:70
int stationPhi() const
Definition MdtTdcMap.h:67
const MdtCablingOnData & onlineId() const
get the online identiifer
Definition MdtTdcMap.h:59
Split the offline part of the cabling apart to use it later for sorting.
Helper struct to search through the std::set if a conversion from offline -> online is needed.
Definition MdtTdcMap.h:88
MdtTdcOffSorter()=default
MdtTdcOffSorter(const MdtTdcMap *ptr)
Definition MdtTdcMap.h:90
const MdtTdcMap * operator->() const
Definition MdtTdcMap.h:91
const MdtTdcMap * m_ptr
Definition MdtTdcMap.h:96
bool operator!() const
Definition MdtTdcMap.h:92
Helper struct to search through the std::set if a conversion from online -> offline is needed.
Definition MdtTdcMap.h:100
const MdtTdcMap * operator->() const
Definition MdtTdcMap.h:103
MdtTdcOnlSorter()=default
const MdtTdcMap * m_ptr
Definition MdtTdcMap.h:108
bool operator!() const
Definition MdtTdcMap.h:104
MdtTdcOnlSorter(const MdtTdcMap *ptr)
Definition MdtTdcMap.h:102