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

#include <PixelDetectorElementStatusToolBase.h>

Inheritance diagram for PixelDetectorElementStatusToolBase:
Collaboration diagram for PixelDetectorElementStatusToolBase:

Public Member Functions

 PixelDetectorElementStatusToolBase (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~PixelDetectorElementStatusToolBase ()
virtual StatusCode initialize () override

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.

Protected Attributes

const PixelIDm_pixelID {}

Private Attributes

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 23 of file PixelDetectorElementStatusToolBase.h.

Constructor & Destructor Documentation

◆ PixelDetectorElementStatusToolBase()

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

Definition at line 8 of file PixelDetectorElementStatusToolBase.cxx.

9 :base_class(type, name, parent)
10{
11}

◆ ~PixelDetectorElementStatusToolBase()

PixelDetectorElementStatusToolBase::~PixelDetectorElementStatusToolBase ( )
virtualdefault

Member Function Documentation

◆ createDetectorElementStatus()

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

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 {
36 if (!m_pixelDetElStatusCondKey.empty()) {
37 SG::ReadCondHandle<InDet::SiDetectorElementStatus> input_element_status{m_pixelDetElStatusCondKey, ctx};
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 {
45 SG::ReadCondHandle<InDetDD::SiDetectorElementCollection> pixelDetEleHandle(m_pixelDetEleCollKey, ctx);
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}
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
SG::ReadCondHandleKey< InDet::SiDetectorElementStatus > m_pixelDetElStatusCondKey
const_pointer_type cptr()
void addDependency(const EventIDRange &range)
MsgStream & msg
Definition testRead.cxx:32

◆ initialize()

StatusCode PixelDetectorElementStatusToolBase::initialize ( )
overridevirtual

Reimplemented in PixelActiveDetectorElementStatusTool, PixelByteStreamErrorDetectorElementStatusTool, and PixelDetectorElementStatusCloneTool.

Definition at line 15 of file PixelDetectorElementStatusToolBase.cxx.

15 {
16 ATH_CHECK(detStore()->retrieve(m_pixelID,"PixelID"));
17 ATH_CHECK(m_pixelDetEleCollKey.initialize());
19
20 return StatusCode::SUCCESS;
21}
#define ATH_CHECK
Evaluate an expression and check for errors.
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

Member Data Documentation

◆ m_pixelDetEleCollKey

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

Definition at line 41 of file PixelDetectorElementStatusToolBase.h.

42{this, "PixelDetEleCollKey", "PixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"};

◆ 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."}
private

Definition at line 44 of file PixelDetectorElementStatusToolBase.h.

45{this, "PixelDetElStatusCondDataBaseKey", "" , "Optional conditions data key of an input SiDetectorElementStatus on which the newly created object will be based."};

◆ m_pixelID

const PixelID* PixelDetectorElementStatusToolBase::m_pixelID {}
protected

Definition at line 38 of file PixelDetectorElementStatusToolBase.h.

38{};

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