9#include "CoralBase/Blob.h"
22 return StatusCode::SUCCESS;
33 return StatusCode::SUCCESS;
41 return StatusCode::FAILURE;
56 std::unique_ptr<LArCalibLineMapping> calibLineMap=std::make_unique<LArCalibLineMapping>(onlineID);
58 std::vector<std::vector<HWIdentifier> >&onlHashToCalibLines=calibLineMap->m_onlHashToCalibLines;
61 const coral::Blob& blobCalib=(*attr)[
"OnlineHashToCalibIds"].data<coral::Blob>();
62 const unsigned nEntries=blobCalib.size()/
sizeof(uint32_t);
63 const uint32_t* pBlobCalib=
static_cast<const uint32_t*
>(blobCalib.startingAddress());
67 onlHashToCalibLines.resize(chanMax);
71 unsigned totCalibLines=0;
72 for (;blobIdx<nEntries && chanIdx<chanMax;++chanIdx) {
73 const unsigned nCalibLines=pBlobCalib[blobIdx++];
74 totCalibLines+=nCalibLines;
76 msg(MSG::ERROR) <<
"Found unresonable large number of calib lines (" << nCalibLines <<
") for channel hash " << chanIdx <<
endmsg;
77 return StatusCode::FAILURE;
79 onlHashToCalibLines[chanIdx].clear();
80 for (
unsigned i=0;i<nCalibLines && blobIdx<nEntries;++i) {
81 onlHashToCalibLines[chanIdx].emplace_back(pBlobCalib[blobIdx++]);
84 msg() << MSG::INFO <<
"Done reading readout/calibration line mapping." <<
endmsg;
85 ATH_MSG_DEBUG(
"BlobIdx=" << blobIdx<<
", chanIdx=" << chanIdx <<
", totCalibLines=" << totCalibLines);
88 if(writeHandle.
record(std::move(calibLineMap)).isFailure()) {
89 ATH_MSG_ERROR(
"Could not record LArCalibLineMapping object with "
91 <<
" with EventRange " << writeHandle.
getRange()
92 <<
" into Conditions Store");
93 return StatusCode::FAILURE;
95 ATH_MSG_INFO(
"recorded new " << writeHandle.
key() <<
" with range " << writeHandle.
getRange() <<
" into Conditions Store");
97 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
const ServiceHandle< StoreGateSvc > & detStore() const
An AttributeList represents a logical row of attributes in a metadata table.
Gaudi::Property< unsigned > m_maxCalibLines
virtual StatusCode initialize() override
SG::WriteCondHandleKey< LArCalibLineMapping > m_writeKey
Gaudi::Property< bool > m_isSuperCell
virtual StatusCode execute(const EventContext &ctx) const override
SG::ReadCondHandleKey< AthenaAttributeList > m_readKey
Helper for the Liquid Argon Calorimeter cell identifiers.
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