ATLAS Offline Software
SCT_ByteStreamErrorsTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
14 
16 #include "InDetIdentifier/SCT_ID.h"
18 #include "StoreGate/ReadHandle.h"
21 
23 SCT_ByteStreamErrorsTool::SCT_ByteStreamErrorsTool(const std::string& type, const std::string& name, const IInterface* parent) :
24  base_class(type, name, parent)
25 {
26 }
27 
31  ATH_CHECK(detStore()->retrieve(m_sct_id, "SCT_ID"));
33 
34  ATH_CHECK(m_config.retrieve());
35 
36  // Read (Cond)Handle Keys
40  for (auto badError : SCT_ByteStreamErrors::BadErrors) {
41  if (badError>=63) {
42  ATH_MSG_FATAL("Logic error: Error code too large and cannot represented as a bit.");
43  }
44  m_badErrorMask |= (1<<badError);
45  }
46 
47  return StatusCode::SUCCESS;
48 }
49 
53  return StatusCode::SUCCESS;
54 }
55 
57 
66 bool
69 }
70 
71 const IDCInDetBSErrContainer* SCT_ByteStreamErrorsTool::getContainer(const EventContext& ctx) const {
77  if (not idcErrCont.isValid()) {
79  if (m_nRetrievalFailure<=3) {
80  ATH_MSG_INFO("SCT_ByteStreamErrorsTool Failed to retrieve BS error container "
82  << " from StoreGate.");
83  if (m_nRetrievalFailure==3) {
84  ATH_MSG_INFO("SCT_ByteStreamErrorsTool This message on retrieval failure of " << m_bsIDCErrContainerName.key() << " is suppressed.");
85  }
86  }
87  return nullptr;
88  }
89  ATH_MSG_VERBOSE("SCT_ByteStreamErrorsTool IDC Container fetched " << m_bsIDCErrContainerName.key());
90  return idcErrCont.cptr();
91 }
92 
95  IDCCacheEntry* cacheEntry{m_eventCache.get(ctx)};
96  if (cacheEntry->needsUpdate(ctx)) {
97  const auto *idcErrContPtr{getContainer(ctx)};
98  if (idcErrContPtr == nullptr) { // missing or not, the cache needs to be reset
99  cacheEntry->reset(ctx.evt(), nullptr);
100  } else {
101  cacheEntry->reset(ctx.evt(), idcErrContPtr->cache());
102  }
103  ATH_MSG_VERBOSE("SCT_ByteStreamErrorsTool Cache for the event reset " << cacheEntry->eventId << " with IDC container" << idcErrContPtr);
104  }
105  return cacheEntry;
106 }
107 
112 bool
113 SCT_ByteStreamErrorsTool::isGood(const IdentifierHash& elementIdHash, const EventContext& ctx) const {
114  {
115 
116  std::scoped_lock<std::mutex> lock{*m_cacheMutex.get(ctx)};
117  ATH_MSG_VERBOSE("SCT_ByteStreamErrorsTool isGood called for " << elementIdHash);
118  const auto *idcCachePtr{getCacheEntry(ctx)->IDCCache};
119  if (idcCachePtr == nullptr) {
120  ATH_MSG_VERBOSE("SCT_ByteStreamErrorsTool No cache! ");
121  return true;
122  }
123 
124  auto errorCode{idcCachePtr->retrieve(elementIdHash)};
125 
126  for (auto badError : SCT_ByteStreamErrors::BadErrors) {
127  if (errorCode == badError) {
128  ATH_MSG_VERBOSE("SCT_ByteStreamErrorsTool Bad Error " << errorCode << " for ID " << elementIdHash);
129  return false;
130  }
131  }
132  } // end of cache operations protection via m_cacheMutex, following code has own protection
133 
134  // If all 6 chips of a link issue ABCD errors or are bad chips or temporarily masked chips, the link is treated as bad one.
135  const Identifier wafer_id{m_sct_id->wafer_id(elementIdHash)};
136  const Identifier module_id{m_sct_id->module_id(wafer_id)};
137  unsigned int badChips{m_config->badChips(module_id, ctx)};
138  unsigned int v_abcdErrorChips{abcdErrorChips(module_id, ctx)};
139  unsigned int v_tempMaskedChips{tempMaskedChips(module_id, ctx)};
140  const int side{m_sct_id->side(wafer_id)};
141  bool allChipsBad{true};
142  const int chipMax{static_cast<short>(side==0 ? N_CHIPS_PER_SIDE : N_CHIPS_PER_SIDE*N_SIDES)};
143  for (int chip{chipMax-N_CHIPS_PER_SIDE}; chip<chipMax; chip++) {
144  bool issueABCDError{((v_abcdErrorChips >> chip) & 0x1) != 0};
145  bool isBadChip{((badChips >> chip) & 0x1) != 0};
146  bool isTempMaskedChip{((v_tempMaskedChips >> chip) & 0x1) != 0};
147  allChipsBad = (issueABCDError or isBadChip or isTempMaskedChip);
148  if (not allChipsBad) break;
149  }
150  return !allChipsBad;
151 }
152 
153 namespace {
154  unsigned int getValueOrZero(const std::unordered_map<size_t, unsigned int> &map, size_t key) {
155  std::unordered_map<size_t, unsigned int>::const_iterator iter = map.find(key);
156  return iter != map.end() ? iter->second : 0;
157  }
158 }
159 
160 
161 void
164  std::scoped_lock<std::mutex> lock{*m_cacheMutex.get(ctx)};
165 
166  const auto *idcCachePtr{getCacheEntry(ctx)};
167  if (idcCachePtr == nullptr || !idcCachePtr->IDCCache) {
168  ATH_MSG_VERBOSE("SCT_ByteStreamErrorsTool No cache! ");
169  return;
170  }
171  if (whandle) {
172  ATH_MSG_ERROR("SCT_ByteStreamErrorsTool is not for conditions objects");
174  }
175 
176  if (fillData(ctx).isFailure()) {
177  return; // @TODO what is the correct way to handle this ? set status to false for all ?
178  }
179 
180  std::vector<bool> &status = element_status.getElementStatus();
181  std::vector<InDet::ChipFlags_t> &chip_status = element_status.getElementChipStatus();
182  if (status.empty()) {
183  status.resize(idcCachePtr->IDCCache->rawReadAccess().size(),true);
184  }
186  if (not si_element_list.isValid()) {
187  std::stringstream msg;
188  msg << "Failed to get SCT detector element collection with key " << m_SCTDetEleCollKey.key();
189  throw std::runtime_error(msg.str());
190  }
191  if (whandle) {
192  whandle->addDependency (si_element_list);
193  }
194 
195  constexpr InDet::ChipFlags_t all_flags_set = static_cast<InDet::ChipFlags_t>((1ul<<(N_CHIPS_PER_SIDE)) - 1ul);
196  static_assert( (1ul<<(N_CHIPS_PER_SIDE*N_SIDES)) - 1ul <= std::numeric_limits<InDet::ChipFlags_t>::max());
197  if (chip_status.empty()) {
198  chip_status.resize(status.size(), all_flags_set);
199  }
200  unsigned int element_i=0;
201  for ( const auto &val : idcCachePtr->IDCCache->rawReadAccess()) {
203  bool is_bad=(error_code<63) && ((1ull<<error_code) & m_badErrorMask);
204  status.at(element_i) = status.at(element_i) & not is_bad;
205  if ( is_bad ) {
206  ATH_MSG_VERBOSE("SCT_ByteStreamErrorsTool Bad Error " << error_code << " for ID " << element_i);
207  }
208  else {
209  IdentifierHash hash(element_i);
210  const InDetDD::SiDetectorElement *siElement = si_element_list->getDetectorElement(hash);
211  const Identifier wafer_id{m_sct_id->wafer_id(hash)};
212  const Identifier module_id{m_sct_id->module_id(wafer_id)};
213  size_t modhash = static_cast<size_t>(module_id.get_compact());
214 
215  unsigned int badChips{m_config->badChips(module_id, ctx)}; // @todo only call once for all
216  unsigned int v_abcdErrorChips{ getValueOrZero( idcCachePtr->abcdErrorChips, modhash) };
217  unsigned int v_tempMaskedChips{ getValueOrZero( idcCachePtr->tempMaskedChips, modhash) };
218  const int side{m_sct_id->side(wafer_id)};
219  bool allChipsBad{true};
220  const int chipMax{static_cast<short>(side==0 ? N_CHIPS_PER_SIDE : N_CHIPS_PER_SIDE*N_SIDES)};
221  InDet::ChipFlags_t bad_chip_flags = 0;
222  for (int chip{chipMax-N_CHIPS_PER_SIDE}; chip<chipMax; chip++) {
223  bool issueABCDError{((v_abcdErrorChips >> chip) & 0x1) != 0};
224  bool isBadChip{((badChips >> chip) & 0x1) != 0};
225  bool isTempMaskedChip{((v_tempMaskedChips >> chip) & 0x1) != 0};
226  bool isBad = (issueABCDError or isBadChip or isTempMaskedChip);
227  bad_chip_flags |= static_cast<InDet::ChipFlags_t>(isBad) << SCT::getGeometricalFromPhysicalChipID(side, siElement->swapPhiReadoutDirection(), chip);
228  allChipsBad &= isBad;
229  }
230  status.at(element_i) = status.at(element_i) & not allChipsBad;
231  chip_status.at(element_i) &= (~bad_chip_flags) & all_flags_set;
232  }
233 
234  ++element_i;
235  }
236 }
237 
238 
239 bool
241  const EventContext& ctx{Gaudi::Hive::currentContext()};
242 
243  return isGood(elementIdHash, ctx);
244 }
245 
246 bool
247 SCT_ByteStreamErrorsTool::isGood(const Identifier& elementId, const EventContext& ctx, InDetConditions::Hierarchy h) const {
248  if (not canReportAbout(h)) return true;
249 
251  const IdentifierHash elementIdHash{m_sct_id->wafer_hash(elementId)};
252  return isGood(elementIdHash, ctx);
253  }
255  return isGoodChip(elementId, ctx);
256  }
257 
258  return true;
259 }
260 
261 bool
263  const EventContext& ctx{Gaudi::Hive::currentContext()};
264  return isGood(elementId, ctx, h);
265 }
266 
267 bool
268 SCT_ByteStreamErrorsTool::isGoodChip(const Identifier& stripId, const EventContext& ctx) const {
269  // This check assumes present SCT.
270  // Get module number
271  const Identifier moduleId{m_sct_id->module_id(stripId)};
272  if (not moduleId.is_valid()) {
273  ATH_MSG_WARNING("moduleId obtained from stripId " << stripId << " is invalid.");
274  return false;
275  }
276 
277  // tempMaskedChips and abcdErrorChips hold 12 bits.
278  // bit 0 (LSB) is chip 0 for side 0.
279  // bit 5 is chip 5 for side 0.
280  // bit 6 is chip 6 for side 1.
281  // bit 11 is chip 11 for side 1.
282  // Temporarily masked chip information
283  const unsigned int v_tempMaskedChips{tempMaskedChips(moduleId, ctx)};
284  // Information of chips with ABCD errors
285  const unsigned int v_abcdErrorChips{abcdErrorChips(moduleId, ctx)};
286  // Take 'OR' of tempMaskedChips and abcdErrorChips
287  const unsigned int badChips{v_tempMaskedChips | v_abcdErrorChips};
288 
289  // If there is no bad chip, this check is done.
290  if (badChips==0) return true;
291 
292  const int side{m_sct_id->side(stripId)};
293  // Check the six chips on the side
294  // 0x3F = 0000 0011 1111
295  // 0xFC0 = 1111 1100 0000
296  // If there is no bad chip on the side, this check is done.
297  if ((side==0 and (badChips & 0x3F)==0) or (side==1 and (badChips & 0xFC0)==0)) return true;
298 
299  int chip{getChip(stripId, ctx)};
300  if (chip<0 or chip>=12) {
301  ATH_MSG_WARNING("chip number is invalid: " << chip);
302  return false;
303  }
304 
305  // Check if the chip is bad
306  const bool badChip{static_cast<bool>(badChips & (1<<chip))};
307 
308  return (not badChip);
309 }
310 
311 int
312 SCT_ByteStreamErrorsTool::getChip(const Identifier& stripId, const EventContext& ctx) const {
313  const Identifier waferId{m_sct_id->wafer_id(stripId)};
314  const IdentifierHash waferHash{m_sct_id->wafer_hash(waferId)};
315  const InDetDD::SiDetectorElement* siElement{getDetectorElement(waferHash, ctx)};
316  if (siElement==nullptr) {
317  ATH_MSG_DEBUG ("InDetDD::SiDetectorElement is not obtained from stripId " << stripId);
318  return -1;
319  }
320  return SCT::getChip(*m_sct_id, *siElement, stripId);
321 }
322 
324 
330 std::set<IdentifierHash>
331 SCT_ByteStreamErrorsTool::getErrorSet(int errorType, const EventContext& ctx) const {
332  ATH_MSG_VERBOSE("SCT_ByteStreamErrorsTool getErrorSet " << errorType);
333  std::set<IdentifierHash> result;
334  if (errorType>=0 and errorType<SCT_ByteStreamErrors::NUM_ERROR_TYPES) {
335  const auto *idcErrCont{getContainer(ctx)};
336  if (idcErrCont != nullptr) {
337  const std::set<size_t>& Mask = idcErrCont->getMask();
338  const auto& raw = idcErrCont->wholeEventReadAccess();
339  for (const size_t hashId : Mask) {
340  auto errCode = raw[hashId].load(std::memory_order_relaxed);
341  if (SCT_ByteStreamErrors::hasError(errCode, static_cast<SCT_ByteStreamErrors::ErrorType>(errorType))) {
342  result.insert(hashId);
343  }
344  }
345  }
346  }
347  return result;
348 }
349 
350 std::set<IdentifierHash>
352  const EventContext& ctx{Gaudi::Hive::currentContext()};
353  return getErrorSet(errorType, ctx);
354 }
355 
357 
363 SCT_ByteStreamErrorsTool::fillData(const EventContext& ctx) const {
364  ATH_MSG_VERBOSE("SCT_ByteStreamErrorsTool fillData");
365 
366  const IDCInDetBSErrContainer* idcErrCont{getContainer(ctx)};
367  if (idcErrCont == nullptr) {
368  ATH_MSG_VERBOSE("idcErrCont == nullptr");
369  return StatusCode::SUCCESS;
370  }
371 
372  auto *cacheEntry{getCacheEntry(ctx)};
373 
374  unsigned int idcErrCont_set_number = idcErrCont->numberSet();
375 
376  if (cacheEntry->m_set_number == idcErrCont_set_number){
377  ATH_MSG_VERBOSE("Same set number found, skip the next steps.");
378  return StatusCode::SUCCESS;
379  }else{
380  cacheEntry->m_set_number = idcErrCont_set_number; //update the set number in cacheEntry.
381  }
382 
386  ATH_MSG_VERBOSE("SCT_ByteStreamErrorsTool size of error container is " << idcErrCont->maxSize());
387  const std::vector<std::pair<size_t, uint64_t>> errorcodesforView{idcErrCont->getAll()};
388 
389  for (const auto& [ hashId, errCode ] : errorcodesforView) {
390 
391  Identifier wafer_id{m_sct_id->wafer_id(hashId)};
392  Identifier module_id{m_sct_id->module_id(wafer_id)};
393  size_t hash = static_cast<size_t>(module_id.get_compact());
394  if (errCode == uint64_t{0}) {
395  // That means this hashId was decoded but had no error
396  // In such case we want to fill the cache also with zero so we do not have to fill the cache again for a given view
397  // (see logic in: getErrorCodeWithCacheUpdate)
398  // Note: invocation of the [] operator on the map will create missing entry and set the value to default (here 0)
399  cacheEntry->abcdErrorChips[ hash ];
400  cacheEntry->tempMaskedChips[ hash ];
401  continue;
402  }
403 
404 
405  ATH_MSG_VERBOSE("SCT_ByteStreamErrorsTool filling event cache for module " << module_id << " ec " << errCode);
406 
407  const int side{m_sct_id->side(m_sct_id->wafer_id(hashId))};
408  // Each bit of errCode represents each SCT_ByteStreamErrors for one wafer
409  // Multiple bits can be true.
410  // Convert errCode to 12 bits of abcdErrorChips and 12 bits of tempMaskedChips for one module (=two wafers).
411  IDCInDetBSErrContainer::ErrorCode v_abcdErrorChips{errCode & SCT_ByteStreamErrors::ABCDErrorMask()};
412  if (v_abcdErrorChips) {
413  v_abcdErrorChips >>= SCT_ByteStreamErrors::ABCDError_Chip0; // bit 0 (5) is for chip 0 (5) for both sides
414  v_abcdErrorChips <<= (side*N_CHIPS_PER_SIDE); // bit 0 (6) is for chip 0 on side 0 (1)
415  cacheEntry->abcdErrorChips[hash] |= v_abcdErrorChips;
416  } else {
417  cacheEntry->abcdErrorChips[hash] = 0;
418  }
419  IDCInDetBSErrContainer::ErrorCode v_tempMaskedChips{errCode & SCT_ByteStreamErrors::TempMaskedChipsMask()};
420  if (v_tempMaskedChips) {
421  v_tempMaskedChips >>= SCT_ByteStreamErrors::TempMaskedChip0; // bit 0 (5) is for chip 0 (5) for both sides0
422  v_tempMaskedChips <<= (side*N_CHIPS_PER_SIDE); // bit 0 (6) is for chip 0 on side 0 (1)
423  cacheEntry->tempMaskedChips[hash] |= v_tempMaskedChips;
424  } else {
425  cacheEntry->tempMaskedChips[hash] = 0;
426  }
427 
428  }
429 
430  return StatusCode::SUCCESS;
431 }
432 
434 
435 unsigned int SCT_ByteStreamErrorsTool::tempMaskedChips(const Identifier& moduleId, const EventContext& ctx) const {
436  ATH_MSG_VERBOSE("SCT_ByteStreamErrorsTool tempMaskedChips");
437  std::scoped_lock<std::mutex> lock{*m_cacheMutex.get(ctx)};
438  auto *cacheEntry{getCacheEntry(ctx)};
439  if (cacheEntry->IDCCache == nullptr) {
440  ATH_MSG_VERBOSE("cacheEntry->IDCCache == nullptr");
441  return 0;
442  }
443 
444  auto [status, v_tempMaskedChips] = getErrorCodeWithCacheUpdate(moduleId, ctx, cacheEntry->tempMaskedChips);
445  if (status.isFailure()) {
446  ATH_MSG_ERROR("SCT_ByteStreamErrorsTool Failure getting temp masked chip errors");
447  }
448  return v_tempMaskedChips; // 12 bits are used.
449  // Bit 0 is for chip 0 on side 0, bit 1 is for chip 1 on side 0, ..., and bit 11 is for chip 5 on side 1
450 }
451 
452 unsigned int SCT_ByteStreamErrorsTool::tempMaskedChips(const Identifier& moduleId) const {
453  const EventContext& ctx{Gaudi::Hive::currentContext()};
454  return tempMaskedChips(moduleId, ctx);
455 }
456 
457 unsigned int SCT_ByteStreamErrorsTool::abcdErrorChips(const Identifier& moduleId, const EventContext& ctx) const {
458  ATH_MSG_VERBOSE("SCT_ByteStreamErrorsTool abcdErrorChips");
459  std::scoped_lock<std::mutex> lock{*m_cacheMutex.get(ctx)};
460  auto *cacheEntry{getCacheEntry(ctx)};
461  if (cacheEntry->IDCCache == nullptr) {
462  ATH_MSG_VERBOSE("cacheEntry->IDCCache == nullptr");
463  return 0;
464  }
465 
466  auto [status, v_abcdErrorChips] = getErrorCodeWithCacheUpdate(moduleId, ctx, cacheEntry->abcdErrorChips);
467  if (status.isFailure()) {
468  ATH_MSG_ERROR("SCT_ByteStreamErrorsTool Failure getting ABCD chip errors");
469  }
470  return v_abcdErrorChips; // 12 bits are used.
471  // Bit 0 is for chip 0 on side 0, bit 1 is for chip 1 on side 0, ..., and bit 11 is for chip 5 on side 1
472 }
473 
474 unsigned int SCT_ByteStreamErrorsTool::abcdErrorChips(const Identifier& moduleId) const {
475  const EventContext& ctx{Gaudi::Hive::currentContext()};
476  return abcdErrorChips(moduleId, ctx);
477 }
478 
479 std::pair<StatusCode, unsigned int> SCT_ByteStreamErrorsTool::getErrorCodeWithCacheUpdate(const Identifier& moduleId, const EventContext& ctx,
480  std::unordered_map<size_t, unsigned int>& whereExected) const {
481  ATH_MSG_VERBOSE("SCT_ByteStreamErrorsTool getErrorCodeWithCacheUpdate " << moduleId);
482  size_t modhash = static_cast<size_t>(moduleId.get_compact());
483  auto it{whereExected.find(modhash)};
484  if (it != whereExected.end()) return std::make_pair(StatusCode::SUCCESS, it->second);
485 
486  // even if there are no errors for this module at all filled
487  // we want the entry of value 0 so we know we walked over it and do not need to invoke filling again
488  // and and do not need to do it again
489 
490  auto *cacheEntry{getCacheEntry(ctx)};
491  cacheEntry->abcdErrorChips[modhash] = 0;
492  cacheEntry->tempMaskedChips[modhash] = 0;
493 
494  // the content is missing, look for actual errors
495  StatusCode sc{fillData(ctx)};
496  if (sc.isFailure()) {
497  return std::make_pair(StatusCode::FAILURE, 0);
498  }
499  // handle situation when the cache does not contain desired datum after the update
500  it = whereExected.find(modhash);
501  if (it == whereExected.end()) {
502  ATH_MSG_ERROR("After fillData in abcdErrorChips, cache does not have an infomation about the " << moduleId);
503  ATH_MSG_ERROR("Likely cause is a request for for different region");
504  return std::make_pair(StatusCode::FAILURE, 0);
505  }
506  return std::make_pair(StatusCode::SUCCESS, it->second);
507 }
508 
509 const InDetDD::SiDetectorElement* SCT_ByteStreamErrorsTool::getDetectorElement(const IdentifierHash& waferHash, const EventContext& ctx) const {
511  if (not condData.isValid()) return nullptr;
512  return condData->getDetectorElement(waferHash);
513 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
SCT_ByteStreamErrorsTool::m_config
ToolHandle< ISCT_ConfigurationConditionsTool > m_config
Definition: SCT_ByteStreamErrorsTool.h:97
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
SCT_ByteStreamErrorsTool::finalize
virtual StatusCode finalize() override
Finalize.
Definition: SCT_ByteStreamErrorsTool.cxx:52
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
SCT_ID.h
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
InDet::SiDetectorElementStatus::getElementStatus
const std::vector< bool > & getElementStatus() const
Definition: SiDetectorElementStatus.h:116
SCT_ByteStreamErrorsTool::getErrorSet
virtual std::set< IdentifierHash > getErrorSet(int errorType, const EventContext &ctx) const override
The accessor method that can be used by clients to retrieve a set of IdHashes of wafers with a given ...
Definition: SCT_ByteStreamErrorsTool.cxx:331
get_generator_info.result
result
Definition: get_generator_info.py:21
max
#define max(a, b)
Definition: cfImp.cxx:41
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
InDetConditions::SCT_CHIP
@ SCT_CHIP
Definition: InDetHierarchy.h:14
SCT_DetectorElementStatus.h
SCT_ChipUtils.h
IDCInDetBSErrContainer
IDC like storage for BS errors, TODO, customise implementation further so that we store int rather th...
Definition: IDCInDetBSErrContainer.h:19
SCT::getChip
constexpr unsigned int getChip(unsigned int side, bool swap, unsigned int strip)
Get the physical chip ID for the given strip.
Definition: SCT_ChipUtils.h:26
skel.it
it
Definition: skel.GENtoEVGEN.py:423
SCT_ByteStreamErrorsTool::abcdErrorChips
virtual unsigned int abcdErrorChips(const Identifier &moduleId) const override
Definition: SCT_ByteStreamErrorsTool.cxx:474
SCT_ByteStreamErrorsTool::isGoodChip
bool isGoodChip(const Identifier &stripId, const EventContext &ctx) const
Definition: SCT_ByteStreamErrorsTool.cxx:268
SCT_ByteStreamErrorsTool.h
SCT_ByteStreamErrorsTool::getChip
int getChip(const Identifier &stripId, const EventContext &ctx) const
Definition: SCT_ByteStreamErrorsTool.cxx:312
InDetConditions::Hierarchy
Hierarchy
Definition: InDetHierarchy.h:14
SCT_ByteStreamErrorsTool::m_sct_id
const SCT_ID * m_sct_id
Definition: SCT_ByteStreamErrorsTool.h:103
SCT_ByteStreamErrorsTool::tempMaskedChips
virtual unsigned int tempMaskedChips(const Identifier &moduleId, const EventContext &ctx) const override
Definition: SCT_ByteStreamErrorsTool.cxx:435
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
SCT_ID::module_id
Identifier module_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
Definition: SCT_ID.h:416
SCT_ByteStreamErrorsTool::canReportAbout
virtual bool canReportAbout(InDetConditions::Hierarchy h) const override
Used by ConditionsSummayTool to decide whether to call isGood() for a particular detector element.
Definition: SCT_ByteStreamErrorsTool.cxx:67
SCT_ByteStreamErrorsTool::m_badErrorMask
uint64_t m_badErrorMask
Definition: SCT_ByteStreamErrorsTool.h:105
SCT_ByteStreamErrorsTool::IDCCacheEntry
Definition: SCT_ByteStreamErrorsTool.h:108
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
TRT::Hit::side
@ side
Definition: HitInfo.h:83
SCT_ByteStreamErrorsTool::m_cntx_sct
IdContext m_cntx_sct
Definition: SCT_ByteStreamErrorsTool.h:104
SCT_ByteStreamErrorsTool::IDCCacheEntry::IDCCache
const IDCInDetBSErrContainer_Cache * IDCCache
Definition: SCT_ByteStreamErrorsTool.h:110
SCT_ByteStreamErrorsTool::isGood
virtual bool isGood(const Identifier &elementId, InDetConditions::Hierarchy h=InDetConditions::DEFAULT) const override
Is the detector element good?
Definition: SCT_ByteStreamErrorsTool.cxx:262
SCT::getGeometricalFromPhysicalChipID
constexpr unsigned int getGeometricalFromPhysicalChipID(unsigned int side, bool swap, unsigned int physical_chip_id)
Get the geometrical chip ID from a physica chip ID.
Definition: SCT_ChipUtils.h:91
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
SCT_ByteStreamErrorsTool::getDetectorElementStatus
virtual void getDetectorElementStatus(const EventContext &ctx, InDet::SiDetectorElementStatus &element_status, SG::WriteCondHandle< InDet::SiDetectorElementStatus > *whandle) const override
Definition: SCT_ByteStreamErrorsTool.cxx:162
InDet::SiDetectorElementStatus
Definition: SiDetectorElementStatus.h:62
SCT_ByteStreamErrorsTool::getErrorCodeWithCacheUpdate
std::pair< StatusCode, unsigned int > getErrorCodeWithCacheUpdate(const Identifier &id, const EventContext &ctx, std::unordered_map< size_t, unsigned int > &whereExected) const
Method that returns BS Error code from the map passed @rag where-Expected If the information is initi...
Definition: SCT_ByteStreamErrorsTool.cxx:479
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
InDetDD::SiDetectorElement::swapPhiReadoutDirection
bool swapPhiReadoutDirection() const
Determine if readout direction between online and offline needs swapping.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
SCT_ByteStreamErrorsTool::IDCCacheEntry::abcdErrorChips
std::unordered_map< size_t, unsigned int > abcdErrorChips
Definition: SCT_ByteStreamErrorsTool.h:117
IDetectorElementStatusTool::getInvalidRange
static EventIDRange getInvalidRange()
Definition: IDetectorElementStatusTool.h:33
test_pyathena.parent
parent
Definition: test_pyathena.py:15
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SCT_ID::wafer_context
IdContext wafer_context(void) const
Definition: SCT_ID.h:705
SCT_ID::wafer_hash
IdentifierHash wafer_hash(const Identifier &wafer_id) const
wafer hash from id - optimized
Definition: SCT_ID.h:492
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
IDCInDetBSErrContainer::ErrorCode
uint64_t ErrorCode
Definition: IDCInDetBSErrContainer.h:21
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SCT_ByteStreamErrorsTool::getCacheEntry
IDCCacheEntry * getCacheEntry(const EventContext &ctx) const
Return cache for the current event If, for current slot, the cache is outdated it is retrieved from t...
Definition: SCT_ByteStreamErrorsTool.cxx:94
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
SCT_ByteStreamErrorsTool::initialize
virtual StatusCode initialize() override
Initialize.
Definition: SCT_ByteStreamErrorsTool.cxx:30
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
SCT_ByteStreamErrors::ErrorType
ErrorType
SCT byte stream error type enums used in SCT_RodDecoder, SCT_ByteStreamErrorsTool,...
Definition: SCT_ByteStreamErrors.h:178
SCT_ByteStreamErrorsTool::SCT_ByteStreamErrorsTool
SCT_ByteStreamErrorsTool(const std::string &type, const std::string &name, const IInterface *parent)
header file for this class.
Definition: SCT_ByteStreamErrorsTool.cxx:23
IDetectorElementStatusTool.h
SCT_ByteStreamErrorsTool::fillData
StatusCode fillData(const EventContext &ctx) const
Updates information per module & ABCD chip.
Definition: SCT_ByteStreamErrorsTool.cxx:363
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
SiDetectorElement.h
SCT_ByteStreamErrorsTool::m_bsIDCErrContainerName
SG::ReadHandleKey< IDCInDetBSErrContainer > m_bsIDCErrContainerName
Definition: SCT_ByteStreamErrorsTool.h:100
SCT_ByteStreamErrorsTool::getContainer
const IDCInDetBSErrContainer * getContainer(const EventContext &ctx) const
Obtains container form the SG, if it is missing it will complain (hard-coded 3 times per job) and ret...
Definition: SCT_ByteStreamErrorsTool.cxx:71
SCT_ByteStreamErrorsTool::m_nRetrievalFailure
std::atomic_uint m_nRetrievalFailure
Definition: SCT_ByteStreamErrorsTool.h:142
IdentifiableValueContainer::getMask
const std::set< size_t > & getMask() const
Definition: IdentifiableValueContainer.h:79
h
Identifier::get_compact
value_type get_compact(void) const
Get the compact id.
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
SCT_FlaggedCondEnum::NUM_ERROR_TYPES
@ NUM_ERROR_TYPES
Definition: SCT_FlaggedCondEnum.h:28
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
InDet::SiDetectorElementStatus::getElementChipStatus
const std::vector< ChipFlags_t > & getElementChipStatus() const
Definition: SiDetectorElementStatus.h:118
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
SCT_ByteStreamErrorsTool::N_CHIPS_PER_SIDE
@ N_CHIPS_PER_SIDE
Definition: SCT_ByteStreamErrorsTool.h:95
SCT_ByteStreamErrorsTool::m_SCTDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_SCTDetEleCollKey
Definition: SCT_ByteStreamErrorsTool.h:101
LArHVGainsPredictor.error_code
error_code
Definition: LArHVGainsPredictor.py:229
SCT_ByteStreamErrorsTool::getDetectorElement
const InDetDD::SiDetectorElement * getDetectorElement(const IdentifierHash &waferHash, const EventContext &ctx) const
Definition: SCT_ByteStreamErrorsTool.cxx:509
InDet::ChipFlags_t
unsigned short ChipFlags_t
Definition: SiDetectorElementStatus.h:60
SCT_ID::side
int side(const Identifier &id) const
Definition: SCT_ID.h:752
SCT_ByteStreamErrorsTool::N_SIDES
@ N_SIDES
Definition: SCT_ByteStreamErrorsTool.h:95
merge.status
status
Definition: merge.py:17
ReadHandle.h
Handle class for reading from StoreGate.
SCT_ID::wafer_id
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side) const
For a single side of module.
Definition: SCT_ID.h:464
IdentifierHash
Definition: IdentifierHash.h:38
InDetConditions::SCT_SIDE
@ SCT_SIDE
Definition: InDetHierarchy.h:14
SG::WriteCondHandle
Definition: WriteCondHandle.h:26
SCT_Monitoring::badError
@ badError
Definition: SCT_MonitoringNumbers.h:63
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
SG::WriteCondHandle::addDependency
void addDependency(const EventIDRange &range)
Definition: WriteCondHandle.h:275
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37