ATLAS Offline Software
Loading...
Searching...
No Matches
NswDcsDbData.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 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 int elink{0};
37 bool operator<(const NswDcsDbData::TDaqConstants& other)const{
38 if(elink != other.elink) return elink < other.elink;
39 return timeUntil < other.timeSince;
40 }
41 };
42
43 NswDcsDbData(const Muon::IMuonIdHelperSvc* idHelperSvc, const MuonGM::MuonDetectorManager* muonGeoMgr);
44 virtual ~NswDcsDbData() = default;
45
46 // setting functions
47 void setDataHv(const DcsTechType tech, const Identifier& chnlId, DcsConstants constants);
48 void setDataTDaq(const DcsTechType tech, const Identifier& chnlId, uint64_t timeSince, uint64_t timeUntil, unsigned int elink, bool permanentlyDisabled);
49 void setDataEltx(const DcsTechType tech, const Identifier& chnlId);
50
51 // retrieval functions
52
54 std::vector<Identifier> getChannelIdsHv(const DcsTechType tech, const std::string& side) const;
56 const DcsConstants* getDataForChannelHv(const DcsTechType tech, const Identifier& channelId, bool issTgcQ1OuterHv) const;
57
59 bool isGood(const EventContext& ctx, const Identifier& channelId, bool issTgcQ1OuterHv = false) const;
60 bool isGoodHv(const Identifier& channelId, bool issTgcQ1OuterHv = false) const;
61 bool isGoodTDaq(const EventContext& ctx, const Identifier& channelId, bool &permanentlyDisabled) const;
62 bool isGoodEltx(const Identifier& channelId) const;
63 bool isConnectedChannel(const Identifier& channelId) const;
64
65private:
66
67 unsigned int identToModuleIdx(const Identifier& chan_id) const;
68
69 // containers
70 struct DcsModule{
71 std::vector<std::unique_ptr<DcsConstants>> channels{};
73 };
74 using ChannelDcsMap = std::vector<DcsModule>;
78 using ChannelTDaqMap = std::vector<std::map<Identifier, std::set<TDaqConstants>>>;
81 using ChannelEltxMap = std::vector<std::set<Identifier>>;
84
85 // ID helpers
88
89};
90
91std::ostream& operator<<(std::ostream& ostr, const NswDcsDbData::TDaqConstants& obj);
92
93
94
95CLASS_DEF( NswDcsDbData , 99551304 , 1 );
97
98#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
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
std::vector< std::set< Identifier > > ChannelEltxMap
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