ATLAS Offline Software
MuonSpectrometer
MuonCnv
MuonNSWCommonDecode
MuonNSWCommonDecode
NSWResourceId.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
#ifndef _MUON_NSW_RESOURCE_ID_H_
5
#define _MUON_NSW_RESOURCE_ID_H_
6
7
#include <iostream>
8
#include "eformat/SourceIdentifier.h"
9
10
#include "
MuonNSWCommonDecode/NSWDecodeBitmaps.h
"
11
#include "
MuonNSWCommonDecode/NSWDecodeHelper.h
"
12
13
namespace
Muon
14
{
15
namespace
nsw
16
{
17
enum
NSWResourceTypes
18
{
19
NSW_RESOURCE_PAD
= 0,
20
NSW_RESOURCE_STRIP
= 1,
21
NSW_RESOURCE_TRIG_PROC
= 2,
22
NSW_RESOURCE_PAD_TRIG
= 3,
23
NSW_RESOURCE_L1DDC
= 4,
24
NSW_RESOURCE_ADDC
= 5,
25
NSW_RESOURCE_ROUTER
= 6,
26
NSW_RESOURCE_RIM_L1DDC
= 7
27
};
28
29
enum
NSWDataTypes
30
{
31
NSW_DATA_L1A
= 0,
32
NSW_DATA_MONITOR
= 1,
33
NSW_DATA_TO_SCA
= 2,
34
NSW_DATA_FROM_SCA
= 3,
35
NSW_DATA_TTC
= 4,
36
NSW_DATA_L1A_INFO
= 5,
37
NSW_DATA_EXT
= 6,
38
NSW_DATA_EXC
= 7
39
};
40
41
class
NSWResourceId
42
{
43
private
:
44
uint8_t
m_Elink
;
45
uint8_t
m_Radius
;
46
uint8_t
m_Layer
;
47
uint8_t
m_Sector
;
48
uint8_t
m_ResourceType
;
49
uint8_t
m_DataType
;
50
uint8_t
m_Version
;
51
uint8_t
m_DetId
;
52
53
// For obsolete pre-versioned data
54
55
uint8_t
m_Eta
;
56
uint8_t
m_Tech
;
57
58
bool
m_pre_version
;
59
60
public
:
61
explicit
NSWResourceId
(
uint32_t
logical_id);
62
virtual
~NSWResourceId
() {};
63
64
uint8_t
elink
()
const
{
return
m_Elink
;};
65
uint8_t
radius
()
const
{
return
m_Radius
;};
66
uint8_t
layer
()
const
{
return
m_Layer
;};
67
uint8_t
sector
()
const
{
return
m_Sector
;};
68
uint8_t
resourceType
()
const
{
return
m_ResourceType
;};
69
uint8_t
dataType
()
const
{
return
m_DataType
;};
70
uint8_t
version
()
const
{
return
m_Version
;};
71
uint8_t
detId
()
const
{
return
m_DetId
;};
72
73
// For obsolete pre-versioned data
74
75
uint8_t
group
()
const
{
return
m_Elink
;};
76
uint8_t
eta
()
const
{
return
m_Eta
;};
77
uint8_t
technology
()
const
{
return
m_Tech
;}
78
79
bool
pre_version
()
const
{
return
m_pre_version
;};
80
81
// Offline decoder
82
83
bool
is_large_station
()
const
;
84
85
int8_t
station_eta
()
const
;
86
uint8_t
station_phi
()
const
;
87
uint8_t
multi_layer
()
const
;
88
uint8_t
gas_gap
()
const
;
89
};
90
}
91
}
92
93
inline
bool
Muon::nsw::NSWResourceId::is_large_station
()
const
94
{
95
// counting from 0, even sectors are large
96
return
((
m_Sector
% 2) == 0);
97
}
98
99
inline
int8_t
Muon::nsw::NSWResourceId::station_eta
()
const
100
{
101
int8_t mod_eta;
102
// Odd identifiers are on side A
103
int8_t side_sign = (m_DetId % 2) == 0 ? -1 : 1;
104
105
// MM identifiers are less than STGC identifiers
106
if
(m_DetId < eformat::MUON_STGC_ENDCAP_A_SIDE)
107
mod_eta = m_Radius < 10 ? 1 : 2;
108
else
109
mod_eta = m_Radius + 1;
110
111
return
(side_sign * mod_eta);
112
}
113
114
inline
uint8_t
Muon::nsw::NSWResourceId::station_phi
()
const
115
{
116
// Becomes 1 to 8
117
return
(m_Sector / 2 + 1);
118
}
119
120
inline
uint8_t
Muon::nsw::NSWResourceId::multi_layer
()
const
121
{
122
// 1 = IP; 2 = HO
123
return
(m_Layer / 4 + 1);
124
}
125
126
inline
uint8_t
Muon::nsw::NSWResourceId::gas_gap
()
const
127
{
128
// 1 to 4
129
return
(m_Layer + 1 - 4 * (m_Layer / 4));
130
}
131
132
inline
Muon::nsw::NSWResourceId::NSWResourceId
(
uint32_t
logical_id)
133
{
134
m_DetId =
Muon::nsw::helper::get_bits
(logical_id,
Muon::nsw::bitMaskDetId
,
Muon::nsw::bitPosDetId
);
135
136
if
(m_DetId == 0)
// pre-versioned logical ID data format
137
{
138
m_pre_version =
true
;
139
m_Version = 0;
140
m_Elink =
Muon::nsw::helper::get_bits
(logical_id,
Muon::nsw::bitMaskElink
,
Muon::nsw::bitPosElink
);
141
m_Radius =
Muon::nsw::helper::get_bits
(logical_id,
Muon::nsw::bitMaskRadius
,
Muon::nsw::bitPosRadius
);
142
m_Layer =
Muon::nsw::helper::get_bits
(logical_id,
Muon::nsw::bitMaskLayer
,
Muon::nsw::bitPosLayer
);
143
m_Sector =
Muon::nsw::helper::get_bits
(logical_id,
Muon::nsw::bitMaskSector
,
Muon::nsw::bitPosSector
);
144
m_Eta =
Muon::nsw::helper::get_bits
(logical_id,
Muon::nsw::bitMaskObsEta
,
Muon::nsw::bitPosObsEta
);
145
m_ResourceType =
Muon::nsw::helper::get_bits
(logical_id,
Muon::nsw::bitMaskObsResType
,
Muon::nsw::bitPosObsResType
);
146
m_Tech =
Muon::nsw::helper::get_bits
(logical_id,
Muon::nsw::bitMaskObsTech
,
Muon::nsw::bitPosObsTech
);
147
m_DataType =
Muon::nsw::helper::get_bits
(logical_id,
Muon::nsw::bitMaskObsDataType
,
Muon::nsw::bitPosObsDataType
);
148
m_DetId = eformat::MUON_STGC_ENDCAP_A_SIDE + m_Eta - 2 * m_Tech;
149
}
150
else
151
{
152
m_pre_version =
false
;
153
m_Elink =
Muon::nsw::helper::get_bits
(logical_id,
Muon::nsw::bitMaskElink
,
Muon::nsw::bitPosElink
);
154
m_Radius =
Muon::nsw::helper::get_bits
(logical_id,
Muon::nsw::bitMaskRadius
,
Muon::nsw::bitPosRadius
);
155
m_Layer =
Muon::nsw::helper::get_bits
(logical_id,
Muon::nsw::bitMaskLayer
,
Muon::nsw::bitPosLayer
);
156
m_Sector =
Muon::nsw::helper::get_bits
(logical_id,
Muon::nsw::bitMaskSector
,
Muon::nsw::bitPosSector
);
157
m_ResourceType =
Muon::nsw::helper::get_bits
(logical_id,
Muon::nsw::bitMaskResType
,
Muon::nsw::bitPosResType
);
158
m_DataType =
Muon::nsw::helper::get_bits
(logical_id,
Muon::nsw::bitMaskDataType
,
Muon::nsw::bitPosDataType
);
159
m_Version =
Muon::nsw::helper::get_bits
(logical_id,
Muon::nsw::bitMaskVersion
,
Muon::nsw::bitPosVersion
);
160
}
161
}
162
163
#endif // _MUON_NSW_RESOURCE_ID_H_
164
165
Muon::nsw::bitMaskDataType
@ bitMaskDataType
Definition:
NSWDecodeBitmaps.h:140
Muon::nsw::NSWResourceId::m_DataType
uint8_t m_DataType
Definition:
NSWResourceId.h:49
Muon::nsw::bitMaskResType
@ bitMaskResType
Definition:
NSWDecodeBitmaps.h:139
Muon::nsw::bitPosElink
@ bitPosElink
Definition:
NSWDecodeBitmaps.h:155
Muon::nsw::NSWResourceId::m_Elink
uint8_t m_Elink
Definition:
NSWResourceId.h:44
Muon::nsw::NSWResourceId::multi_layer
uint8_t multi_layer() const
Definition:
NSWResourceId.h:120
Muon::nsw::NSWResourceId::m_pre_version
bool m_pre_version
Definition:
NSWResourceId.h:58
xAOD::uint8_t
uint8_t
Definition:
Muon_v1.cxx:557
Muon::nsw::NSWResourceId::technology
uint8_t technology() const
Definition:
NSWResourceId.h:77
Muon::nsw::NSWResourceId::pre_version
bool pre_version() const
Definition:
NSWResourceId.h:79
Muon::nsw::NSW_DATA_L1A_INFO
@ NSW_DATA_L1A_INFO
Definition:
NSWResourceId.h:36
xAOD::uint32_t
setEventNumber uint32_t
Definition:
EventInfo_v1.cxx:127
Muon::nsw::NSW_DATA_TTC
@ NSW_DATA_TTC
Definition:
NSWResourceId.h:35
Muon::nsw::NSW_RESOURCE_TRIG_PROC
@ NSW_RESOURCE_TRIG_PROC
Definition:
NSWResourceId.h:21
Muon::nsw::bitPosLayer
@ bitPosLayer
Definition:
NSWDecodeBitmaps.h:157
Muon::nsw::NSWResourceId::m_Layer
uint8_t m_Layer
Definition:
NSWResourceId.h:46
Muon::nsw::NSWResourceId::version
uint8_t version() const
Definition:
NSWResourceId.h:70
Muon::nsw::NSWResourceId::detId
uint8_t detId() const
Definition:
NSWResourceId.h:71
Muon::nsw::NSW_RESOURCE_STRIP
@ NSW_RESOURCE_STRIP
Definition:
NSWResourceId.h:20
Muon::nsw::NSW_RESOURCE_PAD
@ NSW_RESOURCE_PAD
Definition:
NSWResourceId.h:19
Muon::nsw::bitPosVersion
@ bitPosVersion
Definition:
NSWDecodeBitmaps.h:162
Muon::nsw::bitMaskObsDataType
@ bitMaskObsDataType
Definition:
NSWDecodeBitmaps.h:150
Muon::nsw::NSWResourceId::station_eta
int8_t station_eta() const
Definition:
NSWResourceId.h:99
Muon::nsw::NSWResourceId::m_DetId
uint8_t m_DetId
Definition:
NSWResourceId.h:51
Muon::nsw::bitMaskDetId
@ bitMaskDetId
Definition:
NSWDecodeBitmaps.h:143
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition:
TrackSystemController.h:45
Muon::nsw::bitMaskRadius
@ bitMaskRadius
Definition:
NSWDecodeBitmaps.h:136
NSWDecodeBitmaps.h
Muon::nsw::helper::get_bits
uint32_t get_bits(uint32_t word, uint32_t mask, uint8_t position)
Definition:
NSWDecodeHelper.h:168
Muon::nsw::NSWResourceId::m_Sector
uint8_t m_Sector
Definition:
NSWResourceId.h:47
Muon::nsw::NSW_DATA_TO_SCA
@ NSW_DATA_TO_SCA
Definition:
NSWResourceId.h:33
Muon::nsw::bitPosSector
@ bitPosSector
Definition:
NSWDecodeBitmaps.h:158
Muon::nsw::NSWResourceId::dataType
uint8_t dataType() const
Definition:
NSWResourceId.h:69
Muon::nsw::bitPosObsDataType
@ bitPosObsDataType
Definition:
NSWDecodeBitmaps.h:170
Muon::nsw::NSWResourceId::group
uint8_t group() const
Definition:
NSWResourceId.h:75
Muon::nsw::NSWResourceId::m_Radius
uint8_t m_Radius
Definition:
NSWResourceId.h:45
Muon::nsw::NSWResourceTypes
NSWResourceTypes
Definition:
NSWResourceId.h:18
Muon::nsw::NSWResourceId::m_Version
uint8_t m_Version
Definition:
NSWResourceId.h:50
Muon::nsw::NSWResourceId::resourceType
uint8_t resourceType() const
Definition:
NSWResourceId.h:68
Muon::nsw::NSWResourceId::is_large_station
bool is_large_station() const
Definition:
NSWResourceId.h:93
Muon::nsw::bitPosObsEta
@ bitPosObsEta
Definition:
NSWDecodeBitmaps.h:167
Muon::nsw::NSWResourceId::radius
uint8_t radius() const
Definition:
NSWResourceId.h:65
Muon::nsw::NSWResourceId::station_phi
uint8_t station_phi() const
Definition:
NSWResourceId.h:114
Muon::nsw::NSWResourceId::NSWResourceId
NSWResourceId(uint32_t logical_id)
Definition:
NSWResourceId.h:132
Muon::nsw::NSWResourceId
Definition:
NSWResourceId.h:42
Muon::nsw::bitPosResType
@ bitPosResType
Definition:
NSWDecodeBitmaps.h:159
Muon::nsw::bitMaskLayer
@ bitMaskLayer
Definition:
NSWDecodeBitmaps.h:137
Muon::nsw::NSW_RESOURCE_PAD_TRIG
@ NSW_RESOURCE_PAD_TRIG
Definition:
NSWResourceId.h:22
Muon::nsw::NSW_DATA_EXT
@ NSW_DATA_EXT
Definition:
NSWResourceId.h:37
Muon::nsw::NSWResourceId::~NSWResourceId
virtual ~NSWResourceId()
Definition:
NSWResourceId.h:62
Muon::nsw::NSWResourceId::m_ResourceType
uint8_t m_ResourceType
Definition:
NSWResourceId.h:48
Muon::nsw::NSWResourceId::m_Eta
uint8_t m_Eta
Definition:
NSWResourceId.h:55
Muon::nsw::NSW_DATA_L1A
@ NSW_DATA_L1A
Definition:
NSWResourceId.h:31
Muon::nsw::bitMaskObsResType
@ bitMaskObsResType
Definition:
NSWDecodeBitmaps.h:148
NSWDecodeHelper.h
Muon::nsw::NSW_RESOURCE_ROUTER
@ NSW_RESOURCE_ROUTER
Definition:
NSWResourceId.h:25
Muon::nsw::bitMaskSector
@ bitMaskSector
Definition:
NSWDecodeBitmaps.h:138
Muon::nsw::NSW_DATA_EXC
@ NSW_DATA_EXC
Definition:
NSWResourceId.h:38
Muon::nsw::bitPosDetId
@ bitPosDetId
Definition:
NSWDecodeBitmaps.h:163
Muon::nsw::bitMaskElink
@ bitMaskElink
Definition:
NSWDecodeBitmaps.h:135
Muon::nsw::bitMaskObsTech
@ bitMaskObsTech
Definition:
NSWDecodeBitmaps.h:149
Muon::nsw::bitPosRadius
@ bitPosRadius
Definition:
NSWDecodeBitmaps.h:156
Muon::nsw::NSWDataTypes
NSWDataTypes
Definition:
NSWResourceId.h:30
Muon::nsw::NSWResourceId::layer
uint8_t layer() const
Definition:
NSWResourceId.h:66
Muon::nsw::NSW_RESOURCE_RIM_L1DDC
@ NSW_RESOURCE_RIM_L1DDC
Definition:
NSWResourceId.h:26
Muon::nsw::NSW_RESOURCE_ADDC
@ NSW_RESOURCE_ADDC
Definition:
NSWResourceId.h:24
Muon::nsw::NSWResourceId::elink
uint8_t elink() const
Definition:
NSWResourceId.h:64
Muon::nsw::bitMaskObsEta
@ bitMaskObsEta
Definition:
NSWDecodeBitmaps.h:147
Muon::nsw::bitPosObsResType
@ bitPosObsResType
Definition:
NSWDecodeBitmaps.h:168
Muon::nsw::bitPosObsTech
@ bitPosObsTech
Definition:
NSWDecodeBitmaps.h:169
Muon::nsw::NSWResourceId::sector
uint8_t sector() const
Definition:
NSWResourceId.h:67
Muon::nsw::NSW_RESOURCE_L1DDC
@ NSW_RESOURCE_L1DDC
Definition:
NSWResourceId.h:23
Muon::nsw::bitMaskVersion
@ bitMaskVersion
Definition:
NSWDecodeBitmaps.h:142
Muon::nsw::NSW_DATA_MONITOR
@ NSW_DATA_MONITOR
Definition:
NSWResourceId.h:32
Muon::nsw::NSWResourceId::m_Tech
uint8_t m_Tech
Definition:
NSWResourceId.h:56
Muon::nsw::NSWResourceId::gas_gap
uint8_t gas_gap() const
Definition:
NSWResourceId.h:126
Muon::nsw::NSWResourceId::eta
uint8_t eta() const
Definition:
NSWResourceId.h:76
Muon::nsw::bitPosDataType
@ bitPosDataType
Definition:
NSWDecodeBitmaps.h:160
Muon::nsw::NSW_DATA_FROM_SCA
@ NSW_DATA_FROM_SCA
Definition:
NSWResourceId.h:34
Generated on Sun Dec 22 2024 21:15:47 for ATLAS Offline Software by
1.8.18