18 return StatusCode::SUCCESS;
22 if (!readCondHandle.
isValid()) {
24 return StatusCode::FAILURE;
29 if (!deadChannels.good()) {
31 return StatusCode::FAILURE;
33 deadChannels<<
"{"<<std::endl;
34 deadChannels<<
" \"Chambers\": ";
36 deadChannels<<
","<<std::endl;
37 deadChannels<<
" \"MultiLayers\": ";
38 dumpDeadChannels(readCondHandle->getDeadMultilayersId(), deadChannels,
true);
39 deadChannels<<
","<<std::endl;
40 deadChannels<<
" \"TubeLayers:\": ";
41 dumpDeadChannels(readCondHandle->getDeadLayersId(), deadChannels,
true,
true);
42 deadChannels<<
","<<std::endl;
43 deadChannels<<
" \"Tubes:\": ";
44 dumpDeadChannels(readCondHandle->getDeadTubesId(), deadChannels,
true,
true,
true);
45 deadChannels<<std::endl<<
"}"<<std::endl;
48 if (readCondHandle->getAllHvStates().empty() ||
m_dcsJSON.value().empty()){
49 return StatusCode::SUCCESS;
52 if (!dcsStates.good()) {
54 return StatusCode::FAILURE;
58 dcsStates<<
"["<<std::endl;
68 dcsStates<<
" {"<<std::endl;
71 dcsStates<<
" \"standByVolt\": "<<dcs.
standbyVolt<<
", "<<std::endl;
72 dcsStates<<
" \"readyVolt\": "<<dcs.
readyVolt<<std::endl;
74 if ((itr +1 ) != end) dcsStates<<
",";
77 dcsStates<<
"]"<<std::endl;
80 return StatusCode::SUCCESS;
88 bool trailingComma)
const {
89 ostr<<
" \"station\": \""<<
m_idHelperSvc->stationNameString(
id)<<
"\","<<std::endl;
90 ostr<<
" \"eta\": "<<
m_idHelperSvc->stationEta(
id)<<
","<<std::endl;
92 if (!dumpMultiLayer) {
93 ostr<<(trailingComma ?
"," :
"")<<std::endl;
100 ostr<<(trailingComma ?
"," :
"")<<std::endl;
103 ostr<<
","<<std::endl;
104 ostr<<
" \"layer\": "<<idHelper.
tubeLayer(
id);
106 ostr<<(trailingComma ?
"," :
"")<<std::endl;
109 ostr<<
" \"tube:\": \""<<idHelper.
tube(
id);
110 ostr<<(trailingComma ?
"," :
"")<<std::endl;
115 bool dumpLayer,
bool dumpTube)
const {
116 unsigned int processed{0};
117 ostr<<
"["<<std::endl;
119 ostr<<
" {"<<std::endl;
120 dumpIdentifier(
id, ostr, dumpMultiLayer, dumpLayer, dumpTube,
false);
123 if(processed != channels.size()) ostr<<
",";
#define ATH_CHECK
Evaluate an expression and check for errors.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Gaudi::Property< std::string > m_dcsJSON
void dumpIdentifier(const Identifier &id, std::ostream &ostr, bool dumpMultiLayer, bool dumpLayer, bool dumpTube, bool trailingComma) const
Dumps the Identifier into a json format.
SG::ReadCondHandleKey< MdtCondDbData > m_readKey
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
virtual StatusCode execute(const EventContext &ctx) override
Execute method.
Gaudi::Property< std::string > m_deadChannelJSON
MdtCondJsonDumpAlg(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode initialize() override
void dumpDeadChannels(const std::unordered_set< Identifier > &channels, std::ostream &ostr, bool dumpMultiLayer=false, bool dumpLayer=false, bool dumpTube=false) const
Dumps all channels into a JSON format.
int multilayer(const Identifier &id) const
Access to components of the ID.
int tube(const Identifier &id) const
int tubeLayer(const Identifier &id) const
std::vector< Identifier >::const_iterator const_id_iterator
const_id_iterator detectorElement_begin() const
Iterators over full set of ids.
const_id_iterator detectorElement_end() const
std::string getFsmStateStrg(DcsFsmState fsmState)
Helper struct to cache all dcs constants in a common place of the memory.