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

Tool to extend pixel detector element status data by the status extracted from the bytestream error container. More...

#include <PixelDetectorElementStatusCloneTool.h>

Inheritance diagram for PixelDetectorElementStatusCloneTool:
Collaboration diagram for PixelDetectorElementStatusCloneTool:

Public Member Functions

 PixelDetectorElementStatusCloneTool (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

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

Tool to extend pixel detector element status data by the status extracted from the bytestream error container.

The input to the tool can only be conditions data, the output will have an invalid IOV. Thus, can only be event data.

Definition at line 11 of file PixelDetectorElementStatusCloneTool.h.

Constructor & Destructor Documentation

◆ PixelDetectorElementStatusCloneTool()

PixelDetectorElementStatusCloneTool::PixelDetectorElementStatusCloneTool ( 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 > PixelDetectorElementStatusCloneTool::getDetectorElementStatus ( const EventContext &  ctx,
SG::WriteCondHandle< InDet::SiDetectorElementStatus > *  whandle 
) const
overridevirtual

Definition at line 9 of file PixelDetectorElementStatusCloneTool.cxx.

10  {
11  std::unique_ptr<InDet::SiDetectorElementStatus> element_status( createDetectorElementStatus(ctx, whandle));
12  std::vector<bool> &status=element_status->getElementStatus();
13  if (status.empty()) {
14  status.resize(m_pixelID->wafer_hash_max(),true );
15  }
16  std::vector<InDet::ChipFlags_t> &chip_status=element_status->getElementChipStatus();
17  if (chip_status.empty()) {
18  chip_status.resize(status.size(),0xffff);
19  }
20 
21  if (whandle) {
22  ATH_MSG_ERROR("PixelDetectorElementStatusCloneTool is not for use with conditions objects");
24  }
25 
26  return element_status;
27 }

◆ initialize()

StatusCode PixelDetectorElementStatusCloneTool::initialize ( )
overridevirtual

◆ interfaceID()

InterfaceID & PixelDetectorElementStatusCloneTool::interfaceID ( )
inlinestatic

Definition at line 26 of file PixelDetectorElementStatusCloneTool.h.

26  {
27  static InterfaceID IID_PixelDetectorElementStatusCloneTool("PixelDetectorElementStatusCloneTool", 1, 0);
28  return IID_PixelDetectorElementStatusCloneTool;
29 }

Member Data Documentation

◆ 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:
InDetDD::SiDetectorElementCollection
Definition: SiDetectorElementCollection.h:30
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
PixelDetectorElementStatusToolBase::m_pixelID
const PixelID * m_pixelID
Definition: PixelDetectorElementStatusToolBase.h:39
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
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
IDetectorElementStatusTool::getInvalidRange
static EventIDRange getInvalidRange()
Definition: IDetectorElementStatusTool.h:33
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
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
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
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