ATLAS Offline Software
Loading...
Searching...
No Matches
MdtCondDbData Class Reference

#include <MdtCondDbData.h>

Collaboration diagram for MdtCondDbData:

Public Types

using DcsFsmState = MuonCond::DcsFsmState
using DcsConstants = MuonCond::DcsConstants

Public Member Functions

 MdtCondDbData (const MdtIdHelper &id_helper)
virtual ~MdtCondDbData ()=default
void setDeadTube (const Identifier &ident)
 The indiviudal tube is dead.
void setDeadLayer (const Identifier &ident)
 All tubes in a drift layer are dead.
void setDeadMultilayer (const Identifier &ident)
 All tubes in a multi layer are dead.
void setDeadChamber (const Identifier &ident)
 All tubes in a chamber are dead.
const std::set< Identifier > & getDeadTubesId () const
const std::set< Identifier > & getDeadLayersId () const
const std::set< Identifier > & getDeadMultilayersId () const
const std::set< Identifier > & getDeadChambersId () const
bool isGood (const Identifier &Id) const
 Returns if the identifier (tube/multiLayer/chamber) is masked in the conditions database.
bool isGoodTube (const Identifier &Id) const
 Returns whether the particular tube has been markes as bad in the database.
bool isGoodLayer (const Identifier &Id) const
 Returns whether the corresponding tube layer is marked as bad in the database.
bool isGoodMultilayer (const Identifier &Id) const
bool isGoodChamber (const Identifier &Id) const
 Returns true if the complete chamber has not dead channels.
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 state -> DCS state flag standByVolt: voltage if system is at standby readyVolt: Voltage if system is ready for data-taking.
bool hasDCS () const
const DcsConstantsgetHvState (const Identifier &multiLayerID) const
const std::vector< DcsConstants > & getAllHvStates () const

Private Attributes

std::set< Identifierm_cachedDeadTubes {}
std::set< Identifierm_cachedDeadLayers {}
std::set< Identifierm_cachedDeadMultilayers {}
std::set< Identifierm_cachedDeadChambers {}
std::vector< DcsConstantsm_dcsStates {}
const MdtIdHelperm_id_helper

Friends

class MdtCondDbAlg

Detailed Description

Definition at line 24 of file MdtCondDbData.h.

Member Typedef Documentation

◆ DcsConstants

◆ DcsFsmState

Constructor & Destructor Documentation

◆ MdtCondDbData()

MdtCondDbData::MdtCondDbData ( const MdtIdHelper & id_helper)

Definition at line 13 of file MdtCondDbData.cxx.

13 :
14 m_id_helper(id_helper) {}
const MdtIdHelper & m_id_helper

◆ ~MdtCondDbData()

virtual MdtCondDbData::~MdtCondDbData ( )
virtualdefault

Member Function Documentation

◆ getAllHvStates()

const std::vector< DcsConstants > & MdtCondDbData::getAllHvStates ( ) const

Definition at line 60 of file MdtCondDbData.cxx.

60{ return m_dcsStates; }
std::vector< DcsConstants > m_dcsStates

◆ getDeadChambersId()

const std::set< Identifier > & MdtCondDbData::getDeadChambersId ( ) const

Definition at line 25 of file MdtCondDbData.cxx.

25{ return m_cachedDeadChambers; }
std::set< Identifier > m_cachedDeadChambers

◆ getDeadLayersId()

const std::set< Identifier > & MdtCondDbData::getDeadLayersId ( ) const

Definition at line 23 of file MdtCondDbData.cxx.

23{ return m_cachedDeadLayers; }
std::set< Identifier > m_cachedDeadLayers

◆ getDeadMultilayersId()

const std::set< Identifier > & MdtCondDbData::getDeadMultilayersId ( ) const

Definition at line 24 of file MdtCondDbData.cxx.

std::set< Identifier > m_cachedDeadMultilayers

◆ getDeadTubesId()

const std::set< Identifier > & MdtCondDbData::getDeadTubesId ( ) const

Definition at line 22 of file MdtCondDbData.cxx.

22{ return m_cachedDeadTubes; }
std::set< Identifier > m_cachedDeadTubes

◆ getHvState()

const DcsConstants & MdtCondDbData::getHvState ( const Identifier & multiLayerID) const

Definition at line 61 of file MdtCondDbData.cxx.

61 {
62 IdentifierHash hash{};
63 m_id_helper.get_detectorElement_hash(multiLayerID, hash);
64 unsigned int hashIdx =static_cast<unsigned int>(hash);
65 if (hashIdx >= m_dcsStates.size()) {
66 THROW_EXCEPTION("MdtCondDbData::getHvState() - Out of bound access "+
67 std::to_string(hashIdx) + " vs. "+std::to_string(m_dcsStates.size()));
68 }
69 return m_dcsStates[hashIdx];
70}
#define THROW_EXCEPTION(MESSAGE)
Definition throwExcept.h:10

◆ hasDCS()

bool MdtCondDbData::hasDCS ( ) const

Definition at line 71 of file MdtCondDbData.cxx.

71 {
72 return m_dcsStates.size();
73}

◆ isGood()

bool MdtCondDbData::isGood ( const Identifier & Id) const

Returns if the identifier (tube/multiLayer/chamber) is masked in the conditions database.

Definition at line 27 of file MdtCondDbData.cxx.

27 {
28 return (isGoodChamber(Id) && isGoodMultilayer(Id) && isGoodLayer(Id) && isGoodTube(Id));
29}
bool isGoodTube(const Identifier &Id) const
Returns whether the particular tube has been markes as bad in the database.
bool isGoodLayer(const Identifier &Id) const
Returns whether the corresponding tube layer is marked as bad in the database.
bool isGoodChamber(const Identifier &Id) const
Returns true if the complete chamber has not dead channels.
bool isGoodMultilayer(const Identifier &Id) const

◆ isGoodChamber()

bool MdtCondDbData::isGoodChamber ( const Identifier & Id) const

Returns true if the complete chamber has not dead channels.

Definition at line 41 of file MdtCondDbData.cxx.

41 {
42 return m_cachedDeadChambers.empty() || !m_cachedDeadChambers.count(m_id_helper.elementID(Id));
43}

◆ isGoodLayer()

bool MdtCondDbData::isGoodLayer ( const Identifier & Id) const

Returns whether the corresponding tube layer is marked as bad in the database.

Definition at line 32 of file MdtCondDbData.cxx.

32 {
33 if (m_cachedDeadLayers.empty()) return true;
34 const int layer = m_id_helper.tubeLayer(Id);
35 const int multiLayer = m_id_helper.multilayer(Id);
36 return !m_cachedDeadLayers.count(m_id_helper.channelID(Id,multiLayer, layer, 1));
37}
@ layer
Definition HitInfo.h:79

◆ isGoodMultilayer()

bool MdtCondDbData::isGoodMultilayer ( const Identifier & Id) const

Definition at line 38 of file MdtCondDbData.cxx.

38 {
39 return m_cachedDeadLayers.empty() || !m_cachedDeadMultilayers.count(m_id_helper.multilayerID(Id));
40}

◆ isGoodTube()

bool MdtCondDbData::isGoodTube ( const Identifier & Id) const

Returns whether the particular tube has been markes as bad in the database.

Definition at line 31 of file MdtCondDbData.cxx.

31{ return !m_cachedDeadTubes.count(Id); }

◆ setDeadChamber()

void MdtCondDbData::setDeadChamber ( const Identifier & ident)

All tubes in a chamber are dead.

Definition at line 19 of file MdtCondDbData.cxx.

19{ m_cachedDeadChambers.insert(Id); }

◆ setDeadLayer()

void MdtCondDbData::setDeadLayer ( const Identifier & ident)

All tubes in a drift layer are dead.

Definition at line 17 of file MdtCondDbData.cxx.

17{ m_cachedDeadLayers.insert(Id); }

◆ setDeadMultilayer()

void MdtCondDbData::setDeadMultilayer ( const Identifier & ident)

All tubes in a multi layer are dead.

Definition at line 18 of file MdtCondDbData.cxx.

18{ m_cachedDeadMultilayers.insert(Id); }

◆ setDeadTube()

void MdtCondDbData::setDeadTube ( const Identifier & ident)

The indiviudal tube is dead.

Definition at line 16 of file MdtCondDbData.cxx.

16{ m_cachedDeadTubes.insert(Id); }

◆ setHvState()

void MdtCondDbData::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 state -> DCS state flag standByVolt: voltage if system is at standby readyVolt: Voltage if system is ready for data-taking.

Definition at line 45 of file MdtCondDbData.cxx.

45 {
46
47 if (m_dcsStates.empty()) m_dcsStates.resize(m_id_helper.detectorElement_hash_max());
48
49 IdentifierHash hash{};
50 m_id_helper.get_detectorElement_hash(multiLayerID, hash);
51 unsigned int hashIdx = static_cast<unsigned int>(hash);
52 if (hashIdx >= m_dcsStates.size()) {
53 return;
54 }
55 DcsConstants& constants = m_dcsStates.at(hashIdx);
56 constants.standbyVolt = standByVolt;
57 constants.readyVolt = readyVolt;
58 constants.fsmState = state;
59}
MuonCond::DcsConstants DcsConstants

◆ MdtCondDbAlg

friend class MdtCondDbAlg
friend

Definition at line 26 of file MdtCondDbData.h.

Member Data Documentation

◆ m_cachedDeadChambers

std::set<Identifier> MdtCondDbData::m_cachedDeadChambers {}
private

Definition at line 84 of file MdtCondDbData.h.

84{};

◆ m_cachedDeadLayers

std::set<Identifier> MdtCondDbData::m_cachedDeadLayers {}
private

Definition at line 82 of file MdtCondDbData.h.

82{};

◆ m_cachedDeadMultilayers

std::set<Identifier> MdtCondDbData::m_cachedDeadMultilayers {}
private

Definition at line 83 of file MdtCondDbData.h.

83{};

◆ m_cachedDeadTubes

std::set<Identifier> MdtCondDbData::m_cachedDeadTubes {}
private

Definition at line 81 of file MdtCondDbData.h.

81{};

◆ m_dcsStates

std::vector<DcsConstants> MdtCondDbData::m_dcsStates {}
private

Definition at line 86 of file MdtCondDbData.h.

86{};

◆ m_id_helper

const MdtIdHelper& MdtCondDbData::m_id_helper
private

Definition at line 87 of file MdtCondDbData.h.


The documentation for this class was generated from the following files: