Skip to content
Snippets Groups Projects
Commit a0c933e0 authored by Adam Edward Barton's avatar Adam Edward Barton
Browse files

Merge branch 'master-SCT_ByteStreamErrorsTool' into 'master'

Coding style unification of (I)SCT_ByteStreamErrrosTool

See merge request atlas/athena!33778
parents 77ee0a8e c92d0afc
No related branches found
No related tags found
No related merge requests found
// -*- C++ -*- // -*- C++ -*-
/* /*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/ */
/** /**
...@@ -30,20 +30,26 @@ class IdentifierHash; ...@@ -30,20 +30,26 @@ class IdentifierHash;
**/ **/
namespace SCT_ByteStreamErrors { namespace SCT_ByteStreamErrors {
//!< @brief for cases when error doe snot need to be accumulated //!< @brief for cases when error doe snot need to be accumulated
inline IDCInDetBSErrContainer::ErrorCode makeError( ErrorType errType ) { return IDCInDetBSErrContainer::ErrorCode{1} << errType; } inline IDCInDetBSErrContainer::ErrorCode makeError(ErrorType errType) {
return IDCInDetBSErrContainer::ErrorCode{1} << errType;
}
//!< @brief helper to be used in clients to fetch error information //!< @brief helper to be used in clients to fetch error information
inline bool hasError(IDCInDetBSErrContainer::ErrorCode errWord, ErrorType errType ) { return errWord & makeError( errType ); } inline bool hasError(IDCInDetBSErrContainer::ErrorCode errWord, ErrorType errType) {
return errWord & makeError(errType);
}
//!< @brief helper to set the error: @example errors[hashId] = addError( errors[hashId], PixelByteStreamErrors::Invalid ) //!< @brief helper to set the error: @example errors[hashId] = addError(errors[hashId], SCT_ByteStreamErrors::BCIDError)
inline void addError(IDCInDetBSErrContainer::ErrorCode& errWord, ErrorType errType ) { errWord |= makeError( errType ); } inline void addError(IDCInDetBSErrContainer::ErrorCode& errWord, ErrorType errType) {
errWord |= makeError(errType);
}
} }
class ISCT_ByteStreamErrorsTool: virtual public ISCT_ConditionsTool { class ISCT_ByteStreamErrorsTool: virtual public ISCT_ConditionsTool {
public: public:
//@name Tool methods //@name Tool methods
//@{ //@{
...@@ -63,7 +69,7 @@ class ISCT_ByteStreamErrorsTool: virtual public ISCT_ConditionsTool { ...@@ -63,7 +69,7 @@ class ISCT_ByteStreamErrorsTool: virtual public ISCT_ConditionsTool {
virtual unsigned int abcdErrorChips(const Identifier& moduleId) const =0; virtual unsigned int abcdErrorChips(const Identifier& moduleId) const =0;
virtual unsigned int abcdErrorChips(const Identifier& moduleId, const EventContext& ctx) const =0; virtual unsigned int abcdErrorChips(const Identifier& moduleId, const EventContext& ctx) const =0;
private: private:
}; };
......
...@@ -25,24 +25,16 @@ SCT_ByteStreamErrorsTool::SCT_ByteStreamErrorsTool(const std::string& type, cons ...@@ -25,24 +25,16 @@ SCT_ByteStreamErrorsTool::SCT_ByteStreamErrorsTool(const std::string& type, cons
/** Initialize */ /** Initialize */
StatusCode StatusCode
SCT_ByteStreamErrorsTool::initialize() { SCT_ByteStreamErrorsTool::initialize() {
StatusCode sc = detStore()->retrieve(m_sct_id, "SCT_ID") ; ATH_CHECK(detStore()->retrieve(m_sct_id, "SCT_ID"));
if (sc.isFailure()) {
ATH_MSG_FATAL("Cannot retrieve SCT ID helper!");
return StatusCode::FAILURE;
}
m_cntx_sct = m_sct_id->wafer_context(); m_cntx_sct = m_sct_id->wafer_context();
sc = m_config.retrieve(); ATH_CHECK(m_config.retrieve());
if (sc.isFailure()) {
ATH_MSG_FATAL("Cannot retrieve ConfigurationConditionsTool!");
return StatusCode::FAILURE;
}
// Read (Cond)Handle Keys // Read (Cond)Handle Keys
ATH_CHECK(m_bsIDCErrContainerName.initialize()); ATH_CHECK(m_bsIDCErrContainerName.initialize());
ATH_CHECK(m_SCTDetEleCollKey.initialize()); ATH_CHECK(m_SCTDetEleCollKey.initialize());
return sc; return StatusCode::SUCCESS;
} }
/** Finalize */ /** Finalize */
...@@ -76,29 +68,29 @@ const IDCInDetBSErrContainer* SCT_ByteStreamErrorsTool::getContainer(const Event ...@@ -76,29 +68,29 @@ const IDCInDetBSErrContainer* SCT_ByteStreamErrorsTool::getContainer(const Event
m_nRetrievalFailure++; m_nRetrievalFailure++;
if (m_nRetrievalFailure<=3) { if (m_nRetrievalFailure<=3) {
ATH_MSG_INFO("SCT_ByteStreamErrorsTool Failed to retrieve BS error container " ATH_MSG_INFO("SCT_ByteStreamErrorsTool Failed to retrieve BS error container "
<< m_bsIDCErrContainerName.key() << m_bsIDCErrContainerName.key()
<< " from StoreGate."); << " from StoreGate.");
if (m_nRetrievalFailure==3) { if (m_nRetrievalFailure==3) {
ATH_MSG_INFO("SCT_ByteStreamErrorsTool This message on retrieval failure of " << m_bsIDCErrContainerName.key() << " is suppressed."); ATH_MSG_INFO("SCT_ByteStreamErrorsTool This message on retrieval failure of " << m_bsIDCErrContainerName.key() << " is suppressed.");
} }
} }
return nullptr; return nullptr;
} }
ATH_MSG_VERBOSE( "SCT_ByteStreamErrorsTool IDC Container fetched " << m_bsIDCErrContainerName.key() ); ATH_MSG_VERBOSE("SCT_ByteStreamErrorsTool IDC Container fetched " << m_bsIDCErrContainerName.key());
return idcErrCont.cptr(); return idcErrCont.cptr();
} }
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
SCT_ByteStreamErrorsTool::IDCCacheEntry* SCT_ByteStreamErrorsTool::getCacheEntry(const EventContext& ctx) const { SCT_ByteStreamErrorsTool::IDCCacheEntry* SCT_ByteStreamErrorsTool::getCacheEntry(const EventContext& ctx) const {
IDCCacheEntry* cacheEntry = m_eventCache.get( ctx ); IDCCacheEntry* cacheEntry{m_eventCache.get(ctx)};
if( cacheEntry->needsUpdate( ctx ) ) { if (cacheEntry->needsUpdate(ctx)) {
auto idcErrContPtr = getContainer( ctx ); auto idcErrContPtr{getContainer(ctx)};
if ( idcErrContPtr == nullptr ) { // missing or not, the cache needs to be reset if (idcErrContPtr == nullptr) { // missing or not, the cache needs to be reset
cacheEntry->reset( ctx.evt(), nullptr ); cacheEntry->reset(ctx.evt(), nullptr);
} else { } else {
cacheEntry->reset( ctx.evt(), idcErrContPtr->cache() ); cacheEntry->reset(ctx.evt(), idcErrContPtr->cache());
} }
ATH_MSG_VERBOSE( "SCT_ByteStreamErrorsTool Cache for the event reset " << cacheEntry->eventId << " with IDC container" << idcErrContPtr ); ATH_MSG_VERBOSE("SCT_ByteStreamErrorsTool Cache for the event reset " << cacheEntry->eventId << " with IDC container" << idcErrContPtr);
} }
return cacheEntry; return cacheEntry;
} }
...@@ -111,19 +103,19 @@ bool ...@@ -111,19 +103,19 @@ bool
SCT_ByteStreamErrorsTool::isGood(const IdentifierHash& elementIdHash, const EventContext& ctx) const { SCT_ByteStreamErrorsTool::isGood(const IdentifierHash& elementIdHash, const EventContext& ctx) const {
{ {
std::lock_guard<std::mutex> lock{m_cacheMutex}; std::lock_guard<std::mutex> lock{m_cacheMutex};
ATH_MSG_VERBOSE("SCT_ByteStreamErrorsTool isGood called for " << elementIdHash ); ATH_MSG_VERBOSE("SCT_ByteStreamErrorsTool isGood called for " << elementIdHash);
auto idcCachePtr = getCacheEntry(ctx)->IDCCache; auto idcCachePtr{getCacheEntry(ctx)->IDCCache};
if ( idcCachePtr == nullptr ) { if (idcCachePtr == nullptr) {
ATH_MSG_VERBOSE("SCT_ByteStreamErrorsTool No cache! " ); ATH_MSG_VERBOSE("SCT_ByteStreamErrorsTool No cache! ");
return true; return true;
} }
auto errorCode = idcCachePtr->retrieve(elementIdHash); auto errorCode{idcCachePtr->retrieve(elementIdHash)};
for(auto badError : SCT_ByteStreamErrors::BadErrors) { for (auto badError : SCT_ByteStreamErrors::BadErrors) {
if(errorCode == badError) { if (errorCode == badError) {
ATH_MSG_VERBOSE("SCT_ByteStreamErrorsTool Bad Error " << errorCode << " for ID " << elementIdHash ); ATH_MSG_VERBOSE("SCT_ByteStreamErrorsTool Bad Error " << errorCode << " for ID " << elementIdHash);
return false; return false;
} }
} }
} // end of cache operations protection via m_cacheMutex, following code has own protection } // end of cache operations protection via m_cacheMutex, following code has own protection
...@@ -270,16 +262,16 @@ SCT_ByteStreamErrorsTool::getChip(const Identifier& stripId, const EventContext& ...@@ -270,16 +262,16 @@ SCT_ByteStreamErrorsTool::getChip(const Identifier& stripId, const EventContext&
std::set<IdentifierHash> std::set<IdentifierHash>
SCT_ByteStreamErrorsTool::getErrorSet(int errorType, const EventContext& ctx) const { SCT_ByteStreamErrorsTool::getErrorSet(int errorType, const EventContext& ctx) const {
ATH_MSG_VERBOSE( "SCT_ByteStreamErrorsTool getErrorSet " << errorType ); ATH_MSG_VERBOSE("SCT_ByteStreamErrorsTool getErrorSet " << errorType);
std::set<IdentifierHash> result; std::set<IdentifierHash> result;
if (errorType>=0 and errorType<SCT_ByteStreamErrors::NUM_ERROR_TYPES) { if (errorType>=0 and errorType<SCT_ByteStreamErrors::NUM_ERROR_TYPES) {
auto idcErrCont = getContainer( ctx ); auto idcErrCont{getContainer(ctx)};
if ( idcErrCont != nullptr ) { if (idcErrCont != nullptr) {
const std::vector<std::pair<size_t, uint64_t>> errorcodesforView = idcErrCont->getAll(); const std::vector<std::pair<size_t, uint64_t>> errorcodesforView{idcErrCont->getAll()};
for (const auto& [hashId, errCode] : errorcodesforView) { for (const auto& [hashId, errCode] : errorcodesforView) {
if ( SCT_ByteStreamErrors::hasError( errCode, static_cast<SCT_ByteStreamErrors::ErrorType>( errorType ) ) ) { if (SCT_ByteStreamErrors::hasError(errCode, static_cast<SCT_ByteStreamErrors::ErrorType>(errorType))) {
result.insert(hashId); result.insert(hashId);
} }
} }
} }
} }
...@@ -300,27 +292,26 @@ SCT_ByteStreamErrorsTool::getErrorSet(int errorType) const { ...@@ -300,27 +292,26 @@ SCT_ByteStreamErrorsTool::getErrorSet(int errorType) const {
StatusCode StatusCode
SCT_ByteStreamErrorsTool::fillData(const EventContext& ctx) const { SCT_ByteStreamErrorsTool::fillData(const EventContext& ctx) const {
ATH_MSG_VERBOSE("SCT_ByteStreamErrorsTool fillData");
ATH_MSG_VERBOSE( "SCT_ByteStreamErrorsTool fillData "); const IDCInDetBSErrContainer* idcErrCont{getContainer(ctx)};
if (idcErrCont == nullptr) {
const IDCInDetBSErrContainer* idcErrCont = getContainer( ctx );
if ( idcErrCont == nullptr ) {
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
auto cacheEntry = getCacheEntry( ctx ); auto cacheEntry{getCacheEntry(ctx)};
/** OK, so we found the StoreGate container, now lets iterate /** OK, so we found the StoreGate container, now lets iterate
* over it to populate the sets of errors owned by this Tool. * over it to populate the sets of errors owned by this Tool.
*/ */
ATH_MSG_VERBOSE("SCT_ByteStreamErrorsTool size of error container is " << idcErrCont->maxSize()); ATH_MSG_VERBOSE("SCT_ByteStreamErrorsTool size of error container is " << idcErrCont->maxSize());
const std::vector<std::pair<size_t, uint64_t>> errorcodesforView = idcErrCont->getAll(); const std::vector<std::pair<size_t, uint64_t>> errorcodesforView{idcErrCont->getAll()};
for (const auto& [ hashId, errCode ] : errorcodesforView) { for (const auto& [ hashId, errCode ] : errorcodesforView) {
Identifier wafer_id{m_sct_id->wafer_id(hashId)}; Identifier wafer_id{m_sct_id->wafer_id(hashId)};
Identifier module_id{m_sct_id->module_id(wafer_id)}; Identifier module_id{m_sct_id->module_id(wafer_id)};
if ( errCode == uint64_t{0} ) { if (errCode == uint64_t{0}) {
// That means this hashId was decoded but had no error // That means this hashId was decoded but had no error
// 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 // 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
// (see logic in: getErrorCodeWithCacheUpdate) // (see logic in: getErrorCodeWithCacheUpdate)
...@@ -331,7 +322,7 @@ SCT_ByteStreamErrorsTool::fillData(const EventContext& ctx) const { ...@@ -331,7 +322,7 @@ SCT_ByteStreamErrorsTool::fillData(const EventContext& ctx) const {
} }
ATH_MSG_VERBOSE( "SCT_ByteStreamErrorsTool filling event cache for module " << module_id << " ec " << errCode ); ATH_MSG_VERBOSE("SCT_ByteStreamErrorsTool filling event cache for module " << module_id << " ec " << errCode);
const int side{m_sct_id->side(m_sct_id->wafer_id(hashId))}; const int side{m_sct_id->side(m_sct_id->wafer_id(hashId))};
// Each bit of errCode represents each SCT_ByteStreamErrors for one wafer // Each bit of errCode represents each SCT_ByteStreamErrors for one wafer
...@@ -359,13 +350,13 @@ SCT_ByteStreamErrorsTool::fillData(const EventContext& ctx) const { ...@@ -359,13 +350,13 @@ SCT_ByteStreamErrorsTool::fillData(const EventContext& ctx) const {
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
unsigned int SCT_ByteStreamErrorsTool::tempMaskedChips(const Identifier& moduleId, const EventContext& ctx) const { unsigned int SCT_ByteStreamErrorsTool::tempMaskedChips(const Identifier& moduleId, const EventContext& ctx) const {
ATH_MSG_VERBOSE( "SCT_ByteStreamErrorsTool tempMaskedChips "); ATH_MSG_VERBOSE("SCT_ByteStreamErrorsTool tempMaskedChips");
std::lock_guard<std::mutex> lock{m_cacheMutex}; std::lock_guard<std::mutex> lock{m_cacheMutex};
auto cacheEntry = getCacheEntry(ctx); auto cacheEntry{getCacheEntry(ctx)};
if ( cacheEntry->IDCCache == nullptr ) return 0; if (cacheEntry->IDCCache == nullptr) return 0;
auto [status, v_tempMaskedChips] = getErrorCodeWithCacheUpdate(moduleId, ctx, cacheEntry->tempMaskedChips); auto [status, v_tempMaskedChips] = getErrorCodeWithCacheUpdate(moduleId, ctx, cacheEntry->tempMaskedChips);
if ( status.isFailure() ) { if (status.isFailure()) {
ATH_MSG_ERROR("SCT_ByteStreamErrorsTool Failure getting temp masked chip errors"); ATH_MSG_ERROR("SCT_ByteStreamErrorsTool Failure getting temp masked chip errors");
} }
return v_tempMaskedChips; // 12 bits are used. return v_tempMaskedChips; // 12 bits are used.
...@@ -378,13 +369,13 @@ unsigned int SCT_ByteStreamErrorsTool::tempMaskedChips(const Identifier& moduleI ...@@ -378,13 +369,13 @@ unsigned int SCT_ByteStreamErrorsTool::tempMaskedChips(const Identifier& moduleI
} }
unsigned int SCT_ByteStreamErrorsTool::abcdErrorChips(const Identifier& moduleId, const EventContext& ctx) const { unsigned int SCT_ByteStreamErrorsTool::abcdErrorChips(const Identifier& moduleId, const EventContext& ctx) const {
ATH_MSG_VERBOSE( "SCT_ByteStreamErrorsTool abcdErrorChips "); ATH_MSG_VERBOSE("SCT_ByteStreamErrorsTool abcdErrorChips");
std::lock_guard<std::mutex> lock{m_cacheMutex}; std::lock_guard<std::mutex> lock{m_cacheMutex};
auto cacheEntry = getCacheEntry(ctx); auto cacheEntry{getCacheEntry(ctx)};
if ( cacheEntry->IDCCache == nullptr ) return 0; if (cacheEntry->IDCCache == nullptr) return 0;
auto [status, v_abcdErrorChips] = getErrorCodeWithCacheUpdate(moduleId, ctx, cacheEntry->abcdErrorChips); auto [status, v_abcdErrorChips] = getErrorCodeWithCacheUpdate(moduleId, ctx, cacheEntry->abcdErrorChips);
if ( status.isFailure() ) { if (status.isFailure()) {
ATH_MSG_ERROR("SCT_ByteStreamErrorsTool Failure getting ABCD chip errors"); ATH_MSG_ERROR("SCT_ByteStreamErrorsTool Failure getting ABCD chip errors");
} }
return v_abcdErrorChips; // 12 bits are used. return v_abcdErrorChips; // 12 bits are used.
...@@ -396,11 +387,11 @@ unsigned int SCT_ByteStreamErrorsTool::abcdErrorChips(const Identifier& moduleId ...@@ -396,11 +387,11 @@ unsigned int SCT_ByteStreamErrorsTool::abcdErrorChips(const Identifier& moduleId
return abcdErrorChips(moduleId, ctx); return abcdErrorChips(moduleId, ctx);
} }
std::pair<StatusCode, unsigned int> SCT_ByteStreamErrorsTool::getErrorCodeWithCacheUpdate( const Identifier& moduleId, const EventContext& ctx, std::pair<StatusCode, unsigned int> SCT_ByteStreamErrorsTool::getErrorCodeWithCacheUpdate(const Identifier& moduleId, const EventContext& ctx,
std::map<Identifier, unsigned int>& whereExected ) const { std::map<Identifier, unsigned int>& whereExected) const {
ATH_MSG_VERBOSE( "SCT_ByteStreamErrorsTool getErrorCodeWithCacheUpdate " << moduleId ); ATH_MSG_VERBOSE("SCT_ByteStreamErrorsTool getErrorCodeWithCacheUpdate " << moduleId);
auto it{ whereExected.find( moduleId ) }; auto it{whereExected.find(moduleId)};
if ( it != whereExected.end() ) return std::make_pair(StatusCode::SUCCESS, it->second); if (it != whereExected.end()) return std::make_pair(StatusCode::SUCCESS, it->second);
// even if there are no errors for this module at all filled // even if there are no errors for this module at all filled
// we want the entry of value 0 so we know we walked over it and do not need to invoke filling again // we want the entry of value 0 so we know we walked over it and do not need to invoke filling again
...@@ -413,8 +404,8 @@ std::pair<StatusCode, unsigned int> SCT_ByteStreamErrorsTool::getErrorCodeWithCa ...@@ -413,8 +404,8 @@ std::pair<StatusCode, unsigned int> SCT_ByteStreamErrorsTool::getErrorCodeWithCa
return std::make_pair(StatusCode::FAILURE, 0); return std::make_pair(StatusCode::FAILURE, 0);
} }
// handle situation when the cache does not contain desired datum after the update // handle situation when the cache does not contain desired datum after the update
it = whereExected.find( moduleId ); it = whereExected.find(moduleId);
if ( it == whereExected.end() ) { if (it == whereExected.end()) {
ATH_MSG_ERROR("After fillData in abcdErrorChips, cache does not have an infomation about the " << moduleId); ATH_MSG_ERROR("After fillData in abcdErrorChips, cache does not have an infomation about the " << moduleId);
ATH_MSG_ERROR("Likely cause is a request for for different region"); ATH_MSG_ERROR("Likely cause is a request for for different region");
std::make_pair(StatusCode::FAILURE, 0); std::make_pair(StatusCode::FAILURE, 0);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* @file SCT_ByteStreamErrorsTool.h * @file SCT_ByteStreamErrorsTool.h
* header file for tool that keeps track of errors in the bytestream. * header file for tool that keeps track of errors in the bytestream.
* @author Susumu.Oda@cern.ch * @author Susumu.Oda@cern.ch
**/ **/
#ifndef SCT_ByteStreamErrorsTool_h #ifndef SCT_ByteStreamErrorsTool_h
#define SCT_ByteStreamErrorsTool_h #define SCT_ByteStreamErrorsTool_h
...@@ -35,10 +35,10 @@ ...@@ -35,10 +35,10 @@
///STL includes ///STL includes
#include <array> #include <array>
#include <atomic> #include <atomic>
#include <functional>
#include <map> #include <map>
#include <mutex> #include <mutex>
#include <vector> #include <vector>
#include <functional>
/** forward declarations */ /** forward declarations */
class SCT_ID; class SCT_ID;
...@@ -81,8 +81,8 @@ public: ...@@ -81,8 +81,8 @@ public:
virtual bool isGood(const IdentifierHash& elementIdHash) const override; virtual bool isGood(const IdentifierHash& elementIdHash) const override;
virtual bool isGood(const IdentifierHash& elementIdHash, const EventContext& ctx) const override; virtual bool isGood(const IdentifierHash& elementIdHash, const EventContext& ctx) const override;
std::set<IdentifierHash> getErrorSet(int errorType, const EventContext& ctx) const override; // Used by SCTRawDataProviderTool and others virtual std::set<IdentifierHash> getErrorSet(int errorType, const EventContext& ctx) const override; // Used by SCTRawDataProviderTool and others
std::set<IdentifierHash> getErrorSet(int errorType) const override; // Used by SCTRawDataProviderTool and others virtual std::set<IdentifierHash> getErrorSet(int errorType) const override; // Used by SCTRawDataProviderTool and others
virtual unsigned int tempMaskedChips(const Identifier& moduleId, const EventContext& ctx) const override; // Internally used virtual unsigned int tempMaskedChips(const Identifier& moduleId, const EventContext& ctx) const override; // Internally used
virtual unsigned int tempMaskedChips(const Identifier& moduleId) const override; virtual unsigned int tempMaskedChips(const Identifier& moduleId) const override;
...@@ -95,17 +95,16 @@ private: ...@@ -95,17 +95,16 @@ private:
ToolHandle<ISCT_ConfigurationConditionsTool> m_config{this, "ConfigTool", ToolHandle<ISCT_ConfigurationConditionsTool> m_config{this, "ConfigTool",
"SCT_ConfigurationConditionsTool/InDetSCT_ConfigurationConditionsTool", "Tool to retrieve SCT Configuration Tool"}; "SCT_ConfigurationConditionsTool/InDetSCT_ConfigurationConditionsTool", "Tool to retrieve SCT Configuration Tool"};
const SCT_ID* m_sct_id{nullptr};
IdContext m_cntx_sct;
SG::ReadHandleKey<IDCInDetBSErrContainer> m_bsIDCErrContainerName{this, "IDCByteStreamErrContainer", "SCT_ByteStreamErrs", "SCT BS error key for IDC variant"}; SG::ReadHandleKey<IDCInDetBSErrContainer> m_bsIDCErrContainerName{this, "IDCByteStreamErrContainer", "SCT_ByteStreamErrs", "SCT BS error key for IDC variant"};
SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"}; SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"};
const SCT_ID* m_sct_id{nullptr};
IdContext m_cntx_sct;
mutable std::mutex m_cacheMutex{}; mutable std::mutex m_cacheMutex{};
struct IDCCacheEntry { struct IDCCacheEntry {
EventContext::ContextEvt_t eventId = EventContext::INVALID_CONTEXT_EVT; // invalid event ID for the start EventContext::ContextEvt_t eventId{EventContext::INVALID_CONTEXT_EVT}; // invalid event ID for the start
const IDCInDetBSErrContainer_Cache* IDCCache = nullptr; const IDCInDetBSErrContainer_Cache* IDCCache{nullptr};
// infomations in granularity of Chips // infomations in granularity of Chips
// misisng value mean that the map need updating // misisng value mean that the map need updating
// 0 as the value denotes no error // 0 as the value denotes no error
...@@ -114,14 +113,14 @@ private: ...@@ -114,14 +113,14 @@ private:
std::map<Identifier, unsigned int> tempMaskedChips; std::map<Identifier, unsigned int> tempMaskedChips;
std::map<Identifier, unsigned int> abcdErrorChips; std::map<Identifier, unsigned int> abcdErrorChips;
void reset( EventContext::ContextEvt_t evtId, const IDCInDetBSErrContainer_Cache* cache) { void reset(EventContext::ContextEvt_t evtId, const IDCInDetBSErrContainer_Cache* cache) {
eventId = evtId; eventId = evtId;
IDCCache = cache; IDCCache = cache;
tempMaskedChips.clear(); tempMaskedChips.clear();
abcdErrorChips.clear(); abcdErrorChips.clear();
} }
bool needsUpdate( const EventContext& ctx) const { bool needsUpdate(const EventContext& ctx) const {
return eventId != ctx.evt() or eventId == EventContext::INVALID_CONTEXT_EVT; return eventId != ctx.evt() or eventId == EventContext::INVALID_CONTEXT_EVT;
} }
...@@ -156,7 +155,7 @@ private: ...@@ -156,7 +155,7 @@ private:
* Method that returns BS Error code from the map passed @rag where-Expected * Method that returns BS Error code from the map passed @rag where-Expected
* If the information is initially missing, the cache update is triggered * If the information is initially missing, the cache update is triggered
**/ **/
std::pair<StatusCode, unsigned int> getErrorCodeWithCacheUpdate( const Identifier& id, const EventContext& ctx, std::map<Identifier, unsigned int>& whereExected ) const; std::pair<StatusCode, unsigned int> getErrorCodeWithCacheUpdate(const Identifier& id, const EventContext& ctx, std::map<Identifier, unsigned int>& whereExected) const;
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment