ATLAS Offline Software
Loading...
Searching...
No Matches
SiPropertiesTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "SiPropertiesTool.h"
6
7SiPropertiesTool::SiPropertiesTool(const std::string& type, const std::string& name, const IInterface* parent) :
8 base_class(type, name, parent),
9 m_propertiesVector{"SCTSiliconPropertiesVector"}
10{
11 declareProperty("DetectorName", m_detectorName="SCT", "Dectector name: Pixel, SCT or PLR");
12 declareProperty("ReadKey", m_propertiesVector, "Key of SiliconPropertiesVector");
13}
14
15StatusCode
17{
18 ATH_MSG_INFO("SiPropertiesTool Initialized");
19
20 if ((m_detectorName != "Pixel") and (m_detectorName != "SCT") and (m_detectorName != "PLR")) {
21 ATH_MSG_FATAL("Invalid detector name: " << m_detectorName << ". Must be Pixel, SCT or PLR.");
22 return StatusCode::FAILURE;
23 }
24 ATH_CHECK(m_propertiesVector.initialize());
25
26 return StatusCode::SUCCESS;
27}
28
29StatusCode
31{
32 return StatusCode::SUCCESS;
33}
34
36SiPropertiesTool::getSiProperties(const IdentifierHash& elementHash, const EventContext& ctx) const {
38 if (handle.isValid()) {
40 if (vector) {
41 return vector->getSiProperties(elementHash);
42 }
43 }
44
45 ATH_MSG_WARNING("SG::ReadCondHandle<InDet::SiliconPropertiesVector> is not valid. " <<
46 "Return default InDet::SiliconProperties for IdentifierHash for " <<
47 elementHash);
49}
50
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_WARNING(x)
This is a "hash" representation of an Identifier.
SiPropertiesTool(const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode initialize() override
static const InDet::SiliconProperties s_defaultProperties
virtual const InDet::SiliconProperties & getSiProperties(const IdentifierHash &elementHash, const EventContext &ctx) const override
Get properties for the detector element.
virtual StatusCode finalize() override
SG::ReadCondHandleKey< InDet::SiliconPropertiesVector > m_propertiesVector
std::string m_detectorName