ATLAS Offline Software
Loading...
Searching...
No Matches
LArOnlineID.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef LARONLINEID_H
6#define LARONLINEID_H
7
10#include "string.h"
11#include <vector>
12#include <algorithm>
13
14#include <iostream>
15
16
17class IdentifierHash;
18class Range;
19
21{
22 public:
23
24 typedef Identifier::size_type size_type;
25
34
35 int initialize_from_dictionary(const IdDictMgr&) override final;
36
37 bool isHECchannel (const HWIdentifier id) const override final; // differs for Main and DT
38 bool isEMECIW (const HWIdentifier id) const override final; // differs for Main and DT
39 bool isEMECOW (const HWIdentifier id) const override final; // differs for Main and DT
40 bool isEMECchannel (const HWIdentifier id) const override final; // differs for Main and DT
41
42 /* Test beam disctionaries */
43 bool is_H8 (const HWIdentifier channelId) const;
44 bool is_H8crack (const HWIdentifier channelId) const;
45 bool is_H8low (const HWIdentifier channelId) const;
46 bool is_H8high (const HWIdentifier channelId) const;
47 bool is_H6 (const HWIdentifier channelId) const;
48 bool is_H6FT (const HWIdentifier feedthroughId) const;
49 bool is_H6fcal (const HWIdentifier id) const;
50 bool is_H6hec (const HWIdentifier id) const;
51 bool is_H6emec (const HWIdentifier id) const;
52 bool is_H8onlineOnly (const HWIdentifier id) const;
53
54
55
56private:
57/*==== */
58
59 // Test of Em EC special / standard
60 bool isLArCalibOnline(const HWIdentifier id) const;
61
62 // Check methods
63 int init_H8Hashes();
64 int init_H6Hashes();
65};
66
67
68//using the macro below we can assign an identifier (and a version)
69//This is required and checked at compile time when you try to record/retrieve
70CLASS_DEF( LArOnlineID , 158698068 , 1 )
72
73/* TEST BEAM dictionaries */
74
76/*=======================================================================*/
77{
78 return(
79 m_bec_impl.unpack(Id)== 0 && m_side_impl.unpack(Id)== 1 &&
80 m_feedthrough_impl.unpack(Id) < 2
81 );
82}
83inline bool LArOnlineID::is_H8onlineOnly( const HWIdentifier Id ) const
84/*=======================================================================*/
85{
86 return(
87 m_bec_impl.unpack(Id)== 0 && m_side_impl.unpack(Id)==1 &&
88 ( m_feedthrough_impl.unpack(Id)==0 || m_feedthrough_impl.unpack(Id) == 1 )
89 && m_slot_impl.unpack(Id) == 14 && m_channel_in_slot_impl.unpack(Id) > 63
90 );
91}
92inline bool LArOnlineID::is_H8crack( const HWIdentifier Id ) const
93/*=======================================================================*/
94{
95 return(
96 m_bec_impl.unpack(Id)== 0 && m_side_impl.unpack(Id)==1 &&
97 (
98 ( m_feedthrough_impl.unpack(Id)==0
99 && ( m_slot_impl.unpack(Id) == 1 || m_slot_impl.unpack(Id)== 5 ||
100 m_slot_impl.unpack(Id) == 6 || m_slot_impl.unpack(Id)== 7 ||
101 m_slot_impl.unpack(Id) == 9 || m_slot_impl.unpack(Id)== 10||
102 m_slot_impl.unpack(Id) == 12|| m_slot_impl.unpack(Id)== 13 )
103 )
104 ||
105 ( m_feedthrough_impl.unpack(Id) ==1
106 && ( m_slot_impl.unpack(Id) == 1 || m_slot_impl.unpack(Id)== 5 ||
107 m_slot_impl.unpack(Id) == 6 || m_slot_impl.unpack(Id)== 7 ||
108 m_slot_impl.unpack(Id) == 9 || m_slot_impl.unpack(Id)== 10||
109 m_slot_impl.unpack(Id) == 12 || m_slot_impl.unpack(Id)== 13 )
110 )
111 )
112 );
113}
114
115inline bool LArOnlineID::is_H8low( const HWIdentifier Id ) const
116/*=======================================================================*/
117{
118 return(
119 m_bec_impl.unpack(Id)== 0 && m_side_impl.unpack(Id)==1 &&
120 (
121 ( m_feedthrough_impl.unpack(Id)==0
122 && ( m_slot_impl.unpack(Id) == 1 || m_slot_impl.unpack(Id)== 2 ||
123 m_slot_impl.unpack(Id) == 3 || m_slot_impl.unpack(Id)== 4 ||
124 m_slot_impl.unpack(Id) == 5 || m_slot_impl.unpack(Id)== 9 ||
125 m_slot_impl.unpack(Id) == 11|| m_slot_impl.unpack(Id)== 12 )
126 )
127 ||
128 ( m_feedthrough_impl.unpack(Id) ==1
129 && ( m_slot_impl.unpack(Id) == 1 || m_slot_impl.unpack(Id)== 2 ||
130 m_slot_impl.unpack(Id) == 3 || m_slot_impl.unpack(Id)== 4 ||
131 m_slot_impl.unpack(Id) == 5 || m_slot_impl.unpack(Id)== 9 ||
132 m_slot_impl.unpack(Id) == 11 || m_slot_impl.unpack(Id)== 12 )
133 )
134 )
135 );
136}
137
138inline bool LArOnlineID::is_H8high( const HWIdentifier Id ) const
139/*=======================================================================*/
140{
141 return(
142 m_bec_impl.unpack(Id)== 0 && m_side_impl.unpack(Id)==1 &&
143 (
144 ( m_feedthrough_impl.unpack(Id) == 0
145 && ( m_slot_impl.unpack(Id) == 1 || m_slot_impl.unpack(Id)== 6 ||
146 m_slot_impl.unpack(Id) == 7 || m_slot_impl.unpack(Id)== 8 ||
147 m_slot_impl.unpack(Id) == 10 || m_slot_impl.unpack(Id)== 13||
148 m_slot_impl.unpack(Id) == 14 )
149 )
150 ||
151 ( m_feedthrough_impl.unpack(Id) == 1
152 && ( m_slot_impl.unpack(Id) == 1 || m_slot_impl.unpack(Id)== 6 ||
153 m_slot_impl.unpack(Id) == 7 || m_slot_impl.unpack(Id)== 8 ||
154 m_slot_impl.unpack(Id) == 10 || m_slot_impl.unpack(Id)== 13||
155 m_slot_impl.unpack(Id) == 14 )
156 )
157 )
158 );
159}
160
161inline bool LArOnlineID::is_H6( const HWIdentifier Id ) const
162/*=======================================================================*/
163{
164 return(
165 m_bec_impl.unpack(Id)==1 && m_side_impl.unpack(Id)==1 &&
166 (
167 (m_feedthrough_impl.unpack(Id) == 0 && (m_slot_impl.unpack(Id) == 5 ||
168 m_slot_impl.unpack(Id) == 7 ||
169 m_slot_impl.unpack(Id) == 9 ||
170 m_slot_impl.unpack(Id) == 11 ) )
171 ||
172 (m_feedthrough_impl.unpack(Id) == 1 && (m_slot_impl.unpack(Id) == 3 ||
173 m_slot_impl.unpack(Id) == 4 ||
174 m_slot_impl.unpack(Id) == 5 ||
175 m_slot_impl.unpack(Id) == 6 ) )
176 )
177 );
178}
179
180inline bool LArOnlineID::is_H6FT( const HWIdentifier Id ) const
181/*=======================================================================*/
182{
183 return(
184 m_bec_impl.unpack(Id)==1 && m_side_impl.unpack(Id)==1 &&
185 (
186 m_feedthrough_impl.unpack(Id) == 0
187 ||
188 m_feedthrough_impl.unpack(Id) == 1
189 )
190 );
191}
192inline bool LArOnlineID::is_H6fcal( const HWIdentifier Id ) const
193/*=======================================================================*/
194{
195 return(
196 m_bec_impl.unpack(Id)==1 && m_side_impl.unpack(Id)==1 &&
197 (
198 m_feedthrough_impl.unpack(Id) == 1 && ( m_slot_impl.unpack(Id) == 4 ||
199 m_slot_impl.unpack(Id) == 5 ||
200 m_slot_impl.unpack(Id) == 6 )
201 )
202 );
203}
204inline bool LArOnlineID::is_H6hec( const HWIdentifier Id ) const
205/*=======================================================================*/
206{
207 return(
208 m_bec_impl.unpack(Id)==1 && m_side_impl.unpack(Id)==1 &&
209 (m_feedthrough_impl.unpack(Id) == 0 && (m_slot_impl.unpack(Id) == 5 ||
210 m_slot_impl.unpack(Id) == 7 ||
211 m_slot_impl.unpack(Id) == 9 ||
212 m_slot_impl.unpack(Id) == 11 )
213 )
214 );
215}
216inline bool LArOnlineID::is_H6emec( const HWIdentifier Id ) const
217/*=======================================================================*/
218{
219 return(
220 m_bec_impl.unpack(Id)==1 && m_side_impl.unpack(Id)==1 &&
221 (
222 m_feedthrough_impl.unpack(Id) == 1 && m_slot_impl.unpack(Id) == 3
223 )
224 );
225}
226
227
228
229#endif // LARONLINE_ID_H
230
231
232
Provide an interface for finding inheritance information at run time.
#define SG_BASES(D,...)
Declare the base classes from which D derives.
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
This is a "hash" representation of an Identifier.
Helper for the Liquid Argon Calorimeter cell identifiers.
IdDictFieldImplementation m_channel_in_slot_impl
LArOnlineID_Base(const std::string &name, const std::string &group, bool is_slar)
Default constructor.
IdDictFieldImplementation m_feedthrough_impl
IdDictFieldImplementation m_slot_impl
IdDictFieldImplementation m_side_impl
IdDictFieldImplementation m_bec_impl
bool is_H6FT(const HWIdentifier feedthroughId) const
bool is_H8onlineOnly(const HWIdentifier id) const
Definition LArOnlineID.h:83
~LArOnlineID()
Default destructor.
bool isEMECOW(const HWIdentifier id) const override final
bool is_H6hec(const HWIdentifier id) const
LArOnlineID()
Default constructor.
bool is_H8crack(const HWIdentifier channelId) const
Definition LArOnlineID.h:92
bool isLArCalibOnline(const HWIdentifier id) const
bool isEMECIW(const HWIdentifier id) const override final
bool is_H8high(const HWIdentifier channelId) const
int init_H6Hashes()
bool is_H6fcal(const HWIdentifier id) const
int init_H8Hashes()
bool is_H8(const HWIdentifier channelId) const
Definition LArOnlineID.h:75
bool isHECchannel(const HWIdentifier id) const override final
Identifier::size_type size_type
Definition LArOnlineID.h:24
int initialize_from_dictionary(const IdDictMgr &) override final
initialization from the identifier dictionary
bool is_H6(const HWIdentifier channelId) const
bool isEMECchannel(const HWIdentifier id) const override final
bool is_H6emec(const HWIdentifier id) const
bool is_H8low(const HWIdentifier channelId) const
A Range describes the possible ranges for the field values of an ExpandedIdentifier.