18 return StatusCode::SUCCESS;
21 const EventContext& ctx{Gaudi::Hive::currentContext()};
23 if (!readCondHandle.
isValid()) {
25 return StatusCode::FAILURE;
30 if (!deadChannels.good()) {
32 return StatusCode::FAILURE;
34 deadChannels<<
"{"<<std::endl;
35 deadChannels<<
" \"Chambers\": ";
37 deadChannels<<
","<<std::endl;
38 deadChannels<<
" \"MultiLayers\": ";
39 dumpDeadChannels(readCondHandle->getDeadMultilayersId(), deadChannels,
true);
40 deadChannels<<
","<<std::endl;
41 deadChannels<<
" \"TubeLayers:\": ";
42 dumpDeadChannels(readCondHandle->getDeadLayersId(), deadChannels,
true,
true);
43 deadChannels<<
","<<std::endl;
44 deadChannels<<
" \"Tubes:\": ";
45 dumpDeadChannels(readCondHandle->getDeadTubesId(), deadChannels,
true,
true,
true);
46 deadChannels<<std::endl<<
"}"<<std::endl;
49 if (readCondHandle->getAllHvStates().empty() ||
m_dcsJSON.value().empty()){
50 return StatusCode::SUCCESS;
53 if (!dcsStates.good()) {
55 return StatusCode::FAILURE;
59 dcsStates<<
"["<<std::endl;
69 dcsStates<<
" {"<<std::endl;
72 dcsStates<<
" \"standByVolt\": "<<dcs.
standbyVolt<<
", "<<std::endl;
73 dcsStates<<
" \"readyVolt\": "<<dcs.
readyVolt<<std::endl;
75 if ((itr +1 ) != end) dcsStates<<
",";
78 dcsStates<<
"]"<<std::endl;
81 return StatusCode::SUCCESS;
89 bool trailingComma)
const {
90 ostr<<
" \"station\": \""<<
m_idHelperSvc->stationNameString(
id)<<
"\","<<std::endl;
91 ostr<<
" \"eta\": "<<
m_idHelperSvc->stationEta(
id)<<
","<<std::endl;
93 if (!dumpMultiLayer) {
94 ostr<<(trailingComma ?
"," :
"")<<std::endl;
101 ostr<<(trailingComma ?
"," :
"")<<std::endl;
104 ostr<<
","<<std::endl;
105 ostr<<
" \"layer\": "<<idHelper.
tubeLayer(
id);
107 ostr<<(trailingComma ?
"," :
"")<<std::endl;
110 ostr<<
" \"tube:\": \""<<idHelper.
tube(
id);
111 ostr<<(trailingComma ?
"," :
"")<<std::endl;
116 bool dumpLayer,
bool dumpTube)
const {
117 unsigned int processed{0};
118 ostr<<
"["<<std::endl;
120 ostr<<
" {"<<std::endl;
121 dumpIdentifier(
id, ostr, dumpMultiLayer, dumpLayer, dumpTube,
false);
124 if(processed != channels.size()) ostr<<
",";
#define ATH_CHECK
Evaluate an expression and check for errors.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Property< std::string > m_dcsJSON
void dumpDeadChannels(const std::set< Identifier > &channels, std::ostream &ostr, bool dumpMultiLayer=false, bool dumpLayer=false, bool dumpTube=false) const
Dumps all channels into a JSON format.
virtual StatusCode execute() override
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
Gaudi::Property< std::string > m_deadChannelJSON
MdtCondJsonDumpAlg(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode initialize() override
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.