Install fatal handler with default options.
This is meant to be easy to call from python via ctypes.
Install fatal handler with default options.
getRawOccupancy() Read RawOccupancy from Monitoring HIST and write out into local DB
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.
Only dead or distorted, or short known BCs are considered below.
67 m_cablingService = cablingService;
68 if (!m_cablingService) {
70 return StatusCode::FAILURE;
74 CHECK( m_detStore.retrieve() );
78 CHECK( m_detStore->retrieve(caloID) );
80 const TileID* tileID(
nullptr);
81 CHECK( m_detStore->retrieve(tileID) );
84 CHECK( m_detStore->retrieve(tileTBID) );
87 CHECK( m_detStore->retrieve(tileHWID) );
96 if (m_connectedDrawers.size() > 1) {
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) {
112 if (
ros >= 1 && ros < 5 && drawer >= 0 &&
drawer < 64) {
114 msg(MSG::INFO) <<
" 0x" << frag;
137 msg(MSG::INFO) <<
" " << MSG::hex;
147 if (
sc.isFailure()) {
152 int ctb = atlasVersion.compare(0, 9,
"ATLAS-CTB");
153 int geo = atlasVersion.compare(0,9,
"ATLAS-GEO");
154 int run1 = atlasVersion.compare(0,8,
"ATLAS-R1");
155 int ibl = atlasVersion.compare(0,9,
"ATLAS-IBL");
156 int run2 = atlasVersion.compare(0,8,
"ATLAS-R2");
157 int run3 = atlasVersion.compare(0,8,
"ATLAS-R3");
158 int run4 = atlasVersion.compare(0,13,
"ATLAS-P2-RUN4");
159 int upg = atlasVersion.compare(0,7,
"ATLAS-P") ;
160 int comm = atlasVersion.compare(0,10,
"ATLAS-Comm");
162 bool upgradeA = (tileID->cell_hash_max() == MAX_TILE_CELLS_UPGRADEA);
163 bool upgradeBC = (tileID->cell_hash_max() == MAX_TILE_CELLS_UPGRADEBC);
164 bool upgradeABC = (tileID->cell_hash_max() == MAX_TILE_CELLS_UPGRADEABC);
176 ATH_MSG_INFO(
"RUN2 ATLAS geometry flag detected for geometry: " << atlasVersion );
178 ATH_MSG_INFO(
"RUN2 ATLAS UpgradeA geometry flag detected for geometry: " << atlasVersion );
180 }
else if (upgradeBC) {
181 ATH_MSG_INFO(
"RUN2 ATLAS UpgradeBC geometry flag detected for geometry: " << atlasVersion );
183 }
else if (upgradeABC) {
184 ATH_MSG_INFO(
"RUN2 ATLAS UpgradeABC geometry flag detected for geometry: " << atlasVersion );
188 ATH_MSG_INFO(
"Cabling for RUN2 (2014-2017) ATLAS geometry is set via jobOptions " );
190 ATH_MSG_INFO(
"Cabling for RUN2a (2018) ATLAS geometry is set via jobOptions " );
195 ATH_MSG_INFO(
"Using cabling type " << m_cablingType <<
" from jobOptions " );
201 ATH_MSG_INFO(
"RUN3 ATLAS geometry flag detected for geometry: " << atlasVersion );
203 ATH_MSG_INFO(
"Cabling for RUN3 ATLAS geometry is set via jobOptions " );
208 ATH_MSG_INFO(
"Using cabling type " << m_cablingType <<
" from jobOptions " );
213 ATH_MSG_INFO(
"RUN4 ATLAS geometry flag detected for geometry: " << atlasVersion );
215 ATH_MSG_INFO(
"Cabling for RUN3 ATLAS geometry is set via jobOptions " );
220 ATH_MSG_INFO(
"Using cabling type " << m_cablingType <<
" from jobOptions " );
224 ATH_MSG_INFO(
"Cabling for RUN3 ATLAS geometry is set via jobOptions " );
226 ATH_MSG_INFO(
"Cabling for RUN2 (2014-2017) ATLAS geometry is set via jobOptions " );
228 ATH_MSG_INFO(
"Cabling for RUN2a (2018) ATLAS geometry is set via jobOptions " );
229 }
else if (ctb == 0) {
230 ATH_MSG_INFO(
"CTB geometry detected: " << atlasVersion );
232 }
else if (
geo == 0 ||
run1 == 0 || ibl == 0 ||
run2 == 0 || upg == 0) {
233 ATH_MSG_INFO(
"RUN1 ATLAS geometry detected: " << atlasVersion );
235 }
else if (
comm == 0) {
236 ATH_MSG_INFO(
"RUN1 ATLAS Commissioning geometry detected: " << atlasVersion );
239 ATH_MSG_WARNING(
"Old ATLAS geometry detected - most probably it's a mistake: " << atlasVersion );
248 ATH_MSG_INFO(
"Setting Cabling type to " << m_cablingType );
250 ATH_MSG_DEBUG(
"Maximum number of gains: " << m_cablingService->getMaxChannels());
255 if (m_detStore->retrieve(tileMgr).isFailure()) {
256 ATH_MSG_WARNING(
"Unable to retrieve TileDetDescrManager from DetectorStore" );
257 ATH_MSG_WARNING(
"Will not set Tile online hash ID in CaloDetDescrElements" );
262 IdContext chContext = tileHWID->channel_context();
269 int nchan = (tileID->is_tile_gapscin(cell_id)) ? 1 : 2;
272 bool disconnected =
true;
275 HWIdentifier hw1 = m_cablingService->s2h_channel_id(id1);
276 tileHWID->get_hash(hw1, pmtHash[
pmt], &chContext);
278 disconnected &= (
id2 != id1);
280 if (disconnected) m_disconnectedCells.push_back(cell_id);
284 && (pmtHash[0] != oldPmtHash[0] || pmtHash[1] != oldPmtHash[1])) {
287 <<
" id= " << tileID->to_string(cell_id, -2)
288 <<
" from (" << oldPmtHash[0] <<
"," << oldPmtHash[1]
289 <<
") to (" << pmtHash[0] <<
"," << pmtHash[1] <<
")" );
297 msg(
MSG::VERBOSE) <<
"cell_id " << tileID->to_string(cell_id, -2) <<
" ch_id";
299 msg(
MSG::VERBOSE) <<
" " << tileHWID->to_string(m_cablingService->s2h_channel_id(tileID->pmt_id(cell_id, 0)), -1);
304 msg(
MSG::VERBOSE) <<
" " << tileHWID->to_string(m_cablingService->s2h_channel_id(tileID->pmt_id(cell_id, 1)), -1);
314 ATH_MSG_VERBOSE(
"Total: " << m_disconnectedCells.size() <<
" disconnected cells");
320 std::cout <<
"===============================" << std::endl;
329 std::cout <<
" hw1=" << tileHWID->to_string(hwid1, -1);
330 Identifier id1 = m_cablingService->h2s_pmt_id(hwid1);
332 std::cout <<
" id1=" << tileID->to_string(id1, -1);
333 HWIdentifier hwid2 = m_cablingService->s2h_channel_id(id1);
335 if (hwid2 != hwid1) std::cout <<
" hw1!=hw2=" << tileHWID->to_string(hwid2, -1);
339 std::cout <<
" id1!=id2=" << tileID->to_string(
id2, -1);
340 else if (tileTBID->is_tiletb(id1))
341 std::cout << ((tileTBID->eta(id1)>1) ?
" E4'" :
" MBTS");
343 std::cout <<
" cell_hash " << tileID->cell_hash(tileID->cell_id(id1));
344 int drIdx2 = tileHWID->drawerIdx(hwid1);
345 if (drIdx1 != drIdx2) {
346 std::cout <<
" ERROR in drawer index " << drIdx1 <<
" != " << drIdx2
347 <<
" end-begin=" << (tileHWID->drawer_end() - tileHWID->drawer_begin())
348 << std::hex <<
" 0x" << hwid1 <<
" 0x"
349 << (*(tileHWID->drawer_begin() + drIdx1)) << std::dec;
351 std::cout <<
" drawer index " << drIdx2;
354 std::cout <<
" id2=invalid";
357 std::cout <<
" hw2=invalid";
360 std::cout <<
" id1=invalid";
363 std::cout <<
" hw1=invalid";
365 std::cout << std::endl;
371 std::cout <<
"=== D4 cells in special EB ====" << std::endl;
373 int d4module[4] = { 14, 15, 18, 19 };
375 for (
int imod = 0; imod < 4; ++imod) {
376 int module = d4module[imod] - 1;
381 std::cout <<
" id1=" << tileID->to_string(id1, -1);
382 HWIdentifier hw1 = m_cablingService->s2h_channel_id(id1);
384 std::cout <<
" hw1=" << tileHWID->to_string(hw1, -1);
387 if (
id2 != id1) std::cout <<
" id1!=id2=" << tileID->to_string(
id2, -1);
390 if (hw2 != hw1) std::cout <<
" hwid1!=hwid2=" << tileHWID->to_string(hw2, -1);
392 std::cout <<
" hw2=invalid";
395 std::cout <<
" id2=invalid";
398 std::cout <<
" hw1=invalid";
401 std::cout <<
" id1=invalid";
403 std::cout << std::endl;
409 std::cout <<
"=== C10 cells in special EB ===" << std::endl;
411 int c10module[8] = { 39, 40, 41, 42, 55, 56, 57, 58 };
413 for (
int imod = 0; imod < 8; ++imod) {
414 int module = c10module[imod] - 1;
419 std::cout <<
" id1=" << tileID->to_string(id1, -1);
420 HWIdentifier hw1 = m_cablingService->s2h_channel_id(id1);
422 std::cout <<
" hw1=" << tileHWID->to_string(hw1, -1);
425 if (
id2 != id1) std::cout <<
" id1!=id2=" << tileID->to_string(
id2, -1);
428 if (hw2 != hw1) std::cout <<
" hwid1!=hwid2=" << tileHWID->to_string(hw2, -1);
430 std::cout <<
" hw2=invalid";
433 std::cout <<
" id2=invalid";
436 std::cout <<
" hw1=invalid";
439 std::cout <<
" id1=invalid";
441 std::cout << std::endl;
447 std::cout <<
"========= E1 cells =========" << std::endl;
451 for (
int tower = 10; tower < 11; tower += 1) {
455 std::cout <<
" id1=" << tileID->to_string(id1, -1);
456 HWIdentifier hw1 = m_cablingService->s2h_channel_id(id1);
458 std::cout <<
" hw1=" << tileHWID->to_string(hw1, -1);
461 if (
id2 != id1) std::cout <<
" id1!=id2=" << tileID->to_string(
id2, -1);
464 if (hw2 != hw1) std::cout <<
" hwid1!=hwid2=" << tileHWID->to_string(hw2, -1);
466 std::cout <<
" hw2=invalid";
469 std::cout <<
" id2=invalid";
472 std::cout <<
" hw1=invalid";
475 std::cout <<
" id1=invalid";
477 std::cout << std::endl;
483 std::cout <<
"========= E2 cells =========" << std::endl;
487 for (
int tower = 11; tower < 12; tower += 1) {
491 std::cout <<
" id1=" << tileID->to_string(id1, -1);
492 HWIdentifier hw1 = m_cablingService->s2h_channel_id(id1);
494 std::cout <<
" hw1=" << tileHWID->to_string(hw1, -1);
497 if (
id2 != id1) std::cout <<
" id1!=id2=" << tileID->to_string(
id2, -1);
500 if (hw2 != hw1) std::cout <<
" hwid1!=hwid2=" << tileHWID->to_string(hw2, -1);
502 std::cout <<
" hw2=invalid";
505 std::cout <<
" id2=invalid";
508 std::cout <<
" hw1=invalid";
511 std::cout <<
" id1=invalid";
513 std::cout << std::endl;
519 std::cout <<
"========= E3,E4 cells =========" << std::endl;
523 for (
int tower = 13; tower < 16; tower += 2) {
527 std::cout <<
" id1=" << tileID->to_string(id1, -1);
528 HWIdentifier hw1 = m_cablingService->s2h_channel_id(id1);
530 std::cout <<
" hw1=" << tileHWID->to_string(hw1, -1);
533 if (
id2 != id1) std::cout <<
" id1!=id2=" << tileID->to_string(
id2, -1);
536 if (hw2 != hw1) std::cout <<
" hwid1!=hwid2=" << tileHWID->to_string(hw2, -1);
538 std::cout <<
" hw2=invalid";
541 std::cout <<
" id2=invalid";
544 std::cout <<
" hw1=invalid";
547 std::cout <<
" id1=invalid";
549 std::cout << std::endl;
555 std::cout <<
"========= MBTS cells ==========" << std::endl;
559 for (
int tower = 0; tower < 2; ++tower) {
563 std::cout <<
" id1=" << tileTBID->to_string(id1);
564 HWIdentifier hw1 = m_cablingService->s2h_channel_id(id1);
566 std::cout <<
" hw1=" << tileHWID->to_string(hw1, -1);
569 if (
id2 != id1) std::cout <<
" id1!=id2=" << tileTBID->to_string(
id2);
572 if (hw2 != hw1) std::cout <<
" hwid1!=hwid2=" << tileHWID->to_string(hw2, -1);
574 std::cout <<
" hw2=invalid";
577 std::cout <<
" id2=invalid";
580 std::cout <<
" hw1=invalid";
583 std::cout <<
" id1=invalid";
585 std::cout << std::endl;
593 std::cout <<
"========= E4' cells ==========" << std::endl;
597 for (
int tower = 2; tower < 3; ++tower) {
601 std::cout <<
" id1=" << tileTBID->to_string(id1);
602 HWIdentifier hw1 = m_cablingService->s2h_channel_id(id1);
604 std::cout <<
" hw1=" << tileHWID->to_string(hw1, -1);
607 if (
id2 != id1) std::cout <<
" id1!=id2=" << tileTBID->to_string(
id2);
610 if (hw2 != hw1) std::cout <<
" hwid1!=hwid2=" << tileHWID->to_string(hw2, -1);
612 std::cout <<
" hw2=invalid";
615 std::cout <<
" id2=invalid";
618 std::cout <<
" hw1=invalid";
621 std::cout <<
" id1=invalid";
623 std::cout << std::endl;
629 std::cout <<
"===============================" << std::endl;
634 return StatusCode::SUCCESS;