ATLAS Offline Software
LArFCAL_Base_ID.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include "IdDict/IdDictDefs.h"
8 
9 #include "CxxUtils/StrFormat.h"
10 #include <iostream>
11 #include <fstream>
12 
14 
15 #define MAX_BUFFER_LEN 1024
16 
17 
19  const std::string& group,
20  bool supercell)
21  : CaloIDHelper (name, group),
22  m_slar (supercell ? 1 : 0)
23 {
24 }
25 
26 
28 {
29  return(m_slar_impl.unpack(id)) != 0;
30 }
31 
32 int LArFCAL_Base_ID::eta_min(const Identifier modId) const
33 {
34  ExpandedIdentifier expId;
35  IdContext module_cntxt = module_context();
36  if(!get_expanded_id(modId, expId, &module_cntxt)) {
37  int result = -999;
38  for (unsigned int i = 0; i < m_full_channel_range.size(); ++i) {
40  if (range.match(expId)) {
41  const Range::field& eta_field = range[m_ETA_INDEX];
42  if (not eta_field.empty()) {
43  int etamin = eta_field.get_minimum();
44  if (-999 == result) {
45  result = etamin;
46  }
47  else {
48  if (etamin < result) result = etamin;
49  }
50  }
51  }
52  }
53  return (result);
54  }
55  return (-999);
56 }
57 
58 int LArFCAL_Base_ID::eta_max(const Identifier modId) const
59 {
60  ExpandedIdentifier expId;
61  IdContext module_cntxt = module_context();
62  if(!get_expanded_id(modId, expId, &module_cntxt)) {
63  int result = -999;
64  for (unsigned int i = 0; i < m_full_channel_range.size(); ++i) {
66  if (range.match(expId)) {
67  const Range::field& eta_field = range[m_ETA_INDEX];
68  if (not eta_field.empty()) {
69  int etamax = eta_field.get_maximum();
70  if (result < etamax) result = etamax;
71  }
72  }
73  }
74  return (result);
75  }
76  return (-999); // default
77 }
78 
80 {
81  ExpandedIdentifier expId;
82  IdContext module_cntxt = module_context();
83  if(!get_expanded_id(modId, expId, &module_cntxt)) {
84  int result = -999;
85  for (unsigned int i = 0; i < m_full_channel_range.size(); ++i) {
87  if (range.match(expId)) {
88  const Range::field& phi_field = range[m_PHI_INDEX];
89  if (not phi_field.empty()) {
90  int phimin = phi_field.get_minimum();
91  if (-999 == result) {
92  result = phimin;
93  }
94  else {
95  if (phimin < result) result = phimin;
96  }
97  }
98  }
99  }
100  return (result);
101  }
102  return (-999); // default
103 }
104 
105 int LArFCAL_Base_ID::phi_max(const Identifier modId) const
106 {
107  ExpandedIdentifier expId;
108  IdContext module_cntxt = module_context();
109  if(!get_expanded_id(modId, expId, &module_cntxt)) {
110  int result = -999;
111  for (unsigned int i = 0; i < m_full_channel_range.size(); ++i) {
112  const Range& range = m_full_channel_range[i];
113  if (range.match(expId)) {
114  const Range::field& phi_field = range[m_PHI_INDEX];
115  if (not phi_field.empty()) {
116  int phimax = phi_field.get_maximum();
117  if (result < phimax) result = phimax;
118  }
119  }
120  }
121  return (result);
122  }
123  return (-999); // default
124 }
125 
126 IdContext
128 {
129  return region_context();
130 }
131 
133  const std::string& group_name)
134 /*=================================================================*/
135 {
136  MsgStream log(m_msgSvc, "LArFCAL_Base_ID" );
137 
138  std::string strg = "initialize_from_dictionary";
139  log << MSG::DEBUG << strg << endmsg;
140 
141  // Check whether this helper should be reinitialized
142  if (!reinitialize(dict_mgr)) {
143  if(m_msgSvc)log << MSG::DEBUG << "Request to reinitialize not satisfied - tags have not changed" << endmsg;
144  return (0);
145  }
146  else {
147  if(m_msgSvc)log << MSG::DEBUG << "(Re)initialize" << endmsg;
148  }
149 
150  // init base object
152  "LArCalorimeter"))
153  return (1);
154 
155  // initialize dictionary version
156  AtlasDetectorID::setDictVersion(dict_mgr, "LArCalorimeter");
157 
158  // Initialize the field indices
159  if (initLevelsFromDict(group_name)) return (1);
160 
161  // Find value for the field LAr Calorimeter
162  const IdDictDictionary* atlasDict = dict_mgr.find_dictionary ("ATLAS");
163  int larField = -1;
164  if (atlasDict->get_label_value("subdet", "LArCalorimeter", larField)) {
165  std::stringstream strm ;
166  strm << atlasDict->name();
167  strg = "Could not get value for label 'LArCalorimeter' of field 'subdet' in dictionary "
168  + strm.str();
169  if(m_msgSvc) {
170  log << MSG::ERROR << strg << endmsg;
171  }
172  else {
173  std::cout << strg << std::endl;
174  }
175  return (1);
176  }
177 
178 
179  // Find value for the field LArFCAL
180  int larFcalField = -1;
181  if (dict()->get_label_value("part", "LArFCAL", larFcalField)) {
182  std::stringstream strm ;
183  strm << atlasDict->name();
184  strg = "Could not get value for label 'LArFCAL' of field 'part' in dictionary "
185  + strm.str();
186  if(m_msgSvc) {
187  log << MSG::ERROR << strg << endmsg;
188  }
189  else {
190  std::cout << strg << std::endl;
191  }
192  return (1);
193  }
194 
195  // Set up id for region and range prefix
196 
198  region_id.add(larField);
199  region_id.add(larFcalField);
200  Range prefix;
203 
204  if (!m_quiet) {
205  std::string strg0 = " initialize_from_dict : " ;
206  std::string strg1 = " channel range -> " + (std::string)m_full_channel_range;
207  std::string strg2 = " module range -> " + (std::string)m_full_module_range;
208  if(m_msgSvc) {
209  log << MSG::DEBUG << strg0 << endmsg;
210  log << MSG::DEBUG << strg1 << endmsg;
211  log << MSG::DEBUG << strg2 << endmsg;
212  }
213  else {
214  std::cout << strg0 << std::endl;
215  std::cout << strg1 << std::endl;
216  std::cout << strg2 << std::endl;
217  }
218  }
219 
220  // Setup the hash tables
221  if(init_hashes()) return (1);
222 
223  // initilize m_two_sym_sides
224  m_two_sym_sides = ( dictionaryVersion() == "fullAtlas" );
225 
226  if (fill_vec_of_dict_regions (group_name)) return 1;
227 
228  m_vecOfPhiMin.resize(regions().hash_max());
229  for (unsigned int i = 1; i < regions().hash_max(); ++i) {
230  Identifier modId = module_id(i);
231  m_vecOfPhiMin[i] = phi_min_init(modId);
232  }
233 
234  // Setup hash tables for finding neighbours
235  if(m_do_neighbours) {
236  if(init_neighbours(dict_mgr)) return (1);
237  }
238 
239  return 0;
240 
241 }
242 
243 void LArFCAL_Base_ID::module_id_checks ( int pos_neg, int module ) const
244 {
245 
246  // Check that id is within allowed range
247  // Fill expanded id
249  expId << pos_neg << module;
250 
251  if (!m_full_module_range.match(expId)) {
252  std::string errorMessage = "LArFCAL_Base_ID::module_id() result is not OK: ID, range = "
253  + std::string(expId) + " , " + (std::string)m_full_module_range;
254  throw LArID_Exception(errorMessage , 6);
255  }
256 }
257 
258 void LArFCAL_Base_ID::channel_id_checks ( int pos_neg, int module, int eta, int phi) const
259 {
260 
261  // Check that id is within allowed range
262  // Fill expanded id
264  expId << pos_neg << module << eta << phi << m_slar ;
265 
266  if (!m_full_channel_range.match(expId)) {
267  std::string errorMessage = "LArFCAL_Base_ID::channel_id() result is not OK: ID, range = "
268  + std::string(expId) + " , " + (std::string)m_full_channel_range;
269  throw LArID_Exception(errorMessage , 10);
270  }
271 }
272 
274  int eta, int phi) const
275 {
276  // Check that id is within allowed range
277  // Fill expanded id
278  ExpandedIdentifier expId;
279 
280  IdContext context = module_context();
281  if (get_expanded_id(moduleId, expId, &context)) {
282  std::string errorMessage = "LArFCAL_Base_ID::channel_id(modId) result is not OK: ID = "
283  + show_to_string(moduleId) ;
284  throw LArID_Exception(errorMessage , 10);
285  }
286 
287  expId << eta << phi << m_slar ;
288 
289  if (!m_full_channel_range.match(expId)) {
290  std::string errorMessage = "LArFCAL_Base_ID::channel_id(modId) result is not OK: ID, range = "
291  + std::string(expId) + " , " + (std::string)m_full_channel_range;
292  throw LArID_Exception(errorMessage , 10);
293  }
294 }
295 
296 int LArFCAL_Base_ID::get_expanded_id (const Identifier& id, ExpandedIdentifier& exp_id, const IdContext* context) const
297 {
298  // We assume that the context is >= region
299  exp_id.clear();
300  exp_id << lar_field_value()
302  << pos_neg(id)
303  << module(id);
304  if(context && context->end_index() >= m_ETA_INDEX) {
305  exp_id << eta(id);
306  if(context->end_index() >= m_PHI_INDEX) {
307  exp_id << phi(id);
308  if ( context->end_index() >= m_SLAR_INDEX) {
309  exp_id << (unsigned)is_supercell(id);
310  }
311  }
312  }
313  return (0);
314 }
315 
316 int LArFCAL_Base_ID::initLevelsFromDict(const std::string& /*group_name*/)
317 {
318  MsgStream log(m_msgSvc, "LArFCAL_Base_ID" );
319 
320  if(!dict()) {
321  std::string strg = "initLevelsFromDict - dictionary NOT initialized ";
322  if(m_msgSvc) {
323  log << MSG::ERROR << strg << endmsg;
324  }
325  else {
326  std::cout << strg << std::endl;
327  }
328  return (1);
329  }
330 
331  // Find out which identifier field corresponds to each level.
332 
333  m_fcal_region_index = 999 ;
334  m_LAR_INDEX = 999 ;
335  m_FCAL_INDEX = 999 ;
336  m_POSNEG_INDEX = 999 ;
337  m_MODULE_INDEX = 999 ;
338  m_ETA_INDEX = 999 ;
339  m_PHI_INDEX = 999 ;
340  m_SLAR_INDEX = 999 ;
341 
342  // Save index to a FCAL region for unpacking
344  if (dict()->find_region(id,m_fcal_region_index)){
345  std::stringstream strm ;
346  strm << m_fcal_region_index ;
347  std::string strg = "initLevelsFromDict - unable to find fcal region index: id, reg "
348  + (std::string)id + strm.str();
349  if(m_msgSvc) {
350  log << MSG::ERROR << strg << endmsg;
351  }
352  else {
353  std::cout << strg << std::endl;
354  }
355  return (1);
356  }
357 
358  IdDictField* field = dict()->find_field("subdet") ;
359  if (field) {
360  m_LAR_INDEX = field->index();
361  }
362  else {
363  std::string strg = "initLevelsFromDict - unable to find 'subdet' field ";
364  if(m_msgSvc) {
365  log << MSG::ERROR << strg << endmsg;
366  }
367  else {
368  std::cout << strg << std::endl;
369  }
370  return (1);
371  }
372 
373  field = dict()->find_field("part") ;
374  if (field) {
375  m_FCAL_INDEX = field->index();
376  }
377  else {
378  std::string strg = "initLevelsFromDict - unable to find 'part' field ";
379  if(m_msgSvc) {
380  log << MSG::ERROR << strg << endmsg;
381  }
382  else {
383  std::cout << strg << std::endl;
384  }
385  return (1);
386  }
387 
388  field = dict()->find_field("barrel-endcap") ;
389  if (field) {
390  m_POSNEG_INDEX = field->index();
391  }
392  else {
393  std::string strg = "initLevelsFromDict - unable to find 'barrel-endcap' field ";
394  if(m_msgSvc) {
395  log << MSG::ERROR << strg << endmsg;
396  }
397  else {
398  std::cout << strg << std::endl;
399  }
400  return (1);
401  }
402 
403  field = dict()->find_field("module") ;
404  if (field) {
405  m_MODULE_INDEX = field->index();
406  }
407  else {
408  std::string strg = "initLevelsFromDict - unable to find 'module' field ";
409  if(dictionaryVersion() != "H8TestBeam" ) {
410  if(m_msgSvc) {
411  log << MSG::ERROR << strg << endmsg;
412  }
413  else {
414  std::cout << strg << std::endl;
415  }
416  }
417  return (1);
418  }
419 
420  field = dict()->find_field("eta-fcal") ;
421  if (field) {
422  m_ETA_INDEX = field->index();
423  }
424  else {
425  std::string strg = "initLevelsFromDict - unable to find 'eta' field ";
426  if(m_msgSvc) {
427  log << MSG::ERROR << strg << endmsg;
428  }
429  else {
430  std::cout << strg << std::endl;
431  }
432  return (1);
433  }
434 
435  field = dict()->find_field("phi-fcal") ;
436  if (field) {
437  m_PHI_INDEX = field->index();
438  }
439  else {
440  std::string strg = "initLevelsFromDict - unable to find 'phi' field ";
441  if(m_msgSvc) {
442  log << MSG::ERROR << strg << endmsg;
443  }
444  else {
445  std::cout << strg << std::endl;
446  }
447  return (1);
448  }
449 
450  field = dict()->find_field("is-slar-fcal") ;
451  if (field) {
452  m_SLAR_INDEX = field->index();
453  }
454  else {
455  if(m_msgSvc) {
456  log << MSG::ERROR << "initLevelsFromDict - unable to find 'is-slar-fcal' field "
457  << endmsg;
458  }
459  else {
460  std::cout << "LArFCAL_Base_ID::initLevelsFromDict - unable to find 'is-slar-fcal' field "
461  << std::endl ;
462  }
463  return (1);
464  }
465 
466  // Set the field implementations
467 
468  const IdDictRegion& region = dict()->region(m_fcal_region_index);
469 
470  /*
471  std::cout << "LArFCAL_Base_ID::initLevelsFromDict - found levels " << std::endl ;
472  std::cout << "part " << m_FCAL_INDEX << std::endl ;
473  std::cout << "pos-neg " << m_POSNEG_INDEX << std::endl ;
474  std::cout << "module " << m_MODULE_INDEX << std::endl ;
475  std::cout << "eta " << m_ETA_INDEX << std::endl ;
476  std::cout << "phi " << m_PHI_INDEX << std::endl ;
477  */
478 
486 
487  if (!m_quiet) {
488  if(m_msgSvc) {
489  log << MSG::DEBUG << "decode index and bit fields for each level: " << endmsg;
490  log << MSG::DEBUG << "lar " << m_lar_impl.show_to_string() << endmsg;
491  log << MSG::DEBUG << "fcal " << m_fcal_impl.show_to_string() << endmsg;
492  log << MSG::DEBUG << "pn " << m_pn_impl.show_to_string() << endmsg;
493  log << MSG::DEBUG << "mod " << m_module_impl.show_to_string() << endmsg;
494  log << MSG::DEBUG << "eta " << m_eta_impl.show_to_string() << endmsg;
495  log << MSG::DEBUG << "phi " << m_phi_impl.show_to_string() << endmsg;
496  log << MSG::DEBUG << "is-slar " << m_slar_impl.show_to_string() << endmsg;
497  }
498  else {
499  std::cout << "decode index and bit fields for each level: " << std::endl;
500  std::cout << "lar " << m_lar_impl.show_to_string() << std::endl;
501  std::cout << "fcal " << m_fcal_impl.show_to_string() << std::endl;
502  std::cout << "pn " << m_pn_impl.show_to_string() << std::endl;
503  std::cout << "mod " << m_module_impl.show_to_string() << std::endl;
504  std::cout << "eta " << m_eta_impl.show_to_string() << std::endl;
505  std::cout << "phi " << m_phi_impl.show_to_string() << std::endl;
506  std::cout << "is-slar " << m_slar_impl.show_to_string() << std::endl;
507  }
508  }
509 
510 
511  return(0) ;
512 }
513 
515 {
516  if (channels().init (*this, "channels",
519  m_SLAR_INDEX))
520  return 1;
521  if (regions().init (*this, "regions",
525  return 1;
526 
527  return (0);
528 }
529 
531  std::vector<IdentifierHash>& neighbourList) const
532 {
533  int result = 1;
534 
535  neighbourList.clear();
536 
537  if(!m_do_neighbours) {
538  if(m_msgSvc) {
539  MsgStream log(m_msgSvc, "LArFCAL_Base_ID" );
540  log << MSG::WARNING << "neighbours not initialized !!! returning empty list" << endmsg;
541  }
542  else {
543  std::cout << " neighbours not initialized !!! returning empty list " << std::endl;
544  }
545  return result;
546  }
547 
548  if(id>=channel_hash_max()) {
549  if(m_msgSvc) {
550  MsgStream log(m_msgSvc, "LArFCAL_Base_ID" );
551  log << MSG::WARNING << "neighbours requested for non-existing channel -- id/max " << id << "/"
552  << channel_hash_max() << endmsg;
553  }
554  else {
555  std::cout << " neighbours requested for non-existing channel -- id/max " << id << "/"
556  << channel_hash_max() << std::endl;
557  }
558  return result;
559  }
560 
561  if( dictionaryVersion() == "fullAtlas" || dictionaryVersion() == "H6TestBeam" ) {
562 
563  if ( (option & LArNeighbours::all2D) == LArNeighbours::all2D ){
564  if ( !m_neighbours_2d_vec[(unsigned int)id].empty() ) {
565  neighbourList.insert(neighbourList.end(),
566  m_neighbours_2d_vec[(unsigned int)id].begin(),
567  m_neighbours_2d_vec[(unsigned int)id].end());
568  }
569  }
570 
571  if ( (option & LArNeighbours::prevInSamp) ){
572  if ( !m_neighbours_3d_prev_vec[(unsigned int)id].empty() ) {
573  neighbourList.insert(neighbourList.end(),
574  m_neighbours_3d_prev_vec[(unsigned int)id].begin(),
575  m_neighbours_3d_prev_vec[(unsigned int)id].end());
576  }
577  }
578 
579  if ( (option & LArNeighbours::nextInSamp) ){
580  if ( !m_neighbours_3d_next_vec[(unsigned int)id].empty() ) {
581  neighbourList.insert(neighbourList.end(),
582  m_neighbours_3d_next_vec[(unsigned int)id].begin(),
583  m_neighbours_3d_next_vec[(unsigned int)id].end());
584  }
585  }
586 
587  } else {
588  if(m_msgSvc) {
589  MsgStream log(m_msgSvc, "LArFCAL_Base_ID" );
590  log << MSG::WARNING << " NO FCAL neighbours (yet) in the context of " << dictionaryVersion() << endmsg;
591  }
592  else {
593  std::cout << " NO FCAL neighbours (yet) in the context of " << dictionaryVersion() << std::endl;
594  }
595  }
596  return result;
597 }
598 
599 int LArFCAL_Base_ID::init_neighbours_from_file(const std::string& filename, std::vector<std::set<IdentifierHash> > & vec)
600 {
601  MsgStream log(m_msgSvc, "LArFCAL_Base_ID" );
602 
603  log << MSG::DEBUG << "init_neighbours_from_file" << endmsg;
604  // Find the full path to filename:
605  std::string file = PathResolver::find_file (filename, "DATAPATH");
606  log << MSG::DEBUG << "Reading file " << file << endmsg;
607  std::ifstream fin;
608  if (!file.empty()) {
609  fin.open(file.c_str());
610  }
611  else {
612  if(m_msgSvc) {
613  log << MSG::ERROR << "Could not find input file " << filename << endmsg;
614  }
615  else {
616  std::cout << "LarFCal_Base_ID::Could not find input file " << filename << std::endl;
617  }
618  return 1;
619  }
620  if (fin.bad()) {
621  if(m_msgSvc) {
622  log << MSG::ERROR << "Could not open file " << file << endmsg;
623  }
624  else {
625  std::cout << "LarFCal_Base_ID::Could not open file " << file << std::endl;
626  }
627  return 1;
628  }
629 
630  //
631  // Parse the input file
632  //
633 
634  vec.resize(channel_hash_max());
635 
636  char aLine[MAX_BUFFER_LEN];
637  std::string sLine;
638  bool isComment = true;
639  char AorC,dot;
640  int isamp,iphi,ieta;
641 
642  while( isComment ) {
643  sLine.resize( 0 );
644  do {
645  fin.getline(aLine,sizeof(aLine)-1);
646  sLine = std::string(aLine);
647  } while (sLine.empty() && !fin.eof());
648  isComment = ( sLine.find('#') != std::string::npos );
649  }
650  do {
651  unsigned int ic, inext;
652  Identifier thisCell,nextCell;
653  while ( sLine.empty() && !fin.eof()) {
654  fin.getline(aLine,sizeof(aLine)-1);
655  sLine = std::string(aLine);
656  }
657  std::istringstream es( sLine.c_str() );
658 
659  if ( es >> AorC >> isamp >> dot >> iphi >> dot >> ieta ) {
660  thisCell = channel_id((AorC=='A'||AorC=='S'?2:-2),isamp,ieta,iphi);
661  ic = channel_hash(thisCell);
662  while ( es >> AorC >> isamp >> dot >> iphi >> dot >> ieta ) {
663  nextCell = channel_id((AorC=='A'||AorC=='S'?2:-2),isamp,ieta,iphi);
664  inext = channel_hash(nextCell);
665  vec[ic].insert(vec[ic].end(),inext);
666  }
667  sLine.resize(0);
668  }
669  }while (!fin.eof()) ;
670  fin.close();
671 
672  return 0;
673 }
674 
675 int
677 {
678 
679  MsgStream log(m_msgSvc, "LArFCAL_Base_ID" );
680  if(m_msgSvc) {
681  log << MSG::DEBUG << "init_neighbours" << endmsg;
682  }
683  else {
684  std::cout << "LarFCal_Base_ID::init_neighbours " << std::endl;
685  }
686 
687  int status;
688  std::string f2d,f3dnext,f3dprev;
689 
690  if ( m_slar ) {
691  f2d = "FCalSuperCells2DNeighborsNew-April2014.txt";
692  f3dnext = "FCalSuperCells3DNeighborsNextNew-April2014.txt";
693  f3dprev = "FCalSuperCells3DNeighborsPrevNew-April2014.txt";
694  }
695  else {
696  f2d = dict_mgr.find_metadata("FCAL2DNEIGHBORS");
697  f3dnext = dict_mgr.find_metadata("FCAL3DNEIGHBORSNEXT");
698  f3dprev = dict_mgr.find_metadata("FCAL3DNEIGHBORSPREV");
699  }
700  if (f2d.empty() || f3dnext.empty() || f3dprev.empty()) {
701  if(m_msgSvc) {
702  log << MSG::ERROR << "init_neighbours: cannot find neighbours files: "
703  << " f2d: " << f2d << " f3dnext: " << f3dnext << " f3dprev: " << f3dprev
704  << endmsg;
705  }
706  else {
707  std::cout << "LarFCal_Base_ID::init_neighbours cannot find neighbours files: "
708  << " f2d: " << f2d << " f3dnext: " << f3dnext << " f3dprev: " << f3dprev
709  << std::endl;
710  }
711  throw std::runtime_error("LArFCAL_Base_ID::init_neighbours: Cannot find the FCAL Neighbour file names");
712  }
713 
714  status = init_neighbours_2d(f2d);
715  if ( status == 0 )
716  status = init_neighbours_3d_next(f3dnext);
717  if ( status == 0 )
718  status = init_neighbours_3d_prev(f3dprev);
719 
720  if(m_msgSvc) {
721  log << MSG::DEBUG << "init_neighbours status: " << status << endmsg;
722  }
723  else {
724  std::cout << "LarFCal_Base_ID::init_neighbours status: " << status << std::endl;
725  }
726 
727  if ( status == 0 )
728  return (0);
729  else
730  return (1);
731 }
732 
LArFCAL_Base_ID::m_two_sym_sides
bool m_two_sym_sides
Definition: LArFCAL_Base_ID.h:204
LArNeighbours::neighbourOption
neighbourOption
Definition: LArNeighbours.h:12
IdDictDictionary::build_multirange
MultiRange build_multirange() const
Get MultiRange for full dictionary.
Definition: IdDictDictionary.cxx:291
LArFCAL_Base_ID::eta_max
int eta_max(const Identifier regId) const
max value of eta index (-999 == failure)
Definition: LArFCAL_Base_ID.cxx:58
LArFCAL_Base_ID::m_fcal_impl
IdDictFieldImplementation m_fcal_impl
Definition: LArFCAL_Base_ID.h:221
LArFCAL_Base_ID::initialize_base_from_dictionary
virtual int initialize_base_from_dictionary(const IdDictMgr &dict_mgr, const std::string &group_name)
initialization from the identifier dictionary
Definition: LArFCAL_Base_ID.cxx:132
get_generator_info.result
result
Definition: get_generator_info.py:21
LArFCAL_Base_ID.h
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
LArFCAL_Base_ID::m_neighbours_3d_next_vec
std::vector< std::set< IdentifierHash > > m_neighbours_3d_next_vec
Definition: LArFCAL_Base_ID.h:234
LArFCAL_Base_ID::init_neighbours_2d
int init_neighbours_2d(const std::string &filename)
Definition: LArFCAL_Base_ID.h:183
IdDictFieldImplementation::show_to_string
std::string show_to_string(void) const
Definition: IdDictFieldImplementation.cxx:38
LArFCAL_Base_ID::pos_neg
int pos_neg(const Identifier id) const
pos_neg : +/- 2 (A/C side)
CaloIDHelper::channel_hash_max
size_type channel_hash_max() const
One more than the largest channel (cell) hash code.
LArFCAL_Base_ID::phi_max
int phi_max(const Identifier regId) const
max value of phi index (-999 == failure)
Definition: LArFCAL_Base_ID.cxx:105
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
IdDictDictionary::region
const IdDictRegion & region(size_t i) const
Region at index i.
Definition: IdDictDictionary.h:341
CaloIDHelper::fill_vec_of_dict_regions
int fill_vec_of_dict_regions(const std::string &group_name="")
Initialize the list of detector regions.
Definition: CaloIDHelper.cxx:259
IdentifierField::get_minimum
element_type get_minimum() const
Query the values.
Definition: IdentifierField.h:121
IdContext::end_index
size_type end_index() const
Definition: IdContext.h:46
CaloIDHelper::region_context
IdContext region_context() const
Return the context for regions.
ExpandedIdentifier
Definition: DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h:102
LArFCAL_Base_ID::module
int module(const Identifier id) const
module [1,3]
AtlasDetectorID::m_msgSvc
IMessageSvc * m_msgSvc
pointer to the message service
Definition: AtlasDetectorID.h:369
IdDictMgr::find_metadata
const std::string & find_metadata(const std::string &name) const
Access to meta data, name/value pairs.
Definition: IdDictMgr.cxx:92
CaloIDHelper::region_id
Identifier region_id(IdentifierHash hashId) const
Return the region Identifier for a given hash code (no checking).
IdentifierField::get_maximum
element_type get_maximum() const
Definition: IdentifierField.h:130
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:9
ReadOfcFromCool.field
field
Definition: ReadOfcFromCool.py:48
LArFCAL_Base_ID::get_neighbours
int get_neighbours(const IdentifierHash id, const LArNeighbours::neighbourOption &option, std::vector< IdentifierHash > &neighbourList) const
access to hashes for neighbours return == 0 for neighbours found option = all2D,...
Definition: LArFCAL_Base_ID.cxx:530
IdDictDictionary::name
const std::string & name() const
Dictionary name.
Definition: IdDictDictionary.h:323
LArFCAL_Base_ID::eta_min
int eta_min(const Identifier regId) const
min value of eta index (-999 == failure)
Definition: LArFCAL_Base_ID.cxx:32
LArFCAL_Base_ID::m_eta_impl
IdDictFieldImplementation m_eta_impl
Definition: LArFCAL_Base_ID.h:224
AtlasDetectorID::lar_field_value
int lar_field_value() const
Definition: AtlasDetectorID.h:609
IdDictFieldImplementation::unpack
int unpack(Identifier id) const
Identifier manipulation methods.
Definition: IdDictFieldImplementation.h:147
LArFCAL_Base_ID::m_lar_impl
IdDictFieldImplementation m_lar_impl
Definition: LArFCAL_Base_ID.h:220
xAOD::unsigned
unsigned
Definition: RingSetConf_v1.cxx:662
IdDictDictionary::find_field
IdDictField * find_field(const std::string &name) const
Definition: IdDictDictionary.cxx:36
IdDictRegion
Definition: IdDictRegion.h:20
CaloIDHelper::regions
const HashGroup & regions() const
Return the HashGroup for regions.
AtlasDetectorID::dictionaryVersion
virtual std::string dictionaryVersion(void) const override
Definition: AtlasDetectorID.cxx:276
LArFCAL_Base_ID::m_full_channel_range
MultiRange m_full_channel_range
Definition: LArFCAL_Base_ID.h:215
LArFCAL_Base_ID::eta
int eta(const Identifier id) const
eta [0,63] module 1 ; [0,31] module 2 ; [0,15] module 3
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:92
AtlasDetectorID::m_do_neighbours
bool m_do_neighbours
Flag for subclasses to know whether or not to perform neighbour initialization.
Definition: AtlasDetectorID.h:366
IdDictDefs.h
MAX_BUFFER_LEN
#define MAX_BUFFER_LEN
Definition: LArFCAL_Base_ID.cxx:15
LArFCAL_Base_ID::module_id_checks
void module_id_checks(int pos_neg, int module) const
Definition: LArFCAL_Base_ID.cxx:243
LArNeighbours::nextInSamp
@ nextInSamp
Definition: LArNeighbours.h:20
python.PyAthena.module
module
Definition: PyAthena.py:131
LArFCAL_Base_ID::phi
int phi(const Identifier id) const
phi [0,15]
IdDictRegion::implementation
const IdDictFieldImplementation & implementation(size_t i) const
Definition: IdDictRegion.cxx:17
IdDictMgr
Definition: IdDictMgr.h:14
LArFCAL_Base_ID::m_ETA_INDEX
size_type m_ETA_INDEX
Definition: LArFCAL_Base_ID.h:212
StrFormat.h
Provide helper functions to create formatted strings.
IdDictMgr::find_dictionary
IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
Definition: IdDictMgr.cxx:115
IdentifierField::empty
bool empty() const
If true, this field does not have any constraints, and may hold any value representable by element_ty...
Definition: IdentifierField.h:182
lumiFormat.i
int i
Definition: lumiFormat.py:85
LArFCAL_Base_ID::channel_id_checks
void channel_id_checks(int pos_neg, int module, int eta, int phi) const
Definition: LArFCAL_Base_ID.cxx:258
CaloIDHelper::dict
const IdDictDictionary * dict() const
Return the dictionary for this subdetector.
CaloIDHelper
Base class to factor out code common among Calo ID helpers.
Definition: CaloIDHelper.h:34
LArFCAL_Base_ID::init_neighbours_3d_prev
int init_neighbours_3d_prev(const std::string &filename)
Definition: LArFCAL_Base_ID.h:193
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
LArFCAL_Base_ID::channel_id
Identifier channel_id(const ExpandedIdentifier &exp_id) const
cell identifier for a channel from ExpandedIdentifier
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:194
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
file
TFile * file
Definition: tile_monitor.h:29
LArFCAL_Base_ID::m_FCAL_INDEX
size_type m_FCAL_INDEX
Definition: LArFCAL_Base_ID.h:209
mc.group_name
group_name
Definition: mc.PhPy8EG_A14NNPDF23_NNLOPS_example.py:33
LArFCAL_Base_ID::m_full_module_range
MultiRange m_full_module_range
Definition: LArFCAL_Base_ID.h:216
LArFCAL_Base_ID::module_id
Identifier module_id(const ExpandedIdentifier &exp_id) const
module identifier for a channel from ExpandedIdentifier
LArFCAL_Base_ID::module_context
IdContext module_context() const
context for modules – method kept for backward compatibility.
Definition: LArFCAL_Base_ID.cxx:127
LArNeighbours::prevInSamp
@ prevInSamp
Definition: LArNeighbours.h:19
AtlasDetectorID::m_quiet
bool m_quiet
If true, suppress DEBUG/INFO messages.
Definition: AtlasDetectorID.h:372
dot.dot
def dot(G, fn, nodesToHighlight=[])
Definition: dot.py:5
LArFCAL_Base_ID::m_SLAR_INDEX
size_type m_SLAR_INDEX
Definition: LArFCAL_Base_ID.h:208
LArFCAL_Base_ID::m_fcal_region_index
size_type m_fcal_region_index
Definition: LArFCAL_Base_ID.h:206
CaloIDHelper::initialize_base_from_dictionary
int initialize_base_from_dictionary(const IdDictMgr &dict_mgr, const std::string &dict_name)
Do basic initialization of the helper.
Definition: CaloIDHelper.cxx:232
LArFCAL_Base_ID::m_neighbours_3d_prev_vec
std::vector< std::set< IdentifierHash > > m_neighbours_3d_prev_vec
Definition: LArFCAL_Base_ID.h:235
grepfile.ic
int ic
Definition: grepfile.py:33
LArFCAL_Base_ID::m_phi_impl
IdDictFieldImplementation m_phi_impl
Definition: LArFCAL_Base_ID.h:225
IdDictDictionary::get_label_value
int get_label_value(const std::string &field, const std::string &label, int &value) const
Definition: IdDictDictionary.cxx:64
LArFCAL_Base_ID::init_neighbours_from_file
int init_neighbours_from_file(const std::string &filename, std::vector< std::set< IdentifierHash > > &vec)
Definition: LArFCAL_Base_ID.cxx:599
PathResolver.h
CxxUtils::strformat
std::string strformat(const char *fmt,...)
return a std::string according to a format fmt and varargs
Definition: StrFormat.cxx:49
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:239
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
LArFCAL_Base_ID::m_vecOfPhiMin
std::vector< short int > m_vecOfPhiMin
Definition: LArFCAL_Base_ID.h:218
LArFCAL_Base_ID::m_POSNEG_INDEX
size_type m_POSNEG_INDEX
Definition: LArFCAL_Base_ID.h:210
LArFCAL_Base_ID::m_slar
unsigned m_slar
Definition: LArFCAL_Base_ID.h:202
LArFCAL_Base_ID::m_pn_impl
IdDictFieldImplementation m_pn_impl
Definition: LArFCAL_Base_ID.h:222
AtlasDetectorID::setDictVersion
virtual void setDictVersion(const IdDictMgr &dict_mgr, const std::string &name) override
Definition: AtlasDetectorID.cxx:494
Range
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
Definition: DetectorDescription/Identifier/Identifier/Range.h:29
python.PyKernel.init
def init(v_theApp, v_rootStream=None)
Definition: PyKernel.py:45
IdDictDictionary
Definition: IdDictDictionary.h:30
CaloIDHelper::channels
const HashGroup & channels() const
Return the HashGroup for channels (cells).
MultiRange::match
int match(const ExpandedIdentifier &id) const
Match an identifier.
Definition: MultiRange.cxx:57
LArFCAL_Base_ID::init_neighbours_3d_next
int init_neighbours_3d_next(const std::string &filename)
Definition: LArFCAL_Base_ID.h:188
LArFCAL_Base_ID::m_module_impl
IdDictFieldImplementation m_module_impl
Definition: LArFCAL_Base_ID.h:223
AtlasDetectorID::reinitialize
bool reinitialize(const IdDictMgr &dict_mgr)
Test whether an idhelper should be reinitialized based on the change of tags.
Definition: AtlasDetectorID.cxx:216
LArFCAL_Base_ID::get_expanded_id
virtual int get_expanded_id(const Identifier &id, ExpandedIdentifier &exp_id, const IdContext *context) const
create expanded Identifier from Identifier (return == 0 for OK)
Definition: LArFCAL_Base_ID.cxx:296
CaloLCW_tf.group
group
Definition: CaloLCW_tf.py:28
CaloIDHelper::channel_hash
IdentifierHash channel_hash(Identifier channelId) const
Convert a connected channel (cell) Identifier to a hash code.
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:360
PathResolver::find_file
static std::string find_file(const std::string &logical_file_name, const std::string &search_path)
Definition: PathResolver.cxx:183
LArFCAL_Base_ID::m_neighbours_2d_vec
std::vector< std::set< IdentifierHash > > m_neighbours_2d_vec
Definition: LArFCAL_Base_ID.h:233
LArFCAL_Base_ID::m_MODULE_INDEX
size_type m_MODULE_INDEX
Definition: LArFCAL_Base_ID.h:211
MultiRange::size
size_type size() const
Definition: MultiRange.cxx:70
DEBUG
#define DEBUG
Definition: page_access.h:11
LArFCAL_Base_ID::phi_min_init
int phi_min_init(const Identifier regId) const
Definition: LArFCAL_Base_ID.cxx:79
LArFCAL_Base_ID::m_PHI_INDEX
size_type m_PHI_INDEX
Definition: LArFCAL_Base_ID.h:213
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
IdentifierField
This is the individual specification for the range of one ExpandedIdentifier IdentifierField.
Definition: IdentifierField.h:83
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:23
ExpandedIdentifier::clear
void clear()
Erase all fields.
compute_lumi.fin
fin
Definition: compute_lumi.py:19
LArFCAL_Base_ID::init_hashes
int init_hashes()
Definition: LArFCAL_Base_ID.cxx:514
dot
Definition: dot.py:1
merge.status
status
Definition: merge.py:16
AtlasDetectorID::lar_fcal_exp
ExpandedIdentifier lar_fcal_exp(void) const
Definition: AtlasDetectorID.h:571
IdDictField
Definition: IdDictField.h:15
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
LArFCAL_Base_ID::m_LAR_INDEX
size_type m_LAR_INDEX
Definition: LArFCAL_Base_ID.h:207
LArCellBinning.etamin
etamin
Definition: LArCellBinning.py:137
LArFCAL_Base_ID::is_supercell
bool is_supercell(const Identifier id) const
Test if the identifier represents a supercell.
Definition: LArFCAL_Base_ID.cxx:27
IdContext
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
Definition: IdContext.h:26
AtlasDetectorID::lar_fcal_field_value
int lar_fcal_field_value() const
Definition: AtlasDetectorID.h:645
LArFCAL_Base_ID::init_neighbours
int init_neighbours(const IdDictMgr &dict_mgr)
Definition: LArFCAL_Base_ID.cxx:676
LArID_Exception
Exception class for LAr Identifiers.
Definition: LArID_Exception.h:20
LArFCAL_Base_ID::m_slar_impl
IdDictFieldImplementation m_slar_impl
Definition: LArFCAL_Base_ID.h:228
LArNeighbours::all2D
@ all2D
Definition: LArNeighbours.h:18
LArFCAL_Base_ID::LArFCAL_Base_ID
LArFCAL_Base_ID(const std::string &name, const std::string &group, bool supercell)
Definition: LArFCAL_Base_ID.cxx:18
LArFCAL_Base_ID::initLevelsFromDict
int initLevelsFromDict(const std::string &group_name)
Definition: LArFCAL_Base_ID.cxx:316
CaloIDHelper::HashGroup::hash_max
size_type hash_max() const
Return one more than the largest hash code.
Identifier
Definition: IdentifierFieldParser.cxx:14