15 unsigned int computeSize(
const std::vector<std::vector<unsigned short> > &vec2d) {
16 unsigned int total_size =
sizeof(vec2d);
17 for (
const std::vector<unsigned short> &
vec : vec2d) {
18 total_size +=
sizeof(
vec) +
vec.size()*
sizeof(
unsigned short);
35 return StatusCode::SUCCESS;
42 return StatusCode::SUCCESS;
48 auto detector_element_status=
m_condSummaryTool->getDetectorElementStatus(ctx, &writeHandle);
49 const EventIDRange& range = writeHandle.
getRange();
50 if (!range.start().isValid() || !range.stop().isValid()) {
51 ATH_MSG_FATAL(
"Invalid range for " << writeHandle.
key() <<
" : " << range.start() <<
".." << range.stop());
55 unsigned int expected;
58 }
while (total_size > expected && !
m_maxSize.compare_exchange_weak(expected, total_size,std::memory_order_release,std::memory_order_relaxed));
60 if (writeHandle.
record( std::move(detector_element_status) ).isFailure()) {
63 ATH_MSG_DEBUG(
"SiDetectorElementStatus Recorded " << writeHandle.
key() <<
" with Range : " << range );
64 return StatusCode::SUCCESS;
70 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
std::vector< size_t > vec
Handle class for recording to StoreGate.
Base class for conditions algorithms.
static EventIDRange infiniteMixed()
Produces an mixed EventIDRange that is infinite in Time and RunLumi.
virtual StatusCode initialize() override final
std::atomic< unsigned int > m_maxSize
virtual StatusCode finalize() override final
SiDetectorElementStatusCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
SG::WriteCondHandleKey< InDet::SiDetectorElementStatus > m_writeKey
virtual StatusCode execute(const EventContext &ctx) const override final
ToolHandle< IDetectorElementStatusTool > m_condSummaryTool
const std::vector< std::vector< unsigned short > > & getBadCells() const
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