ATLAS Offline Software
LArOnlineID.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include "GaudiKernel/MsgStream.h"
7 #include "IdDict/IdDictDefs.h"
11 #include <cmath>
12 #include <iostream>
13 #include <set>
14 #include <sstream>
15 #include <string>
16 
17 /* See comments in Base class */
18 
21 {
22  m_this_is_slar=false;
23 }
24 
25 
27 = default;
28 
29 /* =================================================================== */
31 /* =================================================================== */
32 {
33  MsgStream log(m_msgSvc, "LArOnlineID" );
34  if (!m_quiet) {
35  std::string strg = "initialize_from_dictionary";
36  if(m_msgSvc) {
37  log << MSG::INFO << strg << endmsg;
38  }
39  else {
40  std::cout << strg << std::endl;
41  }
42  }
43 
44  // Check whether this helper should be reinitialized
45  if (!reinitialize(dict_mgr)) {
46  if(m_msgSvc) log << MSG::DEBUG << "Request to reinitialize not satisfied - tags have not changed" << endmsg;
47  return (0);
48  } else {
49  if(m_msgSvc) log << MSG::DEBUG << "(Re)initialize" << endmsg;
50  }
51 
52  // init base object
53  if(AtlasDetectorID::initialize_from_dictionary(dict_mgr)) return (1);
54  m_dict = dict_mgr.find_dictionary ("LArCalorimeter");
55  if(!m_dict) {
56 
57  std::string strg = " initialize_from_dictionary - cannot access LArCalorimeter dictionary ";
58  if(m_msgSvc) {
59  log << MSG::ERROR << strg << endmsg;
60  }
61  else {
62  std::cout << "LArOnlineID::" << strg << std::endl;
63  }
64  return 1;
65  }
66 
67  // Register version of the dictionary used
68  if (register_dict_tag(dict_mgr, "LArCalorimeter")) return(1);
69 
70  // initialize dictionary version
71  AtlasDetectorID::setDictVersion(dict_mgr, "LArCalorimeter");
72 
73  /* Initialize the field indices */
74 // if(initLevelsFromDict()) return (1);
75  std::string group_name("LArOnline");
77 
78 
79  /* Find value for the field LAr Calorimeter */
80  const IdDictDictionary* atlasDict = dict_mgr.find_dictionary ("ATLAS");
81  int larField = -1;
82  if (atlasDict->get_label_value("subdet", "LArCalorimeter", larField)) {
83  std::stringstream strm;
84  strm << atlasDict->m_name;
85  std::string strg= " Could not get value for label 'LArCalorimeter' of field 'subdet' in dictionary "+strm.str();
86  if(m_msgSvc) {
87  log << MSG::ERROR << strg << endmsg;
88  }
89  else {
90  std::cout << "LArOnlineID:" << strg << std::endl;
91  }
92  return (1);
93  }
94 
95  /* Find value for the field LArOnline */
96  int larOnlineField = -4;
97  if (m_dict->get_label_value("part", "LArOnline", larOnlineField)) {
98  std::stringstream strm;
99  strm << m_dict->m_name;
100  std::string strg = "Could not get value for label 'LArOnline' of field 'part' in dictionary "+strm.str();
101  if(m_msgSvc) {
102  log << MSG::ERROR << strg << endmsg;
103  }
104  else {
105  std::cout << strg << std::endl;
106  }
107  return (1);
108  }
109 
110  /* Find value for the field calibLArOnline */
111  int larOnlineCalibField = -5;
112  if (m_dict->get_label_value("part", "LArOnlineCalib", larOnlineCalibField)) {
113  std::stringstream strm;
114  strm << m_dict->m_name;
115  std::string strg = "Could not get value for label 'LArOnlineCalib' of field 'part' in dictionary "+strm.str();
116  if(m_msgSvc) {
117  log << MSG::ERROR << strg << endmsg;
118  }
119  else {
120  std::cout << strg << std::endl;
121  }
122  return (1);
123  }
124 
125  /* Set up id for Region and range prefix */
127  region_id.add(larField);
128  region_id.add(larOnlineField);
129  Range prefix;
130 
131  /*Full range for all channels*/
135 
136  if (!m_quiet) {
137  std::string strg0= " initialize_from_dictionary :";
138  std::string strg1= " feedthrough range -> " + (std::string)m_full_feedthrough_range;
139  std::string strg2= " feedthrough slot range -> " + (std::string)m_full_feb_range;
140  std::string strg3= " channel range -> " + (std::string)m_full_laronline_range;
141  if(m_msgSvc) {
142  log << MSG::DEBUG << strg0 << endmsg;
143  log << MSG::DEBUG << strg1 << endmsg;
144  log << MSG::DEBUG << strg2 << endmsg;
145  log << MSG::DEBUG << strg3 << endmsg;
146  }
147  else {
148  std::cout << strg0 << std::endl;
149  std::cout << strg1 << std::endl;
150  std::cout << strg2 << std::endl;
151  std::cout << strg3 << std::endl;
152  }
153  }
154 
155 
156  /* Setup the hash tables */
157  if (!m_quiet) {
158  std::stringstream strm;
159  strm << dictionaryVersion();
160  std::string strg="[initialize_from_dictionary] version= " + strm.str();
161  if(m_msgSvc) {
162  log << MSG::DEBUG << strg << endmsg;
163  }
164  else {
165  std::cout << "LArOnlineID: " << strg << std::endl;
166  }
167  }
168  if( dictionaryVersion() == "fullAtlas" ) {
169  if(LArOnlineID_Base::init_hashes()) return (1);
170  if(init_calib_hashes()) return (1);
171  }
172  if( dictionaryVersion() == "H8TestBeam" ) {
173  if(init_H8Hashes()) return (1);
174  if(init_calib_hashes()) return (1);
175  }
176  if( dictionaryVersion() == "H6TestBeam" ) {
177  if(m_msgSvc) log << MSG::DEBUG << "[initialze_from_dictionary] ...call init_H6hashes.." << endmsg;
178  if(init_H6Hashes()) return (1);
179  if(init_calib_hashes()) return (1);
180  }
181  if(m_msgSvc) {
182  log << MSG::DEBUG << "initialize_from_dictionary -> calibModuleHash= " << m_calibModuleHashMax << endmsg;
183  log << MSG::DEBUG << "initialize_from_dictionary -> calibChannelHash= " << m_calibChannelHashMax << endmsg;
184  }
185 
186 
187  // Setup for hash calculation for channels (febs is further below)
188 
189  // Febs have a uniform number of channels
190  // The lookup table only needs to contain the
191  // hash offset for each feb
192 
193  // The implementation requires:
194 
195  // 1) a lookup table for each feb containing hash offset
196  // 2) a decoder to access the "index" corresponding to the
197  // bec/side/ft/slot fields. These fields use x bits, so the
198  // vector has a length of 2**x.
199 
200  /* Create decoder for fields bec to slot */
202  m_bec_impl.bits() +
203  m_side_impl.bits() +
205  m_slot_impl.bits();
207  m_bec_slot_impl.set_bits(bits, bits_offset);
208  int size = (1 << bits);
209 
210  // Set up vector as lookup table for hash calculation.
211  m_chan_hash_calcs.resize(size);
212 
213  std::stringstream strm1;
214  std::stringstream strm2;
215  for (unsigned int i = 0; i < m_febHashMax; ++i) {
216 
217  HWIdentifier febId = feb_Id(i) ;
218 
219  HashCalc hc;
220 
221  HWIdentifier min = channel_Id ( febId, 0);
222 
224  hc.m_hash = min_hash;
226 
227  if (m_bec_slot_impl.unpack(min) >= size) {
228  if (m_quiet) {
229  std::stringstream strm;
230  strm << size;
231  strm1 << show_to_string(min);
232  strm2 << m_bec_slot_impl.unpack(min);
233  std::string strg = "Min > "+strm.str();
234  std::string strg1= " "+strm1.str();
235  std::string strg2= " "+strm2.str();
236  if(m_msgSvc) {
237  log << MSG::DEBUG << strg << endmsg;
238  log << MSG::DEBUG << strg1 << endmsg;
239  log << MSG::DEBUG << strg2 << endmsg;
240  }
241  else {
242  std::cout << strg << std::endl;
243  std::cout << strg1 << std::endl;
244  std::cout << strg2 << std::endl;
245  }
246  }
247  }
248  }
249 
250  // Check channel hash calculation
251  for (unsigned int i = 0; i < m_channelHashMax; ++i) {
252  HWIdentifier id = channel_Id(i);
253  if (channel_Hash(id) != i) {
254  if (!m_quiet) {
255  std::stringstream strm;
256  strm << show_to_string(id);
257  strm1 << channel_Hash(id);
258  strm2 << i;
259  std::string strg = " ***** Error channel ranges, id, hash, i = "+strm.str();
260  std::string strg1= " , "+strm1.str();
261  std::string strg2= " , "+strm2.str();
262  if(m_msgSvc) {
263  log << MSG::ERROR << strg << endmsg;
264  log << MSG::ERROR << strg1 << endmsg;
265  log << MSG::ERROR << strg2 << endmsg;
266  }
267  else {
268  std::cout << strg << std::endl;
269  std::cout << strg1 << std::endl;
270  std::cout << strg2 << std::endl;
271  }
272  }
273  }
274  }
275 
276 
277 
278  // Setup for hash calculation for febs
279 
280  // We calculate the feb hash by saving the hash of each
281  // feedthrough in a HashCalc object and then adding on the slot
282  // number for a particular feb
283 
284  // The implementation requires:
285 
286  // 1) a lookup table for each ft containing hash offset
287  // 2) a decoder to access the "index" corresponding to the
288  // bec/side/ft fields. These fields use x bits, so the
289  // vector has a length of 2**x.
290 
291  /* Create decoder for fields bec to ft */
292  bits = m_bec_impl.bits() +
293  m_side_impl.bits() +
295  bits_offset = m_bec_impl.bits_offset();
296  m_bec_ft_impl.set_bits(bits, bits_offset);
297  size = (1 << bits);
298 
299  // Set up vector as lookup table for hash calculation.
300  m_feb_hash_calcs.resize(size);
301 
302  // Get context for conversion to expanded ids
303  IdContext ftContext = feedthroughContext();
304  ExpandedIdentifier ftExpId;
305 
306  for (unsigned int i = 0; i < m_feedthroughHashMax; ++i) {
307 
309 
310  HashCalcFeb hc;
311 
312  // Set the hash id for each feedthrough, and then check if one
313  // needs to also save the slot values
315  hc.m_hash = min_hash;
316 
317  // For each feedthrough we must check to see if the slot
318  // values are enumerated or not. If they are enumerate we must
319  // save the values in order to calculate the fed hash
320  if (get_expanded_id(min, ftExpId, &ftContext)) {
321  if(m_msgSvc) {
322  log << MSG::WARNING << " ***** Warning cannot get ft expanded id for " << show_to_string(min) << endmsg;
323  } else {
324  std::cout << " ***** Warning cannot get ft expanded id for " << show_to_string(min) << std::endl;
325  }
326  }
327  unsigned int nrangesFound = 0;
328  for (unsigned int i = 0; i < m_full_feb_range.size(); ++i) {
329  if (m_full_feb_range[i].match(ftExpId)) {
330  nrangesFound += 1;
331  const Range::field& slotField = m_full_feb_range[i][m_slot_index];
332  if (slotField.isEnumerated()) {
333  // save values
334  hc.m_slot_values = slotField.get_values();
335  }
336  }
337  }
338 
339  // Similarly, if there is more than one range per feedthrough,
340  // this means that slot values are not a continuous range. In
341  // this case, as well, we save all possible slot values
342  if (nrangesFound > 1) {
343  for (unsigned int i = 0; i < m_full_feb_range.size(); ++i) {
344  if (m_full_feb_range[i].match(ftExpId)) {
345  const Range::field& slotField = m_full_feb_range[i][m_slot_index];
346  if (slotField.isBounded()) {
347  // save values
348  unsigned int nvalues = slotField.get_maximum() - slotField.get_minimum() + 1;
349  hc.m_slot_values.reserve(hc.m_slot_values.size() + nvalues);
350  for (unsigned int j = 0; j < nvalues; ++j) {
351  hc.m_slot_values.push_back(j + slotField.get_minimum());
352  }
353  }
354  else {
355  if(m_msgSvc) {
356  log << MSG::WARNING << " ***** Warning feb range slot field is NOT both_bounded - id, slot mode: "
357  << show_to_string(min) << " enumerated" << endmsg;
358  } else {
359  std::cout << " ***** Warning feb range slot field is NOT both_bounded - id, slot mode: "
360  << show_to_string(min) << " enumerated" << std::endl;
361  }
362  }
363  }
364  }
365  }
366 
367 
368  // Set hash calculator
370 
371 
372  if (m_bec_ft_impl.unpack(min) >= size) {
373  std::string strg = "Min > " + std::to_string(size) + " " +
374  show_to_string(min) + " " +
376  std::to_string(min_hash);
377  if (m_msgSvc) {
378  log << MSG::DEBUG << strg << endmsg;
379  } else {
380  std::cout << strg << std::endl;
381  }
382  }
383  }
384 
385  // Check feb hash calculation
386  for (unsigned int i = 0; i < m_febHashMax; ++i) {
387  HWIdentifier id = feb_Id(i);
388  if (feb_Hash(id) != i) {
389  std::string strg = " ***** Warning feb ranges, id, hash, i = " +
390  show_to_string(id) + " , " + std::to_string(feb_Hash(id)) + " , "+std::to_string(i);
391  if(m_msgSvc) {
392  log << MSG::WARNING << strg << endmsg;
393  }
394  else {
395  std::cout << strg << std::endl;
396  }
397  }
398  }
399 
400  return 0;
401 }
402 
403 
404 /*========================================*/
406 /*========================================*/
407 {
408  MsgStream log(m_msgSvc, "LArOnlineID" );
409  std::string strg1;
410  std::string strg2;
411  std::string strg3;
412 
413  /* Channel hash */
414  unsigned int nids=0;
415  std::set<HWIdentifier> ids;
416  if(m_msgSvc) log << MSG::DEBUG << "[init_H8hashes] > ChannelId : m_full_laronline_range.size() = " << m_full_laronline_range.size() << endmsg;
417  for (unsigned int i = 0; i < m_full_laronline_range.size(); ++i)
418  {
421  for (const auto & exp_id : rit)
422  {
423  HWIdentifier id = this->channel_Id (exp_id[m_bec_index],
424  exp_id[m_side_index],
425  exp_id[m_feedthrough_index],
426  exp_id[m_slot_index],
427  exp_id[m_channel_in_slot_index]);
428  if(!(ids.insert(id)).second)
429  {
430  strg1 = " init_hashes : duplicated id for channel nb = "+std::to_string(nids);
431  strg3 = " expanded Id= "+show_to_string(id);
432  if(m_msgSvc)
433  {
434  log << MSG::ERROR << strg1 << endmsg;
435  log << MSG::ERROR << strg3 << endmsg;
436  }
437  else
438  {
439  std::cout << "LArOnlineID::Error" << strg1 << std::endl;
440  std::cout << strg3 << std::endl;
441  }
442  }
443  nids++;
444  }
445  }
446  unsigned int nidtb=0;
447  std::set<HWIdentifier>::const_iterator first = ids.begin();
448  std::set<HWIdentifier>::const_iterator last = ids.end();
449  for (;first != last && nidtb < nids; ++first)
450  {
451  if( is_H8(*first) )
452  {
453  m_channel_vec.push_back(*first);
454  nidtb++;
455  }
456  }
458 
459 
460  /* FEB hash */
461  /*==========*/
462  nids = 0;
463  ids.clear();
464  if(m_msgSvc) log << MSG::DEBUG << "[init_H8hashes] > FebId : m_full_feb_range.size() = " << m_full_feb_range.size() << endmsg;
465  for (unsigned int i = 0; i < m_full_feb_range.size(); ++i)
466  {
467  const Range& range = m_full_feb_range[i];
469  for (const auto & exp_id : rit)
470  {
471  HWIdentifier febId = feb_Id( exp_id[m_bec_index],
472  exp_id[m_side_index],
473  exp_id[m_feedthrough_index],
474  exp_id[m_slot_index] );
475  if(!(ids.insert(febId)).second)
476  {
477  strg1 = " init_hashes: duplicated id for FEB nb = "+std::to_string(nids);
478  strg3 = " expanded Id= "+show_to_string(febId);
479  if(m_msgSvc)
480  {
481  log << MSG::ERROR << strg1 << endmsg;
482  log << MSG::ERROR << strg3 << endmsg;
483  }
484  else
485  {
486  std::cout << "LArOnlineID:: Error" << strg1 << std::endl;
487  std::cout << strg3 << std::endl;
488  }
489  }
490  nids++;
491  }
492  }
493  nidtb=0;
494  first = ids.begin();
495  last = ids.end();
496  for (;first != last && nidtb < nids; ++first)
497  {
498  if( is_H8(*first) )
499  {
500  m_feb_vec.push_back(*first);
501  nidtb++;
502  }
503  }
504  m_febHashMax = m_feb_vec.size();
505 
506  /* Feedthrough hash */
507  /*=================*/
508  nids = 0;
509  ids.clear();
510  if(m_msgSvc) log << MSG::DEBUG << "[init_H8hashes] FeedthroughId: m_feedthrough_range.size() = " << m_full_feedthrough_range.size() << endmsg;
511  for (unsigned int i = 0; i < m_full_feedthrough_range.size(); ++i)
512  {
515  for (const auto & exp_id:rit)
516  {
517  HWIdentifier feedthroughId = feedthrough_Id( exp_id[m_bec_index],
518  exp_id[m_side_index],
519  exp_id[m_feedthrough_index] );
520  int test_bec = barrel_ec( feedthroughId);
521  int test_pn = pos_neg( feedthroughId);
522  int test_ft = feedthrough( feedthroughId);
523  if(m_msgSvc) log << MSG::VERBOSE << "[init_H8hashes] in loop : [bec,pn,ft]= [" << test_bec
524  << "," << test_pn << "," << test_ft << "]"<< endmsg;
525  if(!(ids.insert(feedthroughId)).second)
526  {
527  strg1 = " init_hashes : duplicated id for feedthrough nb = "+std::to_string(nids);
528  strg3 = " expanded Id= "+show_to_string(feedthroughId);
529  if(m_msgSvc)
530  {
531  log << MSG::ERROR << strg1 << endmsg;
532  log << MSG::ERROR << strg3 << endmsg;
533  }
534  else
535  {
536  std::cout << "LArOnlineID::Error" << strg1 << std::endl;
537  std::cout << strg3 << std::endl;
538  }
539  }
540  nids++;
541  }
542  }
543  nidtb=0;
544  first = ids.begin();
545  last = ids.end();
546  for (;first != last && nidtb < nids; ++first)
547  {
548  if( is_H8(*first) )
549  {
550  m_feedthrough_vec.push_back(*first);
551  nidtb++;
552  }
553  }
555  if(m_msgSvc) log << MSG::DEBUG << "[init_H8hashes] final m_feedthroughHashMax = " << m_feedthroughHashMax << endmsg;
556 
557  return (0);
558 }
559 
560 
561 /*========================================*/
563 /*========================================*/
564 {
565  MsgStream log(m_msgSvc, "LArOnlineID" );
566  std::string strg1;
567  std::string strg2;
568  std::string strg3;
569 
570  unsigned int nids=0;
571  std::set<HWIdentifier> ids;
572  if(m_msgSvc) log << MSG::DEBUG << "[init_H6hashes] : ChannelId : m_full_laronline_range.size() = "
574  for (unsigned int i = 0; i < m_full_laronline_range.size(); ++i)
575  {
578  for (const auto & exp_id:rit)
579  {
580  HWIdentifier id = this->channel_Id (exp_id[m_bec_index],
581  exp_id[m_side_index],
582  exp_id[m_feedthrough_index],
583  exp_id[m_slot_index],
584  exp_id[m_channel_in_slot_index]);
585  if(!(ids.insert(id)).second)
586  {
587  strg1 = " init_hashes: duplicated id for channel nb = "+std::to_string(nids);
588  strg3 = " expanded Id= "+show_to_string(id);
589  if(m_msgSvc)
590  {
591  log << MSG::ERROR << strg1 << endmsg;
592  log << MSG::ERROR << strg3 << endmsg;
593  }
594  else
595  {
596  std::cout << "LArOnlineID:: Error" << strg1 << std::endl;
597  std::cout << strg3 << std::endl;
598  }
599  }
600  nids++;
601  }
602  }
603  unsigned int nidtb=0;
604  std::set<HWIdentifier>::const_iterator first = ids.begin();
605  std::set<HWIdentifier>::const_iterator last = ids.end();
606  for (;first != last && nidtb < nids; ++first)
607  {
608  if( is_H6(*first) )
609  {
610  m_channel_vec.push_back(*first);
611  nidtb++;
612  }
613  }
615 
616  /* FEB hash */
617  /*==========*/
618  nids = 0;
619  ids.clear();
620  if(m_msgSvc) log << MSG::DEBUG << "[init_H6hashes] > FebId : m_full_feb_range.size() = " << m_full_feb_range.size() << endmsg;
621  for (unsigned int i = 0; i < m_full_feb_range.size(); ++i)
622  {
623  const Range& range = m_full_feb_range[i];
625  for (const auto & exp_id : rit)
626  {
627  HWIdentifier febId = feb_Id( exp_id[m_bec_index],
628  exp_id[m_side_index],
629  exp_id[m_feedthrough_index],
630  exp_id[m_slot_index] );
631  if(!(ids.insert(febId)).second)
632  {
633  strg1 = " init_hashes : duplicated id for FEB nb = "+std::to_string(nids);
634  strg3 = " expanded Id= "+show_to_string(febId);
635  if(m_msgSvc)
636  {
637  log << MSG::ERROR << strg1 << endmsg;
638  log << MSG::ERROR << strg3 << endmsg;
639  }
640  else
641  {
642  std::cout << "LArOnlineID::Error" << strg1 << std::endl;
643  std::cout << strg3 << std::endl;
644  }
645  }
646  nids++;
647  }
648  }
649  nidtb=0;
650  first = ids.begin();
651  last = ids.end();
652  for (;first != last && nidtb < nids; ++first)
653  {
654  if( is_H6(*first) )
655  {
656  m_feb_vec.push_back(*first);
657  nidtb++;
658  }
659  }
660  m_febHashMax = m_feb_vec.size();
661 
662 
663  /* Feedthrough hash */
664  /*=================*/
665  nids = 0;
666  ids.clear();
667  // AL-->
668  if(m_msgSvc) log << MSG::DEBUG << "[init_H6hashes] FeedthroughId: m_feedthrough_range.size() = " << m_full_feedthrough_range.size() << endmsg;
669  for (unsigned int i = 0; i < m_full_feedthrough_range.size(); ++i)
670  {
673  for (const auto & exp_id:rit)
674  {
675  HWIdentifier feedthroughId = feedthrough_Id( exp_id[m_bec_index],
676  exp_id[m_side_index],
677  exp_id[m_feedthrough_index] );
678  if(m_msgSvc) log << MSG::DEBUG << "[init_H6hashes] m_bec_index= " << m_bec_index
679  << "m_side_index= " << m_bec_index
680  << "m_feedthrough_index= " << m_bec_index
681  << "m_slot_index= " << m_bec_index << endmsg;
682  int test_bec = barrel_ec( feedthroughId);
683  int test_pn = pos_neg( feedthroughId);
684  int test_ft = feedthrough( feedthroughId);
685  if(m_msgSvc) log << MSG::DEBUG << "[init_H6hashes] in loop : [bec,pn,ft]= [" << test_bec
686  << "," << test_pn << "," << test_ft << "]"<< endmsg;
687  if(!(ids.insert(feedthroughId)).second)
688  {
689  strg1 = " init_hashes : duplicated id for feedthrough nb = "+std::to_string(nids);
690  strg3 = " expanded Id= "+show_to_string(feedthroughId);
691  if(m_msgSvc)
692  {
693  log << MSG::ERROR << strg1 << endmsg;
694  log << MSG::ERROR << strg3 << endmsg;
695  }
696  else
697  {
698  std::cout << "LArOnlineID::Error" << strg1 << std::endl;
699  std::cout << strg3 << std::endl;
700  }
701  }
702  nids++;
703  }
704  }
705  nidtb=0;
706  first = ids.begin();
707  last = ids.end();
708  for (;first != last && nidtb < nids; ++first)
709  {
710  if( is_H6FT( *first ))
711  {
712  if(m_msgSvc) log << MSG::DEBUG << "[init_H6hashes] filling m_feedthrough_vec IS-H6 !!"<< endmsg;
713  m_feedthrough_vec.push_back(*first);
714  nidtb++;
715  }
716  }
718  if(m_msgSvc) log << MSG::DEBUG << "[init_H6hashes] final m_feedthroughHashMax = " << m_feedthroughHashMax << endmsg;
719 
720  return (0);
721 }
722 
724 /*========================================================*/
725 {
726  int ft = feedthrough(id);
727  return ( barrel_ec(id)==1
728  &&
729  ( ft==3 || ft==10 || ft==16 || ft==22 )
730  &&
731  slot(id) > 2 );
732 }
733 
734 bool LArOnlineID::isEMECIW(const HWIdentifier id) const {
735  /*======================================================*/
736  //
737  int bec= barrel_ec(id);
738  int ft = feedthrough(id);
739  int sl = slot(id);
740  return (bec==1 && sl<3 && (ft==3 || ft==10 ||
741  ft==16 || ft==22));
742 }
743 
744 bool LArOnlineID::isEMECOW(const HWIdentifier id) const {
745  /*======================================================*/
746  //
747  int bec= barrel_ec(id);
748  int ft = feedthrough(id);
749  return (bec==1 &&
750  (ft==0 || ft==1 ||
751  ft==2 || ft==4 ||
752  ft==5 || ft==7 ||
753  ft==8 || ft==9 ||
754  ft==11|| ft==12||
755  ft==13|| ft==14||
756  ft==15|| ft==17||
757  ft==18|| ft==19||
758  ft==20|| ft==21||
759  ft==23|| ft==24 )
760  );
761 }
762 
764 /*========================================================*/
765 {/* redefinition with isEMECIW and isEMECOW */
766  return (LArOnlineID::isEMECOW(id) || LArOnlineID::isEMECIW(id));
767 }
LArOnlineID_Base::m_side_index
size_type m_side_index
Definition: LArOnlineID_Base.h:482
ConstRangeIterator
Definition: RangeIterator.h:46
IdDictDictionary::build_multirange
MultiRange build_multirange() const
Get MultiRange for full dictionary.
Definition: IdDictMgr.cxx:923
LArOnlineID::isEMECIW
bool isEMECIW(const HWIdentifier id) const override final
Definition: LArOnlineID.cxx:734
LArOnlineID_Base::channel_Hash
IdentifierHash channel_Hash(HWIdentifier channelId) const
Create channel_hash from channel_Id.
Definition: LArOnlineID_Base.cxx:1632
PlotCalibFromCool.ft
ft
Definition: PlotCalibFromCool.py:329
AtlasDetectorID::initialize_from_dictionary
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
Definition: AtlasDetectorID.cxx:320
LArOnlineID_Base::HashCalcFeb::m_hash
IdentifierHash m_hash
Definition: LArOnlineID_Base.h:534
ParticleGun_SamplingFraction.bec
int bec
Definition: ParticleGun_SamplingFraction.py:89
LArOnlineID_Base::HashCalcFeb::m_slot_values
std::vector< int > m_slot_values
Definition: LArOnlineID_Base.h:535
LArOnlineID_Base::m_feedthrough_impl
IdDictFieldImplementation m_feedthrough_impl
Definition: LArOnlineID_Base.h:514
LArOnlineID_Base::init_calib_hashes
int init_calib_hashes(void)
Definition: LArOnlineID_Base.cxx:1977
LArOnlineID::is_H6FT
bool is_H6FT(const HWIdentifier feedthroughId) const
Definition: LArOnlineID.h:180
IdentifierField::get_minimum
element_type get_minimum() const
Query the values.
Definition: IdentifierField.h:59
LArOnlID_Exception.h
LArOnlineID_Base::m_channel_vec
std::vector< HWIdentifier > m_channel_vec
Definition: LArOnlineID_Base.h:499
LArOnlineID_Base::slot
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...
Definition: LArOnlineID_Base.cxx:1957
ExpandedIdentifier
Definition: DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h:102
LArOnlineID_Base::m_slot_impl
IdDictFieldImplementation m_slot_impl
Definition: LArOnlineID_Base.h:515
LArOnlineID_Base::HashCalc
Define the Hash identifier for channels and febs.
Definition: LArOnlineID_Base.h:525
AtlasDetectorID::m_msgSvc
IMessageSvc * m_msgSvc
pointer to the message service
Definition: AtlasDetectorID.h:368
IdentifierField::get_values
const element_vector & get_values() const
Definition: IdentifierField.h:71
IdentifierField::get_maximum
element_type get_maximum() const
Definition: IdentifierField.h:68
LArOnlineID_Base::feedthroughContext
IdContext feedthroughContext(void) const
Define context for feedthroughs.
Definition: LArOnlineID_Base.cxx:256
LArOnlineID::is_H6
bool is_H6(const HWIdentifier channelId) const
Definition: LArOnlineID.h:161
LArOnlineID_Base::m_dict
const IdDictDictionary * m_dict
Definition: LArOnlineID_Base.h:488
LArOnlineID_Base::m_side_impl
IdDictFieldImplementation m_side_impl
Definition: LArOnlineID_Base.h:513
HWIdentifier
Definition: HWIdentifier.h:13
LArOnlineID_Base::barrel_ec
int barrel_ec(const HWIdentifier id) const
Return the position barrel or endcap of a hardware cell identifier: barrel_ec = [0,...
Definition: LArOnlineID_Base.cxx:1938
IdDictFieldImplementation::unpack
int unpack(Identifier id) const
Identifier manipulation methods.
Definition: IdDictFieldImplementation.h:148
CalibDbCompareRT.region_id
region_id
Definition: CalibDbCompareRT.py:68
LArOnlineID_Base::m_feedthroughHashMax
size_type m_feedthroughHashMax
Definition: LArOnlineID_Base.h:493
AtlasDetectorID::dictionaryVersion
virtual std::string dictionaryVersion(void) const override
Definition: AtlasDetectorID.cxx:347
LArOnlineID_Base::m_bec_slot_impl
IdDictFieldImplementation m_bec_slot_impl
Definition: LArOnlineID_Base.h:518
LArOnlineID_Base::m_calibModuleHashMax
size_type m_calibModuleHashMax
Definition: LArOnlineID_Base.h:504
IdDictDefs.h
LArOnlineID_Base::m_feb_hash_calcs
std::vector< HashCalcFeb > m_feb_hash_calcs
Definition: LArOnlineID_Base.h:537
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
IdDictMgr
Definition: IdDictDefs.h:32
LArOnlineID::LArOnlineID
LArOnlineID(void)
Default constructor.
Definition: LArOnlineID.cxx:19
LArOnlineID_Base::m_full_feedthrough_range
MultiRange m_full_feedthrough_range
Definition: LArOnlineID_Base.h:490
IdDictMgr::find_dictionary
IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
Definition: IdDictMgr.cxx:163
LArOnlineID::isEMECchannel
bool isEMECchannel(const HWIdentifier id) const override final
Definition: LArOnlineID.cxx:763
LArOnlineID_Base::m_febHashMax
size_type m_febHashMax
Definition: LArOnlineID_Base.h:494
LArOnlineID::~LArOnlineID
~LArOnlineID(void)
Default destructor.
lumiFormat.i
int i
Definition: lumiFormat.py:85
IdDictFieldImplementation::set_bits
void set_bits(size_type bits, size_type bits_offset)
Definition: IdDictFieldImplementation.h:279
LArOnlineID_Base::m_calibChannelHashMax
size_type m_calibChannelHashMax
Definition: LArOnlineID_Base.h:505
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
LArOnlineID_Base::get_expanded_id
int get_expanded_id(const HWIdentifier &id, ExpandedIdentifier &exp_id, const IdContext *context) const
create expanded HWIdentifier from HWIdentifier (return == 0 for OK)
Definition: LArOnlineID_Base.cxx:790
IdDictFieldImplementation::bits_offset
size_type bits_offset() const
Definition: IdDictFieldImplementation.h:209
LArOnlineID_Base::channel_Id
HWIdentifier channel_Id(int barrel_ec, int pos_neg, int feedthrough, int slot, int channel) const
create channel identifier from fields
Definition: LArOnlineID_Base.cxx:1565
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
LArOnlineID_Base::pos_neg
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...
Definition: LArOnlineID_Base.cxx:1950
mc.group_name
group_name
Definition: mc.PhPy8EG_A14NNPDF23_NNLOPS_example.py:33
LArOnlineID_Base::initLevelsFromDict
int initLevelsFromDict(const std::string &group_name)
Definition: LArOnlineID_Base.cxx:843
LArOnlineID_Base::m_channelHashMax
size_type m_channelHashMax
Definition: LArOnlineID_Base.h:495
LArOnlineID::init_H8Hashes
int init_H8Hashes(void)
Definition: LArOnlineID.cxx:405
AtlasDetectorID::m_quiet
bool m_quiet
If true, suppress DEBUG/INFO messages.
Definition: AtlasDetectorID.h:371
IdentifierField::isEnumerated
bool isEnumerated() const
Definition: IdentifierField.h:117
LArOnlineID_Base::init_hashes
int init_hashes(void)
Definition: LArOnlineID_Base.cxx:1126
LArOnlineID_Base::feb_Id
HWIdentifier feb_Id(int barrel_ec, int pos_neg, int feedthrough, int slot) const
Create feb_Id from fields.
Definition: LArOnlineID_Base.cxx:1479
LArOnlineID_Base::m_feedthrough_index
size_type m_feedthrough_index
Definition: LArOnlineID_Base.h:483
min
#define min(a, b)
Definition: cfImp.cxx:40
LArOnlineID_Base::m_bec_index
size_type m_bec_index
Definition: LArOnlineID_Base.h:481
LArOnlineID_Base::channel_Hash_binary_search
IdentifierHash channel_Hash_binary_search(HWIdentifier channelId) const
Definition: LArOnlineID_Base.h:560
AtlasDetectorID::register_dict_tag
int register_dict_tag(const IdDictMgr &dict_mgr, const std::string &dict_name)
Register the file and tag names for a particular IdDict dictionary.
Definition: AtlasDetectorID.cxx:266
IdDictDictionary::get_label_value
int get_label_value(const std::string &field, const std::string &label, int &value) const
Definition: IdDictMgr.cxx:340
LArOnlineID_Base::m_feedthrough_vec
std::vector< HWIdentifier > m_feedthrough_vec
Definition: LArOnlineID_Base.h:497
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_Base::feb_Hash_binary_search
IdentifierHash feb_Hash_binary_search(HWIdentifier channelId) const
Definition: LArOnlineID_Base.h:549
python.subdetectors.mmg.ids
ids
Definition: mmg.py:8
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
IdentifierHash.h
LArOnlineID_Base::HashCalc::m_hash
IdentifierHash m_hash
Definition: LArOnlineID_Base.h:528
RangeIterator.h
AtlasDetectorID::setDictVersion
virtual void setDictVersion(const IdDictMgr &dict_mgr, const std::string &name) override
Definition: AtlasDetectorID.cxx:759
Range
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
Definition: DetectorDescription/Identifier/Identifier/Range.h:29
LArOnlineID_Base::m_chan_hash_calcs
std::vector< HashCalc > m_chan_hash_calcs
Definition: LArOnlineID_Base.h:538
IdDictDictionary
Definition: IdDictDefs.h:97
LArOnlineID_Base::m_bec_impl
IdDictFieldImplementation m_bec_impl
Definition: LArOnlineID_Base.h:512
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
IdentifierField::isBounded
bool isBounded() const
Definition: IdentifierField.h:116
LArOnlineID::initialize_from_dictionary
int initialize_from_dictionary(const IdDictMgr &) override final
initialization from the identifier dictionary
Definition: LArOnlineID.cxx:30
LArOnlineID_Base::feedthrough
int feedthrough(const HWIdentifier id) const
Return the feedthrough of a hardware cell identifier : feedthrough = [0,31] Barrel - A/C side or H/...
Definition: LArOnlineID_Base.cxx:1944
AtlasDetectorID::reinitialize
bool reinitialize(const IdDictMgr &dict_mgr)
Test whether an idhelper should be reinitialized based on the change of tags.
Definition: AtlasDetectorID.cxx:284
LArOnlineID_Base::m_full_feb_range
MultiRange m_full_feb_range
Definition: LArOnlineID_Base.h:491
IdDictDictionary::m_name
std::string m_name
Definition: IdDictDefs.h:283
AtlasDetectorID::show_to_string
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
Definition: AtlasDetectorID.cxx:574
LArOnlineID_Base::m_feb_vec
std::vector< HWIdentifier > m_feb_vec
Definition: LArOnlineID_Base.h:498
LArOnlineID_Base::m_full_laronline_range
MultiRange m_full_laronline_range
Definition: LArOnlineID_Base.h:489
MultiRange::size
size_type size() const
Definition: MultiRange.cxx:70
DeMoScan.first
bool first
Definition: DeMoScan.py:536
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
IdentifierField
This is the individual specification for the range of one ExpandedIdentifier IdentifierField.
Definition: IdentifierField.h:21
LArOnlineID_Base::m_slot_index
size_type m_slot_index
Definition: LArOnlineID_Base.h:484
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
LArOnlineID::isHECchannel
bool isHECchannel(const HWIdentifier id) const override final
Definition: LArOnlineID.cxx:723
LArOnlineID_Base::m_channel_in_slot_index
size_type m_channel_in_slot_index
Definition: LArOnlineID_Base.h:485
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
LArOnlineID_Base::HashCalcFeb
Definition: LArOnlineID_Base.h:531
IdContext
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
Definition: IdContext.h:26
LArOnlineID_Base::m_bec_ft_impl
IdDictFieldImplementation m_bec_ft_impl
Definition: LArOnlineID_Base.h:517
LArOnlineID_Base::feb_Hash
IdentifierHash feb_Hash(HWIdentifier febId) const
Create feb hash identifiers from feb identifiers.
Definition: LArOnlineID_Base.cxx:1512
match
bool match(std::string s1, std::string s2)
match the individual directories of two strings
Definition: hcg.cxx:356
LArOnlineID_Base::feedthrough_Id
HWIdentifier feedthrough_Id(int barrel_ec, int pos_neg, int feedthrough) const
Create a feedthrough identifier from fields.
Definition: LArOnlineID_Base.cxx:1400
LArOnlineID_Base::m_this_is_slar
bool m_this_is_slar
Definition: LArOnlineID_Base.h:443
LArOnlineID.h
IdDictFieldImplementation::size_type
Identifier::size_type size_type
Definition: IdDictFieldImplementation.h:62
IdDictFieldImplementation::bits
size_type bits() const
Definition: IdDictFieldImplementation.h:203