ATLAS Offline Software
LArOnlineID.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 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(void);
32  ~LArOnlineID(void);
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_hashes(void) ;
63  int init_H8Hashes(void) ;
64  int init_H6Hashes(void) ;
65 
66 };
67 
68 
69 //using the macro below we can assign an identifier (and a version)
70 //This is required and checked at compile time when you try to record/retrieve
71 CLASS_DEF( LArOnlineID , 158698068 , 1 )
72 
73 /* TEST BEAM dictionaries */
74 
75 inline bool LArOnlineID::is_H8( const HWIdentifier Id ) const
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 }
83 inline 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 }
92 inline 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 
115 inline 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 
138 inline 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 
161 inline 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 
180 inline 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 }
192 inline 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 }
204 inline 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 }
216 inline 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 
LArOnlineID::isEMECIW
bool isEMECIW(const HWIdentifier id) const override final
Definition: LArOnlineID.cxx:734
LArOnlineID::is_H6fcal
bool is_H6fcal(const HWIdentifier id) const
Definition: LArOnlineID.h:192
LArOnlineID::is_H6FT
bool is_H6FT(const HWIdentifier feedthroughId) const
Definition: LArOnlineID.h:180
LArOnlineID::init_hashes
int init_hashes(void)
LArOnlineID_Base.h
LArOnlineID::is_H6
bool is_H6(const HWIdentifier channelId) const
Definition: LArOnlineID.h:161
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:92
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:138
IdDictMgr
Definition: IdDictMgr.h:14
LArOnlineID::LArOnlineID
LArOnlineID(void)
Default constructor.
Definition: LArOnlineID.cxx:19
LArOnlineID::isEMECchannel
bool isEMECchannel(const HWIdentifier id) const override final
Definition: LArOnlineID.cxx:763
LArOnlineID::~LArOnlineID
~LArOnlineID(void)
Default destructor.
LArOnlineID::is_H8onlineOnly
bool is_H8onlineOnly(const HWIdentifier id) const
Definition: LArOnlineID.h:83
LArOnlineID::is_H6hec
bool is_H6hec(const HWIdentifier id) const
Definition: LArOnlineID.h:204
LArOnlineID::init_H8Hashes
int init_H8Hashes(void)
Definition: LArOnlineID.cxx:405
LArOnlineID::is_H8low
bool is_H8low(const HWIdentifier channelId) const
Definition: LArOnlineID.h:115
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:122
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:744
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_H6Hashes
int init_H6Hashes(void)
Definition: LArOnlineID.cxx:562
LArOnlineID::is_H8
bool is_H8(const HWIdentifier channelId) const
Definition: LArOnlineID.h:75
LArOnlineID::initialize_from_dictionary
int initialize_from_dictionary(const IdDictMgr &) override final
initialization from the identifier dictionary
Definition: LArOnlineID.cxx:30
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:64
LArOnlineID::isHECchannel
bool isHECchannel(const HWIdentifier id) const override final
Definition: LArOnlineID.cxx:723
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:216
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