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