15 #include "CoralBase/Attribute.h"
16 #include "CoralBase/AttributeListSpecification.h"
20 #include "nlohmann/json.hpp"
24 ISvcLocator* pSvcLocator)
32 return StatusCode::SUCCESS;
39 if (writeHandle.isValid()) {
40 ATH_MSG_DEBUG(
"CondHandle "<< writeHandle.fullKey() <<
" is already valid."
41 <<
". In theory this should not be called, but may happen"
42 <<
" if multiple concurrent events are being processed out of order.");
43 return StatusCode::SUCCESS;
47 std::unique_ptr<Nsw_CablingMap> writeCdo{std::make_unique<Nsw_CablingMap>(
m_idHelperSvc.get())};
54 return StatusCode::FAILURE;
66 if (!readHandle.isValid()) {
67 ATH_MSG_FATAL(
"Failed to retrive the cabling data from the database "
69 return StatusCode::FAILURE;
72 writeHandle.addDependency(readHandle);
73 ATH_MSG_DEBUG(
"Size of CondAttrListCollection " << readHandle.fullKey()
74 <<
" readCdo->size()= " << readHandle->size());
76 <<
", range of output is " << writeHandle.getRange());
80 for(itr = readHandle->begin(); itr != readHandle->end(); ++itr) {
82 std::string
payload = *(
static_cast<const std::string *
>((atr[
"data"]).addressOfData()));
88 ATH_CHECK(writeHandle.record(std::move(writeCdo)));
89 ATH_MSG_INFO(
"recorded new " << writeHandle.key() <<
" with range "
90 << writeHandle.getRange()
91 <<
" into Conditions Store");
92 return StatusCode::SUCCESS;
99 return StatusCode::SUCCESS;
103 for (
const auto& db_channel :
payload.items()) {
106 std::string stName = cabling_payload[
"station"];
107 const int eta = cabling_payload[
"eta"];
108 const int phi = cabling_payload[
"phi"];
109 const int multilayer = cabling_payload[
"multilayer"];
110 const int gap = cabling_payload[
"gasgap"];
113 if (stName[0] ==
'M') {
114 gap_id = mm_helper.channelID(stName,
eta,
phi, multilayer,
gap, 1,
isValid);
116 const int chType{cabling_payload[
"channeltype"]};
121 << stName <<
" eta: " <<
eta <<
" phi: " <<
phi
122 <<
" multilayer: " << multilayer
123 <<
" gasgap: " <<
gap);
124 return StatusCode::FAILURE;
128 zebra_connector.
firstChannel = cabling_payload[
"FirstZebra"];
129 zebra_connector.lastChannel = cabling_payload[
"LastZebra"];
130 zebra_connector.shiftChannel = cabling_payload[
"ZebraShift"];
131 if (!cabling_map.
addConnector(gap_id, zebra_connector, msgStream()))
132 return StatusCode::FAILURE;
134 return StatusCode::SUCCESS;