50 const std::string&
group,
85 if( ft==31 ){
result =
"I01R";}
86 if( ft==0 ){
result =
"I01L";}
87 if( ft==1 ){
result =
"I02R";}
88 if( ft==2 ){
result =
"I02L";}
89 if( ft==3 ){
result =
"I03R";}
90 if( ft==4 ){
result =
"I03L";}
91 if( ft==5 ){
result =
"I04R";}
92 if( ft==6 ){
result =
"I04L";}
93 if( ft==7 ){
result =
"I05R";}
94 if( ft==8 ){
result =
"I05L";}
95 if( ft==9 ){
result =
"I06R";}
96 if( ft==10 ){
result =
"I06L";}
97 if( ft==11 ){
result =
"I07R";}
98 if( ft==12 ){
result =
"I07L";}
99 if( ft==13 ){
result =
"I08R";}
100 if( ft==14 ){
result =
"I08L";}
101 if( ft==15 ){
result =
"I09R";}
102 if( ft==16 ){
result =
"I09L";}
103 if( ft==17 ){
result =
"I10R";}
104 if( ft==18 ){
result =
"I10L";}
105 if( ft==19 ){
result =
"I11R";}
106 if( ft==20 ){
result =
"I11L";}
107 if( ft==21 ){
result =
"I12R";}
108 if( ft==22 ){
result =
"I12L";}
109 if( ft==23 ){
result =
"I13R";}
110 if( ft==24 ){
result =
"I13L";}
111 if( ft==25 ){
result =
"I14R";}
112 if( ft==26 ){
result =
"I14L";}
113 if( ft==27 ){
result =
"I15R";}
114 if( ft==28 ){
result =
"I15L";}
115 if( ft==29 ){
result =
"I16R";}
116 if( ft==30 ){
result =
"I16L";}
120 if( ft==15 ){
result =
"H01R";}
121 if( ft==16 ){
result =
"H01L";}
122 if( ft==13 ){
result =
"H02R";}
123 if( ft==14 ){
result =
"H02L";}
124 if( ft==11 ){
result =
"H03R";}
125 if( ft==12 ){
result =
"H03L";}
126 if( ft==9 ){
result =
"H04R";}
127 if( ft==10){
result =
"H04L";}
128 if( ft==7 ){
result =
"H05R";}
129 if( ft==8 ){
result =
"H05L";}
130 if( ft==5 ){
result =
"H06R";}
131 if( ft==6 ){
result =
"H06L";}
132 if( ft==3 ){
result =
"H07R";}
133 if( ft==4 ){
result =
"H07L";}
134 if( ft==1 ){
result =
"H08R";}
135 if( ft==2 ){
result =
"H08L";}
136 if( ft==31){
result =
"H09R";}
137 if( ft==0 ){
result =
"H09L";}
138 if( ft==29 ){
result =
"H10R";}
139 if( ft==30 ){
result =
"H10L";}
140 if( ft==27 ){
result =
"H11R";}
141 if( ft==28 ){
result =
"H11L";}
142 if( ft==25 ){
result =
"H12R";}
143 if( ft==26 ){
result =
"H12L";}
144 if( ft==23 ){
result =
"H13R";}
145 if( ft==24 ){
result =
"H13L";}
146 if( ft==21 ){
result =
"H14R";}
147 if( ft==22 ){
result =
"H14L";}
148 if( ft==19 ){
result =
"H15R";}
149 if( ft==20 ){
result =
"H15L";}
150 if( ft==17 ){
result =
"H16R";}
151 if( ft==18 ){
result =
"H16L";}
158 if( ft==0 ){
result =
"A01R";}
159 if( ft==1 ){
result =
"A01L";}
160 if( ft==2 ){
result =
"A02R";}
161 if( ft==3 ){
result =
"A02L";}
162 if( ft==4 ){
result =
"A03R";}
163 if( ft==5 ){
result =
"A03L";}
164 if( ft==6 ){
result =
"A04R";}
165 if( ft==7 ){
result =
"A05R";}
166 if( ft==8 ){
result =
"A05L";}
167 if( ft==9 ){
result =
"A06R";}
168 if( ft==10){
result =
"A06L";}
169 if( ft==11){
result =
"A07R";}
170 if( ft==12){
result =
"A07L";}
171 if( ft==13){
result =
"A08R";}
172 if( ft==14){
result =
"A08L";}
173 if( ft==15){
result =
"A09R";}
174 if( ft==16){
result =
"A09L";}
175 if( ft==17){
result =
"A10R";}
176 if( ft==18){
result =
"A10L";}
177 if( ft==19){
result =
"A11R";}
178 if( ft==20){
result =
"A11L";}
179 if( ft==21){
result =
"A12R";}
180 if( ft==22){
result =
"A12L";}
181 if( ft==23){
result =
"A13R";}
182 if( ft==24){
result =
"A13L";}
183 if( ft==25){
result =
"A14R";}
184 if( ft==26){
result =
"A14L";}
185 if( ft==27){
result =
"A15L";}
189 if( ft==11 ){
result =
"C01R";}
190 if( ft==12 ){
result =
"C01L";}
191 if( ft==9 ){
result =
"C02R";}
192 if( ft==10 ){
result =
"C02L";}
193 if( ft==7 ){
result =
"C03R";}
194 if( ft==8 ){
result =
"C03L";}
195 if( ft==4 ){
result =
"C05R";}
196 if( ft==5 ){
result =
"C05L";}
197 if( ft==2 ){
result =
"C06R";}
198 if( ft==3 ){
result =
"C06L";}
199 if( ft==0 ){
result =
"C07R";}
200 if( ft==1 ){
result =
"C07L";}
201 if( ft==23 ){
result =
"C08R";}
202 if( ft==24 ){
result =
"C08L";}
203 if( ft==21 ){
result =
"C09R";}
204 if( ft==22 ){
result =
"C09L";}
205 if( ft==19 ){
result =
"C10R";}
206 if( ft==20 ){
result =
"C10L";}
207 if( ft==17 ){
result =
"C11R";}
208 if( ft==18 ){
result =
"C11L";}
209 if( ft==15 ){
result =
"C12R";}
210 if( ft==16 ){
result =
"C12L";}
211 if( ft==13 ){
result =
"C13R";}
212 if( ft==14 ){
result =
"C13L";}
213 if( ft==6 ){
result =
"C04L";}
214 if( ft==25 ){
result =
"C14R";}
215 if( ft==26 ){
result =
"C14L";}
216 if( ft==27 ){
result =
"C15L";}
225 std::ostringstream s1;
227 int Nslot =
slot(
id);
229 std::string det_barrel_endcap =
"NODETE";
230 std::string det_side =
"/X-SIDE";
232 if(
barrel_ec(
id) == 0 ) det_barrel_endcap =
"BARREL";
233 if(
barrel_ec(
id) == 1 ) det_barrel_endcap =
"ENDCAP";
234 if(
pos_neg(
id) == 1 ) det_side =
"/A-SIDE";
235 if(
pos_neg(
id) == 0 ) det_side =
"/C-SIDE";
237 s1 << det_barrel_endcap
241 <<
"/CHAN-" << Nchan;
300 if (range.match(expId)) {
302 if (!channel_in_slot_field.
empty()) {
303 int channel_in_slotmax = channel_in_slot_field.
get_maximum();
304 if (
result < channel_in_slotmax)
result = channel_in_slotmax + 1;
325 ATH_MSG_DEBUG(
"Request to reinitialize not satisfied - tags have not changed");
336 ATH_MSG_ERROR(
"initialize_from_dictionary - cannot access LArCalorimeter dictionary");
354 if (atlasDict->
get_label_value(
"subdet",
"LArCalorimeter", larField)) {
355 ATH_MSG_ERROR(
"Could not get value for label 'LArCalorimeter' of field 'subdet' in dictionary "
356 << atlasDict->
name());
361 int larOnlineField = -4;
362 if (
m_dict->get_label_value(
"part",
"LArOnline", larOnlineField)) {
363 ATH_MSG_ERROR(
"Could not get value for label 'LArOnline' of field 'part' in dictionary "
369 int larOnlineCalibField = -5;
370 if (
m_dict->get_label_value(
"part",
"LArOnlineCalib", larOnlineCalibField)) {
371 ATH_MSG_ERROR(
"Could not get value for label 'LArOnlineCalib' of field 'part' in dictionary "
378 region_id.add(larField);
379 region_id.add(larOnlineField);
383 region_id2.
add(larField);
384 region_id2.
add(larOnlineCalibField);
433 int size = (1 << bits);
514 unsigned int nrangesFound = 0;
529 if (nrangesFound > 1) {
537 for (
unsigned int j = 0; j < nvalues; ++j) {
542 ATH_MSG_WARNING(
" ***** Warning feb range slot field is NOT both_bounded - id, slot mode: " +
587 std::string errorMessage =
"LArOnlineID_Base::channel_Id_checks() result is not OK: ID, range = "
604 std::string errorMessage =
"LArOnlineID_Base::channel_Id_checks(febId) result is not OK: ID = "
613 std::string errorMessage =
"LArOnlineID_Base::channel_Id_checks(febId) result is not OK: ID, range = "
630 std::string errorMessage =
"LArOnlineID_Base::channel_Id_checks(feedthroughId) result is not OK: ID = "
639 std::string errorMessage =
"LArOnlineID_Base::channel_Id_checks(feedthroughId) result is not OK: ID, range = "
656 if (!
m_full_feedthrough_range.match(expId)) { std::string errorMessage =
"LArOnlineID_Base::feb_Id_checks() result is not OK: ID, range = "
673 if (!
m_full_feedthrough_range.match(expId)) { std::string errorMessage =
"LArOnlineID_Base::feedthrough_Id_checks() result is not OK: ID, range = "
742 ATH_MSG_ERROR(
"initLevelsFromDict - dictionary NOT initialized");
765 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find laronline region ");
776 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'subdet' field ");
781 field =
m_dict->find_field(
"part") ;
788 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'part' field ");
793 field =
m_dict->find_field(
"barrel-ec") ;
800 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'barrel-endcap' field ");
805 field =
m_dict->find_field(
"pos_neg") ;
812 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'barrel-endcap' field ");
829 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'feedthrough' field ");
834 std::string slot_name;
836 slot_name+=
"slar_slot";
840 field =
m_dict->find_field(slot_name) ;
847 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'slot' field ");
865 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'channel_in_slot' field ");
871 field =
m_dict->find_field(
"is-slar") ;
878 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'slar' field ");
887 ATH_MSG_ERROR(
"initLevelsFromDict - cannot find " << group_name);
904 ATH_MSG_DEBUG(
"decode index and bit fields for each level:");
927 unsigned int nids = 0;
928 std::set<HWIdentifier> ids;
933 for (
const auto & exp_id : rit)
940 if(!(ids.insert(
id)).second)
942 ATH_MSG_ERROR(
"init_hashes: duplicated id for channel nb = " + std::to_string(nids));
950 ATH_MSG_ERROR(
"init_hashes: set size NOT EQUAL to hash max. size " + std::to_string(ids.size()));
955 std::set<HWIdentifier>::const_iterator first = ids.begin();
956 std::set<HWIdentifier>::const_iterator last = ids.end();
972 for (
const auto & exp_id: rit) {
976 if(!(ids.insert(feedthroughId)).second){
977 ATH_MSG_ERROR(
"init_hashes: duplicated id for feedthrough nb = " + std::to_string(nids));
985 ATH_MSG_ERROR(
"init_hashes: set size NOT EQUAL to feedthrough hash max. size " + std::to_string(ids.size()));
1008 for (
const auto & exp_id :rit)
1014 if(!(ids.insert(febId)).second)
1016 ATH_MSG_ERROR(
"init_hashes: duplicated id for FEB nb = " + std::to_string(nids));
1024 ATH_MSG_ERROR(
"init_hashes: set size NOT EQUAL to FEB hash max. size " + std::to_string(ids.size()));
1029 first = ids.begin();
1031 for (;first != last && nids <
m_feb_vec.size(); ++first)
1059 if (
slot<1)
return false;
1060 if (ft<0)
return false;
1062 if (ft>31)
return false;
1063 if (
slot>14)
return false;
1066 if (ft>27)
return false;
1067 if (ft==2 || ft==9 || ft==15 || ft==21){
1068 if (
slot >15)
return false;
1071 if (
slot>15)
return false;
1073 else if (ft>24 && ft<28) {
1074 if (
slot>10)
return false;
1076 else if (ft==3 || ft==10 || ft==16 || ft==22) {
1080 if (
slot>13)
return false;
1239 int slotValue =
slot(febId);
1240 for (
int i = 0; (
unsigned int)i < hc.
m_slot_values.size(); ++i) {
1243 ATH_MSG_WARNING(
"LArOnlineID_Base::feb_Hash - ***** WARNING: could not match slot value for has calculation ");
1246 return (hc.
m_hash + slotIndex);
1403 ( (-1 < ft && ft < 32) &&
1405 ( 63 < ch && ch < 128 )
1411 (ft == 2 || ft == 9 || ft == 15 || ft == 21 ) &&
1412 (63 < ch && ch < 128)
1499 return ( (bec==0 && sl==15)
1501 ( bec==1 && sl==15 &&
1521 (sl==3 || sl==4 || sl==12) &&
1530 (
barrel_ec(
id)==1 && ft==27 && sl==11 )
1690 unsigned int nids=0;
1691 std::set<HWIdentifier> ids;
1695 for (
const auto & exp_id : rit) {
1701 if(!(ids.insert(
id)).second) {
1702 ATH_MSG_WARNING(
"LArOnlineID_Base::init_calib_Hashes: Error: duplicated id for channel id. nids= "
1703 + std::to_string(nids) +
" compact Id " + std::string(exp_id) +
" " +
show_to_string(
id));
1708 unsigned int nidtb=0;
1709 std::set<HWIdentifier>::const_iterator first = ids.begin();
1710 std::set<HWIdentifier>::const_iterator last = ids.end();
1711 for (;first != last && nidtb < nids; ++first) {
1724 for (
const auto & exp_id : rit) {
1729 if(!(ids.insert(febId)).second){
1730 ATH_MSG_WARNING(
"LArOnlineID_Base::init_calibhashes: Warning: duplicated id for feb id. nids= "
1731 + std::to_string(nids) +
" compact Id " + std::string(exp_id) +
" " +
show_to_string(febId));
1737 first = ids.begin();
1739 for (;first != last && nidtb < nids; ++first)
#define ATH_MSG_WARNING(x)
static const int s_lar_online_field_value
static const int s_lar_onlineCalib_field_value
virtual std::string dictionaryVersion(void) const override
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
bool reinitialize(const IdDictMgr &dict_mgr)
Test whether an idhelper should be reinitialized based on the change of tags.
ExpandedIdentifier lar_exp(void) const
virtual void setDictVersion(const IdDictMgr &dict_mgr, const std::string &name) override
int register_dict_tag(const IdDictMgr &dict_mgr, const std::string &dict_name)
Register the file and tag names for a particular IdDict dictionary.
virtual bool do_checks(void) const override
Checks are performed by default in debug compilation and NOT in optimized compilation.
int lar_field_value() const
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
const std::string & group() const
Group name for this helper.
AtlasDetectorID(const std::string &name, const std::string &group)
void add(element_type value)
Append a value into a new field.
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
int get_label_value(const std::string &field, const std::string &label, int &value) const
const std::string & name() const
Dictionary name.
Identifier::size_type size_type
const IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
const IdDictFieldImplementation & implementation(size_t i) const
element_type get_minimum() const
Query the values.
bool empty() const
If true, this field does not have any constraints, and may hold any value representable by element_ty...
bool isEnumerated() const
const element_vector & get_values() const
element_type get_maximum() const
This is a "hash" representation of an Identifier.
Exception class for LAr online Identifiers.
std::vector< int > m_slot_values
Define the Hash identifier for channels and febs.
bool isValidId(const HWIdentifier id) const
Returns false if the identifier is not a LAr-online id or any of the sub-fields is out of range.
int feedthrough(const HWIdentifier id) const
Return the feedthrough of a hardware cell identifier : feedthrough = [0,31] Barrel - A/C side or H/...
bool isNotWarmCableConnected(const HWIdentifier id) const
MultiRange m_full_laronline_range
std::string feedthrough_name(const HWIdentifier id) const
Return a string corresponding to a feedthrough name given an identifier.
std::ranges::subrange< id_iterator > id_range
Type for range over identifiers.
HWIdentifier feedthrough_Id(int barrel_ec, int pos_neg, int feedthrough) const
Create a feedthrough identifier from fields.
virtual bool isEMECchannel(const HWIdentifier id) const =0
std::vector< HWIdentifier > m_channel_vec
bool isHecOnline(const HWIdentifier id) const
bool isFcalOnline(const HWIdentifier id) const
size_type m_calibModuleHashMax
id_iterator feedthrough_begin() const
Return an iterator pointing to Feedthrough identifiers collection.
bool isPS(const HWIdentifier id) const
int get_expanded_calib_id(const HWIdentifier &id, ExpandedIdentifier &exp_id, const IdContext *context) const
bool isEndcapOnline(const HWIdentifier id) const
bool isEMBchannel(const HWIdentifier id) const
IdContext cryostatEndContext() const
Define context for cryostat (obsolete)
std::vector< HWIdentifier >::const_iterator id_iterator
Type for iterators over identifiers.
int slot(const HWIdentifier id) const
Return the slot number of a hardware cell identifier: slot = [1,15] Slot-ID in top part of the crat...
HWIdentifier calib_channel_Id(int barrel_ec, int pos_neg, int feedthrough, int slot, int channel) const
create calibration channel identifiers from fields
virtual bool isEMECIW(const HWIdentifier id) const =0
const IdDictDictionary * m_dict
size_type m_channel_in_slot_index
IdDictFieldImplementation m_channel_in_slot_impl
size_type m_feedthrough_index
bool isEmBarrelOnline(const HWIdentifier id) const
int barrel_ec(const HWIdentifier id) const
Return the position barrel or endcap of a hardware cell identifier: barrel_ec = [0,...
id_range channel_range() const
void feb_Id_checks(int barrel_ec, int pos_neg, int feedthrough, int slot) const
MultiRange m_full_calib_laronline_range
IdentifierHash channel_Hash(HWIdentifier channelId) const
Create channel_hash from channel_Id.
HWIdentifier channel_Id(int barrel_ec, int pos_neg, int feedthrough, int slot, int channel) const
create channel identifier from fields
std::vector< HWIdentifier > m_calib_channel_vec
IdContext channelContext() const
Define context for channel.
int get_expanded_id(const HWIdentifier &id, ExpandedIdentifier &exp_id, const IdContext *context) const
create expanded HWIdentifier from HWIdentifier (return == 0 for OK)
IdContext febContext() const
Define context for feb.
id_iterator channel_end() const
virtual bool isEMECOW(const HWIdentifier id) const =0
IdentifierHash channel_Hash_binary_search(HWIdentifier channelId) const
HWIdentifier calib_module_Id(int barrel_ec, int pos_neg, int feedthrough, int slot) const
Build calibration module identifier from fields.
IdentifierHash feb_Hash_binary_search(HWIdentifier channelId) const
int channel(const HWIdentifier id) const
Return the channel number of a hardware cell identifier channel = [0,127] in all FEB.
id_range feb_range() const
int is_slar(const HWIdentifier id) const
Return whether the channel is in slar or not is_ slar = [0,1] in all FEB.
id_iterator feb_begin() const
Returns an iterator pointing to a feb identifier collection.
size_type m_channelHashMax
size_type m_laronline_index
std::vector< HWIdentifier > m_calib_module_vec
id_iterator channel_begin() const
Returns an iterator pointing to a channel identifier collection.
MultiRange m_full_feb_range
IdDictFieldImplementation m_bec_ft_impl
size_type febHashMax() const
define feb hash tables max size
bool isEmEndcapStandardOnline(const HWIdentifier id) const
size_type channelHashMax() const
Define channel hash tables max size.
LArOnlineID_Base(const std::string &name, const std::string &group, bool is_slar)
Default constructor.
int pos_neg(const HWIdentifier id) const
Return the side of a hardware cell identifier pos_neg = [0,1] positive-side or negative-side Barrel...
bool isEmEndcapSpecialOnline(const HWIdentifier id) const
IdDictFieldImplementation m_feedthrough_impl
std::string channel_name(const HWIdentifier id) const
Return a string corresponding to a feedthrough name given an identifier.
IdentifierHash feb_Hash(HWIdentifier febId) const
Create feb hash identifiers from feb identifiers.
IdContext feedthroughContext() const
Define context for feedthroughs.
IdDictFieldImplementation m_slot_impl
void channel_Id_checks(int barrel_ec, int pos_neg, int feedthrough, int slot, int channel) const
IdDictFieldImplementation m_laronline_impl
IdentifierHash feedthrough_Hash(HWIdentifier feedthroughId) const
Create hash id from feedthrough identifiers.
size_type m_feedthroughHashMax
virtual ~LArOnlineID_Base()
Default destructor.
IdDictFieldImplementation m_side_impl
id_iterator feb_end() const
size_type m_laronlineRegion_index
std::vector< HWIdentifier > m_feb_vec
std::vector< HashCalcFeb > m_feb_hash_calcs
int initLevelsFromDict(const std::string &group_name)
bool isEMECPS(const HWIdentifier id) const
Identifier::size_type size_type
IdDictFieldImplementation m_bec_impl
std::vector< HWIdentifier > m_feedthrough_vec
bool isCalibration(const HWIdentifier id) const
bool isHecOnlineFebId(const HWIdentifier febId) const
bool isFCALchannel(const HWIdentifier id) const
IdDictFieldImplementation m_bec_slot_impl
id_iterator feedthrough_end() const
bool isEMECinHECchannel(const HWIdentifier id) const
IdDictFieldImplementation m_lar_impl
Field Implementation.
size_type feedthroughHashMax() const
Define feedthrough hash tables max size.
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr)
initialization from the identifier dictionary
bool isEMBPS(const HWIdentifier id) const
MultiRange m_full_calib_module_range
id_range feedthrough_range() const
HWIdentifier feb_Id(int barrel_ec, int pos_neg, int feedthrough, int slot) const
Create feb_Id from fields.
size_type m_calibChannelHashMax
int channelInSlotMax(const HWIdentifier Id) const
Return the Maximum channel number of a given feb slot.
bool isEmEndcapOnline(const HWIdentifier id) const
IdDictFieldImplementation m_slar_impl
MultiRange m_full_feedthrough_range
std::vector< HashCalc > m_chan_hash_calcs
void feedthrough_Id_checks(int barrel_ec, int pos_neg, int feedthrough) const
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
bool match(std::string s1, std::string s2)
match the individual directories of two strings