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