ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
PixelActiveDetectorElementStatusTool Class Reference

#include <PixelActiveDetectorElementStatusTool.h>

Inheritance diagram for PixelActiveDetectorElementStatusTool:
Collaboration diagram for PixelActiveDetectorElementStatusTool:

Public Member Functions

 PixelActiveDetectorElementStatusTool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual StatusCode initialize () override
 
virtual std::unique_ptr< InDet::SiDetectorElementStatusgetDetectorElementStatus (const EventContext &ctx, SG::WriteCondHandle< InDet::SiDetectorElementStatus > *whandle) const override
 

Static Public Member Functions

static InterfaceID & interfaceID ()
 

Protected Member Functions

std::unique_ptr< InDet::SiDetectorElementStatuscreateDetectorElementStatus (const EventContext &ctx, SG::WriteCondHandle< InDet::SiDetectorElementStatus > *whandle) const
 Create a new detector element status element container. More...
 

Protected Attributes

const PixelIDm_pixelID {}
 

Private Attributes

SG::ReadCondHandleKey< PixelDCSStatusDatam_condDCSStatusKey {this, "PixelDCSStatusCondData", "PixelDCSStatusCondData", "Pixel FSM status key"}
 
Gaudi::Property< std::vector< std::string > > m_isActiveStatus {this, "IsActiveStatus", {},"Pixel module status for which the module is considered active." }
 
unsigned int m_activeStatusMask {0}
 mask in which each status is represented by a bit and for status values which are cnsidered active the corresponding bit is set; More...
 
ServiceHandle< InDetDD::IPixelReadoutManagerm_pixelReadout {this, "PixelReadoutManager", "PixelReadoutManager", "Pixel readout manager" }
 
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollectionm_pixelDetEleCollKey {this, "PixelDetEleCollKey", "PixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"}
 
SG::ReadCondHandleKey< InDet::SiDetectorElementStatusm_pixelDetElStatusCondKey {this, "PixelDetElStatusCondDataBaseKey", "" , "Optional conditions data key of an input SiDetectorElementStatus on which the newly created object will be based."}
 

Detailed Description

Definition at line 20 of file PixelActiveDetectorElementStatusTool.h.

Constructor & Destructor Documentation

◆ PixelActiveDetectorElementStatusTool()

PixelActiveDetectorElementStatusTool::PixelActiveDetectorElementStatusTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)
inline

Member Function Documentation

◆ createDetectorElementStatus()

std::unique_ptr< InDet::SiDetectorElementStatus > PixelDetectorElementStatusToolBase::createDetectorElementStatus ( const EventContext &  ctx,
SG::WriteCondHandle< InDet::SiDetectorElementStatus > *  whandle 
) const
protectedinherited

Create a new detector element status element container.

Depending on the properties the container may be a copy of an event data or conditions data element status container.

Definition at line 34 of file PixelDetectorElementStatusToolBase.cxx.

35  {
38  if (whandle) {
39  whandle->addDependency (input_element_status);
40  }
41 
42  return std::make_unique<InDet::PixelDetectorElementStatus>(*castToDerived(input_element_status.cptr()));
43  }
44  else {
46  if (not pixelDetEleHandle.isValid() ) {
47  std::stringstream msg;
48  msg << m_pixelDetEleCollKey.fullKey() << " is not available.";
49  throw std::runtime_error(msg.str());
50  }
51  if (whandle) {
52  whandle->addDependency (pixelDetEleHandle);
53  }
54  const InDetDD::SiDetectorElementCollection* elements(*pixelDetEleHandle);
55  return std::make_unique<InDet::PixelDetectorElementStatus>(*elements);
56  }
57 }

◆ getDetectorElementStatus()

std::unique_ptr< InDet::SiDetectorElementStatus > PixelActiveDetectorElementStatusTool::getDetectorElementStatus ( const EventContext &  ctx,
SG::WriteCondHandle< InDet::SiDetectorElementStatus > *  whandle 
) const
overridevirtual

Definition at line 40 of file PixelActiveDetectorElementStatusTool.cxx.

41  {
42  std::unique_ptr<InDet::SiDetectorElementStatus> element_status( createDetectorElementStatus(ctx, whandle));
43  std::vector<bool> &status=element_status->getElementStatus();
44  if (status.empty()) {
46  true // default value of PixelDCSStateData is 0
47  );
48  }
49  std::vector<InDet::ChipFlags_t> &chip_status=element_status->getElementChipStatus();
50  if (chip_status.empty()) {
51  chip_status.resize(status.size(),0xffff); // Should set this to the correct number of chips
52  }
53 
55  andStatus(dcs_status_handle->moduleStatusMap(), m_activeStatusMask, status);
56  if (whandle) {
57  whandle->addDependency (dcs_status_handle);
58  }
59 
60  return element_status;
61 }

◆ initialize()

StatusCode PixelActiveDetectorElementStatusTool::initialize ( )
overridevirtual

Reimplemented from PixelDetectorElementStatusToolBase.

Definition at line 4 of file PixelActiveDetectorElementStatusTool.cxx.

5 {
8 
10  for (unsigned int istatus=0; istatus<m_isActiveStatus.size(); istatus++) {
11  unsigned int active_status=0;
12  if (m_isActiveStatus[istatus]=="OK") { active_status = PixelDCSStatusData::DCSModuleStatus::OK; }
13  else if (m_isActiveStatus[istatus]=="WARNING") { active_status = PixelDCSStatusData::DCSModuleStatus::WARNING; }
14  else if (m_isActiveStatus[istatus]=="ERROR") { active_status = PixelDCSStatusData::DCSModuleStatus::ERROR; }
15  else if (m_isActiveStatus[istatus]=="FATAL") { active_status = PixelDCSStatusData::DCSModuleStatus::FATAL; }
16  else if (m_isActiveStatus[istatus]=="NOSTATUS") { active_status = PixelDCSStatusData::DCSModuleStatus::NOSTATUS; }
17  else {
18  ATH_MSG_ERROR("No matching DCS status " << m_isActiveStatus[istatus] << " in DCSModuleStatus");
19  return StatusCode::FAILURE;
20  }
21  if (active_status>31) {
22  ATH_MSG_FATAL("Logic error: status id too large. Cannot be represented by a bit");
23  return StatusCode::FAILURE;
24  }
25  m_activeStatusMask |= (1u<<active_status);
26  }
27  return StatusCode::SUCCESS;
28 }

◆ interfaceID()

InterfaceID & PixelActiveDetectorElementStatusTool::interfaceID ( )
inlinestatic

Definition at line 42 of file PixelActiveDetectorElementStatusTool.h.

42  {
43  static InterfaceID IID_PixelActiveDetectorElementStatusTool("PixelActiveDetectorElementStatusTool", 1, 0);
44  return IID_PixelActiveDetectorElementStatusTool;
45 }

Member Data Documentation

◆ m_activeStatusMask

unsigned int PixelActiveDetectorElementStatusTool::m_activeStatusMask {0}
private

mask in which each status is represented by a bit and for status values which are cnsidered active the corresponding bit is set;

Definition at line 39 of file PixelActiveDetectorElementStatusTool.h.

◆ m_condDCSStatusKey

SG::ReadCondHandleKey<PixelDCSStatusData> PixelActiveDetectorElementStatusTool::m_condDCSStatusKey {this, "PixelDCSStatusCondData", "PixelDCSStatusCondData", "Pixel FSM status key"}
private

Definition at line 34 of file PixelActiveDetectorElementStatusTool.h.

◆ m_isActiveStatus

Gaudi::Property< std::vector<std::string> > PixelActiveDetectorElementStatusTool::m_isActiveStatus {this, "IsActiveStatus", {},"Pixel module status for which the module is considered active." }
private

Definition at line 36 of file PixelActiveDetectorElementStatusTool.h.

◆ m_pixelDetEleCollKey

SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> PixelDetectorElementStatusToolBase::m_pixelDetEleCollKey {this, "PixelDetEleCollKey", "PixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"}
privateinherited

Definition at line 45 of file PixelDetectorElementStatusToolBase.h.

◆ m_pixelDetElStatusCondKey

SG::ReadCondHandleKey<InDet::SiDetectorElementStatus> PixelDetectorElementStatusToolBase::m_pixelDetElStatusCondKey {this, "PixelDetElStatusCondDataBaseKey", "" , "Optional conditions data key of an input SiDetectorElementStatus on which the newly created object will be based."}
privateinherited

Definition at line 48 of file PixelDetectorElementStatusToolBase.h.

◆ m_pixelID

const PixelID* PixelDetectorElementStatusToolBase::m_pixelID {}
protectedinherited

Definition at line 39 of file PixelDetectorElementStatusToolBase.h.

◆ m_pixelReadout

ServiceHandle<InDetDD::IPixelReadoutManager> PixelDetectorElementStatusToolBase::m_pixelReadout {this, "PixelReadoutManager", "PixelReadoutManager", "Pixel readout manager" }
privateinherited

Definition at line 42 of file PixelDetectorElementStatusToolBase.h.


The documentation for this class was generated from the following files:
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
InDetDD::SiDetectorElementCollection
Definition: SiDetectorElementCollection.h:30
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
PixelDetectorElementStatusToolBase::m_pixelID
const PixelID * m_pixelID
Definition: PixelDetectorElementStatusToolBase.h:39
python.Constants.ERROR
int ERROR
Definition: Control/AthenaCommon/python/Constants.py:18
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
PixelDetectorElementStatusToolBase::PixelDetectorElementStatusToolBase
PixelDetectorElementStatusToolBase(const std::string &type, const std::string &name, const IInterface *parent)
Definition: PixelDetectorElementStatusToolBase.cxx:8
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
PixelActiveDetectorElementStatusTool::m_condDCSStatusKey
SG::ReadCondHandleKey< PixelDCSStatusData > m_condDCSStatusKey
Definition: PixelActiveDetectorElementStatusTool.h:35
PixelActiveDetectorElementStatusTool::m_isActiveStatus
Gaudi::Property< std::vector< std::string > > m_isActiveStatus
Definition: PixelActiveDetectorElementStatusTool.h:37
PixelDetectorElementStatusToolBase::createDetectorElementStatus
std::unique_ptr< InDet::SiDetectorElementStatus > createDetectorElementStatus(const EventContext &ctx, SG::WriteCondHandle< InDet::SiDetectorElementStatus > *whandle) const
Create a new detector element status element container.
Definition: PixelDetectorElementStatusToolBase.cxx:34
PixelDetectorElementStatusToolBase::m_pixelDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
Definition: PixelDetectorElementStatusToolBase.h:46
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
python.Constants.WARNING
int WARNING
Definition: Control/AthenaCommon/python/Constants.py:17
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
PixelID::wafer_hash_max
size_type wafer_hash_max(void) const
Definition: PixelID.cxx:831
PixelDetectorElementStatusToolBase::m_pixelDetElStatusCondKey
SG::ReadCondHandleKey< InDet::SiDetectorElementStatus > m_pixelDetElStatusCondKey
Definition: PixelDetectorElementStatusToolBase.h:49
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
merge.status
status
Definition: merge.py:17
PixelActiveDetectorElementStatusTool::m_activeStatusMask
unsigned int m_activeStatusMask
mask in which each status is represented by a bit and for status values which are cnsidered active th...
Definition: PixelActiveDetectorElementStatusTool.h:39
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
PixelDetectorElementStatusToolBase::initialize
virtual StatusCode initialize() override
Definition: PixelDetectorElementStatusToolBase.cxx:15
SG::WriteCondHandle::addDependency
void addDependency(const EventIDRange &range)
Definition: WriteCondHandle.h:275