ATLAS Offline Software
TileNeighbour.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /***************************************************************************
6  Access to Tile Calorimeter raw data
7  -----------------------------------------
8  ***************************************************************************/
9 
10 //<doc><file> $Id: TileNeighbour.cxx,v 1.13 2008-12-13 04:57:11 ssnyder Exp $
11 //<version> $Name: not supported by cvs2svn $
12 
13 //<<<<<< INCLUDES >>>>>>
14 
16 #include "CaloIdentifier/TileID.h"
17 #include "Identifier/Identifier.h"
19 
21 #include "GaudiKernel/MsgStream.h"
22 
23 #include <algorithm>
24 #include <iostream>
25 #include <fstream>
26 #include <iomanip>
27 
28 #include <cstring>
29 
30 using namespace LArNeighbours;
31 
32 
33 #define MAX_TOKEN_SIZE 256
34 
35 
36 namespace {
37 struct Cell
38 {
39  Identifier id;
40  IdentifierHash hash_id;
41  short int index = 0;
42 
43  std::string name;
44  std::vector<std::string> neighbours[4];
45  std::vector<int> neighbours_ind[4];
46 
47 };
48 } // anonymous namespace
49 
50 
52  : m_debug(0)
53  , m_length(0)
54  , m_maxHash(0)
55 {
56 }
57 
59 = default;
60 
61 int TileNeighbour::initialize(const Tile_Base_ID* tileID, const std::string& filename)
62 {
63  MsgStream log(tileID->m_msgSvc, "TileNeighbour" );
64  MSG::Level logLevel = log.level();
65  if (logLevel==MSG::VERBOSE) m_debug = 1;
66  if (logLevel< MSG::VERBOSE) m_debug = 2;
67 
68  // Find the full path to filename:
69  std::string file = PathResolver::find_file (filename, "DATAPATH");
70  log << MSG::INFO << "Reading file " << file << endmsg;
71  std::ifstream fin;
72  if (!file.empty()) {
73  fin.open(file.c_str());
74  }
75  else {
76  log << MSG::ERROR << "Could not find input file " << filename << endmsg;
77  return 1;
78  }
79  if (fin.bad()) {
80  log << MSG::ERROR << "Could not open file " << file << endmsg;
81  return 1;
82  }
83 
84  //
85  // Parse the input file
86  //
87  unsigned int line=0, record=0; // file line number, record number
88  char token[MAX_TOKEN_SIZE]; // input token
89 
90  log << MSG::VERBOSE << "Parsing input file:" << endmsg;
91 
92  std::vector<Cell> allCells;
93 
94  while ( fin >> token ) {
95  line++; // count input lines
96  if ( token[0] == '#' || token[0] == '!' || ( token[0] == '/' && token[1] == '/' ) ) {
97  fin.ignore(MAX_TOKEN_SIZE, '\n');
98  continue; // skip comments
99  }
100 
101  unsigned int toklen = strlen(token) - 1 ;
102  token[toklen] = 0; // remove ":" at the end
103  log << MSG::VERBOSE << token << " ";
104 
105  Cell newCell;
106  newCell.name = token;
107  for (unsigned int i=0; i<4; ++i) newCell.neighbours[i].clear();
108 
109  unsigned int column=0;
110  while ( fin >> token) {
111  toklen = strlen(token) - 1;
112  bool lastelem = ( token[toklen] == ';' );
113  token[toklen] = 0; // remove "," or ";"
114  log << token << " ";
115  if (strcmp(token,"none") != 0)
116  newCell.neighbours[column].emplace_back(token);
117  if (lastelem) {
118  ++column;
119  if (4 == column) break;
120  }
121  }
122 
123  fin.ignore(MAX_TOKEN_SIZE, '\n'); // skip to eol
124 
125  log << endmsg;
126  allCells.push_back(newCell);
127  record++; // count input records
128 
129  } // end while fin
130 
131  fin.close();
132 
133  log << MSG::DEBUG << "Processed " << line << " lines, " << record << " records." << endmsg;
134 
135  unsigned int curSize = allCells.size();
136  for (unsigned int i=0; i<curSize; ++i) {
137 
138  std::string::size_type pos = allCells[i].name.find( '-', 0 );
139  if ( std::string::npos != pos ) { // it is not D0 cell
140 
141  Cell newCell;
142  std::string tmpName;
143  tmpName = allCells[i].name;
144  tmpName.replace(pos,1,"+");
145  newCell.name = tmpName;
146 
147  for (unsigned int j=0; j<4; ++j) {
148  unsigned int j1 = (j<2) ? 1-j : j; // swap prev and next eta
149  unsigned int nb_size=allCells[i].neighbours[j].size();
150  for (unsigned int k=0; k<nb_size; ++k) {
151  tmpName = allCells[i].neighbours[j][k];
152  pos = tmpName.find( '-', 0 );
153  if ( std::string::npos != pos ) {
154  tmpName.replace(pos,1,"+");
155  } else {
156  pos = tmpName.find( '+', 0 );
157  if ( std::string::npos != pos ) {
158  tmpName.replace(pos,1,"-");
159  }
160  }
161  newCell.neighbours[j1].push_back(tmpName);
162  }
163  }
164  allCells.push_back(newCell);
165  }
166  }
167 
168  unsigned int nids = 0;
169  unsigned int max_phi = 0, phi=0;
170  std::set<std::pair<IdentifierHash,int> > ids;
171  ids.clear();
172  for (unsigned int i = 0; i < tileID->m_full_cell_range.size(); ++i) {
173  const Range& range = tileID->m_full_cell_range[i];
174  Range::const_identifier_factory first = range.factory_begin();
175  Range::const_identifier_factory last = range.factory_end();
176  for (; first != last; ++first) {
177  const ExpandedIdentifier& exp_id = (*first);
178  phi = exp_id[tileID->m_MODULE_INDEX];
179  if (phi > max_phi) max_phi = phi;
180  Identifier id = tileID->cell_id ( exp_id[tileID->m_SECTION_INDEX],
181  exp_id[tileID->m_SIDE_INDEX],
182  exp_id[tileID->m_MODULE_INDEX],
183  exp_id[tileID->m_TOWER_INDEX],
184  exp_id[tileID->m_SAMPLE_INDEX]);
185  IdentifierHash hashid = tileID->channels().hash (id);
186  if(!(ids.insert(std::make_pair(hashid,phi))).second){
187  log << MSG::ERROR << "init_hashes "
188  << " Error: duplicated id for cell id. nids= " << nids
189  << " compact Id " << tileID->show_to_string(id)
190  << endmsg;
191  }
192  nids++;
193  }
194  }
195  ++max_phi;
197  m_length = m_maxHash / max_phi;
198  if ( fill_phi_vec(ids, m_maxHash, max_phi, log) ) {
199  m_maxHash = m_length = 0;
200  return (1);
201  }
202 
203  curSize = allCells.size();
204 
205  std::string nb_name[4] = {"Prev_eta_", "Next_eta_", "Prev_smp_", "Next_smp_"};
206 
207  for (unsigned int i=0; i<curSize; ++i) {
208  get_id(allCells[i].name,allCells[i].id,tileID);
209  allCells[i].hash_id = tileID->channels().hash (allCells[i].id);
210  for (unsigned int ii=0; ii<m_length; ++ii) {
211  if ( m_hashid_vec[ii] == allCells[i].hash_id) {
212  allCells[i].index = ii;
213  break;
214  }
215  }
216 
217  for (unsigned int j=0; j<4; ++j) {
218  unsigned int nb_size=allCells[i].neighbours[j].size();
219  allCells[i].neighbours_ind[j].resize(nb_size);
220  for (unsigned int k=0; k<nb_size; ++k) {
221  for (unsigned int ii=0; ii<curSize; ++ii) {
222  if ( allCells[ii].name == allCells[i].neighbours[j][k]) {
223  allCells[i].neighbours_ind[j][k] = ii;
224  if (m_debug) {
225  log << MSG::VERBOSE << allCells[i].name << " "
226  << tileID->to_string(allCells[i].id,-2) << " "
227  << allCells[i].hash_id << " "
228  << allCells[i].index << " "
229  << nb_name[j] << k << " "
230  << allCells[i].neighbours[j][k] << " "
231  << allCells[i].neighbours_ind[j][k] << " "
232  << endmsg;
233  }
234  break;
235  }
236  }
237  }
238  }
239  }
240 
241  m_prev_eta.resize(m_length);
242  m_next_eta.resize(m_length);
243  m_prev_samp.resize(m_length);
244  m_next_samp.resize(m_length);
245  m_prev_samp_wide.resize(m_length);
246  m_next_samp_wide.resize(m_length);
247 
248  std::vector<short int> neighbours[4];
249  for (unsigned int i=0; i<curSize; ++i) {
250  unsigned int ind = allCells[i].index;
251 
252  for (unsigned int j=0; j<4; ++j) {
253  unsigned int nb_size=allCells[i].neighbours[j].size();
254  neighbours[j].resize(nb_size);
255  for (unsigned int k=0; k<nb_size; ++k) {
256  neighbours[j][k] = allCells[allCells[i].neighbours_ind[j][k]].index;
257  }
258  }
259 
260  initialize_prev_eta (ind,neighbours[0]);
261  initialize_next_eta (ind,neighbours[1]);
262  initialize_prev_samp(ind,neighbours[2]);
263  initialize_next_samp(ind,neighbours[3]);
264 
265  // build wide prev/next sampling for 3D neighbours with corners
266 
267  // tower and side of current cell
268  int sd = tileID->side(allCells[i].id);
269  int tw = tileID->tower(allCells[i].id);
270  int sm = tileID->sample(allCells[i].id);
271  int se = tileID->section(allCells[i].id);
272 
273  for (unsigned int j=2; j<4; ++j) {
274  // find eta neighbours for all cells in prev/next sampling
275  // and keep only those which are not too far away
276  unsigned int nb_size=allCells[i].neighbours[j].size(); // how many cells in prev/next sampling
277  for (unsigned int k=0; k<nb_size; ++k) { // loop over them
278  unsigned int new_i = allCells[i].neighbours_ind[j][k]; // this is ind of cell in other sampling
279  for (unsigned int new_j=0; new_j<2; ++new_j) { // loop over prev/next eta for new cell
280  unsigned int new_nb_size=allCells[new_i].neighbours[new_j].size();
281  for (unsigned int new_k=0; new_k<new_nb_size; ++new_k) { // all new neighbours
282  unsigned int new_nb_i = allCells[new_i].neighbours_ind[new_j][new_k];
283  short new_nb_index = allCells[new_nb_i].index; // hash index of new neighbour
284  int n=neighbours[j].size()-1;
285  for ( ; n>-1; --n) { // check for duplicates
286  if (neighbours[j][n] == new_nb_index)
287  break;
288  }
289  if (n<0) { // new cell, check how far is it
290  int new_sd = tileID->side(allCells[new_nb_i].id);
291  int new_tw = tileID->tower(allCells[new_nb_i].id);
292  int new_sm = tileID->sample(allCells[new_nb_i].id);
293  int new_se = tileID->section(allCells[new_nb_i].id);
294  if ( ( new_sd != sd && new_tw == tw ) || // only tower=0 from other side
295  ( new_sd == sd && ( // the same eta side
296  ( new_se == se && abs(new_tw - tw) < 3 ) || // withit one detector
297  ( new_se != se && ( // when we jump over crack
298  ( new_sm == sm+1 && abs(new_tw - tw) < 3 ) || // next sampling
299  ( new_sm != sm+1 && abs(new_tw - tw) < 4 ) ))))) { // previous sampling
300  neighbours[j].push_back(new_nb_index); // not too far away, take it
301  }
302  }
303  }
304  }
305  }
306  }
307 
308  initialize_prev_samp_wide(ind,neighbours[2]);
309  initialize_next_samp_wide(ind,neighbours[3]);
310  }
311 
312  if (m_debug) {
313 
314  IdContext context = tileID->cell_context();
315  std::vector<IdentifierHash> nb_list;
316 
317  unsigned int hash_max = tileID->cell_hash_max();
318  for (unsigned int i=0; i<hash_max; ++i) {
319 
320  Identifier id;
321  tileID->get_id (i, id, &context);
322  if ( tileID->module(id) != 0 ) continue;
323 
324  IdentifierHash hash_id=i;
325  nb_list.clear(); nb_list.push_back(hash_id);
326  print_list(nb_list, tileID, &context, log, "\nCell "," : ");
327 
328  tileID->get_neighbours(hash_id, prevInPhi, nb_list);
329  print_list(nb_list, tileID, &context, log, "Prev phi "," ; ");
330 
331  tileID->get_neighbours(hash_id, nextInPhi, nb_list);
332  print_list(nb_list, tileID, &context, log, "Next phi "," ; ");
333 
334  tileID->get_neighbours(hash_id, prevInEta, nb_list);
335  print_list(nb_list, tileID, &context, log, "Prev eta "," ; ");
336 
337  tileID->get_neighbours(hash_id, nextInEta, nb_list);
338  print_list(nb_list, tileID, &context, log, "Next eta "," ; ");
339 
340  tileID->get_neighbours(hash_id, prevInSamp, nb_list);
341  print_list(nb_list, tileID, &context, log, "Prev smp "," ; ");
342 
343  tileID->get_neighbours(hash_id, nextInSamp, nb_list);
344  print_list(nb_list, tileID, &context, log, "Next smp "," ; ");
345 
346  tileID->get_neighbours(hash_id, faces2D, nb_list);
347  print_list(nb_list, tileID, &context, log, "Face 2D "," ; ");
348 
349  tileID->get_neighbours(hash_id, corners2D, nb_list);
350  print_list(nb_list, tileID, &context, log, "Corn 2D "," ; ");
351 
352  tileID->get_neighbours(hash_id, all2D, nb_list);
353  print_list(nb_list, tileID, &context, log, "All 2D "," ; ");
354 
355  tileID->get_neighbours(hash_id, all3D, nb_list);
356  print_list(nb_list, tileID, &context, log, "All 3D "," ; ");
357 
358  tileID->get_neighbours(hash_id, all3DwithCorners, nb_list);
359  print_list(nb_list, tileID, &context, log, "All 3DC "," ; ");
360 
361  tileID->get_neighbours(hash_id, super3D, nb_list);
362  print_list(nb_list, tileID, &context, log, "Super 3D "," ; ");
363 
364  }
365  }
366 
367  return (0);
368 }
369 
370 int TileNeighbour::fill_phi_vec (std::set<std::pair<IdentifierHash,int> > & ids,
371  unsigned int hash_max, unsigned int max_phi, MsgStream & log)
372 {
373 
374  if(ids.size() != hash_max) {
375  log << MSG::ERROR << "fill_phi_vec "
376  << " Error: set size NOT EQUAL to hash max. size " << ids.size()
377  << " hash max " << hash_max
378  << endmsg;
379  return (1);
380  }
381 
382  m_phid_index.resize(hash_max);
383  m_cell_index.resize(hash_max);
384  m_hashid_vec.resize(hash_max);
385 
386  int dphi = hash_max / max_phi; // number of Ids in one phi-slice
387 
388  int ind_min=0, ind_max=-1, phi, phi_prev=-1, index=0;
389 
390  std::set<std::pair<IdentifierHash,int> >::const_iterator first = ids.begin();
391  std::set<std::pair<IdentifierHash,int> >::const_iterator last = ids.end();
392 
393  for (;first != last; ++first) {
394  phi = (*first).second;
395  if (phi != phi_prev) {
396  if (0 == phi) {
397  ++ind_max;
398  ind_min = ind_max;
399  }
400  index = ind_min + dphi * phi;
401  phi_prev = phi;
402  } else {
403  if (0 == phi) {
404  ++ind_max;
405  }
406  ++index;
407  }
408  IdentifierHash hash_id = (*first).first;
409  m_hashid_vec[index] = hash_id ;
410  m_phid_index[hash_id] = dphi*phi;
411  m_cell_index[hash_id] = index - dphi*phi;
412  }
413 
414  return (0);
415 }
416 
417 int TileNeighbour::initialize_prev_eta(unsigned int ind,const std::vector<short int> & all_cells)
418 {
419  m_prev_eta [ind] = all_cells;
420  return (0);
421 }
422 
423 int TileNeighbour::initialize_next_eta(unsigned int ind,const std::vector<short int> & all_cells)
424 {
425  m_next_eta [ind] = all_cells;
426  return (0);
427 }
428 
429 int TileNeighbour::initialize_prev_samp(unsigned int ind,const std::vector<short int> & all_cells)
430 {
431  m_prev_samp [ind] = all_cells;
432  return (0);
433 }
434 
435 int TileNeighbour::initialize_next_samp(unsigned int ind,const std::vector<short int> & all_cells)
436 {
437  m_next_samp [ind] = all_cells;
438  return (0);
439 }
440 
441 int TileNeighbour::initialize_prev_samp_wide(unsigned int ind,const std::vector<short int> & all_cells)
442 {
443  m_prev_samp_wide [ind] = all_cells;
445  return (0);
446 }
447 
448 int TileNeighbour::initialize_next_samp_wide(unsigned int ind,const std::vector<short int> & all_cells)
449 {
450  m_next_samp_wide [ind] = all_cells;
452  return (0);
453 }
454 
455 int TileNeighbour::prev_phi (const IdentifierHash & id,
456  std::vector<IdentifierHash> & neighbourList) const
457 {
458  unsigned int phid = m_phid_index[id];
459  unsigned int cell = m_cell_index[id];
460  if ( phid == 0 ) phid = m_maxHash;
461  phid -= m_length;
462 
463  neighbourList.push_back(m_hashid_vec[phid+cell]);
464 
465  return 1;
466 }
467 
468 int TileNeighbour::next_phi (const IdentifierHash & id,
469  std::vector<IdentifierHash> & neighbourList) const
470 {
471  unsigned int phid = m_phid_index[id];
472  unsigned int cell = m_cell_index[id];
473  phid += m_length;
474  if ( phid == m_maxHash ) phid = 0;
475 
476  neighbourList.push_back(m_hashid_vec[phid+cell]);
477 
478  return 1;
479 }
480 
481 int TileNeighbour::prev_eta (const IdentifierHash & id,
482  std::vector<IdentifierHash> & neighbourList) const
483 {
484  unsigned int phid = m_phid_index[id];
485  unsigned int cell = m_cell_index[id];
486 
487  unsigned int size = m_prev_eta[cell].size();
488  for (unsigned int i=0; i<size; ++i) {
489  neighbourList.push_back(m_hashid_vec[phid+m_prev_eta[cell][i]]);
490  }
491 
492  return size;
493 }
494 
495 int TileNeighbour::next_eta (const IdentifierHash & id,
496  std::vector<IdentifierHash> & neighbourList) const
497 {
498  unsigned int phid = m_phid_index[id];
499  unsigned int cell = m_cell_index[id];
500 
501  unsigned int size = m_next_eta[cell].size();
502  for (unsigned int i=0; i<size; ++i) {
503  neighbourList.push_back(m_hashid_vec[phid+m_next_eta[cell][i]]);
504  }
505 
506  return size;
507 }
508 
509 int TileNeighbour::prev_samp (const IdentifierHash & id,
510  std::vector<IdentifierHash> & neighbourList) const
511 {
512  unsigned int phid = m_phid_index[id];
513  unsigned int cell = m_cell_index[id];
514 
515  unsigned int size = m_prev_samp[cell].size();
516  for (unsigned int i=0; i<size; ++i) {
517  neighbourList.push_back(m_hashid_vec[phid+m_prev_samp[cell][i]]);
518  }
519 
520  return size;
521 }
522 
523 int TileNeighbour::next_samp (const IdentifierHash & id,
524  std::vector<IdentifierHash> & neighbourList) const
525 {
526  unsigned int phid = m_phid_index[id];
527  unsigned int cell = m_cell_index[id];
528 
529  unsigned int size = m_next_samp[cell].size();
530  for (unsigned int i=0; i<size; ++i) {
531  neighbourList.push_back(m_hashid_vec[phid+m_next_samp[cell][i]]);
532  }
533 
534  return size;
535 }
536 
537 int TileNeighbour::prev_samp_wide (const IdentifierHash & id,
538  std::vector<IdentifierHash> & neighbourList) const
539 {
540  unsigned int phid = m_phid_index[id];
541  unsigned int cell = m_cell_index[id];
542 
543  unsigned int size = m_prev_samp_wide[cell].size();
544  for (unsigned int i=0; i<size; ++i) {
545  neighbourList.push_back(m_hashid_vec[phid+m_prev_samp_wide[cell][i]]);
546  }
547 
548  return size;
549 }
550 
551 int TileNeighbour::next_samp_wide (const IdentifierHash & id,
552  std::vector<IdentifierHash> & neighbourList) const
553 {
554  unsigned int phid = m_phid_index[id];
555  unsigned int cell = m_cell_index[id];
556 
557  unsigned int size = m_next_samp_wide[cell].size();
558  for (unsigned int i=0; i<size; ++i) {
559  neighbourList.push_back(m_hashid_vec[phid+m_next_samp_wide[cell][i]]);
560  }
561 
562  return size;
563 }
564 
565 void TileNeighbour::get_id(std::string & strName, Identifier & id, const Tile_Base_ID* tileID)
566 {
567  const char * name = strName.c_str();
568  int se;
569  int sd;
570  int sm;
571  int tw;
572 
573  std::string::size_type pos = strName.find( '-', 0 );
574  if ( std::string::npos != pos ) sd = -1; else sd = 1;
575 
576  sscanf(name+2,"%80d",&tw);
577  if (tw<0) tw *= -1;
578 
579  switch ( name[0] ) {
580  case 'a': case 'A': sm = 0; tw -= 1;
581  if (tw<10) se = 1; else se = 2;
582  break;
583  case 'b': case 'B': sm = 1; tw -= 1;
584  if (tw<10) se = 1; else se = 2;
585  break;
586  case 'c': case 'C': sm = 1; tw -= 1;
587  se = 3;
588  break;
589  case 'd': case 'D': sm = 2; tw *= 2;
590  if (tw<10) se = 1; else se = 2;
591  if (tw==8) se = 3;
592  break;
593  case 'e': case 'E': sm = 3;
594  switch ( tw ) {
595  case 1: tw = 10; break;
596  case 2: tw = 11; break;
597  case 3: tw = 13; break;
598  case 4: tw = 15; break;
599  }
600  se = 3;
601  break;
602  case 's': case 'S': sm = 0; tw -= 1;
603  if (tw<9) se = 1; else se = 2;
604  break;
605  case 'v': case 'V': sm = 2; tw *= 2;
606  if (tw<10) se = 1; else se = 2;
607  break;
608  default: se = 0; sm = -1; tw = -1; break;
609  }
610 
611  id = tileID->cell_id(se,sd,0,tw,sm);
612 }
613 
614 void TileNeighbour::get_name(Identifier & id, std::string & strSection,
615  int & module, std::string & strCell,
616  const Tile_Base_ID* tileID, MsgStream & log, const char * end)
617 {
618  int section = tileID->section (id);
619  int side = tileID->side (id);
620  module = tileID->module (id);
621  int tower = tileID->tower (id);
622  int sample = tileID->sample (id);
623  bool supercell = tileID->is_supercell(id);
624 
625  switch (section) {
626  case 0: strSection = "Online"; break;
627  case 1: strSection = "Barrel"; break;
628  case 2: strSection = "Ext.Barrel"; break;
629  case 3: strSection = (sample < 3) ? "ITC": "Gap.Scin"; break;
630  default: strSection = "Unknown";
631  }
632 
633  int tw=0;
634  char sd = (side<0) ? '-' : '+';
635  char sm=0,s1=0;
636 
637  switch (sample) {
638  case 0: sm=(supercell?'S':'A');
639  tw=tower+1;
640  break;
641  case 1: sm='B';
642  tw=tower+1;
643  if (tw<9) s1='C';
644  if (tw==10) sm='C';
645  break;
646  case 2: sm=(supercell?'V':'D');
647  tw=tower/2;
648  if (tw==0) {
649  if (sd=='+') sd='*';
650  else sd='0';
651  }
652  break;
653  case 3: sm='E';
654  tw=(tower-7)/2;
655  break;
656  }
657 
658  char name[15];
659  if (s1>0) snprintf(name,sizeof(name),"%c%c%c%d",sm,s1,sd,tw);
660  else snprintf(name,sizeof(name),"%c%c%d", sm,sd,tw);
661  strCell = name;
662 
663  if (end)
664  log << tileID->to_string(id,-2) << " "
665  << strSection << " " << module << " " << strCell << end;
666 }
667 
668 void TileNeighbour::print_list(std::vector<IdentifierHash> & nb_list,
669  const Tile_Base_ID* tileID,
670  const IdContext* context,
671  MsgStream & log,
672  const char * pref,
673  const char * suff)
674 {
675  Identifier id;
676  int module;
677  std::string strCell;
678  std::string strSection;
679 
680  std::sort(nb_list.begin(), nb_list.end());
681  unsigned int size=nb_list.size();
682  log << MSG::VERBOSE << pref << "(" << size << ") ";
683 // size = strlen(pref) + 4 + ((size)<10 ? 1 : 2);
684 // char *space = new char[size+1];
685 // memset(space,32,size);
686 // space[size]=0;
687  for (unsigned int j=0; j<size; ++j) {
688  log << MSG::VERBOSE << endmsg;
689  log << MSG::VERBOSE << "\t";
690  tileID->get_id (nb_list[j], id, context);
691  get_name(id,strSection,module,strCell,tileID,log,suff);
692  }
693  log << endmsg;
694 // delete [] space;
695 }
TileNeighbour::initialize_next_samp
int initialize_next_samp(unsigned int ind, const std::vector< short int > &all_cells)
Definition: TileNeighbour.cxx:435
TileNeighbour::m_maxHash
unsigned int m_maxHash
Definition: TileNeighbour.h:65
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
TileNeighbour::next_eta
int next_eta(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
Definition: TileNeighbour.cxx:495
TileNeighbour::initialize_prev_eta
int initialize_prev_eta(unsigned int ind, const std::vector< short int > &all_cells)
Definition: TileNeighbour.cxx:417
ReadCellNoiseFromCoolCompare.s1
s1
Definition: ReadCellNoiseFromCoolCompare.py:378
Tile_Base_ID::cell_hash_max
size_type cell_hash_max(void) const
Definition: Tile_Base_ID.cxx:1313
checkFileSG.line
line
Definition: checkFileSG.py:75
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
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
TileNeighbour::next_samp
int next_samp(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
Definition: TileNeighbour.cxx:523
TileNeighbour::initialize_prev_samp_wide
int initialize_prev_samp_wide(unsigned int ind, const std::vector< short int > &all_cells)
Definition: TileNeighbour.cxx:441
Tile_Base_ID::m_MODULE_INDEX
size_type m_MODULE_INDEX
Definition: Tile_Base_ID.h:344
LArNeighbours::corners2D
@ corners2D
Definition: LArNeighbours.h:17
Tile_Base_ID::cell_context
IdContext cell_context(void) const
id for cells
Definition: Tile_Base_ID.cxx:1059
index
Definition: index.py:1
TileNeighbour::m_hashid_vec
std::vector< IdentifierHash > m_hashid_vec
Definition: TileNeighbour.h:76
TileNeighbour::get_id
static void get_id(std::string &strName, Identifier &id, const Tile_Base_ID *tileID)
Definition: TileNeighbour.cxx:565
python.TrigPSCPythonDbSetup.logLevel
logLevel
If HLT PSK is set on command line read it from DB instead of COOL (ATR-25974)
Definition: TrigPSCPythonDbSetup.py:27
LArNeighbours::faces2D
@ faces2D
Definition: LArNeighbours.h:16
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
Tile_Base_ID::side
int side(const Identifier &id) const
Definition: Tile_Base_ID.cxx:153
Tile_Base_ID::sample
int sample(const Identifier &id) const
Definition: Tile_Base_ID.cxx:171
TileNeighbour::initialize_next_eta
int initialize_next_eta(unsigned int ind, const std::vector< short int > &all_cells)
Definition: TileNeighbour.cxx:423
TileNeighbour::fill_phi_vec
int fill_phi_vec(std::set< std::pair< IdentifierHash, int > > &ids, unsigned int hash_max, unsigned int max_phi, MsgStream &log)
Definition: TileNeighbour.cxx:370
ExpandedIdentifier
Definition: DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h:108
DeMoUpdate.column
dictionary column
Definition: DeMoUpdate.py:1110
AtlasDetectorID::m_msgSvc
IMessageSvc * m_msgSvc
pointer to the message service
Definition: AtlasDetectorID.h:368
Tile_Base_ID::tower
int tower(const Identifier &id) const
Definition: Tile_Base_ID.cxx:165
keylayer_zslicemap.se
se
Definition: keylayer_zslicemap.py:194
LArNeighbours::prevInPhi
@ prevInPhi
Definition: LArNeighbours.h:12
TileNeighbour::prev_samp
int prev_samp(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
Definition: TileNeighbour.cxx:509
TileID.h
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
TileNeighbour::prev_eta
int prev_eta(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
Definition: TileNeighbour.cxx:481
TileNeighbour::prev_phi
int prev_phi(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
Definition: TileNeighbour.cxx:455
TileNeighbour::m_cell_index
std::vector< short int > m_cell_index
Definition: TileNeighbour.h:75
TRT::Hit::side
@ side
Definition: HitInfo.h:83
TileNeighbour::initialize
int initialize(const Tile_Base_ID *tileID, const std::string &filename="TileNeighbour.txt")
Definition: TileNeighbour.cxx:61
python.selector.AtlRunQuerySelectorLhcOlc.sd
sd
Definition: AtlRunQuerySelectorLhcOlc.py:612
Tile_Base_ID::m_SECTION_INDEX
size_type m_SECTION_INDEX
Definition: Tile_Base_ID.h:342
LArNeighbours::nextInSamp
@ nextInSamp
Definition: LArNeighbours.h:20
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
TileNeighbour::TileNeighbour
TileNeighbour(void)
Definition: TileNeighbour.cxx:51
python.PyAthena.module
module
Definition: PyAthena.py:134
LArNeighbours::nextInPhi
@ nextInPhi
Definition: LArNeighbours.h:13
Tile_Base_ID::get_id
virtual int get_id(const IdentifierHash &hash_id, Identifier &id, const IdContext *context=0) const
create compact id from hash id (return == 0 for OK)
Definition: Tile_Base_ID.cxx:1077
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
TileNeighbour::initialize_next_samp_wide
int initialize_next_samp_wide(unsigned int ind, const std::vector< short int > &all_cells)
Definition: TileNeighbour.cxx:448
Tile_Base_ID::module
int module(const Identifier &id) const
Definition: Tile_Base_ID.cxx:159
doubleTestComp.j1
j1
Definition: doubleTestComp.py:21
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:100
TileNeighbour::~TileNeighbour
virtual ~TileNeighbour(void)
lumiFormat.i
int i
Definition: lumiFormat.py:92
LArNeighbours::all3DwithCorners
@ all3DwithCorners
Definition: LArNeighbours.h:26
beamspotman.n
n
Definition: beamspotman.py:731
TileNeighbour::m_prev_eta
std::vector< std::vector< short int > > m_prev_eta
Definition: TileNeighbour.h:67
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
Tile_Base_ID
This class factors out code common between TileID and Tile_SuperCell_ID.
Definition: Tile_Base_ID.h:39
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
file
TFile * file
Definition: tile_monitor.h:29
TileNeighbour.h
CaloIDHelper::HashGroup::hash
IdentifierHash hash(Identifier id) const
Look up the hash code corresponding to an Identifier.
TileNeighbour::m_next_samp
std::vector< std::vector< short int > > m_next_samp
Definition: TileNeighbour.h:70
Range::const_identifier_factory
Definition: DetectorDescription/Identifier/Identifier/Range.h:191
LArNeighbours::prevInSamp
@ prevInSamp
Definition: LArNeighbours.h:19
Tile_Base_ID::m_TOWER_INDEX
size_type m_TOWER_INDEX
Definition: Tile_Base_ID.h:345
LArNeighbours::super3D
@ super3D
Definition: LArNeighbours.h:29
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:224
PathResolver.h
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:191
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
python.subdetectors.mmg.ids
ids
Definition: mmg.py:8
IdentifierHash.h
TileNeighbour::m_prev_samp
std::vector< std::vector< short int > > m_prev_samp
Definition: TileNeighbour.h:69
Range
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
Definition: DetectorDescription/Identifier/Identifier/Range.h:27
Tile_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 = prevInPhi,...
Definition: Tile_Base_ID.cxx:1786
TileNeighbour::m_next_samp_wide
std::vector< std::vector< short int > > m_next_samp_wide
Definition: TileNeighbour.h:72
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
TileNeighbour::m_length
unsigned int m_length
Definition: TileNeighbour.h:64
CaloIDHelper::channels
const HashGroup & channels() const
Return the HashGroup for channels (cells).
TileNeighbour::prev_samp_wide
int prev_samp_wide(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
Definition: TileNeighbour.cxx:537
Tile_Base_ID::m_full_cell_range
MultiRange m_full_cell_range
Definition: Tile_Base_ID.h:363
TileNeighbour::m_prev_samp_wide
std::vector< std::vector< short int > > m_prev_samp_wide
Definition: TileNeighbour.h:71
DeMoScan.index
string index
Definition: DeMoScan.py:362
Tile_Base_ID::m_SIDE_INDEX
size_type m_SIDE_INDEX
Definition: Tile_Base_ID.h:343
TileNeighbour::m_debug
unsigned int m_debug
Definition: TileNeighbour.h:63
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
Tile_Base_ID::to_string
std::string to_string(const Identifier &id, int level=0) const
Definition: Tile_Base_ID.cxx:52
LArNeighbours::nextInEta
@ nextInEta
Definition: LArNeighbours.h:15
TileNeighbour::m_next_eta
std::vector< std::vector< short int > > m_next_eta
Definition: TileNeighbour.h:68
MultiRange::size
size_type size() const
Definition: DetectorDescription/Identifier/src/Range.cxx:2488
DeMoScan.first
bool first
Definition: DeMoScan.py:534
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
Tile_Base_ID::is_supercell
bool is_supercell(const Identifier &id) const
Definition: Tile_Base_ID.cxx:294
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
LArNeighbours
Definition: LArNeighbours.h:11
TileNeighbour::get_name
static void get_name(Identifier &id, std::string &section, int &module, std::string &cell, const Tile_Base_ID *tileID, MsgStream &log, const char *end)
Definition: TileNeighbour.cxx:614
TileNeighbour::m_phid_index
std::vector< short int > m_phid_index
Definition: TileNeighbour.h:74
compute_lumi.fin
fin
Definition: compute_lumi.py:19
LArNeighbours::all3D
@ all3D
Definition: LArNeighbours.h:24
LArNeighbours::prevInEta
@ prevInEta
Definition: LArNeighbours.h:14
TileNeighbour::next_phi
int next_phi(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
Definition: TileNeighbour.cxx:468
TileNeighbour::next_samp_wide
int next_samp_wide(const IdentifierHash &id, std::vector< IdentifierHash > &neighbourList) const
Definition: TileNeighbour.cxx:551
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
Tile_Base_ID::section
int section(const Identifier &id) const
Definition: Tile_Base_ID.cxx:147
MultiRange::cardinality
size_type cardinality() const
Computes a possible cardinality from all ranges.
Definition: DetectorDescription/Identifier/src/Range.cxx:2503
section
void section(const std::string &sec)
Definition: TestTriggerMenuAccess.cxx:22
Tile_Base_ID::cell_id
Identifier cell_id(const Identifier &any_id) const
Definition: Tile_Base_ID.cxx:581
MAX_TOKEN_SIZE
#define MAX_TOKEN_SIZE
Definition: TileNeighbour.cxx:33
IdContext
class IdContext
Definition: IdContext.h:34
Tile_Base_ID::m_SAMPLE_INDEX
size_type m_SAMPLE_INDEX
Definition: Tile_Base_ID.h:346
LArNeighbours::all2D
@ all2D
Definition: LArNeighbours.h:18
checkFileSG.ind
list ind
Definition: checkFileSG.py:118
fitman.k
k
Definition: fitman.py:528
TileNeighbour::print_list
static void print_list(std::vector< IdentifierHash > &nb_list, const Tile_Base_ID *tileID, const IdContext *context, MsgStream &log, const char *pref, const char *suff)
Definition: TileNeighbour.cxx:668
TileNeighbour::initialize_prev_samp
int initialize_prev_samp(unsigned int ind, const std::vector< short int > &all_cells)
Definition: TileNeighbour.cxx:429