ATLAS Offline Software
MdtCondDbData.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
8 
10 // --- writing identifiers -------
12  m_id_helper(id_helper) {}
13 
18 
19 
20 const std::set<Identifier>& MdtCondDbData::getDeadTubesId() const{ return m_cachedDeadTubes; }
21 const std::set<Identifier>& MdtCondDbData::getDeadLayersId() const{ return m_cachedDeadLayers; }
22 const std::set<Identifier>& MdtCondDbData::getDeadMultilayersId() const{ return m_cachedDeadMultilayers; }
23 const std::set<Identifier>& MdtCondDbData::getDeadChambersId() const{ return m_cachedDeadChambers; }
24 
25 bool MdtCondDbData::isGood(const Identifier & Id) const {
26  return (isGoodChamber(Id) && isGoodMultilayer(Id) && isGoodLayer(Id) && isGoodTube(Id));
27 }
28 
29 bool MdtCondDbData::isGoodTube(const Identifier & Id) const { return !m_cachedDeadTubes.count(Id); }
30 bool MdtCondDbData::isGoodLayer(const Identifier & Id) const {
31  if (m_cachedDeadLayers.empty()) return true;
32  const int layer = m_id_helper.tubeLayer(Id);
33  const int multiLayer = m_id_helper.multilayer(Id);
35 }
38 }
39 bool MdtCondDbData::isGoodChamber(const Identifier & Id) const {
40  return m_cachedDeadChambers.empty() || !m_cachedDeadChambers.count(m_id_helper.elementID(Id));
41 }
42 
43 void MdtCondDbData::setHvState(const Identifier& multiLayerID, const DcsFsmState state, const float standByVolt, const float readyVolt) {
44 
46 
49  unsigned int hashIdx = static_cast<unsigned int>(hash);
50  if (hashIdx >= m_dcsStates.size()) {
51  return;
52  }
53  DcsConstants& constants = m_dcsStates.at(hashIdx);
54  constants.standbyVolt = standByVolt;
55  constants.readyVolt = readyVolt;
56  constants.fsmState = state;
57 }
58 const std::vector<DcsConstants>& MdtCondDbData::getAllHvStates() const { return m_dcsStates; }
59 const DcsConstants& MdtCondDbData::getHvState(const Identifier& multiLayerID) const {
62  unsigned int hashIdx =static_cast<unsigned int>(hash);
63  if (hashIdx >= m_dcsStates.size()) {
64  throw std::runtime_error("MdtCondDbData::getHvState() - Out of bound access "+
65  std::to_string(hashIdx) + " vs. "+std::to_string(m_dcsStates.size()));
66  }
67  return m_dcsStates[hashIdx];
68 }
69 bool MdtCondDbData::hasDCS() const {
70  return m_dcsStates.size();
71 }
72 
73 
74 
MdtIdHelper::multilayer
int multilayer(const Identifier &id) const
Access to components of the ID.
Definition: MdtIdHelper.cxx:722
MdtCondDbData::m_id_helper
const MdtIdHelper & m_id_helper
Definition: MdtCondDbData.h:84
MdtCondDbData::isGood
bool isGood(const Identifier &Id) const
Returns if the identifier (tube/multiLayer/chamber) is masked in the conditions database.
Definition: MdtCondDbData.cxx:25
MdtCondDbData::getDeadMultilayersId
const std::set< Identifier > & getDeadMultilayersId() const
Definition: MdtCondDbData.cxx:22
MdtCondDbData::hasDCS
bool hasDCS() const
Definition: MdtCondDbData.cxx:69
MdtCondDbData::getAllHvStates
const std::vector< DcsConstants > & getAllHvStates() const
Definition: MdtCondDbData.cxx:58
MdtCondDbData::m_cachedDeadLayers
std::set< Identifier > m_cachedDeadLayers
Definition: MdtCondDbData.h:79
MuonIdHelper::detectorElement_hash_max
size_type detectorElement_hash_max() const
Definition: MuonIdHelper.h:186
MdtIdHelper::tubeLayer
int tubeLayer(const Identifier &id) const
Definition: MdtIdHelper.cxx:724
MdtCondDbData::setDeadLayer
void setDeadLayer(const Identifier &ident)
All tubes in a drift layer are dead.
Definition: MdtCondDbData.cxx:15
MdtCondDbData::setDeadChamber
void setDeadChamber(const Identifier &ident)
All tubes in a chamber are dead.
Definition: MdtCondDbData.cxx:17
MdtCondDbData::getDeadLayersId
const std::set< Identifier > & getDeadLayersId() const
Definition: MdtCondDbData.cxx:21
MuonCond::DcsFsmState
DcsFsmState
Definition: MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/Defs.h:15
MdtCondDbData::getDeadChambersId
const std::set< Identifier > & getDeadChambersId() const
Definition: MdtCondDbData.cxx:23
MdtCondDbData::setHvState
void setHvState(const Identifier &multiLayerID, const DcsFsmState state, const float standByVolt, const float readyVolt)
Adds a DCS state to the conditions object multiLayerID -> Identifier of a tube in the multilayer stat...
Definition: MdtCondDbData.cxx:43
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
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
MdtIdHelper
Definition: MdtIdHelper.h:61
MdtIdHelper.h
MdtCondDbData::isGoodLayer
bool isGoodLayer(const Identifier &Id) const
Returns whether the corresponding tube layer is marked as bad in the database
Definition: MdtCondDbData.cxx:30
MdtCondDbData::m_cachedDeadTubes
std::set< Identifier > m_cachedDeadTubes
Definition: MdtCondDbData.h:78
MdtCondDbData::getHvState
const DcsConstants & getHvState(const Identifier &multiLayerID) const
Definition: MdtCondDbData.cxx:59
MdtCondDbData::setDeadTube
void setDeadTube(const Identifier &ident)
The indiviudal tube is dead.
Definition: MdtCondDbData.cxx:14
MdtCondDbData::isGoodTube
bool isGoodTube(const Identifier &Id) const
Returns whether the particular tube has been markes as bad in the database.
Definition: MdtCondDbData.cxx:29
MdtIdHelper::channelID
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int tubeLayer, int tube) const
Definition: MdtIdHelper.cxx:659
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
MdtCondDbData::setDeadMultilayer
void setDeadMultilayer(const Identifier &ident)
All tubes in a multi layer are dead.
Definition: MdtCondDbData.cxx:16
MdtCondDbData::isGoodChamber
bool isGoodChamber(const Identifier &Id) const
Returns true if the complete chamber has not dead channels.
Definition: MdtCondDbData.cxx:39
MdtIdHelper::elementID
Identifier elementID(int stationName, int stationEta, int stationPhi) const
Definition: MdtIdHelper.cxx:630
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
constants
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:1
MdtIdHelper::get_detectorElement_hash
virtual int get_detectorElement_hash(const Identifier &id, IdentifierHash &hash_id) const override
Definition: MdtIdHelper.cxx:325
MdtCondDbData::m_dcsStates
std::vector< DcsConstants > m_dcsStates
Definition: MdtCondDbData.h:83
MdtCondDbData::DcsConstants
MuonCond::DcsConstants DcsConstants
Definition: MdtCondDbData.h:60
MdtIdHelper::multilayerID
Identifier multilayerID(const Identifier &channeldID) const
Definition: MdtIdHelper.cxx:332
MdtCondDbData::MdtCondDbData
MdtCondDbData(const MdtIdHelper &id_helper)
Definition: MdtCondDbData.cxx:11
IdentifierHash
Definition: IdentifierHash.h:38
MdtCondDbData::getDeadTubesId
const std::set< Identifier > & getDeadTubesId() const
Definition: MdtCondDbData.cxx:20
MdtCondDbData::m_cachedDeadMultilayers
std::set< Identifier > m_cachedDeadMultilayers
Definition: MdtCondDbData.h:80
MdtCondDbData.h
sTgcDigitEffiDump.multiLayer
int multiLayer
Definition: sTgcDigitEffiDump.py:36
MdtCondDbData::isGoodMultilayer
bool isGoodMultilayer(const Identifier &Id) const
Definition: MdtCondDbData.cxx:36
MdtCondDbData::m_cachedDeadChambers
std::set< Identifier > m_cachedDeadChambers
Definition: MdtCondDbData.h:81