ATLAS Offline Software
Public Types | Public Member Functions | Private Attributes | Friends | List of all members
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. More...
 
void setDeadLayer (const Identifier &ident)
 All tubes in a drift layer are dead. More...
 
void setDeadMultilayer (const Identifier &ident)
 All tubes in a multi layer are dead. More...
 
void setDeadChamber (const Identifier &ident)
 All tubes in a chamber are dead. More...
 
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. More...
 
bool isGoodTube (const Identifier &Id) const
 Returns whether the particular tube has been markes as bad in the database. More...
 
bool isGoodLayer (const Identifier &Id) const
 Returns whether the corresponding tube layer is marked as bad in the database
More...
 
bool isGoodMultilayer (const Identifier &Id) const
 
bool isGoodChamber (const Identifier &Id) const
 Returns true if the complete chamber has not dead channels. More...
 
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. More...
 
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 21 of file MdtCondDbData.h.

Member Typedef Documentation

◆ DcsConstants

Definition at line 60 of file MdtCondDbData.h.

◆ DcsFsmState

Definition at line 59 of file MdtCondDbData.h.

Constructor & Destructor Documentation

◆ MdtCondDbData()

MdtCondDbData::MdtCondDbData ( const MdtIdHelper id_helper)

Definition at line 11 of file MdtCondDbData.cxx.

11  :
12  m_id_helper(id_helper) {}

◆ ~MdtCondDbData()

virtual MdtCondDbData::~MdtCondDbData ( )
virtualdefault

Member Function Documentation

◆ getAllHvStates()

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

Definition at line 58 of file MdtCondDbData.cxx.

58 { return m_dcsStates; }

◆ getDeadChambersId()

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

Definition at line 23 of file MdtCondDbData.cxx.

23 { return m_cachedDeadChambers; }

◆ getDeadLayersId()

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

Definition at line 21 of file MdtCondDbData.cxx.

21 { return m_cachedDeadLayers; }

◆ getDeadMultilayersId()

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

Definition at line 22 of file MdtCondDbData.cxx.

22 { return m_cachedDeadMultilayers; }

◆ getDeadTubesId()

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

Definition at line 20 of file MdtCondDbData.cxx.

20 { return m_cachedDeadTubes; }

◆ getHvState()

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

Definition at line 59 of file MdtCondDbData.cxx.

59  {
62  unsigned int hashIdx =static_cast<unsigned int>(hash);
63  if (hashIdx >= m_dcsStates.size()) {
64  THROW_EXCEPTION("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 }

◆ hasDCS()

bool MdtCondDbData::hasDCS ( ) const

Definition at line 69 of file MdtCondDbData.cxx.

69  {
70  return m_dcsStates.size();
71 }

◆ isGood()

bool MdtCondDbData::isGood ( const Identifier Id) const

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

Definition at line 25 of file MdtCondDbData.cxx.

25  {
26  return (isGoodChamber(Id) && isGoodMultilayer(Id) && isGoodLayer(Id) && isGoodTube(Id));
27 }

◆ isGoodChamber()

bool MdtCondDbData::isGoodChamber ( const Identifier Id) const

Returns true if the complete chamber has not dead channels.

Definition at line 39 of file MdtCondDbData.cxx.

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

◆ isGoodLayer()

bool MdtCondDbData::isGoodLayer ( const Identifier Id) const

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

Definition at line 30 of file MdtCondDbData.cxx.

30  {
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 }

◆ isGoodMultilayer()

bool MdtCondDbData::isGoodMultilayer ( const Identifier Id) const

Definition at line 36 of file MdtCondDbData.cxx.

36  {
38 }

◆ isGoodTube()

bool MdtCondDbData::isGoodTube ( const Identifier Id) const

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

Definition at line 29 of file MdtCondDbData.cxx.

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

◆ setDeadChamber()

void MdtCondDbData::setDeadChamber ( const Identifier ident)

All tubes in a chamber are dead.

Definition at line 17 of file MdtCondDbData.cxx.

17 { m_cachedDeadChambers.insert(Id); }

◆ setDeadLayer()

void MdtCondDbData::setDeadLayer ( const Identifier ident)

All tubes in a drift layer are dead.

Definition at line 15 of file MdtCondDbData.cxx.

15 { m_cachedDeadLayers.insert(Id); }

◆ setDeadMultilayer()

void MdtCondDbData::setDeadMultilayer ( const Identifier ident)

All tubes in a multi layer are dead.

Definition at line 16 of file MdtCondDbData.cxx.

16 { m_cachedDeadMultilayers.insert(Id); }

◆ setDeadTube()

void MdtCondDbData::setDeadTube ( const Identifier ident)

The indiviudal tube is dead.

Definition at line 14 of file MdtCondDbData.cxx.

14 { 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 43 of file MdtCondDbData.cxx.

43  {
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 }

Friends And Related Function Documentation

◆ MdtCondDbAlg

friend class MdtCondDbAlg
friend

Definition at line 23 of file MdtCondDbData.h.

Member Data Documentation

◆ m_cachedDeadChambers

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

Definition at line 81 of file MdtCondDbData.h.

◆ m_cachedDeadLayers

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

Definition at line 79 of file MdtCondDbData.h.

◆ m_cachedDeadMultilayers

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

Definition at line 80 of file MdtCondDbData.h.

◆ m_cachedDeadTubes

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

Definition at line 78 of file MdtCondDbData.h.

◆ m_dcsStates

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

Definition at line 83 of file MdtCondDbData.h.

◆ m_id_helper

const MdtIdHelper& MdtCondDbData::m_id_helper
private

Definition at line 84 of file MdtCondDbData.h.


The documentation for this class was generated from the following files:
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::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
THROW_EXCEPTION
#define THROW_EXCEPTION(MSG)
Definition: MMReadoutElement.cxx:48
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
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::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::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:326
MdtCondDbData::m_dcsStates
std::vector< DcsConstants > m_dcsStates
Definition: MdtCondDbData.h:83
MdtIdHelper::multilayerID
Identifier multilayerID(const Identifier &channeldID) const
Definition: MdtIdHelper.cxx:333
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
MdtCondDbData::m_cachedDeadMultilayers
std::set< Identifier > m_cachedDeadMultilayers
Definition: MdtCondDbData.h:80
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