diff --git a/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelByteStreamErrors.h b/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelByteStreamErrors.h index 7d0a6b326fd11b5fdc62ef3fee98efa0ed8b9ad6..a73afa4bc8be2b50b8f6aacc2aea205b94804119 100644 --- a/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelByteStreamErrors.h +++ b/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelByteStreamErrors.h @@ -9,9 +9,13 @@ // errors can coexist per hashID so we need to reserve separate bit for them namespace PixelByteStreamErrors { - //!< Possible errors in pixel data decoding, exactl clone of definition in: PixelConditionsTools/IPixelByteStreamErrorsTool.h, the later will be removed + //!< Possible errors in pixel data decoding enum PixelErrorsEnum {TimeOut=0, firstErrType=TimeOut, BCID, LVL1ID, Preamble, Trailer, - Flagged, DisableFE, BadFE, ROD, Decoding, Invalid, LinkMaskedByPPC, Limit, TruncatedROB, MaskedROB, lastErrType=MaskedROB, ErrorsNumber=lastErrType+1 }; + Flagged, BadFE, Decoding, Invalid, LinkMaskedByPPC, Limit, TruncatedROB, MaskedROB, + MCCUndefined, MCCLVL1IDEoECheck, MCCBCIDEoECheck, MCCLVL1IDCheck, MCCEoEOverflow, MCCHitOverflow, + FEWarning, FEHitParity, FERegisterParity, FEHammingCode, FEEoCOverflow, + RODTrailerBitError,RODHeaderLimit,RODDataOVerflow, + lastErrType=RODDataOVerflow, ErrorsNumber=lastErrType+1 }; //!< @brief for cases when error doe snot need to be accumulated inline IDCInDetBSErrContainer::ErrorCode makeError( PixelErrorsEnum errType ) { return IDCInDetBSErrContainer::ErrorCode{1} << errType; } diff --git a/InnerDetector/InDetConditions/PixelConditionsTools/PixelConditionsTools/IPixelByteStreamErrorsTool.h b/InnerDetector/InDetConditions/PixelConditionsTools/PixelConditionsTools/IPixelByteStreamErrorsTool.h deleted file mode 100644 index c5d577258a057bce3464a6ebfa6ba3f817a48b8d..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelConditionsTools/PixelConditionsTools/IPixelByteStreamErrorsTool.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef PIXELCONDITIONSTOOLS_IPIXELBYTESTREAMERRORSSVC_H -#define PIXELCONDITIONSTOOLS_IPIXELBYTESTREAMERRORSSVC_H -//STL includes -#include <string> -#include <set> -#include <array> - -//Gaudi includes -#include "GaudiKernel/IInterface.h" -class StatusCode; -#include "GaudiKernel/ServiceHandle.h" - -#include "InDetConditionsSummaryService/InDetHierarchy.h" - -//forward declarations -template <class TYPE> class SvcFactory; -class ISvcLocator; -class PixelID; -class StoreGateSvc; -class Identifier; -class IdentifierHash; -namespace InDetDD{ - class PixelDetectorManager; -} - -class IPixelByteStreamErrorsTool: virtual public IInterface, virtual public IAlgTool { - - public: - - enum ErrorType {TimeOut=0, firstErrType=TimeOut, BCID=1, LVL1ID=2, Preamble=3, Trailer=4, - Flagged=5, DisableFE=6, ROD=7, Decoding=8, Invalid=9, LinkMaskedByPPC=10, Limit=11, lastErrType=Limit }; - static constexpr std::array<ErrorType, lastErrType+1> AllPixErrTypes{TimeOut, BCID, LVL1ID, Preamble, Trailer, - Flagged, DisableFE, ROD, Decoding, Invalid, LinkMaskedByPPC, Limit}; - - static_assert( Limit == AllPixErrTypes.size()-1, "Not all Pixel BS Decoding Errors are in the array AllPixErrTypes" ); - - virtual ~IPixelByteStreamErrorsTool() = default; - DeclareInterfaceID(IPixelByteStreamErrorsTool, 1, 0); - - virtual bool isGood(const IdentifierHash & elementIdHash) const =0; - - virtual unsigned int getModuleErrors(IdentifierHash hashID) const =0; - - virtual void setModuleErrors(IdentifierHash hashID, unsigned int errorcode) const =0; - virtual void setModuleRODErrors(IdentifierHash hashID, unsigned int errorcode) const =0; - - virtual std::map<IdentifierHash, std::map<unsigned int, unsigned int> > & getAllFeErrors() const =0; - virtual unsigned int getFeErrorCode(IdentifierHash module, unsigned int fe_number) const =0; - virtual void setFeErrorCode(IdentifierHash module, unsigned int fe_number, unsigned int errorcode) const =0; - - virtual void setModuleFragmentSize(IdentifierHash hashID, unsigned int length) const =0; - virtual unsigned int getModuleFragmentSize(IdentifierHash hashID) const =0; - - virtual void resetCounts() const =0; // for the counts used by HLT - virtual int getNumberOfErrors(int errorType) const =0; // for HLT - - virtual void addInvalidIdentifier() const =0; - virtual void addPreambleError() const =0; - virtual void addTimeOutError() const =0; - virtual void addLVL1IDError() const =0; - virtual void addBCIDError() const =0; - virtual void addFlaggedError() const =0; - virtual void addTrailerError() const =0; - virtual void addDisabledFEError() const =0; - virtual void addDecodingError() const =0; - virtual void addRODError() const =0; - virtual void addRead(IdentifierHash hashID) const =0; - virtual unsigned int getReadEvents(IdentifierHash hashID) const =0; - virtual bool isActive(IdentifierHash hashID) const =0; - virtual void addBadFE(IdentifierHash hashID, int badFE) const =0; - virtual unsigned int getBadFE(IdentifierHash hashID) const =0; - virtual StatusCode readData()=0; - virtual StatusCode recordData() const =0; - - // FE-I4B - virtual void addLinkMaskedByPPC() const =0; - virtual void addLimitError() const =0; - virtual void updateServiceRecords(int code, unsigned int count) const =0; - virtual unsigned int getServiceRecordCount(int code) const =0; - -}; - -#endif diff --git a/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelByteStreamErrorsTool.cxx b/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelByteStreamErrorsTool.cxx deleted file mode 100644 index 6c2cdeb041ff9b3ee7400dbb4ec80314c9a561c8..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelByteStreamErrorsTool.cxx +++ /dev/null @@ -1,361 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#include "PixelByteStreamErrorsTool.h" - -PixelByteStreamErrorsTool::PixelByteStreamErrorsTool(const std::string& type, const std::string& name, const IInterface* parent) - :AthAlgTool(type, name, parent), - m_pixelID(nullptr), - m_ServiceRecords(), - m_readESD(false) -{ - declareProperty("ReadingESD", m_readESD,"Get summary of BS errors from StoreGate, if available"); - resetCounts(); -} - -//Initialize -StatusCode PixelByteStreamErrorsTool::initialize() { - - ATH_CHECK(detStore()->retrieve(m_pixelID,"PixelID")); - - if (m_readESD) { - ATH_CHECK(m_BSErrContReadKey.initialize()); - renounce(m_BSErrContWriteKey); - } - else { - renounce(m_BSErrContReadKey); - ATH_CHECK(m_BSErrContWriteKey.initialize()); - } - - m_module_errors.reserve(m_pixelID->wafer_hash_max()); - m_moduleROD_errors.reserve(m_pixelID->wafer_hash_max()); - m_event_read.reserve(m_pixelID->wafer_hash_max()); - m_FE_errors.reserve(m_pixelID->wafer_hash_max()); - m_module_isread.reserve(m_pixelID->wafer_hash_max()); - - // before reading first event, set all modules as active - for (unsigned int i=0; i<m_pixelID->wafer_hash_max(); i++) { m_module_isread[i]=true; } - - resetCounts(); - - for (unsigned int i=0; i<m_pixelID->wafer_hash_max(); i++) { - m_event_read[i] = 0; - m_FE_errors[i] = 0; - } - - for (unsigned int i=0; i<m_pixelID->wafer_hash_max(); i++) { - m_module_errors[i]=0; - m_moduleROD_errors[i]=0; - m_module_isread[i]=m_readESD; - } - m_all_FE_errors.clear(); - - return StatusCode::SUCCESS; -} - -//Finalize -StatusCode PixelByteStreamErrorsTool::finalize() { - - if (m_event_read.size() && m_FE_errors.size()) { - unsigned int mxevent=0; - unsigned int mdread=0; - unsigned int missing=0; - unsigned int mbadfe=0; - for (unsigned int i=0; i<m_pixelID->wafer_hash_max(); i++) { - if (m_event_read[i]==0) { - ATH_MSG_DEBUG("Disabled module HashId " << i); - continue; - } - if (m_FE_errors[i]!=0) { - ATH_MSG_DEBUG("Disabled FEs module HashId " << i << " FE mask=" << std::hex << m_FE_errors[i] << std::dec); - mbadfe++; - } - if (m_event_read[i]>mxevent) { - missing += ( (m_event_read[i]-mxevent)*mdread ); - mxevent = m_event_read[i]; - } else if ( m_event_read[i]<mxevent ) { - missing += mxevent-m_event_read[i]; - } - mdread++; - } - ATH_MSG_INFO("Found in data " << mdread << " modules out of " << m_pixelID->wafer_hash_max()); - ATH_MSG_INFO("Found " << mxevent << " events with pixel data and " << missing << " missing module fragments"); - ATH_MSG_INFO("Found " << mbadfe << " modules with disabled FE"); - ATH_MSG_INFO(" --------------------------------------------- "); - } - - ATH_MSG_INFO(" --- Summary from PixelByteStreamErrorsTool --- "); - ATH_MSG_INFO(" - Number of invalid Identifiers Errors: " << m_numInvalidIdentifiers); - ATH_MSG_INFO(" - Number of Preamble Errors: " << m_numPreambleErrors); - ATH_MSG_INFO(" - Number of TimeOut Errors: " << m_numTimeOutErrors); - ATH_MSG_INFO(" - Number of LVL1ID Errors: " << m_numLVL1IDErrors); - ATH_MSG_INFO(" - Number of BCID Errors: " << m_numBCIDErrors); - ATH_MSG_INFO(" - Number of Flagged Errors: " << m_numFlaggedErrors); - ATH_MSG_INFO(" - Number of Trailer Errors: " << m_numTrailerErrors); - ATH_MSG_INFO(" - Number of Disabled FE Errors: " << m_numDisabledFEErrors); - ATH_MSG_INFO(" - Number of ROD Errors: " << m_numRODErrors); - ATH_MSG_INFO(" - Number of links masked by PPC: " << m_numLinkMaskedByPPC); - ATH_MSG_INFO(" - Number of header/trailer limit errors: " << m_numLimitError); - ATH_MSG_INFO(" - Number of Unknown word Errors: " << m_numDecodingErrors); - ATH_MSG_INFO(" --------------------------------------------- "); - - return StatusCode::SUCCESS; -} - -bool PixelByteStreamErrorsTool::isGood(const IdentifierHash & elementIdHash) const { - Identifier dehashedId = m_pixelID->wafer_id(elementIdHash); - - if (m_pixelID->wafer_hash_max()==2048) { // RUN-2 setup - // If module is IBL of DBM, return isActive - if ((m_pixelID->barrel_ec(dehashedId) == 0 && m_pixelID->layer_disk(dehashedId) == 0) - || m_pixelID->is_dbm(dehashedId)) { - return isActive(elementIdHash); - } - } - - int errorcode = m_module_errors[elementIdHash]; - if ((errorcode & 0xFFF1F00F) == 0) { // Mask FE errors - return isActive(elementIdHash); - } - else { - return false; - } -} - -unsigned int PixelByteStreamErrorsTool::getModuleErrors(IdentifierHash hashID) const { - return m_module_errors[(int) hashID]; -} - -void PixelByteStreamErrorsTool::setModuleErrors(IdentifierHash hashID, unsigned int errorcode) const { - if (static_cast<unsigned int>(hashID)<m_pixelID->wafer_hash_max()) { - m_module_errors[static_cast<unsigned int>(hashID)] = errorcode; - } -} - -void PixelByteStreamErrorsTool::setModuleRODErrors(IdentifierHash hashID, unsigned int errorcode) const { - if (static_cast<unsigned int>(hashID)<m_pixelID->wafer_hash_max()) { - m_moduleROD_errors[static_cast<unsigned int>(hashID)] = errorcode; - } -} - -std::map<IdentifierHash, std::map<unsigned int, unsigned int> > & PixelByteStreamErrorsTool::getAllFeErrors() const { - return m_all_FE_errors; -} - -unsigned int PixelByteStreamErrorsTool::getFeErrorCode(IdentifierHash module, unsigned int fe_number) const { - std::map<IdentifierHash, std::map<unsigned int, unsigned int> >::iterator mod_itr = m_all_FE_errors.find(module); - if (mod_itr != m_all_FE_errors.end()) { - std::map<unsigned int, unsigned int>::iterator fe_itr = mod_itr->second.find(fe_number); - if (fe_itr != mod_itr->second.end()) { - return fe_itr->second; - } - } - return 0; -} - -void PixelByteStreamErrorsTool::setFeErrorCode(IdentifierHash module, unsigned int fe_number, unsigned int errorcode) const { - m_all_FE_errors[module][fe_number] = errorcode; -} - -void PixelByteStreamErrorsTool::setModuleFragmentSize(IdentifierHash hashID, unsigned int size) const { - m_module_fragment_size[hashID] = size; -} - -unsigned int PixelByteStreamErrorsTool::getModuleFragmentSize(IdentifierHash hashID) const { - std::map<IdentifierHash, unsigned int>::iterator itr = m_module_fragment_size.find(hashID); - if (itr != m_module_fragment_size.end()) { - return itr->second; - } - return 0; -} - -void PixelByteStreamErrorsTool::resetCounts() const { - m_numTimeOutErrors=0; - m_numBCIDErrors=0; - m_numLVL1IDErrors=0; - m_numInvalidIdentifiers=0; - m_numPreambleErrors=0; - m_numTrailerErrors=0; - m_numFlaggedErrors=0; - m_numDisabledFEErrors=0; - m_numDecodingErrors=0; - m_numRODErrors=0; - m_numLinkMaskedByPPC=0; - m_numLimitError=0; - - // Also reset FE-I4B service records - for (int i = 0; i < 32; ++i) { m_ServiceRecords[i]=0; } -} - -int PixelByteStreamErrorsTool::getNumberOfErrors(int errorType) const { - switch(errorType) { - case TimeOut: - return m_numTimeOutErrors; - case BCID: - return m_numBCIDErrors; - case LVL1ID: - return m_numLVL1IDErrors; - case Preamble: - return m_numPreambleErrors; - case Trailer: - return m_numTrailerErrors; - case Flagged: - return m_numFlaggedErrors; - case DisableFE: - return m_numDisabledFEErrors; - case ROD: - return m_numRODErrors; - case Decoding: - return m_numDecodingErrors; - case Invalid: - return m_numInvalidIdentifiers; - case LinkMaskedByPPC: - return m_numLinkMaskedByPPC; - case Limit: - return m_numLimitError; - } - return 0; -} - -void PixelByteStreamErrorsTool::addInvalidIdentifier() const { - m_numInvalidIdentifiers++; -} - -void PixelByteStreamErrorsTool::addPreambleError() const { - m_numPreambleErrors++; -} - -void PixelByteStreamErrorsTool::addTimeOutError() const { - m_numTimeOutErrors++; -} - -void PixelByteStreamErrorsTool::addLVL1IDError() const { - m_numLVL1IDErrors++; -} - -void PixelByteStreamErrorsTool::addBCIDError() const { - m_numBCIDErrors++; -} - -void PixelByteStreamErrorsTool::addFlaggedError() const { - m_numFlaggedErrors++; -} - -void PixelByteStreamErrorsTool::addTrailerError() const { - m_numTrailerErrors++; -} - -void PixelByteStreamErrorsTool::addDisabledFEError() const { - m_numDisabledFEErrors++; -} - -void PixelByteStreamErrorsTool::addDecodingError() const { - m_numDecodingErrors++; -} - -void PixelByteStreamErrorsTool::addRODError() const { - m_numRODErrors++; -} - -void PixelByteStreamErrorsTool::addRead(IdentifierHash hashID) const { - if (static_cast<unsigned int>(hashID)<m_pixelID->wafer_hash_max()) { - m_event_read[static_cast<unsigned int>(hashID)]++; - m_module_isread[static_cast<unsigned int>(hashID)]=true; - } -} - -unsigned int PixelByteStreamErrorsTool::getReadEvents(IdentifierHash hashID) const { - return m_event_read[(int)hashID]; -} - -bool PixelByteStreamErrorsTool::isActive(IdentifierHash hashID) const { - return m_module_isread[(int)hashID]; -} - -void PixelByteStreamErrorsTool::addBadFE(IdentifierHash hashID, int badFE) const { - if (static_cast<unsigned int>(hashID)<m_pixelID->wafer_hash_max()) { - m_FE_errors[static_cast<unsigned int>(hashID)] |= (1<<badFE); - } -} - -unsigned int PixelByteStreamErrorsTool::getBadFE(IdentifierHash hashID) const { - return m_FE_errors[(int)hashID]; -} - -StatusCode PixelByteStreamErrorsTool::readData() { - - SG::ReadHandle<InDetBSErrContainer> errCont(m_BSErrContReadKey); - if (!errCont.isValid()) { - ATH_MSG_ERROR("Failed to retrieve BS error container from SG"); - return StatusCode::FAILURE; - } - - for (unsigned int i=0; i<m_pixelID->wafer_hash_max(); i++) { - m_event_read[i] = 0; - m_module_errors[i]=0; - m_moduleROD_errors[i]=0; - m_module_isread[i]=m_readESD; - } - - for (const auto* elt : *errCont) { - IdentifierHash myHash=elt->first; - if (myHash<m_pixelID->wafer_hash_max()) { - setModuleErrors(myHash,elt->second); - } - else if (myHash<2*m_pixelID->wafer_hash_max()) { - myHash-=m_pixelID->wafer_hash_max(); - m_module_isread[static_cast<unsigned int>(myHash)]=false; - } - else { - myHash-=2*m_pixelID->wafer_hash_max(); - setModuleRODErrors(myHash,elt->second); - } - } - for (unsigned int i=0; i<m_pixelID->wafer_hash_max(); i++) { - if (m_module_isread[i]) { m_event_read[i]++; } - } - - return StatusCode::SUCCESS; -} - -// record the data to Storegate: for one event, one entry per module with errors -StatusCode PixelByteStreamErrorsTool::recordData() const { - - std::unique_ptr<InDetBSErrContainer> cont = std::make_unique<InDetBSErrContainer>(); - for (unsigned int i=0; i<m_pixelID->wafer_hash_max(); i++) { - if (m_module_errors[i] != 0){ - std::pair<IdentifierHash, int>* err = new std::pair<IdentifierHash, int>(std::make_pair((IdentifierHash)i, m_module_errors[i])); - cont->push_back(err); - } - if ( !m_module_isread[i] ) { - std::pair<IdentifierHash, int>* err = new std::pair<IdentifierHash, int>(std::make_pair((IdentifierHash)(i+m_pixelID->wafer_hash_max()),1)); - cont->push_back(err); - } - if ( m_moduleROD_errors[i] != 0 ) { - std::pair<IdentifierHash, int>* err = new std::pair<IdentifierHash, int>(std::make_pair((IdentifierHash)(i+2*m_pixelID->wafer_hash_max()),m_moduleROD_errors[i])); - cont->push_back(err); - } - } - - SG::WriteHandle<InDetBSErrContainer> errCont (m_BSErrContWriteKey); - ATH_CHECK( errCont.record (std::move (cont)) ); - return StatusCode::SUCCESS; -} - -void PixelByteStreamErrorsTool::addLinkMaskedByPPC() const { - ++m_numLinkMaskedByPPC; -} - -void PixelByteStreamErrorsTool::addLimitError() const { - ++m_numLimitError; -} - -void PixelByteStreamErrorsTool::updateServiceRecords(int code, unsigned int count) const { - m_ServiceRecords[code] = count; -} - -unsigned int PixelByteStreamErrorsTool::getServiceRecordCount(int code) const { - return m_ServiceRecords[code]; -} - diff --git a/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelByteStreamErrorsTool.h b/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelByteStreamErrorsTool.h deleted file mode 100644 index a957f7a58dcb9a69faaa431282553fa1b390e49a..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelByteStreamErrorsTool.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef PixelByteStreamErrorsTool_h -#define PixelByteStreamErrorsTool_h - -#include "AthenaBaseComps/AthAlgTool.h" -#include "PixelConditionsTools/IPixelByteStreamErrorsTool.h" - -//STL includes -#include <string> -#include <set> -#include <map> - -//Gaudi includes -#include "AthenaBaseComps/AthService.h" -#include "GaudiKernel/ServiceHandle.h" - -//Athena includes -#include "CxxUtils/checker_macros.h" -#include "Identifier/Identifier.h" -#include "Identifier/IdentifierHash.h" -#include "InDetIdentifier/PixelID.h" - -//local includes -#include "InDetByteStreamErrors/InDetBSErrContainer.h" - -#include "StoreGate/ReadHandleKey.h" -#include "StoreGate/WriteHandleKey.h" - -class ATLAS_NOT_THREAD_SAFE PixelByteStreamErrorsTool: // This class currently has many mutable memebers without mutex guard or atomicity. -public AthAlgTool, public IPixelByteStreamErrorsTool { - public: - static InterfaceID& interfaceID(); - - PixelByteStreamErrorsTool(const std::string& type, const std::string& name, const IInterface* parent); - virtual ~PixelByteStreamErrorsTool(){} - virtual StatusCode initialize() override; - virtual StatusCode finalize() override; - - virtual bool isGood(const IdentifierHash & elementIdHash) const override final; - - virtual unsigned int getModuleErrors(IdentifierHash hashID) const override final; - - virtual void setModuleErrors(IdentifierHash hashID, unsigned int errorcode) const override final; - virtual void setModuleRODErrors(IdentifierHash hashID, unsigned int errorcode) const override final; - - virtual std::map<IdentifierHash, std::map<unsigned int, unsigned int> > & getAllFeErrors() const override final; - virtual unsigned int getFeErrorCode(IdentifierHash module, unsigned int fe_number) const override final; - virtual void setFeErrorCode(IdentifierHash module, unsigned int fe_number, unsigned int errorcode) const override final; - - virtual void setModuleFragmentSize(IdentifierHash hashID, unsigned int length) const override final; - virtual unsigned int getModuleFragmentSize(IdentifierHash hashID) const override final; - - virtual void resetCounts() const override final; // for the counts used by HLT - virtual int getNumberOfErrors(int errorType) const override final; // for HLT - - virtual void addInvalidIdentifier() const override final; - virtual void addPreambleError() const override final; - virtual void addTimeOutError() const override final; - virtual void addLVL1IDError() const override final; - virtual void addBCIDError() const override final; - virtual void addFlaggedError() const override final; - virtual void addTrailerError() const override final; - virtual void addDisabledFEError() const override final; - virtual void addDecodingError() const override final; - virtual void addRODError() const override final; - virtual void addRead(IdentifierHash hashID) const override final; - virtual unsigned int getReadEvents(IdentifierHash hashID) const override final; - virtual bool isActive(IdentifierHash hashID) const override final; - virtual void addBadFE(IdentifierHash hashID, int badFE) const override final; - virtual unsigned int getBadFE(IdentifierHash hashID) const override final; - - virtual StatusCode readData() override; - virtual StatusCode recordData() const override; - - // FE-I4B trailer errors - virtual void addLinkMaskedByPPC() const override final; - virtual void addLimitError() const override final; - virtual void updateServiceRecords(int code, unsigned int count) const override final; - virtual unsigned int getServiceRecordCount(int code) const override final; - - private: - const PixelID* m_pixelID; - - SG::ReadHandleKey<InDetBSErrContainer> m_BSErrContReadKey {this, "PixelByteStreamErrsRead", "PixelByteStreamErrs", "PixelByteStreamErrs container key"}; - SG::WriteHandleKey<InDetBSErrContainer> m_BSErrContWriteKey {this, "PixelByteStreamErrsWrite", "PixelByteStreamErrs", "PixelByteStreamErrs container key"}; - - mutable std::vector<unsigned int> m_module_errors; - mutable std::vector<unsigned int> m_moduleROD_errors; - mutable std::vector<unsigned int> m_event_read; - mutable std::vector<unsigned int> m_FE_errors; - mutable std::vector<bool> m_module_isread; - - //number of errors in the event - mutable int m_numInvalidIdentifiers; - mutable int m_numPreambleErrors; - mutable int m_numTimeOutErrors; - mutable int m_numLVL1IDErrors; - mutable int m_numBCIDErrors; - mutable int m_numFlaggedErrors; - mutable int m_numTrailerErrors; - mutable int m_numDisabledFEErrors; - mutable int m_numDecodingErrors; - mutable int m_numRODErrors; - mutable int m_numLinkMaskedByPPC; - mutable int m_numLimitError; - - // Collection of all FE errors in the event - // m_all_FE_errors[moduleID][FEnumber] = errorcode - mutable std::map<IdentifierHash, std::map<unsigned int, unsigned int> > m_all_FE_errors; - - // ROB fragment length for each module - mutable std::map<IdentifierHash, unsigned int> m_module_fragment_size; - - // FE-I4B service record codes - // Array of counters for each code, i.e. m_ServiceRecords[0] is the - // count for code 0 (BCID counter error) - mutable unsigned int m_ServiceRecords[32]; - - bool m_readESD; -}; - -inline InterfaceID& PixelByteStreamErrorsTool::interfaceID() { - static InterfaceID IID_PixelByteStreamErrorsTool("PixelByteStreamErrorsTool", 1, 0); - return IID_PixelByteStreamErrorsTool; -} - -#endif diff --git a/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelConditionsSummaryTool.cxx b/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelConditionsSummaryTool.cxx index 987cbe69384186acefc94c0036ab882cccedd421..ad9f03b2f11b76f905887a0a230d41013d3db6b3 100644 --- a/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelConditionsSummaryTool.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelConditionsSummaryTool.cxx @@ -108,19 +108,20 @@ bool PixelConditionsSummaryTool::hasBSError(const IdentifierHash& moduleHash, Id bool PixelConditionsSummaryTool::hasBSError(const IdentifierHash& moduleHash, const EventContext& ctx) const { if (!m_useByteStream) { return false; } - uint64_t word = getBSErrorWord(moduleHash,ctx); - if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::TimeOut)) { return true; } - if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::BCID)) { return true; } - if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::LVL1ID)) { return true; } - if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::Preamble)) { return true; } - if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::Trailer)) { return true; } - if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::Decoding)) { return true; } - if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::Invalid)) { return true; } - if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::LinkMaskedByPPC)) { return true; } - if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::Limit)) { return true; } - if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::TruncatedROB)) { return true; } - if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::MaskedROB)) { return true; } + uint64_t word = getBSErrorWord(moduleHash,ctx); + if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::TruncatedROB)) { return true; } + if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::MaskedROB)) { return true; } + if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::Preamble)) { return true; } + if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::TimeOut)) { return true; } + if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::LVL1ID)) { return true; } + if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::BCID)) { return true; } + if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::Trailer)) { return true; } + if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::MCCLVL1IDEoECheck)) { return true; } + if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::MCCBCIDEoECheck)) { return true; } + if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::MCCLVL1IDCheck)) { return true; } + if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::MCCEoEOverflow)) { return true; } + if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::MCCHitOverflow)) { return true; } return false; } @@ -135,18 +136,16 @@ bool PixelConditionsSummaryTool::hasBSError(const IdentifierHash& moduleHash, Id int indexFE = (1+chFE)*maxHash+(int)moduleHash; // (FE_channel+1)*2048 + moduleHash uint64_t word = getBSErrorWord(indexFE,ctx); - if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::TimeOut)) { return true; } - if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::BCID)) { return true; } - if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::LVL1ID)) { return true; } - if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::Preamble)) { return true; } - if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::Trailer)) { return true; } - if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::Decoding)) { return true; } - if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::Invalid)) { return true; } - if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::LinkMaskedByPPC)) { return true; } - if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::Limit)) { return true; } - if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::TruncatedROB)) { return true; } - if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::MaskedROB)) { return true; } - + if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::Preamble)) { return true; } + if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::TimeOut)) { return true; } + if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::LVL1ID)) { return true; } + if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::BCID)) { return true; } + if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::Trailer)) { return true; } + if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::MCCLVL1IDEoECheck)) { return true; } + if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::MCCBCIDEoECheck)) { return true; } + if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::MCCLVL1IDCheck)) { return true; } + if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::MCCEoEOverflow)) { return true; } + if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::MCCHitOverflow)) { return true; } return false; } @@ -171,7 +170,9 @@ bool PixelConditionsSummaryTool::isActive(const Identifier& /*elementId*/, const bool PixelConditionsSummaryTool::isActive(const IdentifierHash& moduleHash, const EventContext& ctx) const { - if (m_useByteStream && hasBSError(moduleHash, ctx)) { return false; } + // The index array is defined in PixelRawDataProviderTool::SizeOfIDCInDetBSErrContainer() + // Here, 52736 is a separator beween error flags and isActive flags. + if (m_useByteStream && getBSErrorWord(moduleHash+52736,ctx)!=1) { return false; } SG::ReadCondHandle<PixelDCSStateData> dcsstate_data(m_condDCSStateKey,ctx); bool isDCSActive = false; @@ -189,7 +190,9 @@ bool PixelConditionsSummaryTool::isActive(const IdentifierHash& moduleHash, cons bool PixelConditionsSummaryTool::isActive(const IdentifierHash& moduleHash, const Identifier& elementId, const EventContext& ctx) const { - if (m_useByteStream && hasBSError(moduleHash, ctx)) { return false; } + // The index array is defined in PixelRawDataProviderTool::SizeOfIDCInDetBSErrContainer() + // Here, 52736 is a separator beween error flags and isActive flags. + if (m_useByteStream && getBSErrorWord(moduleHash+52736,ctx)!=1) { return false; } SG::ReadCondHandle<PixelDCSStateData> dcsstate_data(m_condDCSStateKey,ctx); bool isDCSActive = false; diff --git a/InnerDetector/InDetConditions/PixelConditionsTools/src/components/PixelConditionsTools_entries.cxx b/InnerDetector/InDetConditions/PixelConditionsTools/src/components/PixelConditionsTools_entries.cxx index c0b870924577ce96ca5c593665ff9fe0634a0662..389bf353786d6b02ffdb6ba9b0eaaa44d708e15c 100644 --- a/InnerDetector/InDetConditions/PixelConditionsTools/src/components/PixelConditionsTools_entries.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsTools/src/components/PixelConditionsTools_entries.cxx @@ -1,9 +1,4 @@ #include "src/PixelConditionsSummaryTool.h" -#ifndef SIMULATIONBASE -#include "src/PixelByteStreamErrorsTool.h" -#endif DECLARE_COMPONENT( PixelConditionsSummaryTool ) -#ifndef SIMULATIONBASE -DECLARE_COMPONENT( PixelByteStreamErrorsTool ) -#endif + diff --git a/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRawDataProviderTool.cxx b/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRawDataProviderTool.cxx index 2a284b4cfd9a2a5ac81614b979849dca6be66c44..f863e45e40759c4d4c617f5bcf14b44c933b817c 100644 --- a/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRawDataProviderTool.cxx +++ b/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRawDataProviderTool.cxx @@ -141,9 +141,12 @@ int PixelRawDataProviderTool::SizeOfIDCInDetBSErrContainer() const { // 2048 x 17 (module + FE) = 34816 // // IBL extra error information : - // 280(module) x 2(FE) x 32(error counter) = 35840 + // 280(module) x 2(FE) x 32(error counter) = 17920 // ------------------------------------- - // Total : 70656 + // + // isActive status : 2048 + // ------------------------------------- + // Total : 54784 //========================================================= - return 70656; + return 54784; } diff --git a/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRodDecoder.cxx b/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRodDecoder.cxx index 4bc0e65aca5d289838e7e5d7b86cad5978802919..3926185870eab9d66c243daceef581753e25cc23 100644 --- a/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRodDecoder.cxx +++ b/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRodDecoder.cxx @@ -132,10 +132,13 @@ StatusCode PixelRodDecoder::fillCollection( const ROBFragment *robFrag, IPixelRD } SG::ReadCondHandle<PixelCablingCondData> pixCabling(m_condCablingKey); std::unique_ptr<SG::ReadCondHandle<PixelHitDiscCnfgData> > pixHitDiscCnfg; - unsigned int errorcode = 0; - uint64_t bsErrCode = 0; // new BS Errors handling + unsigned int errorRecoverable = 0; uint32_t serviceCodeCounter = 0; // frequency of the serviceCode (with the exceptions of serviceCode = 14,15 or 16) uint32_t serviceCode = 0; // is a code. the corresponding meaning is listed in the table in the FE-I4 manual, pag. 105 + + // The index array is defined in PixelRawDataProviderTool::SizeOfIDCInDetBSErrContainer() + std::array<uint64_t, 54784> bsErrWord; + std::fill(bsErrWord.begin(),bsErrWord.end(),0); // Check ROD status if (robFrag->nstatus()!=0) { const uint32_t* rob_status; @@ -150,29 +153,35 @@ StatusCode PixelRodDecoder::fillCollection( const ROBFragment *robFrag, IPixelRD if (((*rob_status) >> 27) & 0x1) { const std::deque<Identifier> offlineIdList = pixCabling->find_entry_offlineList(robId); for (const Identifier& id: offlineIdList) { - PixelByteStreamErrors::addError(bsErrCode,PixelByteStreamErrors::TruncatedROB); IdentifierHash idHash = m_pixel_id->wafer_hash(id); - decodingErrors.setOrDrop(idHash,bsErrCode); + PixelByteStreamErrors::addError(bsErrWord[static_cast<int>(idHash)],PixelByteStreamErrors::TruncatedROB); } ATH_MSG_DEBUG("ROB status word for robid 0x"<< std::hex << robId << std::dec <<" indicates data truncation."); + for (size_t i=0; i<static_cast<size_t>(bsErrWord.size()); i++) { + if (bsErrWord[i]>0) { + decodingErrors.setOrDrop(i,bsErrWord[i]); + } + } return StatusCode::RECOVERABLE; } if (((*rob_status) >> 31) & 0x1) { const std::deque<Identifier> offlineIdList = pixCabling->find_entry_offlineList(robId); for (const Identifier& id: offlineIdList) { - PixelByteStreamErrors::addError(bsErrCode,PixelByteStreamErrors::MaskedROB); IdentifierHash idHash = m_pixel_id->wafer_hash(id); - decodingErrors.setOrDrop(idHash,bsErrCode); + PixelByteStreamErrors::addError(bsErrWord[static_cast<int>(idHash)],PixelByteStreamErrors::MaskedROB); } ATH_MSG_DEBUG( "ROB status word for robid 0x"<< std::hex << robId<< std::dec <<" indicates resource was masked off."); + for (size_t i=0; i<static_cast<size_t>(bsErrWord.size()); i++) { + if (bsErrWord[i]>0) { + decodingErrors.setOrDrop(i,bsErrWord[i]); + } + } return StatusCode::RECOVERABLE; } } } - StatusCode sc = StatusCode::SUCCESS; - // Fill the Collections for this ROB. unsigned int mBCID = 0x3FFF; // create module BCID variable unsigned int mLVL1ID = 0x3FFF; // create module LVL1ID variable @@ -226,19 +235,50 @@ StatusCode PixelRodDecoder::fillCollection( const ROBFragment *robFrag, IPixelRD corruptionError = corruptionError || checkDataWordsCorruption( rawDataWord ); uint32_t word_type = getDataType(rawDataWord, link_start); // get type of data word ++nwords_in_module_fragment; - errorcode = 0; - bsErrCode = 0; serviceCodeCounter = 0; serviceCode = 0; + + int indexModule = -1; + int indexFE = -1; + if (word_type!=PRB_LINKHEADER) { + if (offlineIdHash!=0xffffffff) { // now write the error word to the service + isIBLModule = false; + isDBMModule = false; + if (m_is_ibl_present) { + isIBLModule = isIBL(robId); + isDBMModule = isDBM(robId); + } + + int chFE = 0; + if (isIBLModule || isDBMModule) { // get FE channel id for IBL + linkNum_IBLheader = decodeModule_IBL(rawDataWord); + chFE = (extractFefromLinkNum(linkNum_IBLheader) & 0x1); + } + else { // for PIXEL + chFE = decodeFE(rawDataWord); + } + indexModule = static_cast<int>(offlineIdHash); // [0,2047] + indexFE = (1+chFE)*m_pixel_id->wafer_hash_max()+static_cast<int>(offlineIdHash); // index for IDCInDetBSErrContainer + } + } + + bool headerErr_decoding = false; + bool headerErr_flagged = false; + bool headerErr_preamble = false; + bool headerErr_timeout = false; + bool headerErr_lvl1id = false; + bool headerErr_bcid = false; switch (word_type) { // depending on type of word call the right decoding method //-------------------------------------------------------------------------------------------- HEADER WORD FOUND case PRB_LINKHEADER: // link (module) header found ATH_MSG_DEBUG("Header word found"); + errorRecoverable = 0; // reset errorcode + if (link_start) { // if header found before last header was closed by a trailer -> error generalwarning("In ROB 0x" << std::hex << robId << ": Unexpected link header found: 0x" << std::hex << rawDataWord << ", data corruption" << std::dec); m_numDecodingErrors++; - PixelByteStreamErrors::addError( bsErrCode, PixelByteStreamErrors::Decoding ); + headerErr_decoding = true; } else { ATH_MSG_DEBUG( "Header decoding starts" ); @@ -254,7 +294,6 @@ StatusCode PixelRodDecoder::fillCollection( const ROBFragment *robFrag, IPixelRD isIBLModule = isIBL(robId); isDBMModule = isDBM(robId); } - errorcode = 0; // reset errorcode // Keep track of IDs for previous fragment before decoding the new values prevLVL1ID = mLVL1ID; prevBCID = mBCID; @@ -272,7 +311,7 @@ StatusCode PixelRodDecoder::fillCollection( const ROBFragment *robFrag, IPixelRD linkNum_IBLheader = decodeModule_IBL(rawDataWord); // decode IBL FE number on the S-Link (range [0,7], as 8 FEs are connected to 1 S-Link in IBL) and the S-Link number itself: n if (decodeFeI4Bflag_IBL(rawDataWord)) { m_numFlaggedErrors++; - PixelByteStreamErrors::addError( bsErrCode, PixelByteStreamErrors::Flagged ); + headerErr_flagged = true; } fe_IBLheader = extractFefromLinkNum(linkNum_IBLheader); mLink = fe_IBLheader; // this is used to retrieve the onlineId. It contains only the 3 LSBs of the nnnnn, indicating the number of FE w.r.t. the SLink @@ -290,7 +329,8 @@ StatusCode PixelRodDecoder::fillCollection( const ROBFragment *robFrag, IPixelRD if ((mBCID != prevBCID + 1) && prevBCID != 0x3FFF && prevBCID != mBCID_max_IBL) { lvl1id_bcid_warning("In ROB 0x" << std::hex << robId << ", FE: 0x" << mLink << ": frame header with non-consecutive BCID (current BCID = 0x" << mBCID << ", previous BCID = 0x" << prevBCID << ")" << std::dec); } - } else { // If decoding new FE, check BCID offset + } + else { // If decoding new FE, check BCID offset offsetBCID_ROB_FE = static_cast<int>(mBCID) - robBCID; if (offsetBCID_ROB_FE != prevOffsetBCID_ROB_FE && (offsetBCID_ROB_FE != 0x3FFF && prevOffsetBCID_ROB_FE != 0x3FFF)) { lvl1id_bcid_warning("In ROB 0x" << std::hex << robId << ", FE: 0x" << mLink << std::dec << ": FE header with unexpected BCID offset" << " wrt to ROB header (offset = " << offsetBCID_ROB_FE << ", expected " << prevOffsetBCID_ROB_FE << " from ROB)"); @@ -302,8 +342,9 @@ StatusCode PixelRodDecoder::fillCollection( const ROBFragment *robFrag, IPixelRD prevStartingBCID = mBCID; } // Count number of headers received - if (mLink < 0x8) ++nFragmentsPerFE[mLink]; - } else { // this is Pixels detector decode header word. Data format: 001PtlbxdnnnnnnnMMMMLLLLBBBBBBBB (NOT IBL OR PIXEL) + if (mLink < 0x8) { ++nFragmentsPerFE[mLink]; } + } + else { // this is Pixels detector decode header word. Data format: 001PtlbxdnnnnnnnMMMMLLLLBBBBBBBB (NOT IBL OR PIXEL) ATH_MSG_VERBOSE( "Decoding Pixel header word: 0x" << std::hex << rawDataWord << std::dec ); mBCID = decodeBCID(rawDataWord); // decode Pixel BCID: B mLVL1ID = decodeL1ID(rawDataWord); // decode Pixel LVL1ID: L @@ -311,8 +352,27 @@ StatusCode PixelRodDecoder::fillCollection( const ROBFragment *robFrag, IPixelRD const uint32_t headerError = decodeHeaderErrors(rawDataWord); // get link (module) header errors if ( headerError != 0 ) { sc = StatusCode::RECOVERABLE; - errorcode = errorcode | (headerError << 20); //encode error as HHHHMMMMMMMMFFFFFFFFTTTT for header, flagword, trailer errors - checkHeaderErrors( bsErrCode, headerError ); + errorRecoverable = errorRecoverable | (headerError << 20); //encode error as HHHHMMMMMMMMFFFFFFFFTTTT for header, flagword, trailer errors + + if (headerError != 0) { // only treatment for header errors now, FIXME + if (headerError & (1 << 3)) { + m_numPreambleErrors++; + headerErr_preamble = true; + } + if (headerError & (1 << 2)) { + m_numTimeOutErrors++; + headerErr_timeout = true; + } + if (headerError & (1 << 1)) { + m_numLVL1IDErrors++; + headerErr_lvl1id = true; + } + if (headerError & (1 << 0)) { + m_numBCIDErrors++; + headerErr_bcid = true; + } + } + } } // end of detector type decoding // Get onlineId @@ -328,13 +388,25 @@ StatusCode PixelRodDecoder::fillCollection( const ROBFragment *robFrag, IPixelRD offlineIdHash = m_pixel_id->wafer_hash(pixCabling->find_entry_onoff(onlineId)); if (offlineIdHash != previous_offlineIdHash) { mBCID_offset = mBCID; // set BCID offset if this is first LVL1A + // The index array is defined in PixelRawDataProviderTool::SizeOfIDCInDetBSErrContainer() + // Here, 52736 is a separator beween error flags and isActive flags. + bsErrWord[static_cast<int>(offlineIdHash)+52736] = 1; } mLVL1A = mBCID - mBCID_offset; // calculate the LVL1A if (mLVL1A < 0) { - if (isIBLModule || isDBMModule) mLVL1A = mLVL1A + mBCID_max_IBL; - else mLVL1A = mLVL1A + mBCID_max_pix; + if (isIBLModule || isDBMModule) { mLVL1A=mLVL1A+mBCID_max_IBL; } + else { mLVL1A=mLVL1A+mBCID_max_pix; } } + // Fill header error word per module + if (headerErr_decoding) { PixelByteStreamErrors::addError(bsErrWord[static_cast<int>(offlineIdHash)],PixelByteStreamErrors::Decoding); } + if (headerErr_flagged) { PixelByteStreamErrors::addError(bsErrWord[static_cast<int>(offlineIdHash)],PixelByteStreamErrors::Flagged); } + if (headerErr_preamble) { PixelByteStreamErrors::addError(bsErrWord[static_cast<int>(offlineIdHash)],PixelByteStreamErrors::Preamble); } + if (headerErr_timeout) { PixelByteStreamErrors::addError(bsErrWord[static_cast<int>(offlineIdHash)],PixelByteStreamErrors::TimeOut); } + if (headerErr_lvl1id) { PixelByteStreamErrors::addError(bsErrWord[static_cast<int>(offlineIdHash)],PixelByteStreamErrors::LVL1ID); } + if (headerErr_bcid) { PixelByteStreamErrors::addError(bsErrWord[static_cast<int>(offlineIdHash)],PixelByteStreamErrors::BCID); } + + #ifdef PIXEL_DEBUG ATH_MSG_VERBOSE( "link header with BCID: " << mBCID << " LVL1ID: " << mLVL1ID << " LVL1A: " << mLVL1A << " link: " << mLink << " found"); ATH_MSG_VERBOSE( "got OfflineIDHash: 0x" << std::hex << offlineIdHash << " from OnlineID: 0x" << onlineId << std::dec << " link: " << mLink); @@ -368,15 +440,18 @@ StatusCode PixelRodDecoder::fillCollection( const ROBFragment *robFrag, IPixelRD are_4condensed_words = false; // All 4 words have to be found before turning it on condensedWords[0] = rawDataWord; continue; - } else if (countHitCondensedWords == 1) { // it is the second of the 4 hit condensed words (IBL) + } + else if (countHitCondensedWords == 1) { // it is the second of the 4 hit condensed words (IBL) ++countHitCondensedWords; condensedWords[1] = rawDataWord; continue; - } else if (countHitCondensedWords == 2) { // it is the third of the 4 hit condensed words (IBL) + } + else if (countHitCondensedWords == 2) { // it is the third of the 4 hit condensed words (IBL) ++countHitCondensedWords; condensedWords[2] = rawDataWord; continue; - } else if (((rawDataWord & PRB_DATAMASK) == PRB_LASTHITCONDENSEDWORD) && (countHitCondensedWords == 3)) { // it is the fourth of the 4 hit condensed words (IBL) + } + else if (((rawDataWord & PRB_DATAMASK) == PRB_LASTHITCONDENSEDWORD) && (countHitCondensedWords == 3)) { // it is the fourth of the 4 hit condensed words (IBL) are_4condensed_words = true; receivedCondensedWords = true; condensedWords[3] = rawDataWord; @@ -415,7 +490,8 @@ StatusCode PixelRodDecoder::fillCollection( const ROBFragment *robFrag, IPixelRD if (countHitCondensedWords != 0) { // I received some IBL words, but less than 4, there was an error in the rod transmission generalwarning("In ROB 0x" << std::hex << robId << ", link 0x" << mLink << ": Interruption of IBL condensed words - hit(s) ignored (current dataword: 0x" << std::hex << rawDataWord << std::dec << ")"); m_numDecodingErrors++; - PixelByteStreamErrors::addError( bsErrCode, PixelByteStreamErrors::Decoding ); + if (indexModule>-1) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::Decoding); } + if (indexFE>-1) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::Decoding); } countHitCondensedWords = 0; } // IBL non-condensed Hit Words decoding: @@ -433,10 +509,12 @@ StatusCode PixelRodDecoder::fillCollection( const ROBFragment *robFrag, IPixelRD ATH_MSG_DEBUG("hit dataword found for module offlineIDHash: " << offlineIdHash << " Row: 0x" << std::hex << mRow << " Col: 0x" << mColumn << " Tot: 0x" << mToT << std::dec); #endif - } else { // it is an IBL/DBM hit word, but it hasn't been recognised + } + else { // it is an IBL/DBM hit word, but it hasn't been recognised generalwarning("In ROB 0x" << std::hex << robId << ", FE: 0x" << mLink << ": IBL/DBM hit word 0x" << rawDataWord << " not recognised" << std::dec); m_numDecodingErrors++; - PixelByteStreamErrors::addError( bsErrCode, PixelByteStreamErrors::Decoding ); + if (indexModule>-1) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::Decoding); } + if (indexFE>-1) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::Decoding); } continue; } // computing the FE number on the silicon wafer for IBL ( mFE is = 0 for IBL 3D and the lower-eta FE on the planar sensor, @@ -454,7 +532,8 @@ StatusCode PixelRodDecoder::fillCollection( const ROBFragment *robFrag, IPixelRD << ": Interruption of IBL condensed words - hit(s) ignored (current dataword: 0x" << std::hex << rawDataWord << std::dec << ")"); m_numDecodingErrors++; - PixelByteStreamErrors::addError( bsErrCode, PixelByteStreamErrors::Decoding ); + if (indexModule>-1) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::Decoding); } + if (indexFE>-1) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::Decoding); } countHitCondensedWords = 0; } //Pixel Hit Words decoding: @@ -506,7 +585,8 @@ StatusCode PixelRodDecoder::fillCollection( const ROBFragment *robFrag, IPixelRD unsigned int num_cycles_toFillCollection(0); if (are_4condensed_words) { num_cycles_toFillCollection = nHits; - } else { + } + else { num_cycles_toFillCollection = 1; row[0] = mRow; col[0] = mColumn; @@ -523,7 +603,8 @@ StatusCode PixelRodDecoder::fillCollection( const ROBFragment *robFrag, IPixelRD if ((tot[i] & 0xF0) == 0x00) { generalwarning("In ROB 0x" << std::hex << robId << ", FE 0x" << mLink << ": First IBL ToT field is 0 - hit word 0x" << rawDataWord << " decodes to ToT1 = 0" << (tot[i] >> 4) << ", ToT2 = 0x" << (tot[i] & 0xF) << ", row = " << std::dec << row[i] << " col = " << col[i] << std::dec); continue; - } else { + } + else { if (((row[i] != 0) && (col[i] != 0) && (row[i] <= 336) && (col[i] <= 80)) || isDBMModule) { // FIXME : Hardcoded numbers. Should be ok as they are features of the FE-I4, but worth checking! pixelId = m_pixelCabling ->getPixelIdfromHash (offlineIdHash, mFE, row[i], col[i]); @@ -538,7 +619,8 @@ StatusCode PixelRodDecoder::fillCollection( const ROBFragment *robFrag, IPixelRD if (pixelId == invalidPixelId) { generalwarning("In ROB 0x" << std::hex << robId << ", FE 0x" << mLink << ": Illegal pixelId - hit word 0x" << rawDataWord << " decodes to ToT1 = 0" << (tot[i] >> 4) << ", ToT2 = 0x" << (tot[i] & 0xF) << ", row = " << std::dec << row[i] << " col = " << col[i] << std::dec); m_numInvalidIdentifiers++; - PixelByteStreamErrors::addError( bsErrCode, PixelByteStreamErrors::Invalid ); + if (indexModule>-1) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::Invalid); } + if (indexFE>-1) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::Invalid); } continue; } IBLtot[0] = divideHits(tot[i], 4, 7); // corresponds to (col, row) @@ -553,7 +635,8 @@ StatusCode PixelRodDecoder::fillCollection( const ROBFragment *robFrag, IPixelRD // Get the hit discrimination configuration setting for this FE if (m_pixelCabling->getModuleType(pixelId)==IPixelCablingSvc::IBL_PLANAR || m_pixelCabling->getModuleType(pixelId)==IPixelCablingSvc::DBM) { hitDiscCnfg = (*pixHitDiscCnfg)->getHitDiscCnfgPL(); - } else if (m_pixelCabling->getModuleType(pixelId)==IPixelCablingSvc::IBL_3D) { + } + else if (m_pixelCabling->getModuleType(pixelId)==IPixelCablingSvc::IBL_3D) { hitDiscCnfg = (*pixHitDiscCnfg)->getHitDiscCnfg3D(); } // Now do some interpreting of the ToT values @@ -562,7 +645,8 @@ StatusCode PixelRodDecoder::fillCollection( const ROBFragment *robFrag, IPixelRD if (not m_checkDuplicatedPixel or thisRdoIsUnique(pixelId, foundPixels)) { // Insert the first part of the ToT info in the collection coll->push_back(new RDO(pixelId, IBLtot[0], mBCID, mLVL1ID, mLVL1A)); - } else { + } + else { m_numDuplicatedPixels++; } @@ -577,10 +661,12 @@ StatusCode PixelRodDecoder::fillCollection( const ROBFragment *robFrag, IPixelRD if ((row[i] + 1) > 336) { // FIXME: hardcoded number - but it should still be ok, because it's a feature of the FE-I4! // this should never happen. If row[i] == 336, (row[i]+1) == 337. This row does not exist, so the TOT(337) should always be 0 (== no hit) generalwarning("In ROB = 0x" << std::hex << robId << ", link 0x" << mLink << ": Illegal IBL row number for second ToT field, hit word 0x" << rawDataWord << " decodes to row = " << std::dec << row[i]+1 << " col = " << col[i] << " (ToT1 = 0x" << std::hex << IBLtot[0] << " ToT2 = 0x" << IBLtot[1] << ")"); - PixelByteStreamErrors::addError( bsErrCode, PixelByteStreamErrors::Invalid ); + if (indexModule>-1) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::Invalid); } + if (indexFE>-1) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::Invalid); } m_numInvalidIdentifiers++; continue; - } else { + } + else { pixelId = m_pixelCabling ->getPixelIdfromHash (offlineIdHash, mFE, row[i] + 1, col[i]); #ifdef PIXEL_DEBUG @@ -597,12 +683,14 @@ StatusCode PixelRodDecoder::fillCollection( const ROBFragment *robFrag, IPixelRD if (pixelId == invalidPixelId) { generalwarning("In ROB 0x" << std::hex << robId << ", FE 0x" << mLink << ": Illegal pixelId - hit word 0x" << rawDataWord << " decodes to ToT1 = 0" << (tot[i] >> 4) << ", ToT2 = 0x" << (tot[i] & 0xF) << ", row = " << std::dec << row[i] << " col = " << col[i] << std::dec); m_numInvalidIdentifiers++; - PixelByteStreamErrors::addError( bsErrCode, PixelByteStreamErrors::Invalid ); + if (indexModule>-1) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::Invalid); } + if (indexFE>-1) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::Invalid); } continue; } if (not m_checkDuplicatedPixel or thisRdoIsUnique(pixelId, foundPixels)) { coll->push_back(new RDO(pixelId, IBLtot[1], mBCID, mLVL1ID, mLVL1A)); - } else { + } + else { m_numDuplicatedPixels++; } @@ -616,7 +704,8 @@ StatusCode PixelRodDecoder::fillCollection( const ROBFragment *robFrag, IPixelRD else { generalwarning("In ROB = 0x" << std::hex << robId << ", link 0x" << mLink << ": Illegal IBL row/col number, hit word 0x" << rawDataWord << " decodes to row = " << std::dec << row[i] << " col = " << col[i] << " (ToT1 = 0x" << std::hex << (tot[i] >> 4) << " ToT2 = 0x" << (tot[i] & 0xF) << ")"); m_numInvalidIdentifiers++; - PixelByteStreamErrors::addError( bsErrCode, PixelByteStreamErrors::Invalid ); + if (indexModule>-1) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::Invalid); } + if (indexFE>-1) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::Invalid); } continue; } } // end of the else from the condition "(tot[i] & 0xF0) == 0xF", corresponding to an invalid tot sent by the ROD @@ -628,13 +717,15 @@ StatusCode PixelRodDecoder::fillCollection( const ROBFragment *robFrag, IPixelRD if (pixelId == invalidPixelId) { ATH_MSG_DEBUG("In ROB = 0x" << std::hex << robId << ", link 0x" << mLink << ": Illegal pixelId - row = " << std::dec << mRow << ", col = " << mColumn << ", dataword = 0x" << std::hex << rawDataWord << std::dec); m_numInvalidIdentifiers++; - PixelByteStreamErrors::addError( bsErrCode, PixelByteStreamErrors::Invalid ); + if (indexModule>-1) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::Invalid); } + if (indexFE>-1) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::Invalid); } continue; } // Now the Collection is there for sure. Create RDO and push it into Collection. if (not m_checkDuplicatedPixel or thisRdoIsUnique(pixelId, foundPixels)) { coll->push_back(new RDO(pixelId, mToT, mBCID, mLVL1ID, mLVL1A)); - } else { + } + else { m_numDuplicatedPixels++; } @@ -647,7 +738,8 @@ StatusCode PixelRodDecoder::fillCollection( const ROBFragment *robFrag, IPixelRD else { // no header found before hit -> error generalwarning("In ROB = 0x" << std::hex << robId << ", link 0x" << mLink << ": Unexpected hit dataword: " << rawDataWord << " - hit ignored"); m_numDecodingErrors++; - PixelByteStreamErrors::addError( bsErrCode, PixelByteStreamErrors::Decoding ); + if (indexModule>-1) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::Decoding); } + if (indexFE>-1) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::Decoding); } continue; } break; @@ -655,10 +747,12 @@ StatusCode PixelRodDecoder::fillCollection( const ROBFragment *robFrag, IPixelRD case PRB_LINKTRAILER: // link (module) trailer found if (link_start) { // if header found before trailer -> expected ATH_MSG_DEBUG( "link trailer found" ); // trailer found debug message - } else { // no header found before trailer -> error + } + else { // no header found before trailer -> error generalwarning("In ROB = 0x" << std::hex << robId << ", link 0x" << mLink << ": Unexpected trailer found: 0x" << std::hex << rawDataWord << ", data corruption"); m_numDecodingErrors++; - PixelByteStreamErrors::addError( bsErrCode, PixelByteStreamErrors::Decoding ); + if (indexModule>-1) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::Decoding); } + if (indexFE>-1) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::Decoding); } continue; } previous_offlineIdHash = offlineIdHash; // save offlineId for next header; @@ -668,11 +762,49 @@ StatusCode PixelRodDecoder::fillCollection( const ROBFragment *robFrag, IPixelRD if (isIBLModule || isDBMModule) { // decode IBL/DBM Trailer word: 010nnnnnECPplbzhvMMMMMMMMMMxxxxx ATH_MSG_VERBOSE( "Decoding IBL/DBM trailer word: 0x" << std::hex << rawDataWord << std::dec ); const uint32_t trailerError = decodeTrailerErrors_IBL(rawDataWord); // => E cPpl bzhv // taking all errors together. - // Insert trailer errors into errorcode (except the 'c' bit) - // CCC CCCC CCCC CCCC CCCC EPpl bzhv - const uint32_t trailerError_noC = (trailerError & 0x7F) | ((trailerError & 0x100) >> 1); - errorcode = errorcode | trailerError_noC; - checkTrailerErrorsIBL( bsErrCode, trailerError ); + + if (trailerError & (1 << 8)) { // time out error bit => E + m_numTimeOutErrors++; + if (indexModule>-1) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::TimeOut); } + if (indexFE>-1) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::TimeOut); } + } + + if (trailerError & (1 << 6)) {// link masked by PPC => P + m_numLinkMaskedByPPC++; + if (indexModule>-1) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::LinkMaskedByPPC); } + if (indexFE>-1) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::LinkMaskedByPPC); } + } + if (trailerError & (1 << 5)) { // preamble error bit => p + m_numPreambleErrors++; + if (indexModule>-1) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::Preamble); } + if (indexFE>-1) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::Preamble); } + } + if (trailerError & (1 << 4)) { // LVL1 error bit => l + m_numLVL1IDErrors++; + if (indexModule>-1) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::LVL1ID); } + if (indexFE>-1) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::LVL1ID); } + } + if (trailerError & (1 << 3)) {// BCID error bit => b + m_numBCIDErrors++; + if (indexModule>-1) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::BCID); } + if (indexFE>-1) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::BCID); } + } + if (trailerError & (1 << 2)) { // trailer error bit => z + m_numTrailerErrors++; + if (indexModule>-1) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::Trailer); } + if (indexFE>-1) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::Trailer); } + } + if (trailerError & (1 << 1)) { // header/trailer limit error=> h + m_numLimitError++; + if (indexModule>-1) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::Limit); } + if (indexFE>-1) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::Limit); } + } + if (trailerError & (1 << 0)) { // data overflow error=> v + m_numInvalidIdentifiers++; + if (indexModule>-1) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::Invalid); } + if (indexFE>-1) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::Invalid); } + } + if (trailerError & (1 << 7)) { // condensed mode bit => W if (!receivedCondensedWords) { generalwarning("In ROB 0x" << std::hex << robId << ", link 0x" << mLink << ": condensed mode bit is set, but no condensed words received" << std::dec); } } @@ -685,13 +817,38 @@ StatusCode PixelRodDecoder::fillCollection( const ROBFragment *robFrag, IPixelRD if (decodeBcidTrailer_IBL(rawDataWord) != (mBCID & PRB_BCIDSKIPTRAILERmask_IBL)) { generalwarning("In ROB 0x" << std::hex << robId << ", link 0x" << mLink << ": Trailer BCID does not match header (trailer BCID = 0x" << decodeBcidTrailer_IBL(rawDataWord) << ", 5LSB of header BCID = 0x" << (mBCID & PRB_BCIDSKIPTRAILERmask_IBL) << ")" << std::dec); } - } else { // decode Pixel trailer word + } + else { // decode Pixel trailer word ATH_MSG_VERBOSE( "Decoding Pixel trailer word: 0x" << std::hex << rawDataWord << std::dec ); const uint32_t trailerError = decodeTrailerErrors(rawDataWord); // creating link (module) trailer error variable if (trailerError != 0) { sc = StatusCode ::RECOVERABLE; - errorcode = errorcode | trailerError; //encode error as HHHHMMMMMMMMFFFFFFFFTTTT for header, flagword, trailer errors - checkTrailerErrors( bsErrCode, trailerError); + errorRecoverable = errorRecoverable | trailerError; //encode error as HHHHMMMMMMMMFFFFFFFFTTTT for header, flagword, trailer errors + + const std::array<unsigned long long, 4> bitPosition{0_BIT, 1_BIT, 2_BIT, 3_BIT}; + for (const auto bit:bitPosition){ + if (trailerError & bit) ++m_numTrailerErrors; + } + + if ( trailerError & 0xF ) { + if (indexModule>-1) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::Trailer); } + if (indexFE>-1) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::Trailer); } + } + + // Extra for pixel monitoring + if (trailerError != 0) { + if (indexModule>-1) { + if (trailerError & (1 << 2)) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::RODTrailerBitError); } + if (trailerError & (1 << 1)) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::RODHeaderLimit); } + if (trailerError & (1 << 0)) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::RODDataOVerflow); } + } + if (indexFE>-1) { + if (trailerError & (1 << 2)) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::RODTrailerBitError); } + if (trailerError & (1 << 1)) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::RODHeaderLimit); } + if (trailerError & (1 << 0)) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::RODDataOVerflow); } + } + } + } } break; @@ -705,28 +862,32 @@ StatusCode PixelRodDecoder::fillCollection( const ROBFragment *robFrag, IPixelRD if (linkNum_IBLword != linkNum_IBLheader) { generalwarning("In ROB 0x" << std::hex << robId << ", link 0x" << mLink << ": Link number mismatch - nnnnn (error word) = 0x" << linkNum_IBLword << ", nnnnn (header) = 0x" << linkNum_IBLheader << std::dec); } - serviceCodeCounter = decodeServiceCodeCounter_IBL(rawDataWord); // frequency of the serviceCode (with the exceptions of serviceCode = 14,15 or 16) + serviceCodeCounter = decodeServiceCodeCounter_IBL(rawDataWord)+1; // frequency of the serviceCode (with the exceptions of serviceCode = 14,15 or 16) serviceCode = decodeServiceCode_IBL(rawDataWord); // is a code. the corresponding meaning is listed in the table in the FE-I4 manual, pag. 105 // Treat the service code only if its meaning is valid (i.e. value < 31) - if (serviceCode < 32) { - // Treatment of the FE flag serviceCode and serviceCodeCounter - // Returns encoded uint32_t to be added to errorcode - uint32_t encodedServiceCodes = treatmentFEFlagInfo(serviceCode, serviceCodeCounter); - // Insert service codes into errorcode - // CCC CCCC CCCC CCCC CCCC EPpl bzhv - errorcode = errorcode | (encodedServiceCodes << 8); - } else { + if (serviceCode>31) { generalwarning("In ROB 0x" << std::hex << robId << ", link 0x" << mLink << ": Got out-of-bounds service code: " << std::dec << serviceCode << " (counter: " << serviceCodeCounter << "), ignored"); } - } else { // Pixel type2 flag found + int chFE = (extractFefromLinkNum(linkNum_IBLheader) & 0x1); + if (serviceCodeCounter>0 && serviceCode<32) { + if (serviceCode!=14) { + // The index array is defined in PixelRawDataProviderTool::SizeOfIDCInDetBSErrContainer() + int indexOffset = 17*m_pixel_id->wafer_hash_max(); + int indexSvcCounter = indexOffset+serviceCode*280*2+2*(static_cast<int>(offlineIdHash)-156)+chFE; + bsErrWord[indexSvcCounter] = serviceCodeCounter; + } + } + + } + else { // Pixel type2 flag found ATH_MSG_VERBOSE( "Decoding Pixel FEflag word: 0x" << std::hex << rawDataWord << std::dec ); uint32_t FEFlags = decodeFEFlags2(rawDataWord); // get FE flags uint32_t MCCFlags = decodeMCCFlags(rawDataWord); // get MCC flags FEFlags = FEFlags & 0xF3; // mask out the parity bits, they don't work if ((MCCFlags | FEFlags) != 0) { sc = StatusCode::RECOVERABLE; - errorcode = errorcode | (MCCFlags << 12) | (FEFlags << 4); //encode error as HHHHMMMMMMMMFFFFFFFFTTTT for header, flagword, trailer errors + errorRecoverable = errorRecoverable | (MCCFlags << 12) | (FEFlags << 4); //encode error as HHHHMMMMMMMMFFFFFFFFTTTT for header, flagword, trailer errors //for now just sum all flagged errors_ const std::array<unsigned long long, 8> bitPosition {0_BIT, 1_BIT, 2_BIT, 3_BIT, 4_BIT, 5_BIT, 6_BIT, 7_BIT}; for (const auto thisBit:bitPosition){ @@ -735,14 +896,48 @@ StatusCode PixelRodDecoder::fillCollection( const ROBFragment *robFrag, IPixelRD } if ( MCCFlags & 0xff or FEFlags & 0xff ) { - PixelByteStreamErrors::addError( bsErrCode, PixelByteStreamErrors::Flagged ); + if (indexModule>-1) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::Flagged); } + if (indexFE>-1) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::Flagged); } + } + + if (indexModule>-1) { + if (MCCFlags & (1 << 7)) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::MCCUndefined); } + if (MCCFlags & (1 << 6)) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::MCCUndefined); } + if (MCCFlags & (1 << 5)) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::MCCUndefined); } + if (MCCFlags & (1 << 4)) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::MCCLVL1IDEoECheck); } + if (MCCFlags & (1 << 3)) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::MCCBCIDEoECheck); } + if (MCCFlags & (1 << 2)) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::MCCLVL1IDCheck); } + if (MCCFlags & (1 << 1)) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::MCCEoEOverflow); } + if (MCCFlags & (1 << 0)) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::MCCHitOverflow); } + + if (FEFlags & (1 << 4)) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::FEWarning); } + if (FEFlags & (1 << 3)) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::FEHitParity); } + if (FEFlags & (1 << 2)) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::FERegisterParity); } + if (FEFlags & (1 << 1)) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::FEHammingCode); } + if (FEFlags & (1 << 0)) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::FEEoCOverflow); } + } + + if (indexFE>-1) { + if (MCCFlags & (1 << 7)) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::MCCUndefined); } + if (MCCFlags & (1 << 6)) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::MCCUndefined); } + if (MCCFlags & (1 << 5)) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::MCCUndefined); } + if (MCCFlags & (1 << 4)) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::MCCLVL1IDEoECheck); } + if (MCCFlags & (1 << 3)) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::MCCBCIDEoECheck); } + if (MCCFlags & (1 << 2)) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::MCCLVL1IDCheck); } + if (MCCFlags & (1 << 1)) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::MCCEoEOverflow); } + if (MCCFlags & (1 << 0)) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::MCCHitOverflow); } + + if (FEFlags & (1 << 4)) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::FEWarning); } + if (FEFlags & (1 << 3)) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::FEHitParity); } + if (FEFlags & (1 << 2)) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::FERegisterParity); } + if (FEFlags & (1 << 1)) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::FEHammingCode); } + if (FEFlags & (1 << 0)) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::FEEoCOverflow); } } - } else { + } + else { m_numDisabledFEErrors++; - PixelByteStreamErrors::addError( bsErrCode, PixelByteStreamErrors::BadFE ); - + if (indexFE>-1) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::BadFE); } ATH_MSG_DEBUG( "Disabled Pixel chip " << ((rawDataWord & 0x0F000000) >> 24) ); - } } @@ -759,37 +954,10 @@ StatusCode PixelRodDecoder::fillCollection( const ROBFragment *robFrag, IPixelRD default: generalwarning("In ROB 0x" << std::hex << robId << ", FE 0x" << mLink << ": Unknown word type found, 0x" << std::hex << rawDataWord << std::dec << ", ignoring"); m_numDecodingErrors++; - PixelByteStreamErrors::addError( bsErrCode, PixelByteStreamErrors::Decoding ); + if (indexModule>-1) { PixelByteStreamErrors::addError(bsErrWord[indexModule],PixelByteStreamErrors::Decoding); } + if (indexFE>-1) { PixelByteStreamErrors::addError(bsErrWord[indexFE],PixelByteStreamErrors::Decoding); } } // end of switch - - if (offlineIdHash!=0xffffffff) { // now write the error word to the service - - int chFE = 0; - if (isIBLModule || isDBMModule) { // get FE channel id for IBL - linkNum_IBLheader = decodeModule_IBL(rawDataWord); - chFE = (extractFefromLinkNum(linkNum_IBLheader) & 0x1); - } - else { // for PIXEL - chFE = decodeFE(rawDataWord); - } - - if (bsErrCode) { - int indexFE = (1+chFE)*m_pixel_id->wafer_hash_max()+(int)offlineIdHash; // index for IDCInDetBSErrContainer - decodingErrors.setOrDrop( offlineIdHash, bsErrCode ); - decodingErrors.setOrDrop( indexFE, bsErrCode ); - } - if (isIBLModule) { - if (serviceCode>0 && serviceCode<32) { - if (serviceCode!=14) { - int indexOffset = 17*m_pixel_id->wafer_hash_max(); - int indexSvcCounter = indexOffset+(serviceCode-1)*280*2+2*((int)offlineIdHash-156)+chFE; - decodingErrors.setOrDrop( indexSvcCounter, serviceCodeCounter ); - } - } - } - } - } // end of loop over ROD ATH_CHECK( updateEventInfoIfEventCorrupted( corruptionError ) ); @@ -799,14 +967,20 @@ StatusCode PixelRodDecoder::fillCollection( const ROBFragment *robFrag, IPixelRD checkUnequalNumberOfHeaders( nFragmentsPerFE, robId ); } + // Fill error information in IDC + for (size_t i=0; i<static_cast<size_t>(bsErrWord.size()); i++) { + if (bsErrWord[i]>0) { + decodingErrors.setOrDrop(i,bsErrWord[i]); + } + } + if (sc == StatusCode::RECOVERABLE) { - if (errorcode == (3 << 20) ){ // Fix for M8, this error always occurs, masked out REMOVE FIXME !! + if (errorRecoverable == (3 << 20) ){ // Fix for M8, this error always occurs, masked out REMOVE FIXME !! m_masked_errors++; return StatusCode::SUCCESS; } - - ATH_MSG_DEBUG( "Recoverable errors found in PixelRodDecoder, errorcode: " << errorcode ); + ATH_MSG_DEBUG( "Recoverable errors found in PixelRodDecoder, errorcode: " << errorRecoverable ); } return sc; } @@ -912,8 +1086,7 @@ uint32_t PixelRodDecoder::decodeHeaderErrors(const uint32_t word) const //////////////////////// // decode hit row number (bits 0-7 of Pixel hit word, bits 0-8 of IBL hit word) //////////////////////// -uint32_t PixelRodDecoder::decodeRow(const uint32_t word, bool isIBLorDBM) const -{ +uint32_t PixelRodDecoder::decodeRow(const uint32_t word, bool isIBLorDBM) const { if( isIBLorDBM ) { return ((word >> PRB_ROWskip_IBL) & PRB_ROWmask_IBL); } @@ -925,8 +1098,7 @@ uint32_t PixelRodDecoder::decodeRow(const uint32_t word, bool isIBLorDBM) const //////////////////////// // decode hit column number (bits 8-12 of Pixel hit word, bits 9-15 of IBL hit word) //////////////////////// -uint32_t PixelRodDecoder::decodeColumn(const uint32_t word, bool isIBLorDBM) const -{ +uint32_t PixelRodDecoder::decodeColumn(const uint32_t word, bool isIBLorDBM) const { if( isIBLorDBM ) { return ((word >> PRB_COLUMNskip_IBL) & PRB_COLUMNmask_IBL); } @@ -938,64 +1110,50 @@ uint32_t PixelRodDecoder::decodeColumn(const uint32_t word, bool isIBLorDBM) con //////////////////////// // decode hit TimeOverThreshold value (bits 16-23 of Pixel hit word, bits 16-23 of IBL hit word) //////////////////////// -uint32_t PixelRodDecoder::decodeToT(const uint32_t word, bool isIBLorDBM) const -{ - if ( isIBLorDBM ) - { // IBL Tot => 8 bits to be divided into 2 Tot info, each of which is 4 bits - uint32_t Tot8Bits = ((word >> PRB_TOTskip_IBL) & PRB_TOTmask_IBL); // this Tot information returns a 8-bit word. In the case of the IBL, it will be splitted into Tot(1) and Tot(2), corresponding to pixels (col,row) and (col, row+1) - return Tot8Bits; - } - else - { // Pixel Tot - return ((word >> PRB_TOTskip) & PRB_TOTmask); - } +uint32_t PixelRodDecoder::decodeToT(const uint32_t word, bool isIBLorDBM) const { + if ( isIBLorDBM ) { // IBL Tot => 8 bits to be divided into 2 Tot info, each of which is 4 bits + uint32_t Tot8Bits = ((word >> PRB_TOTskip_IBL) & PRB_TOTmask_IBL); // this Tot information returns a 8-bit word. In the case of the IBL, it will be splitted into Tot(1) and Tot(2), corresponding to pixels (col,row) and (col, row+1) + return Tot8Bits; + } + else { // Pixel Tot + return ((word >> PRB_TOTskip) & PRB_TOTmask); + } } - - //////////////////////// // decode Link number in the IBL not-condensed hit word (bits 24-26 of IBL hit word) //////////////////////// -uint32_t PixelRodDecoder::decodeLinkNumHit_IBL(const uint32_t word) const -{ +uint32_t PixelRodDecoder::decodeLinkNumHit_IBL(const uint32_t word) const { return ((word >> PRB_LINKNUMHITskip_IBL) & PRB_LINKNUMHITmask_IBL); } - //////////////////////// // decode module FE number (bits 24-27 of Pixel hit word) //////////////////////// -uint32_t PixelRodDecoder::decodeFE(const uint32_t word) const -{ +uint32_t PixelRodDecoder::decodeFE(const uint32_t word) const { return ((word >> PRB_FEskip) & PRB_FEmask); } - // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ TRAILER BITS //////////////////////// // decode IBL "M" in the trailer (bits 5-14 of IBL module trailer word) //////////////////////// -uint32_t PixelRodDecoder::decodeSkippedTrigTrailer_IBL(const uint32_t word) const -{ +uint32_t PixelRodDecoder::decodeSkippedTrigTrailer_IBL(const uint32_t word) const { return ((word >> PRB_SKIPPEDTRIGGERTRAILERskip_IBL) & PRB_SKIPPEDTRIGGERTRAILERmask_IBL); } //////////////////////// // decode IBL trailer errors (bits 15-23 of IBL module trailer word) //////////////////////// -uint32_t PixelRodDecoder::decodeTrailerErrors_IBL(const uint32_t word) const -{ +uint32_t PixelRodDecoder::decodeTrailerErrors_IBL(const uint32_t word) const { return ((word >> PRB_TRAILERERRORSskip_IBL) & PRB_TRAILERERRORSmask_IBL); } - - //////////////////////// // decode Link Number in the IBL Trailer (bits 24-26 of IBL module trailer word) //////////////////////// -uint32_t PixelRodDecoder::decodeLinkNumTrailer_IBL(const uint32_t word) const -{ +uint32_t PixelRodDecoder::decodeLinkNumTrailer_IBL(const uint32_t word) const { return ((word >> PRB_LINKNUMTRAILERskip_IBL) & PRB_LINKNUMTRAILERmask_IBL); } @@ -1003,8 +1161,7 @@ uint32_t PixelRodDecoder::decodeLinkNumTrailer_IBL(const uint32_t word) const //////////////////////// // decode BCID in trailer word //////////////////////// -uint32_t PixelRodDecoder::decodeBcidTrailer_IBL(const uint32_t word) const -{ +uint32_t PixelRodDecoder::decodeBcidTrailer_IBL(const uint32_t word) const { return ((word >> PRB_BCIDSKIPTRAILERskip_IBL) & PRB_BCIDSKIPTRAILERmask_IBL); } @@ -1012,27 +1169,22 @@ uint32_t PixelRodDecoder::decodeBcidTrailer_IBL(const uint32_t word) const //////////////////////// // decode Condensed Mode Bit in the IBL trailer (bit 22 of IBL module trailer word) //////////////////////// -uint32_t PixelRodDecoder::decodeCondensedModeBit_IBL(const uint32_t word) const -{ +uint32_t PixelRodDecoder::decodeCondensedModeBit_IBL(const uint32_t word) const { return ((word >> PRB_CONDENSEDMODEskip_IBL) & PRB_CONDENSEDMODEmask_IBL); } - - //////////////////////// // decode trailer errors (bits 26-28 of Pixel module trailer word) //////////////////////// //template <class ROBData> -uint32_t PixelRodDecoder::decodeTrailerErrors(const uint32_t word) const -{ +uint32_t PixelRodDecoder::decodeTrailerErrors(const uint32_t word) const { return ((word >> PRB_TRAILERERRORSskip) & PRB_TRAILERERRORSmask); } //////////////////////// // look for bitflips in trailer word (bits 0-25 of Pixel module trailer word) //////////////////////// -uint32_t PixelRodDecoder::decodeTrailerBitflips(const uint32_t word) const -{ +uint32_t PixelRodDecoder::decodeTrailerBitflips(const uint32_t word) const { uint32_t flipword = ((word >> PRB_TRAILERBITFLIPskip) & PRB_TRAILERBITFLIPmask); uint32_t errorcount = 0; if (flipword != 0) { @@ -1049,26 +1201,21 @@ uint32_t PixelRodDecoder::decodeTrailerBitflips(const uint32_t word) const //////////////////////// // decodeServiceCodeCounter (bits 0-9 of IBL flag word) //////////////////////// -uint32_t PixelRodDecoder::decodeServiceCodeCounter_IBL(const uint32_t word) const -{ +uint32_t PixelRodDecoder::decodeServiceCodeCounter_IBL(const uint32_t word) const { return((word >> PRB_SERVICECODECOUNTERskip_IBL) & PRB_SERVICECODECOUNTERmask_IBL); } //////////////////////// // decodeServiceCode (bits 17-22 of IBL flag word) //////////////////////// -uint32_t PixelRodDecoder::decodeServiceCode_IBL(const uint32_t word) const -{ +uint32_t PixelRodDecoder::decodeServiceCode_IBL(const uint32_t word) const { return((word >> PRB_SERVICECODEskip_IBL) & PRB_SERVICECODEmask_IBL); } - - //////////////////////// // decodeLinkNumFEFlag (bits 25-27 of IBL flag word) //////////////////////// -uint32_t PixelRodDecoder::decodeLinkNumFEFlag_IBL(const uint32_t word) const -{ +uint32_t PixelRodDecoder::decodeLinkNumFEFlag_IBL(const uint32_t word) const { return((word >> PRB_LINKNUMBERFEFLAGskip_IBL) & PRB_LINKNUMBERFEFLAGmask_IBL); } @@ -1076,25 +1223,21 @@ uint32_t PixelRodDecoder::decodeLinkNumFEFlag_IBL(const uint32_t word) const //////////////////////// // decode FE flag errors (bits 0-7 of Pixel flag type 2 word) //////////////////////// -uint32_t PixelRodDecoder::decodeFEFlags2(const uint32_t word) const -{ +uint32_t PixelRodDecoder::decodeFEFlags2(const uint32_t word) const { return ((word >> PRB_FEFlagskip2) & PRB_FEFlagmask2); } //////////////////////// // decode MCC flag errors (bits 8-12 of Pixel flag type 2 word) //////////////////////// -uint32_t PixelRodDecoder::decodeMCCFlags(const uint32_t word) const -{ +uint32_t PixelRodDecoder::decodeMCCFlags(const uint32_t word) const { return ((word >> PRB_MCCFlagskip) & PRB_MCCFlagmask); } - //////////////////////// // determine module word type //////////////////////// -uint32_t PixelRodDecoder::getDataType(unsigned int rawDataWord, bool link_start) const -{ +uint32_t PixelRodDecoder::getDataType(unsigned int rawDataWord, bool link_start) const { if (link_start) { // there was a header, so if a timeout is found it's really a timeout and not an empty header, same for raw data if ((rawDataWord & PRB_DATAMASK) == PRB_RAWDATA ) return PRB_RAWDATA; // module flag word found if (rawDataWord == PRB_TIMEOUT) return PRB_TIMEOUT; // time out word found @@ -1112,17 +1255,18 @@ bool PixelRodDecoder::checkDataWordsCorruption( uint32_t rawDataWord) const { if ( ATH_UNLIKELY( rawDataWord==0xaa1234aa )) { generalwarning("Evt marker encountered during loop on ROD datawords"); return true; - } else if ( ATH_UNLIKELY( rawDataWord==0xdd1234dd ) ){ + } + else if ( ATH_UNLIKELY( rawDataWord==0xdd1234dd ) ){ generalwarning("ROB marker encountered during loop on ROD datawords"); return true; - } else if ( ATH_UNLIKELY( rawDataWord==0xee1234ee) ){ + } + else if ( ATH_UNLIKELY( rawDataWord==0xee1234ee) ){ generalwarning("ROD marker encountered during loop on ROD datawords"); return true; } return false; // no corruption } - uint32_t PixelRodDecoder::treatmentFEFlagInfo(unsigned int serviceCode, unsigned int serviceCodeCounter) const { unsigned int etc = 0, l1req = 0; // Log the code count @@ -1278,29 +1422,6 @@ uint32_t PixelRodDecoder::treatmentFEFlagInfo(unsigned int serviceCode, unsigned return code; } - -void PixelRodDecoder::checkHeaderErrors( uint64_t& bsErrorCode, uint32_t headerError ) const { - if (headerError != 0) { // only treatment for header errors now, FIXME - if (headerError & (1 << 3)) { - m_numPreambleErrors++; - PixelByteStreamErrors::addError( bsErrorCode, PixelByteStreamErrors::Preamble ); - } - if (headerError & (1 << 2)) { - m_numTimeOutErrors++; - PixelByteStreamErrors::addError( bsErrorCode, PixelByteStreamErrors::TimeOut ); - } - if (headerError & (1 << 1)) { - m_numLVL1IDErrors++; - PixelByteStreamErrors::addError( bsErrorCode, PixelByteStreamErrors::LVL1ID ); - } - if (headerError & (1 << 0)) { - m_numBCIDErrors++; - PixelByteStreamErrors::addError( bsErrorCode, PixelByteStreamErrors::BCID ); - } - } -} - - StatusCode PixelRodDecoder::updateEventInfoIfEventCorrupted( bool isCorrupted ) const { if ( not isCorrupted ) return StatusCode::SUCCESS; @@ -1323,7 +1444,8 @@ void PixelRodDecoder::checkUnequalNumberOfHeaders( const unsigned int nFragments for (unsigned int i = 0; i < 8; ++i) { if (nFrags == 0) { if (nFragmentsPerFE[i] != 0) nFrags = nFragmentsPerFE[i]; // set nFrags on first non-zero occurence - } else { + } + else { if (nFragmentsPerFE[i] != 0 && nFragmentsPerFE[i] != nFrags) { foundIssue = true; } @@ -1343,50 +1465,3 @@ void PixelRodDecoder::checkUnequalNumberOfHeaders( const unsigned int nFragments generalwarning("[FE number] : [# headers] - " << errmsg); } -void PixelRodDecoder::checkTrailerErrors( uint64_t& bsErrorCode, uint32_t trailerError ) const { - const std::array<unsigned long long, 4> bitPosition{0_BIT, 1_BIT, 2_BIT, 3_BIT}; - for (const auto bit:bitPosition){ - if (trailerError & bit) ++m_numTrailerErrors; - } - - if ( trailerError & 0xF ) { - PixelByteStreamErrors::addError( bsErrorCode, PixelByteStreamErrors::Trailer ); - } -} - -void PixelRodDecoder::checkTrailerErrorsIBL( uint64_t& bsErrorCode, uint32_t trailerError ) const { - // Add errors to errorsvc - if (trailerError & (1 << 8)) { // time out error bit => E - m_numTimeOutErrors++; - PixelByteStreamErrors::addError( bsErrorCode, PixelByteStreamErrors::TimeOut ); - } - - if (trailerError & (1 << 6)) {// link masked by PPC => P - m_numLinkMaskedByPPC++; - PixelByteStreamErrors::addError( bsErrorCode, PixelByteStreamErrors::LinkMaskedByPPC ); - } - if (trailerError & (1 << 5)) { // preamble error bit => p - m_numPreambleErrors++; - PixelByteStreamErrors::addError( bsErrorCode, PixelByteStreamErrors::Preamble ); - } - if (trailerError & (1 << 4)) { // LVL1 error bit => l - m_numLVL1IDErrors++; - PixelByteStreamErrors::addError( bsErrorCode, PixelByteStreamErrors::LVL1ID ); - } - if (trailerError & (1 << 3)) {// BCID error bit => b - m_numBCIDErrors++; - PixelByteStreamErrors::addError( bsErrorCode, PixelByteStreamErrors::BCID ); - } - if (trailerError & (1 << 2)) { // trailer error bit => z - m_numTrailerErrors++; - PixelByteStreamErrors::addError( bsErrorCode, PixelByteStreamErrors::Trailer ); - } - if (trailerError & (1 << 1)) { // header/trailer limit error=> h - m_numLimitError++; - PixelByteStreamErrors::addError( bsErrorCode, PixelByteStreamErrors::Limit ); - } - if (trailerError & (1 << 0)) { // data overflow error=> v - m_numInvalidIdentifiers++; - PixelByteStreamErrors::addError( bsErrorCode, PixelByteStreamErrors::Invalid ); - } -} diff --git a/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRodDecoder.h b/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRodDecoder.h index 630ce423fc1e52a9ba683ff4859749225ee06d85..d79954e70a51611e41853b27c66a59d7108a109b 100644 --- a/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRodDecoder.h +++ b/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRodDecoder.h @@ -149,13 +149,6 @@ class PixelRodDecoder : virtual public IPixelRodDecoder, public AthAlgTool { bool m_is_ibl_module; bool m_is_dbm_module; - //!< if there are errors in the header, save info in error word and (for now) report to BS error tool - void checkHeaderErrors( uint64_t& bsErrorWord, uint32_t headerWord ) const; - - //!< if there are errors in the trailer, save info in error word and (for now) report to BS error tool - void checkTrailerErrors( uint64_t& bsErrorWord, uint32_t headerWord ) const; - void checkTrailerErrorsIBL( uint64_t& bsErrorWord, uint32_t headerWord ) const; - //!< if the flag is set to true appropriate bits are set in event info StatusCode updateEventInfoIfEventCorrupted( bool isCorrupted ) const; diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthErrorMonAlg.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthErrorMonAlg.cxx index ae2f07d0efc6c531acb87bac9a5e1d8ebcd89022..ff05823a9a7bb66289b2f8df4954ebf30ab54d67 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthErrorMonAlg.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthErrorMonAlg.cxx @@ -69,26 +69,36 @@ StatusCode PixelAthErrorMonAlg::fillHistograms( const EventContext& ctx ) const for (int i=0; i<maxHash; i++) { // Get accumulated errors (Module) - uint64_t kErrorWord = m_pixelCondSummaryTool->getBSErrorWord(i,ctx); ATH_MSG_DEBUG("Module hash=" << i << " has"); - if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::TimeOut )) { ATH_MSG_DEBUG(" TimeOut state..."); } - else if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::BCID )) { ATH_MSG_DEBUG(" BCID state..."); } - else if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::LVL1ID )) { ATH_MSG_DEBUG(" LVL1ID state..."); } - else if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::Preamble )) { ATH_MSG_DEBUG(" Preamble state..."); } - else if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::Trailer )) { ATH_MSG_DEBUG(" Trailer state..."); } - else if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::Flagged )) { ATH_MSG_DEBUG(" Flagged state..."); } - else if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::DisableFE )) { ATH_MSG_DEBUG(" DisableFE state..."); } - else if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::BadFE )) { ATH_MSG_DEBUG(" BadFE state..."); } - else if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::ROD )) { ATH_MSG_DEBUG(" ROD state..."); } - else if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::Decoding )) { ATH_MSG_DEBUG(" Decoding state..."); } - else if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::Invalid )) { ATH_MSG_DEBUG(" Invalid state..."); } - else if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::LinkMaskedByPPC)) { ATH_MSG_DEBUG(" LinkMaskedByPPC state..."); } - else if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::Limit )) { ATH_MSG_DEBUG(" Limit state..."); } - else if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::TruncatedROB )) { ATH_MSG_DEBUG(" TruncatedROB state..."); } - else if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::MaskedROB )) { ATH_MSG_DEBUG(" MaskedROB state..."); } - else { ATH_MSG_DEBUG(" no entry ..."); } + if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::TimeOut )) { ATH_MSG_DEBUG(" TimeOut state..."); } + if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::BCID )) { ATH_MSG_DEBUG(" BCID state..."); } + if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::LVL1ID )) { ATH_MSG_DEBUG(" LVL1ID state..."); } + if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::Preamble )) { ATH_MSG_DEBUG(" Preamble state..."); } + if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::Trailer )) { ATH_MSG_DEBUG(" Trailer state..."); } + if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::Flagged )) { ATH_MSG_DEBUG(" Flagged state..."); } + if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::BadFE )) { ATH_MSG_DEBUG(" BadFE state..."); } + if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::Decoding )) { ATH_MSG_DEBUG(" Decoding state..."); } + if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::Invalid )) { ATH_MSG_DEBUG(" Invalid state..."); } + if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::LinkMaskedByPPC )) { ATH_MSG_DEBUG(" LinkMaskedByPPC state..."); } + if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::Limit )) { ATH_MSG_DEBUG(" Limit state..."); } + if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::TruncatedROB )) { ATH_MSG_DEBUG(" TruncatedROB state..."); } + if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::MaskedROB )) { ATH_MSG_DEBUG(" MaskedROB state..."); } + if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::MCCUndefined )) { ATH_MSG_DEBUG(" MCCUndefined state..."); } + if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::MCCLVL1IDEoECheck )) { ATH_MSG_DEBUG(" MCCLVL1IDEoECheck state..."); } + if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::MCCBCIDEoECheck )) { ATH_MSG_DEBUG(" MCCBCIDEoECheck state..."); } + if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::MCCLVL1IDCheck )) { ATH_MSG_DEBUG(" MCCLVL1IDCheck state..."); } + if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::MCCEoEOverflow )) { ATH_MSG_DEBUG(" MCCEoEOverflow state..."); } + if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::MCCHitOverflow )) { ATH_MSG_DEBUG(" MCCHitOverflow state..."); } + if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::FEWarning )) { ATH_MSG_DEBUG(" FEWarning state..."); } + if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::FEHitParity )) { ATH_MSG_DEBUG(" FEHitParity state..."); } + if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::FERegisterParity )) { ATH_MSG_DEBUG(" FERegisterParity state..."); } + if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::FEHammingCode )) { ATH_MSG_DEBUG(" FEHammingCode state..."); } + if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::FEEoCOverflow )) { ATH_MSG_DEBUG(" FEEoCOverflow state..."); } + if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::RODTrailerBitError)) { ATH_MSG_DEBUG(" RODTrailerBitError state..."); } + if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::RODHeaderLimit )) { ATH_MSG_DEBUG(" RODHeaderLimit state..."); } + if (PixelByteStreamErrors::hasError(kErrorWord,PixelByteStreamErrors::RODDataOVerflow )) { ATH_MSG_DEBUG(" RODDataOVerflow state..."); } // Loop over all FE int nFE = 16; @@ -98,21 +108,28 @@ StatusCode PixelAthErrorMonAlg::fillHistograms( const EventContext& ctx ) const for (int j=0; j<nFE; j++) { int channelFE = (1+j)*maxHash+i; // (FE_channel+1)*2048 + moduleHash uint64_t kErrorFEWord = m_pixelCondSummaryTool->getBSErrorWord(channelFE,ctx); - if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::TimeOut )) { ATH_MSG_DEBUG(" FE ch.=" << j << " TimeOut state..."); } - if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::BCID )) { ATH_MSG_DEBUG(" FE ch.=" << j << " BCID state..."); } - if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::LVL1ID )) { ATH_MSG_DEBUG(" FE ch.=" << j << " LVL1ID state..."); } - if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::Preamble )) { ATH_MSG_DEBUG(" FE ch.=" << j << " Preamble state..."); } - if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::Trailer )) { ATH_MSG_DEBUG(" FE ch.=" << j << " Trailer state..."); } - if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::Flagged )) { ATH_MSG_DEBUG(" FE ch.=" << j << " Flagged state..."); } - if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::DisableFE )) { ATH_MSG_DEBUG(" FE ch.=" << j << " DisableFE state..."); } - if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::BadFE )) { ATH_MSG_DEBUG(" FE ch.=" << j << " BadFE state..."); } - if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::ROD )) { ATH_MSG_DEBUG(" FE ch.=" << j << " ROD state..."); } - if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::Decoding )) { ATH_MSG_DEBUG(" FE ch.=" << j << " Decoding state..."); } - if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::Invalid )) { ATH_MSG_DEBUG(" FE ch.=" << j << " Invalid state..."); } - if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::LinkMaskedByPPC)) { ATH_MSG_DEBUG(" FE ch.=" << j << " LinkMaskedByPPC state..."); } - if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::Limit )) { ATH_MSG_DEBUG(" FE ch.=" << j << " Limit state..."); } - if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::TruncatedROB )) { ATH_MSG_DEBUG(" FE ch.=" << j << " TruncatedROB state..."); } - if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::MaskedROB )) { ATH_MSG_DEBUG(" FE ch.=" << j << " MaskedROB state..."); } + if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::TimeOut )) { ATH_MSG_DEBUG(" FE ch.=" << j << " TimeOut state..."); } + if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::BCID )) { ATH_MSG_DEBUG(" FE ch.=" << j << " BCID state..."); } + if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::LVL1ID )) { ATH_MSG_DEBUG(" FE ch.=" << j << " LVL1ID state..."); } + if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::Preamble )) { ATH_MSG_DEBUG(" FE ch.=" << j << " Preamble state..."); } + if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::Trailer )) { ATH_MSG_DEBUG(" FE ch.=" << j << " Trailer state..."); } + if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::Flagged )) { ATH_MSG_DEBUG(" FE ch.=" << j << " Flagged state..."); } + if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::BadFE )) { ATH_MSG_DEBUG(" FE ch.=" << j << " BadFE state..."); } + if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::Decoding )) { ATH_MSG_DEBUG(" FE ch.=" << j << " Decoding state..."); } + if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::Invalid )) { ATH_MSG_DEBUG(" FE ch.=" << j << " Invalid state..."); } + if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::LinkMaskedByPPC )) { ATH_MSG_DEBUG(" FE ch.=" << j << " LinkMaskedByPPC state..."); } + if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::Limit )) { ATH_MSG_DEBUG(" FE ch.=" << j << " Limit state..."); } + if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::MCCUndefined )) { ATH_MSG_DEBUG(" FE ch.=" << j << " MCCUndefined state..."); } + if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::MCCLVL1IDEoECheck)) { ATH_MSG_DEBUG(" FE ch.=" << j << " MCCLVL1IDEoECheck state..."); } + if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::MCCBCIDEoECheck )) { ATH_MSG_DEBUG(" FE ch.=" << j << " MCCBCIDEoECheck state..."); } + if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::MCCLVL1IDCheck )) { ATH_MSG_DEBUG(" FE ch.=" << j << " MCCLVL1IDCheck state..."); } + if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::MCCEoEOverflow )) { ATH_MSG_DEBUG(" FE ch.=" << j << " MCCEoEOverflow state..."); } + if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::MCCHitOverflow )) { ATH_MSG_DEBUG(" FE ch.=" << j << " MCCHitOverflow state..."); } + if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::FEWarning )) { ATH_MSG_DEBUG(" FE ch.=" << j << " FEWarning state..."); } + if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::FEHitParity )) { ATH_MSG_DEBUG(" FE ch.=" << j << " FEHitParity state..."); } + if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::FERegisterParity )) { ATH_MSG_DEBUG(" FE ch.=" << j << " FERegisterParity state..."); } + if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::FEHammingCode )) { ATH_MSG_DEBUG(" FE ch.=" << j << " FEHammingCode state..."); } + if (PixelByteStreamErrors::hasError(kErrorFEWord,PixelByteStreamErrors::FEEoCOverflow )) { ATH_MSG_DEBUG(" FE ch.=" << j << " FEEoCOverflow state..."); } } // Get IBL SearviceRecords : IBL hashID[156-435] diff --git a/InnerDetector/InDetTrigRecAlgs/InDetTrigPrepRawDataFormat/CMakeLists.txt b/InnerDetector/InDetTrigRecAlgs/InDetTrigPrepRawDataFormat/CMakeLists.txt index 3913c930f85dbfec9070b4651913c5e8af48931f..54830581fbcfb9cc1dc0ac744b90f3b3f78c85a6 100644 --- a/InnerDetector/InDetTrigRecAlgs/InDetTrigPrepRawDataFormat/CMakeLists.txt +++ b/InnerDetector/InDetTrigRecAlgs/InDetTrigPrepRawDataFormat/CMakeLists.txt @@ -30,6 +30,7 @@ atlas_depends_on_subdirs( PUBLIC InnerDetector/InDetRecTools/SiClusterizationTool InnerDetector/InDetRecTools/TRT_DriftCircleTool InnerDetector/InDetTrigRecTools/InDetTrigToolInterfaces + InnerDetector/InDetConditions/PixelConditionsData InnerDetector/InDetConditions/SCT_ConditionsData Tracking/TrkEvent/TrkTrack Trigger/TrigEvent/TrigSteeringEvent @@ -39,7 +40,7 @@ atlas_depends_on_subdirs( PUBLIC atlas_add_component( InDetTrigPrepRawDataFormat src/*.cxx src/components/*.cxx - LINK_LIBRARIES Identifier GaudiKernel InDetPrepRawData TrigInterfacesLib AthenaKernel StoreGateLib SGtests AtlasDetDescr IRegionSelector InDetByteStreamErrors ByteStreamCnvSvcBaseLib TRT_ConditionsServicesLib InDetIdentifier InDetReadoutGeometry TRT_ReadoutGeometry InDetRawData SiClusterizationToolLib TrkTrack TrigSteeringEvent TrigTimeAlgsLib PixelConditionsToolsLib TRT_DriftCircleToolLib InDetTrigToolInterfacesLib SCT_ConditionsData ) + LINK_LIBRARIES Identifier GaudiKernel InDetPrepRawData TrigInterfacesLib AthenaKernel StoreGateLib SGtests AtlasDetDescr IRegionSelector InDetByteStreamErrors ByteStreamCnvSvcBaseLib TRT_ConditionsServicesLib InDetIdentifier InDetReadoutGeometry TRT_ReadoutGeometry InDetRawData SiClusterizationToolLib TrkTrack TrigSteeringEvent TrigTimeAlgsLib PixelConditionsToolsLib TRT_DriftCircleToolLib InDetTrigToolInterfacesLib PixelConditionsData SCT_ConditionsData ) # Install files from the package: atlas_install_headers( InDetTrigPrepRawDataFormat ) diff --git a/InnerDetector/InDetTrigRecAlgs/InDetTrigPrepRawDataFormat/InDetTrigPrepRawDataFormat/Pixel_TrgClusterization.h b/InnerDetector/InDetTrigRecAlgs/InDetTrigPrepRawDataFormat/InDetTrigPrepRawDataFormat/Pixel_TrgClusterization.h index 745a9ae5d8cd28b7ec73911c57a5f10402b50afb..618b6cfb49f09ef212fb4a43bb8a7be8fee26f73 100755 --- a/InnerDetector/InDetTrigRecAlgs/InDetTrigPrepRawDataFormat/InDetTrigPrepRawDataFormat/Pixel_TrgClusterization.h +++ b/InnerDetector/InDetTrigRecAlgs/InDetTrigPrepRawDataFormat/InDetTrigPrepRawDataFormat/Pixel_TrgClusterization.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ ///////////////////////////////////////////////////////////////////////////// @@ -34,11 +34,11 @@ #include "InDetPrepRawData/PixelClusterContainer.h" #include "Identifier/IdentifierHash.h" -#include "PixelConditionsTools/IPixelByteStreamErrorsTool.h" +#include "InDetConditionsSummaryService/IInDetConditionsTool.h" +#include "PixelConditionsData/PixelByteStreamErrors.h" #include "SiClusterizationTool/IPixelClusteringTool.h" #include "SiClusterizationTool/PixelGangedAmbiguitiesFinder.h" - #include <string> #include "GaudiKernel/ToolHandle.h" @@ -121,8 +121,9 @@ namespace InDet { bool m_doFullScan; //!< support for FullScan mode double m_etaHalfWidth; //!< ROI half-width in eta double m_phiHalfWidth; //!< ROI half-width in phi - ToolHandle<IPixelByteStreamErrorsTool> m_bsError - {this, "PixelByteStreamErrorsTool", "PixelByteStreamErrorsTool", "Tool for PixelByteStreamError"}; + + ToolHandle<IInDetConditionsTool> m_pixelConditionsTool + {this, "PixelConditionsSummaryTool", "PixelConditionsSummaryTool", "Tool to retrieve Pixel Conditions summary"}; ServiceHandle<IROBDataProviderSvc> m_robDataProvider; //!< ROB Data Provide Service bool m_doTimeOutChecks; //check global timer diff --git a/InnerDetector/InDetTrigRecAlgs/InDetTrigPrepRawDataFormat/src/Pixel_TrgClusterization.cxx b/InnerDetector/InDetTrigRecAlgs/InDetTrigPrepRawDataFormat/src/Pixel_TrgClusterization.cxx index 1dd2cb7184bf8102200e8bc968acac9886f708ee..5121bff4d1de2e293b0b05c9507f295a038a037e 100755 --- a/InnerDetector/InDetTrigRecAlgs/InDetTrigPrepRawDataFormat/src/Pixel_TrgClusterization.cxx +++ b/InnerDetector/InDetTrigRecAlgs/InDetTrigPrepRawDataFormat/src/Pixel_TrgClusterization.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ //*************************************************************************** @@ -211,9 +211,9 @@ namespace InDet{ } - //BS Error Svc - if (m_bsError.retrieve().isFailure()){ - ATH_MSG_FATAL( "Could not retrieve " << m_bsError ); + //PixelConditionsSummaryTool + if (m_pixelConditionsTool.retrieve().isFailure()){ + ATH_MSG_FATAL( "Could not retrieve " << m_pixelConditionsTool ); return HLT::ErrorCode(HLT::Action::ABORT_JOB, HLT::Reason::BAD_JOB_SETUP); } @@ -315,10 +315,6 @@ namespace InDet{ // Transform those indexes into a RDO collection. //------------------------------------------------------------------------- - //handling of decoding problems - m_bsError->resetCounts(); - - // Get RoiDescriptor const TrigRoiDescriptor* roi; if ( HLT::OK != getFeature(outputTE, roi) ) { @@ -383,30 +379,38 @@ namespace InDet{ if (scdec.isSuccess()){ - //check for recoverable errors + // Here, store critical pixel module errors, which flagged as bad. + int bsErrors[12]; + const EventContext& ctx{Gaudi::Hive::currentContext()}; + for (size_t imod=0; imod<m_idHelper->wafer_hash_max(); imod++) { + uint64_t word = m_pixelConditionsTool->getBSErrorWord(imod,ctx); + if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::TruncatedROB)) { bsErrors[0]++; } + if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::MaskedROB)) { bsErrors[1]++; } + if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::Preamble)) { bsErrors[2]++; } + if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::TimeOut)) { bsErrors[3]++; } + if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::LVL1ID)) { bsErrors[4]++; } + if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::BCID)) { bsErrors[5]++; } + if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::Trailer)) { bsErrors[6]++; } + if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::MCCLVL1IDEoECheck)) { bsErrors[7]++; } + if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::MCCBCIDEoECheck)) { bsErrors[8]++; } + if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::MCCLVL1IDCheck)) { bsErrors[9]++; } + if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::MCCEoEOverflow)) { bsErrors[10]++; } + if (PixelByteStreamErrors::hasError(word,PixelByteStreamErrors::MCCHitOverflow)) { bsErrors[11]++; } + } int n_err_total = 0; - - int bsErrors[IPixelByteStreamErrorsTool::AllPixErrTypes.size()]; - - for (const auto idx : IPixelByteStreamErrorsTool::AllPixErrTypes ){ - int n_errors = m_bsError->getNumberOfErrors(idx); - n_err_total += n_errors; - bsErrors[idx] = n_errors; - } - + for (int idx=0; idx<12; idx++) { n_err_total+=bsErrors[idx]; } + ATH_MSG_DEBUG( "decoding errors: " << n_err_total ); if (n_err_total){ - for (const auto idx : IPixelByteStreamErrorsTool::AllPixErrTypes ){ - if (bsErrors[idx]) - m_PixBSErr.push_back(idx); - if(msgLvl(MSG::DEBUG)) - msg(MSG::DEBUG) << " " << bsErrors[idx]; + for (int idx=0; idx<12; idx++) { + if (bsErrors[idx]) { m_PixBSErr.push_back(idx); } + if (msgLvl(MSG::DEBUG)) { msg(MSG::DEBUG) << " " << bsErrors[idx]; } } } ATH_MSG_DEBUG( "" ); - + } else { ATH_MSG_DEBUG( " m_rawDataProvider->decode failed" ); } diff --git a/Tools/PROCTools/data/master_q431_AOD_digest.ref b/Tools/PROCTools/data/master_q431_AOD_digest.ref index 910c66c8240bcc3722a569ab5cc89e28deed06d0..e732ebb5172503eccec5b68f6bbb5549810d4a74 100644 --- a/Tools/PROCTools/data/master_q431_AOD_digest.ref +++ b/Tools/PROCTools/data/master_q431_AOD_digest.ref @@ -1,19 +1,19 @@ run event nTopo nIdTracks nJets nMuons 330470 1183722158 1 0 0 0 - 330470 1183722342 394 404 20 0 - 330470 1183727953 532 562 11 4 - 330470 1183732647 467 447 13 1 + 330470 1183722342 394 404 18 0 + 330470 1183727953 532 561 13 4 + 330470 1183732647 467 446 12 1 330470 1183733040 381 283 6 1 - 330470 1183734651 361 354 14 3 + 330470 1183734651 361 355 14 3 330470 1183735332 406 371 9 1 330470 1183736475 741 634 15 2 330470 1183738728 1 0 0 0 330470 1183738949 368 415 9 1 330470 1183742489 152 123 2 1 330470 1183743040 285 304 5 0 - 330470 1183746343 492 453 14 0 + 330470 1183746343 492 451 14 0 330470 1183746710 6 0 0 0 - 330470 1183751782 239 230 5 0 + 330470 1183751782 239 229 5 0 330470 1183752624 347 336 8 3 330470 1183753006 357 372 11 3 330470 1183754806 470 402 15 0 @@ -21,6 +21,6 @@ 330470 1183769939 348 341 11 3 330470 1183773832 307 199 7 0 330470 1183775209 57 0 0 0 - 330470 1183787124 431 357 11 2 - 330470 1183787946 321 310 5 1 - 330470 1183795329 458 329 18 0 + 330470 1183787124 431 356 11 2 + 330470 1183787946 321 309 5 1 + 330470 1183795329 458 328 18 0 diff --git a/Tools/PROCTools/python/RunTier0TestsTools.py b/Tools/PROCTools/python/RunTier0TestsTools.py index 54b4171f96779642e8ada080d4140bfced5f4661..58d9885cf531850942357af52947ae5bfff992a4 100644 --- a/Tools/PROCTools/python/RunTier0TestsTools.py +++ b/Tools/PROCTools/python/RunTier0TestsTools.py @@ -34,7 +34,7 @@ ciRefFileMap = { 'overlay-d1592-22.0' : 'v1', 'overlay-bkg-21.0' : 'v1', 'overlay-bkg-22.0' : 'v4', - 'dataoverlay-d1590-22.0' : 'v1', + 'dataoverlay-d1590-22.0' : 'v2', 'dataoverlay-hits-22.0' : 'v1', } diff --git a/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref b/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref index 6eaeb28be0fc6faadf68598ade0be3199fbe7ee4..db000a6dc46ae891b4566a870bfc4a685efec270 100644 --- a/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref +++ b/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref @@ -479,14 +479,14 @@ TrigSignatureMoniMT INFO HLT_j45_sktc_nojcalib_L TrigSignatureMoniMT INFO -- #1542468090 Events 20 20 0 0 0 0 0 0 0 0 0 3 - - - 3 TrigSignatureMoniMT INFO -- #1542468090 Features 0 0 0 0 0 0 0 0 0 3 - - - TrigSignatureMoniMT INFO HLT_j45_subjesgscIS_ftf_011jvt_L1J15 #266323220 -TrigSignatureMoniMT INFO -- #266323220 Events 20 20 0 0 0 0 0 0 0 0 0 3 - - - 3 -TrigSignatureMoniMT INFO -- #266323220 Features 0 0 0 0 0 0 0 0 0 3 - - - +TrigSignatureMoniMT INFO -- #266323220 Events 20 20 0 0 0 0 0 0 0 0 0 4 - - - 4 +TrigSignatureMoniMT INFO -- #266323220 Features 0 0 0 0 0 0 0 0 0 4 - - - TrigSignatureMoniMT INFO HLT_j45_subjesgscIS_ftf_015jvt_L1J15 #3102941497 -TrigSignatureMoniMT INFO -- #3102941497 Events 20 20 0 0 0 0 0 0 0 0 0 3 - - - 3 -TrigSignatureMoniMT INFO -- #3102941497 Features 0 0 0 0 0 0 0 0 0 3 - - - +TrigSignatureMoniMT INFO -- #3102941497 Events 20 20 0 0 0 0 0 0 0 0 0 4 - - - 4 +TrigSignatureMoniMT INFO -- #3102941497 Features 0 0 0 0 0 0 0 0 0 4 - - - TrigSignatureMoniMT INFO HLT_j45_subjesgscIS_ftf_059jvt_L1J15 #2237035634 -TrigSignatureMoniMT INFO -- #2237035634 Events 20 20 0 0 0 0 0 0 0 0 0 3 - - - 3 -TrigSignatureMoniMT INFO -- #2237035634 Features 0 0 0 0 0 0 0 0 0 3 - - - +TrigSignatureMoniMT INFO -- #2237035634 Events 20 20 0 0 0 0 0 0 0 0 0 4 - - - 4 +TrigSignatureMoniMT INFO -- #2237035634 Features 0 0 0 0 0 0 0 0 0 4 - - - TrigSignatureMoniMT INFO HLT_j45_subjesgscIS_ftf_L1J15 #1960278431 TrigSignatureMoniMT INFO -- #1960278431 Events 20 20 0 0 0 0 0 0 0 0 0 7 - - - 7 TrigSignatureMoniMT INFO -- #1960278431 Features 0 0 0 0 0 0 0 0 0 7 - - - @@ -557,8 +557,8 @@ TrigSignatureMoniMT INFO HLT_j85_L1J20 #51047553 TrigSignatureMoniMT INFO -- #510475538 Events 20 20 0 0 0 0 0 0 0 0 0 3 - - - 3 TrigSignatureMoniMT INFO -- #510475538 Features 0 0 0 0 0 0 0 0 0 3 - - - TrigSignatureMoniMT INFO HLT_j85_ftf_L1J20 #877042532 -TrigSignatureMoniMT INFO -- #877042532 Events 20 20 0 0 0 0 0 0 0 0 0 3 - - - 3 -TrigSignatureMoniMT INFO -- #877042532 Features 0 0 0 0 0 0 0 0 0 3 - - - +TrigSignatureMoniMT INFO -- #877042532 Events 20 20 0 0 0 0 0 0 0 0 0 2 - - - 2 +TrigSignatureMoniMT INFO -- #877042532 Features 0 0 0 0 0 0 0 0 0 2 - - - TrigSignatureMoniMT INFO HLT_j85_pf_ftf_L1J20 #789444389 TrigSignatureMoniMT INFO -- #789444389 Events 20 20 0 0 0 0 0 0 0 0 0 2 - - - 2 TrigSignatureMoniMT INFO -- #789444389 Features 0 0 0 0 0 0 0 0 0 2 - - - @@ -1070,17 +1070,17 @@ TrigSignatureMoniMT INFO HLT_xe30_mht_L1XE10 #36 TrigSignatureMoniMT INFO -- #3626903018 Events 20 20 0 0 0 0 0 0 0 0 0 14 - - - 14 TrigSignatureMoniMT INFO -- #3626903018 Features 0 0 0 0 0 0 0 0 0 14 - - - TrigSignatureMoniMT INFO HLT_xe30_mhtpufit_em_subjesgscIS_L1XE10 #689201557 -TrigSignatureMoniMT INFO -- #689201557 Events 20 20 0 0 0 0 0 0 0 0 0 5 - - - 5 -TrigSignatureMoniMT INFO -- #689201557 Features 0 0 0 0 0 0 0 0 0 5 - - - +TrigSignatureMoniMT INFO -- #689201557 Events 20 20 0 0 0 0 0 0 0 0 0 4 - - - 4 +TrigSignatureMoniMT INFO -- #689201557 Features 0 0 0 0 0 0 0 0 0 4 - - - TrigSignatureMoniMT INFO HLT_xe30_mhtpufit_pf_subjesgscIS_L1XE10 #1886909707 -TrigSignatureMoniMT INFO -- #1886909707 Events 20 20 0 0 0 0 0 0 0 0 0 3 - - - 3 -TrigSignatureMoniMT INFO -- #1886909707 Features 0 0 0 0 0 0 0 0 0 3 - - - +TrigSignatureMoniMT INFO -- #1886909707 Events 20 20 0 0 0 0 0 0 0 0 0 2 - - - 2 +TrigSignatureMoniMT INFO -- #1886909707 Features 0 0 0 0 0 0 0 0 0 2 - - - TrigSignatureMoniMT INFO HLT_xe30_pfopufit_L1XE10 #2252641537 TrigSignatureMoniMT INFO -- #2252641537 Events 20 20 0 0 0 0 0 0 0 0 0 4 - - - 4 TrigSignatureMoniMT INFO -- #2252641537 Features 0 0 0 0 0 0 0 0 0 4 - - - TrigSignatureMoniMT INFO HLT_xe30_pfsum_L1XE10 #998713382 -TrigSignatureMoniMT INFO -- #998713382 Events 20 20 0 0 0 0 0 0 0 0 0 5 - - - 5 -TrigSignatureMoniMT INFO -- #998713382 Features 0 0 0 0 0 0 0 0 0 5 - - - +TrigSignatureMoniMT INFO -- #998713382 Events 20 20 0 0 0 0 0 0 0 0 0 6 - - - 6 +TrigSignatureMoniMT INFO -- #998713382 Features 0 0 0 0 0 0 0 0 0 6 - - - TrigSignatureMoniMT INFO HLT_xe30_tcpufit_L1XE10 #1583719916 TrigSignatureMoniMT INFO -- #1583719916 Events 20 20 0 0 0 0 0 0 0 0 0 6 - - - 6 TrigSignatureMoniMT INFO -- #1583719916 Features 0 0 0 0 0 0 0 0 0 6 - - -