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