ATLAS Offline Software
PixelDetectorElementStatusToolBase.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
8 PixelDetectorElementStatusToolBase::PixelDetectorElementStatusToolBase(const std::string& type, const std::string& name, const IInterface* parent)
9  :base_class(type, name, parent)
10 {
11 }
12 
14 
16  ATH_CHECK(detStore()->retrieve(m_pixelID,"PixelID"));
19 
20  return StatusCode::SUCCESS;
21 }
22 
23 namespace {
26  if (!ret) {
27  throw std::runtime_error("Object is not of expected type InDet::PixelDetectorElementStatus");
28  }
29  return ret;
30  }
31 }
32 
33 std::unique_ptr<InDet::SiDetectorElementStatus>
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 }
58 
59 
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
InDetDD::SiDetectorElementCollection
Definition: SiDetectorElementCollection.h:30
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
PixelDetectorElementStatusToolBase::m_pixelID
const PixelID * m_pixelID
Definition: PixelDetectorElementStatusToolBase.h:39
SG::ReadCondHandle::isValid
bool isValid()
Definition: ReadCondHandle.h:206
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
PixelDetectorElementStatus.h
InDet::PixelDetectorElementStatus
Event data to hold the status information for Pixel modules.
Definition: PixelDetectorElementStatus.h:14
InDet::SiDetectorElementStatus
Definition: SiDetectorElementStatus.h:62
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
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.PyKernel.detStore
detStore
Definition: PyKernel.py:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
PixelDetectorElementStatusToolBase::m_pixelDetElStatusCondKey
SG::ReadCondHandleKey< InDet::SiDetectorElementStatus > m_pixelDetElStatusCondKey
Definition: PixelDetectorElementStatusToolBase.h:49
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
PixelDetectorElementStatusToolBase::~PixelDetectorElementStatusToolBase
virtual ~PixelDetectorElementStatusToolBase()
PixelDetectorElementStatusToolBase.h
SG::WriteCondHandle
Definition: WriteCondHandle.h:26
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