9 #include "CoralBase/Blob.h"
10 #include <string_view>
20 return StatusCode::SUCCESS;
25 if (writeHandle.isValid()) {
26 ATH_MSG_DEBUG(
"CondHandle " << writeHandle.fullKey() <<
" is already valid."
27 <<
". In theory this should not be called, but may happen"
28 <<
" if multiple concurrent events are being processed out of order.");
29 return StatusCode::SUCCESS;
32 if (readHandle_XTalk.cptr() ==
nullptr) {
34 return StatusCode::FAILURE;
36 ATH_MSG_DEBUG(
"Size of CondAttrListCollection" << readHandle_XTalk.fullKey() <<
" = " << readHandle_XTalk->size());
37 EventIDRange rangeW_XTalk;
38 if (!readHandle_XTalk.range(rangeW_XTalk)) {
39 ATH_MSG_ERROR(
"Failed to retrieve validity range for " << readHandle_XTalk.key());
40 return StatusCode::FAILURE;
46 if(rangeIntersection.start()>rangeIntersection.stop()) {
47 ATH_MSG_ERROR(
"Invalid intersection range: " << rangeIntersection);
48 return StatusCode::FAILURE;
51 auto outputCdo = std::make_unique<TgcDigitCrosstalkData>();
52 constexpr std::string_view
delimiter{
";"};
53 for (
const auto &[
channel, attribute] : *readHandle_XTalk.cptr()) {
55 const std::string strstrip{
static_cast<const char*
>(blob_strip.startingAddress())};
74 std::array<float, TgcDigitCrosstalkData::N_PROB> prob_strip{prob10, prob11, prob20, prob21};
75 outputCdo->setStripProbability(layerId, prob_strip);
78 const std::string strwire {
static_cast<const char*
>(blob_wire.startingAddress())};
97 std::array<float, TgcDigitCrosstalkData::N_PROB> prob_wire{prob10, prob11, prob20, prob21};
98 outputCdo->setWireProbability(layerId, prob_wire);
102 if (writeHandle.record(rangeIntersection, std::move(outputCdo)).isFailure()) {
103 ATH_MSG_FATAL(
"Could not record TgcDigitCrosstalkData " << writeHandle.key()
104 <<
" with EventRange " << rangeIntersection
105 <<
" into Conditions Store");
106 return StatusCode::FAILURE;
108 ATH_MSG_DEBUG(
"recorded new " << writeHandle.key() <<
" with range " << rangeIntersection <<
" into Conditions Store");
110 return StatusCode::SUCCESS;