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