ATLAS Offline Software
Loading...
Searching...
No Matches
NswDcsDbData.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MUONCONDDATA_NSWDCSDBDATA_H
6#define MUONCONDDATA_NSWDCSDBDATA_H
7
8// STL includes
9#include <set>
10#include <vector>
11
12// Athena includes
16#include "MuonCondData/Defs.h"
18
20
21public:
22 enum class DcsTechType{
23 MMG, // MM channels
24 MMD, // MM drift channels
25 STG // sTGC
26 };
30
31
33 uint64_t timeSince{0};
34 uint64_t timeUntil{0};
35 unsigned elink{0};
37 bool operator<(const NswDcsDbData::TDaqConstants& other)const{
38 if(elink != other.elink) {
39 return elink < other.elink;
40 }
41 return timeUntil < other.timeSince;
42 }
43 };
44
45 NswDcsDbData(const Muon::IMuonIdHelperSvc* idHelperSvc, const MuonGM::MuonDetectorManager* muonGeoMgr);
46 virtual ~NswDcsDbData() = default;
47
48 // setting functions
49 void setDataHv(const DcsTechType tech,
50 const Identifier& chnlId,
52 void setDataTDaq(const DcsTechType tech,
53 const Identifier& chnlId,
54 uint64_t timeSince,
55 uint64_t timeUntil,
56 unsigned int elink,
57 bool permanentlyDisabled);
58 void setDataEltx(const DcsTechType tech,
59 const Identifier& chnlId);
60
61 // retrieval functions
62
64 std::vector<Identifier> getChannelIdsHv(const DcsTechType tech, const std::string& side) const;
66 const DcsConstants* getDataForChannelHv(const DcsTechType tech, const Identifier& channelId, bool issTgcQ1OuterHv) const;
67
69 bool isGood(const EventContext& ctx, const Identifier& channelId, bool issTgcQ1OuterHv = false) const;
70 bool isGoodHv(const Identifier& channelId, bool issTgcQ1OuterHv = false) const;
71 bool isGoodTDaq(const EventContext& ctx, const Identifier& channelId, bool &permanentlyDisabled) const;
72 bool isGoodEltx(const Identifier& channelId) const;
73 bool isConnectedChannel(const Identifier& channelId) const;
74
75private:
76
77 unsigned int identToModuleIdx(const Identifier& chan_id) const;
78
79 // containers
80 struct DcsModule{
81 std::vector<std::unique_ptr<DcsConstants>> channels{};
83 };
84 using ChannelDcsMap = std::vector<DcsModule>;
88 using ChannelTDaqMap = std::vector<std::map<Identifier, std::set<TDaqConstants>>>;
91 using ChannelEltxMap = std::vector<std::unordered_set<Identifier>>;
94
95 // ID helpers
98
99};
100
101std::ostream& operator<<(std::ostream& ostr, const NswDcsDbData::TDaqConstants& obj);
102
103
104
105CLASS_DEF( NswDcsDbData , 99551304 , 1 );
107
108#endif
Hold mappings of ranges to condition objects.
#define CONDCONT_MIXED_DEF(...)
Definition CondCont.h:1446
Provide an interface for finding inheritance information at run time.
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
std::ostream & operator<<(std::ostream &ostr, const NswDcsDbData::TDaqConstants &obj)
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
MuonCond::DcsFsmState DcsFsmState
MuonCond::DcsConstants DcsConstants
std::vector< DcsModule > ChannelDcsMap
ChannelDcsMap m_data_hv_stg
void setDataHv(const DcsTechType tech, const Identifier &chnlId, DcsConstants constants)
ChannelDcsMap m_data_hv_mmd
bool isGoodEltx(const Identifier &channelId) const
ChannelEltxMap m_data_eltx_stg
const DcsConstants * getDataForChannelHv(const DcsTechType tech, const Identifier &channelId, bool issTgcQ1OuterHv) const
Retrieves the calibration constant for a particular readout channel.
MuonCond::DcsDataType DcsDataType
ChannelDcsMap m_data_hv_mmg
bool isGood(const EventContext &ctx, const Identifier &channelId, bool issTgcQ1OuterHv=false) const
Returns whether the channel is alive, i.e. DCS state on, etc...
ChannelTDaqMap m_data_tdaq_mmg
std::vector< std::unordered_set< Identifier > > ChannelEltxMap
virtual ~NswDcsDbData()=default
ChannelTDaqMap m_data_tdaq_stg
NswDcsDbData(const Muon::IMuonIdHelperSvc *idHelperSvc, const MuonGM::MuonDetectorManager *muonGeoMgr)
unsigned int identToModuleIdx(const Identifier &chan_id) const
const Muon::IMuonIdHelperSvc * m_idHelperSvc
ChannelEltxMap m_data_eltx_mmg
bool isConnectedChannel(const Identifier &channelId) const
bool isGoodHv(const Identifier &channelId, bool issTgcQ1OuterHv=false) const
const MuonGM::MuonDetectorManager * m_muonGeoMgr
std::vector< std::map< Identifier, std::set< TDaqConstants > > > ChannelTDaqMap
std::vector< Identifier > getChannelIdsHv(const DcsTechType tech, const std::string &side) const
void setDataTDaq(const DcsTechType tech, const Identifier &chnlId, uint64_t timeSince, uint64_t timeUntil, unsigned int elink, bool permanentlyDisabled)
bool isGoodTDaq(const EventContext &ctx, const Identifier &channelId, bool &permanentlyDisabled) const
void setDataEltx(const DcsTechType tech, const Identifier &chnlId)
Helper struct to cache all dcs constants in a common place of the memory.
std::vector< std::unique_ptr< DcsConstants > > channels
bool operator<(const NswDcsDbData::TDaqConstants &other) const