|
ATLAS Offline Software
|
Go to the documentation of this file.
6 #include "GaudiKernel/EventIDRange.h"
8 #include "CoralBase/Blob.h"
26 return StatusCode::SUCCESS;
34 ATH_MSG_DEBUG(
"CondHandle " << writeHandle.
fullKey() <<
" is already valid.. In theory this should not be called, but may happen if multiple concurrent events are being processed out of order.");
35 return StatusCode::SUCCESS;
40 if (readCdo==
nullptr) {
42 return StatusCode::FAILURE;
46 if (not readHandle.
range(rangeW)) {
48 return StatusCode::FAILURE;
50 ATH_MSG_INFO(
"Size of AthenaAttributeList " << readHandle.
fullKey() <<
" readCdo->size()= " << readCdo->size());
54 std::unique_ptr<PixelReadoutSpeedData> writeCdo(std::make_unique<PixelReadoutSpeedData>());
57 const char*
p =
static_cast<const char*
>(
blob.startingAddress());
58 unsigned int len =
blob.size();
59 std::map<uint32_t,bool> rodReadoutMap;
60 std::string dataString;
61 dataString.resize(len);
62 for (
unsigned int i=0;
i!=len; ++
i) { dataString[
i]=*
p++; }
65 while (dataString.find(
',',
pos)!=std::string::npos) {
66 std::istringstream iss(dataString.substr(
pos,dataString.find(
',',
pos)));
68 iss >> std::hex >>
rod;
70 const std::string speed = dataString.substr(dataString.find(
',',
pos)+1,dataString.find(
'\n',
pos)-dataString.find(
',',
pos)-1);
72 if (speed!=
"SINGLE_40") { rodReadoutMap[
rod]=
true; }
73 else { rodReadoutMap[
rod]=
false; }
75 pos = dataString.find(
'\n',
pos)+1;
77 writeCdo -> setReadoutMap(rodReadoutMap);
79 if (writeHandle.
record(rangeW, std::move(writeCdo)).isFailure()) {
80 ATH_MSG_FATAL(
"Could not record PixelReadoutSpeedData " << writeHandle.
key() <<
" with EventRange " << rangeW <<
" into Conditions Store");
81 return StatusCode::FAILURE;
83 ATH_MSG_INFO(
"recorded new CDO " << writeHandle.
key() <<
" with range " << rangeW <<
" into Conditions Store");
85 return StatusCode::SUCCESS;
const DataObjID & fullKey() const
SG::ReadCondHandleKey< AthenaAttributeList > m_readKey
SG::WriteCondHandleKey< PixelReadoutSpeedData > m_writeKey
virtual StatusCode initialize() override
bool range(EventIDRange &r)
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
An algorithm that can be simultaneously executed in multiple threads.
const DataObjID & fullKey() const
::StatusCode StatusCode
StatusCode definition for legacy code.
virtual StatusCode execute(const EventContext &ctx) const override
PixelReadoutSpeedAlg(const std::string &name, ISvcLocator *pSvcLocator)
An AttributeList represents a logical row of attributes in a metadata table. The name and type of eac...
const std::string & key() const
StatusCode initialize(bool used=true)
const std::string & key() const