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 24 of file MdtCondDbData.h.

Member Typedef Documentation

◆ DcsConstants

Definition at line 63 of file MdtCondDbData.h.

◆ DcsFsmState

Definition at line 62 of file MdtCondDbData.h.

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

◆ ~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; }

◆ getDeadChambersId()

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

Definition at line 25 of file MdtCondDbData.cxx.

25 { return m_cachedDeadChambers; }

◆ getDeadLayersId()

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

Definition at line 23 of file MdtCondDbData.cxx.

23 { return m_cachedDeadLayers; }

◆ getDeadMultilayersId()

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

Definition at line 24 of file MdtCondDbData.cxx.

24 { return m_cachedDeadMultilayers; }

◆ getDeadTubesId()

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

Definition at line 22 of file MdtCondDbData.cxx.

22 { return m_cachedDeadTubes; }

◆ getHvState()

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

Definition at line 61 of file MdtCondDbData.cxx.

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

◆ 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 }

◆ 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);
37 }

◆ isGoodMultilayer()

bool MdtCondDbData::isGoodMultilayer ( const Identifier Id) const

Definition at line 38 of file MdtCondDbData.cxx.

38  {
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 
48 
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 }

Friends And Related Function Documentation

◆ 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.

◆ m_cachedDeadLayers

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

Definition at line 82 of file MdtCondDbData.h.

◆ m_cachedDeadMultilayers

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

Definition at line 83 of file MdtCondDbData.h.

◆ m_cachedDeadTubes

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

Definition at line 81 of file MdtCondDbData.h.

◆ m_dcsStates

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

Definition at line 86 of file MdtCondDbData.h.

◆ 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:
MdtIdHelper::multilayer
int multilayer(const Identifier &id) const
Access to components of the ID.
Definition: MdtIdHelper.cxx:727
MdtCondDbData::m_id_helper
const MdtIdHelper & m_id_helper
Definition: MdtCondDbData.h:87
MdtCondDbData::m_cachedDeadLayers
std::set< Identifier > m_cachedDeadLayers
Definition: MdtCondDbData.h:82
MuonIdHelper::detectorElement_hash_max
size_type detectorElement_hash_max() const
Definition: MuonIdHelper.h:183
MdtIdHelper::tubeLayer
int tubeLayer(const Identifier &id) const
Definition: MdtIdHelper.cxx:729
MuonR4::to_string
std::string to_string(const SectorProjector proj)
Definition: MsTrackSeeder.cxx:74
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:32
MdtCondDbData::m_cachedDeadTubes
std::set< Identifier > m_cachedDeadTubes
Definition: MdtCondDbData.h:81
MdtCondDbData::isGoodTube
bool isGoodTube(const Identifier &Id) const
Returns whether the particular tube has been markes as bad in the database.
Definition: MdtCondDbData.cxx:31
MdtIdHelper::channelID
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int tubeLayer, int tube) const
Definition: MdtIdHelper.cxx:664
THROW_EXCEPTION
#define THROW_EXCEPTION(MESSAGE)
Definition: throwExcept.h:10
MdtCondDbData::isGoodChamber
bool isGoodChamber(const Identifier &Id) const
Returns true if the complete chamber has not dead channels.
Definition: MdtCondDbData.cxx:41
MdtIdHelper::elementID
Identifier elementID(int stationName, int stationEta, int stationPhi) const
Definition: MdtIdHelper.cxx:635
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:108
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:331
MdtCondDbData::m_dcsStates
std::vector< DcsConstants > m_dcsStates
Definition: MdtCondDbData.h:86
MdtIdHelper::multilayerID
Identifier multilayerID(const Identifier &channeldID) const
Definition: MdtIdHelper.cxx:338
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:83
sTgcDigitEffiDump.multiLayer
int multiLayer
Definition: sTgcDigitEffiDump.py:36
MdtCondDbData::isGoodMultilayer
bool isGoodMultilayer(const Identifier &Id) const
Definition: MdtCondDbData.cxx:38
MdtCondDbData::m_cachedDeadChambers
std::set< Identifier > m_cachedDeadChambers
Definition: MdtCondDbData.h:84