ATLAS Offline Software
Loading...
Searching...
No Matches
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
12
13namespace Muon
14{
15 namespace nsw
16 {
28
40
42 {
43 private:
44 uint8_t m_Elink;
45 uint8_t m_Radius;
46 uint8_t m_Layer;
47 uint8_t m_Sector;
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
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
94{
95 // counting from 0, even sectors are large
96 return ((m_Sector % 2) == 0);
97}
98
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
115{
116 // Becomes 1 to 8
117 return (m_Sector / 2 + 1);
118}
119
121{
122 // 1 = IP; 2 = HO
123 return (m_Layer / 4 + 1);
124}
125
127{
128 // 1 to 4
129 return (m_Layer + 1 - 4 * (m_Layer / 4));
130}
131
132inline Muon::nsw::NSWResourceId::NSWResourceId (uint32_t logical_id)
133{
135
136 if (m_DetId == 0) // pre-versioned logical ID data format
137 {
138 m_pre_version = true;
139 m_Version = 0;
148 m_DetId = eformat::MUON_STGC_ENDCAP_A_SIDE + m_Eta - 2 * m_Tech;
149 }
150 else
151 {
152 m_pre_version = false;
160 }
161}
162
163#endif // _MUON_NSW_RESOURCE_ID_H_
164
165
uint8_t technology() const
uint8_t version() const
uint8_t dataType() const
uint8_t multi_layer() const
uint8_t station_phi() const
int8_t station_eta() const
NSWResourceId(uint32_t logical_id)
bool is_large_station() const
uint8_t resourceType() const
uint32_t get_bits(uint32_t word, uint32_t mask, uint8_t position)
@ NSW_RESOURCE_PAD_TRIG
@ NSW_RESOURCE_ROUTER
@ NSW_RESOURCE_TRIG_PROC
@ NSW_RESOURCE_RIM_L1DDC
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.