9#include "CoralBase/Blob.h"
25 return StatusCode::SUCCESS;
36 return StatusCode::SUCCESS;
44 return StatusCode::FAILURE;
56 larOnlineID=scidhelper;
75 std::unique_ptr<LArOnOffIdMapping> onOffMap=std::make_unique<LArOnOffIdMapping>(larOnlineID,calocellID);
77 const coral::Blob& blobOnOff=(*attr)[
"OnlineHashToOfflineId"].data<coral::Blob>();
78 unsigned nChan=blobOnOff.size()/
sizeof(uint32_t);
79 const uint32_t* pBlobOnOff=
static_cast<const uint32_t*
>(blobOnOff.startingAddress());
82 ATH_MSG_ERROR(
"Number of channels read from DB (" << nChan <<
") does not match online hash max ("
84 return StatusCode::FAILURE;
88 unsigned nConnected=0;
90 for (
unsigned i=0;i<nChan;++i) {
96 onOffMap->m_onlHashToOffline[i]=id;
97 onOffMap->m_oflHashToOnline[oflHash]=hwid;
98 onOffMap->m_onlHashToOflHash[i]=oflHash;
102 ATH_MSG_INFO(
"Done reading online/offline identifier mapping");
103 ATH_MSG_INFO(
"Found " << nChan <<
" online identifier and " << nConnected <<
" offline identifier. "
104 << nChan-nConnected <<
" disconnected channels.");
106 if(writeHandle.
record(std::move(onOffMap)).isFailure()) {
107 ATH_MSG_ERROR(
"Could not record LArOnOffMapping object with "
109 <<
" with EventRange " << writeHandle.
getRange()
110 <<
" into Conditions Store");
111 return StatusCode::FAILURE;
113 ATH_MSG_INFO(
"recorded new " << writeHandle.
key() <<
" with range " << writeHandle.
getRange() <<
" into Conditions Store");
115 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
Helper class for offline supercell identifiers.
const ServiceHandle< StoreGateSvc > & detStore() const
An AttributeList represents a logical row of attributes in a metadata table.
Helper base class for offline cell identifiers.
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
Helper class for offline cell identifiers.
Helper class for offline supercell identifiers.
This is a "hash" representation of an Identifier.
virtual StatusCode initialize() override
Gaudi::Property< bool > m_isSuperCell
SG::ReadCondHandleKey< AthenaAttributeList > m_readKey
SG::WriteCondHandleKey< LArOnOffIdMapping > m_writeKey
virtual StatusCode execute(const EventContext &ctx) const override
Helper for the Liquid Argon Calorimeter cell identifiers.
HWIdentifier channel_Id(int barrel_ec, int pos_neg, int feedthrough, int slot, int channel) const
create channel identifier from fields
size_type channelHashMax() const
Define channel hash tables max size.
const std::string & key() const
void addDependency(const EventIDRange &range)
const EventIDRange & getRange() const
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED