ATLAS Offline Software
Functions
TileCablingSvc.cxx File Reference
#include "StoreGate/StoreGateSvc.h"
#include "AthenaKernel/errorcheck.h"
#include "GeoModelInterfaces/IGeoModelSvc.h"
#include "CaloIdentifier/CaloLVL1_ID.h"
#include "CaloIdentifier/TileID.h"
#include "CaloIdentifier/TileTBID.h"
#include "CaloDetDescr/CaloDetDescrElement.h"
#include "TileConditions/TileCablingSvc.h"
#include "TileIdentifier/TileHWID.h"
#include "TileCalibBlobObjs/TileCalibUtils.h"
#include "TileDetDescr/TileDetDescrManager.h"
#include <cstdlib>

Go to the source code of this file.

Functions

StatusCode TileCablingSvc::initialize ATLAS_NOT_THREAD_SAFE ()
 Install fatal handler with default options. More...
 

Function Documentation

◆ ATLAS_NOT_THREAD_SAFE()

StatusCode TileCablingSvc::initialize ATLAS_NOT_THREAD_SAFE ( )
inline

Install fatal handler with default options.

This is meant to be easy to call from python via ctypes.

Install fatal handler with default options.

getLorentzAngle() Read LorentzAngle from HIST and write out into local DB

getBSErrors() Read BSErrors from Monitoring HIST and write out into local DB

getEfficiency() Read Efficiency from Monitoring HIST and write out into local DB

getRawOccupancy() Read RawOccupancy from Monitoring HIST and write out into local DB

getNoiseOccupancy() Read NoiseOccupancy from HIST and write out into local DB

getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats

Install fatal handler with default options.

called at the end of each athena event (can be used for eg.

called at the beginning of each athena event (can be used for eg.

return the simulation service ID

resetting dynamic selectors)

beginning of the loop of channels

bad bit newly found

known bad bit

for low noisy cells

for high noisy cells

0.01 is used to scale "PER" to the same order of magnitude to "SIG"

smaller deviation: distorted

checking TmaxAmp, Not mixed with MaxAmp and Width

channel information output

Only dead or distorted, or short known BCs are considered below.

index of bc

now add branches and leaves to the tree

now add branches and leaves to the tree

Definition at line 61 of file TileCablingSvc.cxx.

61  {
62 
63  ATH_MSG_DEBUG( "In initialize() " );
64 
65  //=== creating cabling singleton
66  TileCablingService* cablingService = TileCablingService::getInstance_nc();
67  m_cablingService = cablingService;
68  if (!m_cablingService) {
69  ATH_MSG_ERROR( "Cannot get instance of TileCablingService" );
70  return StatusCode::FAILURE;
71  }
72 
73  //===
74  CHECK( m_detStore.retrieve() );
75 
76  //=== retrieve all helpers from detector store
77  const CaloLVL1_ID* caloID(nullptr);
78  CHECK( m_detStore->retrieve(caloID) );
79 
80  const TileID* tileID(nullptr);
81  CHECK( m_detStore->retrieve(tileID) );
82 
83  const TileTBID* tileTBID(nullptr);
84  CHECK( m_detStore->retrieve(tileTBID) );
85 
86  const TileHWID* tileHWID(nullptr);
87  CHECK( m_detStore->retrieve(tileHWID) );
88 
89  //=== Initialize TileCablingService singleton
90  cablingService->setCaloLVL1(caloID);
91  cablingService->setTileID(tileID);
92  cablingService->setTileTBID(tileTBID);
93  cablingService->setTileHWID(tileHWID);
94 
95  //=== set connected drawers if non-empty list
96  if (m_connectedDrawers.size() > 1) {
97  //===disconnect all drawers first
98  for (int ros = 1; ros < 5; ++ros) {
99  for (int drawer = 0; drawer < 64; ++drawer) {
100  cablingService->setConnected(ros, drawer, false);
101  }
102  }
103  int count = 0;
104 
105  msg(MSG::INFO) << "Connected drawer list:" << MSG::hex;
106  for (unsigned int dr = 1; dr < m_connectedDrawers.size(); dr += 2) {
107  int frag1 = std::strtol(m_connectedDrawers[dr - 1].data(), nullptr, 0);
108  int frag2 = std::strtol(m_connectedDrawers[dr].data(), nullptr, 0);
109  for (int frag = frag1; frag <= frag2; ++frag) {
110  int ros = frag >> 8;
111  int drawer = frag & 0xFF;
112  if (ros >= 1 && ros < 5 && drawer >= 0 && drawer < 64) {
113  cablingService->setConnected(ros, drawer, true);
114  msg(MSG::INFO) << " 0x" << frag;
115  char module[3];
116  sprintf(module, "%2.2d", drawer + 1);
117  switch (ros) {
118  case 1:
119  msg(MSG::INFO) << "/LBA" << module;
120  break;
121  case 2:
122  msg(MSG::INFO) << "/LBC" << module;
123  break;
124  case 3:
125  msg(MSG::INFO) << "/EBA" << module;
126  break;
127  case 4:
128  msg(MSG::INFO) << "/EBC" << module;
129  break;
130  default:
131  msg(MSG::INFO) << "/XXX" << module;
132  break;
133  }
134  if (++count > 3) {
135  count = 0;
136  msg(MSG::INFO) << endmsg;
137  msg(MSG::INFO) << " " << MSG::hex;
138  }
139  }
140  }
141  }
142  msg(MSG::INFO) << MSG::dec << endmsg;
143  }
144 
145  SmartIF<IGeoModelSvc> geoModel{service("GeoModelSvc")};
146  if (!geoModel) {
147  ATH_MSG_ERROR( "Could not locate GeoModelSvc" );
148  } else {
149  // check the DetDescr version
150  std::string atlasVersion = geoModel->atlasVersion();
151  int ctb = atlasVersion.compare(0, 9, "ATLAS-CTB");
152  int geo = atlasVersion.compare(0,9,"ATLAS-GEO");
153  int run1 = atlasVersion.compare(0,8,"ATLAS-R1");
154  int ibl = atlasVersion.compare(0,9,"ATLAS-IBL");
155  int run2 = atlasVersion.compare(0,8,"ATLAS-R2");
156  int run3 = atlasVersion.compare(0,8,"ATLAS-R3");
157  int run4 = atlasVersion.compare(0,13,"ATLAS-P2-RUN4");
158  int upg = atlasVersion.compare(0,7,"ATLAS-P") ;
159  int comm = atlasVersion.compare(0,10,"ATLAS-Comm");
160 
161  bool upgradeA = (tileID->cell_hash_max() == MAX_TILE_CELLS_UPGRADEA);
162  bool upgradeBC = (tileID->cell_hash_max() == MAX_TILE_CELLS_UPGRADEBC);
163  bool upgradeABC = (tileID->cell_hash_max() == MAX_TILE_CELLS_UPGRADEABC);
164 
165  // choose which geometries are true RUN2 geometries to apply run2 cabling
166  bool nothing_found = (ctb*geo*run1*ibl*run2*run3*run4*upg*comm != 0);
167  GeoModel::GeoConfig geoConfig = geoModel->geoConfig();
168  bool RUN2 = (nothing_found && geoConfig==GeoModel::GEO_RUN2) || (run2 == 0);
169  bool RUN3 = (nothing_found && geoConfig==GeoModel::GEO_RUN3) || (run3 == 0);
170  bool RUN4 = (nothing_found && geoConfig==GeoModel::GEO_RUN4) || (run4 == 0);
171  //|| (ibl == 0 || upg == 0);
172 
173  if (RUN2) {
174 
175  ATH_MSG_INFO( "RUN2 ATLAS geometry flag detected for geometry: " << atlasVersion );
176  if (upgradeA) {
177  ATH_MSG_INFO( "RUN2 ATLAS UpgradeA geometry flag detected for geometry: " << atlasVersion );
178  m_cablingType = TileCablingService::UpgradeA;
179  } else if (upgradeBC) {
180  ATH_MSG_INFO( "RUN2 ATLAS UpgradeBC geometry flag detected for geometry: " << atlasVersion );
181  m_cablingType = TileCablingService::UpgradeBC;
182  } else if (upgradeABC) {
183  ATH_MSG_INFO( "RUN2 ATLAS UpgradeABC geometry flag detected for geometry: " << atlasVersion );
184  m_cablingType = TileCablingService::UpgradeABC;
185  } else {
186  if (m_cablingType == TileCablingService::RUN2Cabling) {
187  ATH_MSG_INFO( "Cabling for RUN2 (2014-2017) ATLAS geometry is set via jobOptions " );
188  } else if (m_cablingType == TileCablingService::RUN2aCabling) {
189  ATH_MSG_INFO( "Cabling for RUN2a (2018) ATLAS geometry is set via jobOptions " );
190  } else if (m_cablingType < TileCablingService::RUN2Cabling) {
191  ATH_MSG_INFO( "Setting RUN2 (2014-2017) cabling" );
192  m_cablingType = TileCablingService::RUN2Cabling;
193  } else {
194  ATH_MSG_INFO( "Using cabling type " << m_cablingType << " from jobOptions " );
195  }
196  }
197 
198  } else if (RUN3) {
199 
200  ATH_MSG_INFO( "RUN3 ATLAS geometry flag detected for geometry: " << atlasVersion );
201  if (m_cablingType == TileCablingService::RUN3Cabling) {
202  ATH_MSG_INFO( "Cabling for RUN3 ATLAS geometry is set via jobOptions " );
203  } else if ( m_cablingType < TileCablingService::RUN2Cabling) {
204  ATH_MSG_INFO( "Setting RUN3 cabling" );
205  m_cablingType = TileCablingService::RUN3Cabling;
206  } else {
207  ATH_MSG_INFO( "Using cabling type " << m_cablingType << " from jobOptions " );
208  }
209 
210  } else if (RUN4) {
211 
212  ATH_MSG_INFO( "RUN4 ATLAS geometry flag detected for geometry: " << atlasVersion );
213  if (m_cablingType == TileCablingService::RUN3Cabling) {
214  ATH_MSG_INFO( "Cabling for RUN3 ATLAS geometry is set via jobOptions " );
215  } else if ( m_cablingType < TileCablingService::RUN3Cabling) {
216  ATH_MSG_INFO( "Setting RUN3 cabling" );
217  m_cablingType = TileCablingService::RUN3Cabling;
218  } else {
219  ATH_MSG_INFO( "Using cabling type " << m_cablingType << " from jobOptions " );
220  }
221 
222  } else if (m_cablingType == TileCablingService::RUN3Cabling) {
223  ATH_MSG_INFO( "Cabling for RUN3 ATLAS geometry is set via jobOptions " );
224  } else if (m_cablingType == TileCablingService::RUN2Cabling) {
225  ATH_MSG_INFO( "Cabling for RUN2 (2014-2017) ATLAS geometry is set via jobOptions " );
226  } else if (m_cablingType == TileCablingService::RUN2aCabling) {
227  ATH_MSG_INFO( "Cabling for RUN2a (2018) ATLAS geometry is set via jobOptions " );
228  } else if (ctb == 0) {
229  ATH_MSG_INFO( "CTB geometry detected: " << atlasVersion );
230  m_cablingType = TileCablingService::TestBeam;
231  } else if (geo == 0 || run1 == 0 || ibl == 0 || run2 == 0 || upg == 0) {
232  ATH_MSG_INFO( "RUN1 ATLAS geometry detected: " << atlasVersion );
233  m_cablingType = TileCablingService::MBTSOnly;
234  } else if (comm == 0) {
235  ATH_MSG_INFO( "RUN1 ATLAS Commissioning geometry detected: " << atlasVersion );
236  m_cablingType = TileCablingService::MBTSOnly;
237  } else {
238  ATH_MSG_WARNING( "Old ATLAS geometry detected - most probably it's a mistake: " << atlasVersion );
239  // in this case change cabling type only if it is not set via jobOptions
240  if (m_cablingType < -1 || m_cablingType >= TileCablingService::UnknownCabling)
241  m_cablingType = TileCablingService::OldSim;
242  else
243  ATH_MSG_INFO( "Using cabling type from jobOptions " );
244  }
245  }
246 
247  ATH_MSG_INFO( "Setting Cabling type to " << m_cablingType );
248  ATH_CHECK( cablingService->setCablingType((TileCablingService::TileCablingType) m_cablingType) );
249  ATH_MSG_DEBUG( "Maximum number of gains: " << m_cablingService->getMaxChannels());
250 
251  // ------------ Setting TileCal channel hashes in CaloDDE -------------
252  // ---------- it can be done only after we set cabling type -----------
253  const TileDetDescrManager* tileMgr;
254  if (m_detStore->retrieve(tileMgr).isFailure()) {
255  ATH_MSG_WARNING( "Unable to retrieve TileDetDescrManager from DetectorStore" );
256  ATH_MSG_WARNING( "Will not set Tile online hash ID in CaloDetDescrElements" );
257  } else {
258  ATH_MSG_VERBOSE( "List of disconnected cells" );
259 
260  unsigned int nCellMax = tileMgr->tile_cell_size();
261  IdContext chContext = tileHWID->channel_context();
262 
263  for (unsigned int cell = 0; cell < nCellMax; ++cell) {
264  CaloDetDescrElement* caloDDE = tileMgr->get_cell_element(cell);
265 
266  if (caloDDE) {
267  Identifier cell_id = tileID->cell_id(caloDDE->subcalo_hash());
268  int nchan = (tileID->is_tile_gapscin(cell_id)) ? 1 : 2;
270 
271  bool disconnected = true;
272  for (int pmt = 0; pmt < nchan; ++pmt) {
273  Identifier id1 = tileID->pmt_id(cell_id, pmt);
274  HWIdentifier hw1 = m_cablingService->s2h_channel_id(id1);
275  tileHWID->get_hash(hw1, pmtHash[pmt], &chContext);
276  Identifier id2 = m_cablingService->h2s_pmt_id(hw1);
277  disconnected &= (id2 != id1);
278  }
279  if (disconnected) m_disconnectedCells.push_back(cell_id);
280 
281  IdentifierHash oldPmtHash[2] = { caloDDE->onl1(), caloDDE->onl2() };
282  if ((oldPmtHash[0] != TileHWID::NOT_VALID_HASH || oldPmtHash[1] != TileHWID::NOT_VALID_HASH)
283  && (pmtHash[0] != oldPmtHash[0] || pmtHash[1] != oldPmtHash[1])) {
284 
285  ATH_MSG_WARNING( "changing channel hash for cell hash= " << cell
286  << " id= " << tileID->to_string(cell_id, -2)
287  << " from (" << oldPmtHash[0] << "," << oldPmtHash[1]
288  << ") to (" << pmtHash[0] << "," << pmtHash[1] << ")" );
289 
290  }
291 
292  caloDDE->set_online(pmtHash[0], pmtHash[1]);
293  if (msgLvl(MSG::VERBOSE)) {
294  if (disconnected) {
295 
296  msg(MSG::VERBOSE) << "cell_id " << tileID->to_string(cell_id, -2) << " ch_id";
297  if (pmtHash[0] != TileHWID::NOT_VALID_HASH)
298  msg(MSG::VERBOSE) << " " << tileHWID->to_string(m_cablingService->s2h_channel_id(tileID->pmt_id(cell_id, 0)), -1);
299  else
300  msg(MSG::VERBOSE) << " invalid";
301  if (nchan > 1) {
302  if (pmtHash[1] != TileHWID::NOT_VALID_HASH)
303  msg(MSG::VERBOSE) << " " << tileHWID->to_string(m_cablingService->s2h_channel_id(tileID->pmt_id(cell_id, 1)), -1);
304  else
305  msg(MSG::VERBOSE) << " invalid";
306  }
307  msg(MSG::VERBOSE) << endmsg;
308  }
309  }
310  }
311  }
312 
313  ATH_MSG_VERBOSE( "Total: " << m_disconnectedCells.size() << " disconnected cells");
314  }
315 
316  if (msgLvl(MSG::VERBOSE)) {
317 
318  // checking all HWIDs
319  std::cout << "===============================" << std::endl;
320 
321  for (int ros = 1; ros < 5; ++ros) {
322  for (int drawer = 0; drawer < 64; ++drawer) {
323  int drIdx1 = TileCalibUtils::getDrawerIdx(ros, drawer);
324  for (int channel = 0; channel < 48; ++channel) {
325 
326  HWIdentifier hwid1 = tileHWID->channel_id(ros, drawer, channel);
327  if (hwid1.is_valid()) {
328  std::cout << " hw1=" << tileHWID->to_string(hwid1, -1);
329  Identifier id1 = m_cablingService->h2s_pmt_id(hwid1);
330  if (id1.is_valid()) {
331  std::cout << " id1=" << tileID->to_string(id1, -1);
332  HWIdentifier hwid2 = m_cablingService->s2h_channel_id(id1);
333  if (hwid2.is_valid()) {
334  if (hwid2 != hwid1) std::cout << " hw1!=hw2=" << tileHWID->to_string(hwid2, -1);
335  Identifier id2 = m_cablingService->h2s_pmt_id(hwid2);
336  if (id2.is_valid()) {
337  if (id2 != id1)
338  std::cout << " id1!=id2=" << tileID->to_string(id2, -1);
339  else if (tileTBID->is_tiletb(id1))
340  std::cout << ((tileTBID->eta(id1)>1) ? " E4'" : " MBTS");
341  else
342  std::cout << " cell_hash " << tileID->cell_hash(tileID->cell_id(id1));
343  int drIdx2 = tileHWID->drawerIdx(hwid1);
344  if (drIdx1 != drIdx2) {
345  std::cout << " ERROR in drawer index " << drIdx1 << " != " << drIdx2
346  << " end-begin=" << (tileHWID->drawer_end() - tileHWID->drawer_begin())
347  << std::hex << " 0x" << hwid1 << " 0x"
348  << (*(tileHWID->drawer_begin() + drIdx1)) << std::dec;
349  } else {
350  std::cout << " drawer index " << drIdx2;
351  }
352  } else {
353  std::cout << " id2=invalid";
354  }
355  } else {
356  std::cout << " hw2=invalid";
357  }
358  } else {
359  std::cout << " id1=invalid";
360  }
361  } else {
362  std::cout << " hw1=invalid";
363  }
364  std::cout << std::endl;
365  }
366  }
367  }
368 
369  // checking D4 in few modules
370  std::cout << "=== D4 cells in special EB ====" << std::endl;
371 
372  int d4module[4] = { 14, 15, 18, 19 };
373  for (int side = -1; side < 2; side += 2) {
374  for (int imod = 0; imod < 4; ++imod) {
375  int module = d4module[imod] - 1;
376  for (int pmt = 0; pmt < 2; ++pmt) {
377 
378  Identifier id1 = tileID->pmt_id(3, side, module, 8, 2, pmt);
379  if (id1.is_valid()) {
380  std::cout << " id1=" << tileID->to_string(id1, -1);
381  HWIdentifier hw1 = m_cablingService->s2h_channel_id(id1);
382  if (hw1.is_valid()) {
383  std::cout << " hw1=" << tileHWID->to_string(hw1, -1);
384  Identifier id2 = m_cablingService->h2s_pmt_id(hw1);
385  if (id2.is_valid()) {
386  if (id2 != id1) std::cout << " id1!=id2=" << tileID->to_string(id2, -1);
387  HWIdentifier hw2 = m_cablingService->s2h_channel_id(id2);
388  if (hw2.is_valid()) {
389  if (hw2 != hw1) std::cout << " hwid1!=hwid2=" << tileHWID->to_string(hw2, -1);
390  } else {
391  std::cout << " hw2=invalid";
392  }
393  } else {
394  std::cout << " id2=invalid";
395  }
396  } else {
397  std::cout << " hw1=invalid";
398  }
399  } else {
400  std::cout << " id1=invalid";
401  }
402  std::cout << std::endl;
403  }
404  }
405  }
406 
407  // checking C10 in few modules
408  std::cout << "=== C10 cells in special EB ===" << std::endl;
409 
410  int c10module[8] = { 39, 40, 41, 42, 55, 56, 57, 58 };
411  for (int side = -1; side < 2; side += 2) {
412  for (int imod = 0; imod < 8; ++imod) {
413  int module = c10module[imod] - 1;
414  for (int pmt = 0; pmt < 2; ++pmt) {
415 
416  Identifier id1 = tileID->pmt_id(3, side, module, 9, 1, pmt);
417  if (id1.is_valid()) {
418  std::cout << " id1=" << tileID->to_string(id1, -1);
419  HWIdentifier hw1 = m_cablingService->s2h_channel_id(id1);
420  if (hw1.is_valid()) {
421  std::cout << " hw1=" << tileHWID->to_string(hw1, -1);
422  Identifier id2 = m_cablingService->h2s_pmt_id(hw1);
423  if (id2.is_valid()) {
424  if (id2 != id1) std::cout << " id1!=id2=" << tileID->to_string(id2, -1);
425  HWIdentifier hw2 = m_cablingService->s2h_channel_id(id2);
426  if (hw2.is_valid()) {
427  if (hw2 != hw1) std::cout << " hwid1!=hwid2=" << tileHWID->to_string(hw2, -1);
428  } else {
429  std::cout << " hw2=invalid";
430  }
431  } else {
432  std::cout << " id2=invalid";
433  }
434  } else {
435  std::cout << " hw1=invalid";
436  }
437  } else {
438  std::cout << " id1=invalid";
439  }
440  std::cout << std::endl;
441  }
442  }
443  }
444 
445  // checking E1
446  std::cout << "========= E1 cells =========" << std::endl;
447 
448  for (int side = -1; side < 2; side += 2) {
449  for (int module = 0; module < 64; ++module) {
450  for (int tower = 10; tower < 11; tower += 1) {
451 
452  Identifier id1 = tileID->pmt_id(3, side, module, tower, 3, 0);
453  if (id1.is_valid()) {
454  std::cout << " id1=" << tileID->to_string(id1, -1);
455  HWIdentifier hw1 = m_cablingService->s2h_channel_id(id1);
456  if (hw1.is_valid()) {
457  std::cout << " hw1=" << tileHWID->to_string(hw1, -1);
458  Identifier id2 = m_cablingService->h2s_pmt_id(hw1);
459  if (id2.is_valid()) {
460  if (id2 != id1) std::cout << " id1!=id2=" << tileID->to_string(id2, -1);
461  HWIdentifier hw2 = m_cablingService->s2h_channel_id(id2);
462  if (hw2.is_valid()) {
463  if (hw2 != hw1) std::cout << " hwid1!=hwid2=" << tileHWID->to_string(hw2, -1);
464  } else {
465  std::cout << " hw2=invalid";
466  }
467  } else {
468  std::cout << " id2=invalid";
469  }
470  } else {
471  std::cout << " hw1=invalid";
472  }
473  } else {
474  std::cout << " id1=invalid";
475  }
476  std::cout << std::endl;
477  }
478  }
479  }
480 
481  // checking E2
482  std::cout << "========= E2 cells =========" << std::endl;
483 
484  for (int side = -1; side < 2; side += 2) {
485  for (int module = 0; module < 64; ++module) {
486  for (int tower = 11; tower < 12; tower += 1) {
487 
488  Identifier id1 = tileID->pmt_id(3, side, module, tower, 3, 0);
489  if (id1.is_valid()) {
490  std::cout << " id1=" << tileID->to_string(id1, -1);
491  HWIdentifier hw1 = m_cablingService->s2h_channel_id(id1);
492  if (hw1.is_valid()) {
493  std::cout << " hw1=" << tileHWID->to_string(hw1, -1);
494  Identifier id2 = m_cablingService->h2s_pmt_id(hw1);
495  if (id2.is_valid()) {
496  if (id2 != id1) std::cout << " id1!=id2=" << tileID->to_string(id2, -1);
497  HWIdentifier hw2 = m_cablingService->s2h_channel_id(id2);
498  if (hw2.is_valid()) {
499  if (hw2 != hw1) std::cout << " hwid1!=hwid2=" << tileHWID->to_string(hw2, -1);
500  } else {
501  std::cout << " hw2=invalid";
502  }
503  } else {
504  std::cout << " id2=invalid";
505  }
506  } else {
507  std::cout << " hw1=invalid";
508  }
509  } else {
510  std::cout << " id1=invalid";
511  }
512  std::cout << std::endl;
513  }
514  }
515  }
516 
517  // checking E3,E4
518  std::cout << "========= E3,E4 cells =========" << std::endl;
519 
520  for (int side = -1; side < 2; side += 2) {
521  for (int module = 0; module < 64; ++module) {
522  for (int tower = 13; tower < 16; tower += 2) {
523 
524  Identifier id1 = tileID->pmt_id(3, side, module, tower, 3, 0);
525  if (id1.is_valid()) {
526  std::cout << " id1=" << tileID->to_string(id1, -1);
527  HWIdentifier hw1 = m_cablingService->s2h_channel_id(id1);
528  if (hw1.is_valid()) {
529  std::cout << " hw1=" << tileHWID->to_string(hw1, -1);
530  Identifier id2 = m_cablingService->h2s_pmt_id(hw1);
531  if (id2.is_valid()) {
532  if (id2 != id1) std::cout << " id1!=id2=" << tileID->to_string(id2, -1);
533  HWIdentifier hw2 = m_cablingService->s2h_channel_id(id2);
534  if (hw2.is_valid()) {
535  if (hw2 != hw1) std::cout << " hwid1!=hwid2=" << tileHWID->to_string(hw2, -1);
536  } else {
537  std::cout << " hw2=invalid";
538  }
539  } else {
540  std::cout << " id2=invalid";
541  }
542  } else {
543  std::cout << " hw1=invalid";
544  }
545  } else {
546  std::cout << " id1=invalid";
547  }
548  std::cout << std::endl;
549  }
550  }
551  }
552 
553  // checking MBTS
554  std::cout << "========= MBTS cells ==========" << std::endl;
555 
556  for (int side = -1; side < 2; side += 2) {
557  for (int module = 0; module < 8; ++module) {
558  for (int tower = 0; tower < 2; ++tower) {
559 
560  Identifier id1 = tileTBID->channel_id(side, module, tower);
561  if (id1.is_valid()) {
562  std::cout << " id1=" << tileTBID->to_string(id1);
563  HWIdentifier hw1 = m_cablingService->s2h_channel_id(id1);
564  if (hw1.is_valid()) {
565  std::cout << " hw1=" << tileHWID->to_string(hw1, -1);
566  Identifier id2 = m_cablingService->h2s_pmt_id(hw1);
567  if (id2.is_valid()) {
568  if (id2 != id1) std::cout << " id1!=id2=" << tileTBID->to_string(id2);
569  HWIdentifier hw2 = m_cablingService->s2h_channel_id(id2);
570  if (hw2.is_valid()) {
571  if (hw2 != hw1) std::cout << " hwid1!=hwid2=" << tileHWID->to_string(hw2, -1);
572  } else {
573  std::cout << " hw2=invalid";
574  }
575  } else {
576  std::cout << " id2=invalid";
577  }
578  } else {
579  std::cout << " hw1=invalid";
580  }
581  } else {
582  std::cout << " id1=invalid";
583  }
584  std::cout << std::endl;
585  }
586  }
587  }
588 
589  // checking E4'
590  if (m_cablingType == TileCablingService::RUN2Cabling || m_cablingType == TileCablingService::RUN2aCabling) {
591 
592  std::cout << "========= E4' cells ==========" << std::endl;
593 
594  for (int side = -1; side < 0; side += 2) {
595  for (int module = 0; module < 4; ++module) {
596  for (int tower = 2; tower < 3; ++tower) {
597 
598  Identifier id1 = tileTBID->channel_id(side, module, tower);
599  if (id1.is_valid()) {
600  std::cout << " id1=" << tileTBID->to_string(id1);
601  HWIdentifier hw1 = m_cablingService->s2h_channel_id(id1);
602  if (hw1.is_valid()) {
603  std::cout << " hw1=" << tileHWID->to_string(hw1, -1);
604  Identifier id2 = m_cablingService->h2s_pmt_id(hw1);
605  if (id2.is_valid()) {
606  if (id2 != id1) std::cout << " id1!=id2=" << tileTBID->to_string(id2);
607  HWIdentifier hw2 = m_cablingService->s2h_channel_id(id2);
608  if (hw2.is_valid()) {
609  if (hw2 != hw1) std::cout << " hwid1!=hwid2=" << tileHWID->to_string(hw2, -1);
610  } else {
611  std::cout << " hw2=invalid";
612  }
613  } else {
614  std::cout << " id2=invalid";
615  }
616  } else {
617  std::cout << " hw1=invalid";
618  }
619  } else {
620  std::cout << " id1=invalid";
621  }
622  std::cout << std::endl;
623  }
624  }
625  }
626  }
627 
628  std::cout << "===============================" << std::endl;
629  }
630 
631  if (m_useCache) cablingService->fillH2SIdCache();
632 
633  return StatusCode::SUCCESS;
634 }
TileCablingService::RUN3Cabling
@ RUN3Cabling
Definition: TileCablingService.h:91
TileCablingService::MBTSOnly
@ MBTSOnly
Definition: TileCablingService.h:87
CaloDetDescrElement::onl2
IdentifierHash onl2() const
cell online identifier 2
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:408
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
GeoModel::GeoConfig
GeoConfig
Definition: IGeoDbTagSvc.h:17
TileCablingService::TestBeam
@ TestBeam
Definition: TileCablingService.h:84
ReadBchFromCool.pmt
pmt
Definition: ReadBchFromCool.py:62
TileCablingService::UpgradeA
@ UpgradeA
Definition: TileCablingService.h:92
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
PlotCalibFromCool.nchan
nchan
Definition: PlotCalibFromCool.py:564
python.TurnDataReader.dr
dr
Definition: TurnDataReader.py:112
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
HWIdentifier
Definition: HWIdentifier.h:13
Identifier::is_valid
bool is_valid() const
Check if id is in a valid state.
TileCablingService::RUN2aCabling
@ RUN2aCabling
Definition: TileCablingService.h:90
TileCablingService::fillH2SIdCache
void fillH2SIdCache(void)
Definition: TileCablingService.cxx:2391
Example_ReadSampleNoise.drawer
drawer
Definition: Example_ReadSampleNoise.py:39
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
TileCablingService::setCablingType
bool setCablingType(TileCablingType type)
Definition: TileCablingService.cxx:228
TileCablingService::setConnected
void setConnected(int section, int side, int modMin, int modMax)
Definition: TileCablingService.cxx:339
TRT::Hit::side
@ side
Definition: HitInfo.h:83
CaloDetDescrElement::onl1
IdentifierHash onl1() const
cell online identifier 1
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:404
RunTileCalibRec.run3
run3
Definition: RunTileCalibRec.py:208
python.PyAthena.module
module
Definition: PyAthena.py:131
TileHWID
Helper class for TileCal online (hardware) identifiers.
Definition: TileHWID.h:49
TileDetDescrManager::tile_cell_size
calo_element_vec_size tile_cell_size() const
Definition: TileDetDescrManager.h:153
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
id2
HWIdentifier id2
Definition: LArRodBlockPhysicsV0.cxx:562
TileCablingService::setTileHWID
void setTileHWID(const TileHWID *tileHWID)
Definition: TileCablingService.h:186
TileDetDescrManager
Definition: TileDetDescrManager.h:33
TileID
Helper class for TileCal offline identifiers.
Definition: TileID.h:68
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
maskDeadModules.run1
run1
Definition: maskDeadModules.py:40
TileCablingService::UnknownCabling
@ UnknownCabling
Definition: TileCablingService.h:95
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
CaloDetDescrElement::set_online
void set_online(const IdentifierHash onl1, const IdentifierHash onl2)
set cell online identifiers (Tile)
Definition: CaloDetDescrElement.cxx:147
GeoModel::GEO_RUN4
@ GEO_RUN4
Definition: IGeoDbTagSvc.h:21
TileCablingService::setTileID
void setTileID(const TileID *tileID)
Definition: TileCablingService.h:185
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
maskDeadModules.ros
ros
Definition: maskDeadModules.py:35
TileCablingService
Definition: TileCablingService.h:23
GeoModel::GEO_RUN3
@ GEO_RUN3
Definition: IGeoDbTagSvc.h:20
TileDetDescrManager::get_cell_element
CaloDetDescrElement * get_cell_element(unsigned int cell_hash) const
Definition: TileDetDescrManager.h:156
TileHWID::NOT_VALID_HASH
@ NOT_VALID_HASH
Definition: TileHWID.h:314
ReadCellNoiseFromCoolCompare.run2
run2
Definition: ReadCellNoiseFromCoolCompare.py:53
CaloLVL1_ID
Helper class for offline TT identifiers.
Definition: CaloLVL1_ID.h:66
TileCablingService::TileCablingType
TileCablingType
Definition: TileCablingService.h:84
GeoModel::GEO_RUN2
@ GEO_RUN2
Definition: IGeoDbTagSvc.h:19
TileCablingService::setCaloLVL1
void setCaloLVL1(const CaloLVL1_ID *tt_ID)
Definition: TileCablingService.h:184
TileCablingService::UpgradeABC
@ UpgradeABC
Definition: TileCablingService.h:94
ReadCalibFromCool.comm
comm
Definition: ReadCalibFromCool.py:440
TileCablingService::setTileTBID
void setTileTBID(const TileTBID *tileTBID)
Definition: TileCablingService.h:187
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
TileCablingService::UpgradeBC
@ UpgradeBC
Definition: TileCablingService.h:93
LArCellConditions.geo
bool geo
Definition: LArCellConditions.py:46
TileCablingService::OldSim
@ OldSim
Definition: TileCablingService.h:85
TileTBID
Helper class for TileCal offline identifiers of ancillary testbeam detectors and MBTS.
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:65
TileCalibUtils::getDrawerIdx
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
Definition: TileCalibUtils.cxx:60
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
TileCablingService::RUN2Cabling
@ RUN2Cabling
Definition: TileCablingService.h:89
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
IdContext
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
Definition: IdContext.h:26
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
CaloDetDescrElement::subcalo_hash
IdentifierHash subcalo_hash() const
cell subcalo hash
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:418
Identifier
Definition: IdentifierFieldParser.cxx:14