ATLAS Offline Software
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
13 #include "AthenaKernel/CondCont.h"
14 #include "AthenaKernel/BaseInfo.h"
16 #include "MuonCondData/Defs.h"
18 
19 class NswDcsDbData {
20 
21 public:
22  enum class DcsTechType{
23  MMG, // MM channels
24  MMD, // MM drift channels
25  STG // sTGC
26  };
30 
31 
32  struct TDaqConstants{
35  unsigned int elink{0};
36  bool permanentlyDisabled{false};
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 
65 private:
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 
91 std::ostream& operator<<(std::ostream& ostr, const NswDcsDbData::TDaqConstants& obj);
92 
93 
94 
95 CLASS_DEF( NswDcsDbData , 99551304 , 1 );
97 
98 #endif
NswDcsDbData::getDataForChannelHv
const DcsConstants * getDataForChannelHv(const DcsTechType tech, const Identifier &channelId, bool issTgcQ1OuterHv) const
Retrieves the calibration constant for a particular readout channel.
Definition: NswDcsDbData.cxx:147
NswDcsDbData::DcsTechType
DcsTechType
Definition: NswDcsDbData.h:22
NswDcsDbData::DcsTechType::STG
@ STG
NswDcsDbData::setDataEltx
void setDataEltx(const DcsTechType tech, const Identifier &chnlId)
Definition: NswDcsDbData.cxx:100
NswDcsDbData::isGood
bool isGood(const EventContext &ctx, const Identifier &channelId, bool issTgcQ1OuterHv=false) const
Returns whether the channel is alive, i.e. DCS state on, etc...
Definition: NswDcsDbData.cxx:180
NswDcsDbData::m_data_tdaq_mmg
ChannelTDaqMap m_data_tdaq_mmg
Definition: NswDcsDbData.h:79
CondCont.h
Hold mappings of ranges to condition objects.
NswDcsDbData::DcsModule::channels
std::vector< std::unique_ptr< DcsConstants > > channels
Definition: NswDcsDbData.h:71
NswDcsDbData::TDaqConstants::timeUntil
uint64_t timeUntil
Definition: NswDcsDbData.h:34
CONDCONT_MIXED_DEF
CONDCONT_MIXED_DEF(NswDcsDbData, 125092872)
NswDcsDbData::m_data_hv_stg
ChannelDcsMap m_data_hv_stg
Definition: NswDcsDbData.h:77
MuonCond::DcsFsmState
DcsFsmState
Definition: MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/Defs.h:15
NswDcsDbData::TDaqConstants::operator<
bool operator<(const NswDcsDbData::TDaqConstants &other) const
Definition: NswDcsDbData.h:37
TRT::Hit::side
@ side
Definition: HitInfo.h:83
operator<<
std::ostream & operator<<(std::ostream &ostr, const NswDcsDbData::TDaqConstants &obj)
Definition: NswDcsDbData.cxx:28
NswDcsDbData::TDaqConstants::elink
unsigned int elink
Definition: NswDcsDbData.h:35
NswDcsDbData::identToModuleIdx
unsigned int identToModuleIdx(const Identifier &chan_id) const
Definition: NswDcsDbData.cxx:33
DcsConstants
MdtCondDbData::DcsConstants DcsConstants
Definition: MdtCondDbData.cxx:9
NswDcsDbData::TDaqConstants
Definition: NswDcsDbData.h:32
NswDcsDbData::DcsTechType::MMD
@ MMD
BaseInfo.h
Provide an interface for finding inheritance information at run time.
NswDcsDbData::isGoodHv
bool isGoodHv(const Identifier &channelId, bool issTgcQ1OuterHv=false) const
Definition: NswDcsDbData.cxx:194
NswDcsDbData::TDaqConstants::timeSince
uint64_t timeSince
Definition: NswDcsDbData.h:33
NswDcsDbData::isGoodEltx
bool isGoodEltx(const Identifier &channelId) const
Definition: NswDcsDbData.cxx:248
MuonCond::DcsConstants
Helper struct to cache all dcs constants in a common place of the memory.
Definition: MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/Defs.h:31
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
NswDcsDbData::ChannelDcsMap
std::vector< DcsModule > ChannelDcsMap
Definition: NswDcsDbData.h:74
NswDcsDbData::DcsModule
Definition: NswDcsDbData.h:70
CLASS_DEF
CLASS_DEF(NswDcsDbData, 99551304, 1)
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:122
NswDcsDbData::m_data_hv_mmd
ChannelDcsMap m_data_hv_mmd
Definition: NswDcsDbData.h:76
NswDcsDbData::DcsTechType::MMG
@ MMG
NswDcsDbData::~NswDcsDbData
virtual ~NswDcsDbData()=default
Defs.h
NswDcsDbData::setDataHv
void setDataHv(const DcsTechType tech, const Identifier &chnlId, DcsConstants constants)
Definition: NswDcsDbData.cxx:50
NswDcsDbData::ChannelEltxMap
std::vector< std::set< Identifier > > ChannelEltxMap
Definition: NswDcsDbData.h:81
MuonCond::DcsDataType
DcsDataType
Definition: MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/Defs.h:11
NswDcsDbData::isGoodTDaq
bool isGoodTDaq(const EventContext &ctx, const Identifier &channelId, bool &permanentlyDisabled) const
Definition: NswDcsDbData.cxx:211
NswDcsDbData::NswDcsDbData
NswDcsDbData(const Muon::IMuonIdHelperSvc *idHelperSvc, const MuonGM::MuonDetectorManager *muonGeoMgr)
Definition: NswDcsDbData.cxx:24
NswDcsDbData
Definition: NswDcsDbData.h:19
MuonDetectorManager.h
NswDcsDbData::getChannelIdsHv
std::vector< Identifier > getChannelIdsHv(const DcsTechType tech, const std::string &side) const
Definition: NswDcsDbData.cxx:113
NswDcsDbData::m_data_eltx_mmg
ChannelEltxMap m_data_eltx_mmg
Definition: NswDcsDbData.h:82
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
NswDcsDbData::ChannelTDaqMap
std::vector< std::map< Identifier, std::set< TDaqConstants > >> ChannelTDaqMap
Definition: NswDcsDbData.h:78
constants
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:1
MuonGM::MuonDetectorManager
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:50
NswDcsDbData::m_data_hv_mmg
ChannelDcsMap m_data_hv_mmg
Definition: NswDcsDbData.h:75
NswDcsDbData::isConnectedChannel
bool isConnectedChannel(const Identifier &channelId) const
Definition: NswDcsDbData.cxx:257
NswDcsDbData::DcsModule::layer_id
Identifier layer_id
Definition: NswDcsDbData.h:72
Muon::IMuonIdHelperSvc
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
Definition: IMuonIdHelperSvc.h:27
NswDcsDbData::setDataTDaq
void setDataTDaq(const DcsTechType tech, const Identifier &chnlId, uint64_t timeSince, uint64_t timeUntil, unsigned int elink, bool permanentlyDisabled)
Definition: NswDcsDbData.cxx:87
NswDcsDbData::m_muonGeoMgr
const MuonGM::MuonDetectorManager * m_muonGeoMgr
Definition: NswDcsDbData.h:87
NswDcsDbData::TDaqConstants::permanentlyDisabled
bool permanentlyDisabled
Definition: NswDcsDbData.h:36
NswDcsDbData::m_idHelperSvc
const Muon::IMuonIdHelperSvc * m_idHelperSvc
Definition: NswDcsDbData.h:86
python.PyAthena.obj
obj
Definition: PyAthena.py:132
NswDcsDbData::m_data_tdaq_stg
ChannelTDaqMap m_data_tdaq_stg
Definition: NswDcsDbData.h:80
IMuonIdHelperSvc.h
NswDcsDbData::m_data_eltx_stg
ChannelEltxMap m_data_eltx_stg
Definition: NswDcsDbData.h:83
Identifier
Definition: IdentifierFieldParser.cxx:14