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