ATLAS Offline Software
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 
7 SiPropertiesTool::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 
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  }
25 
26  return StatusCode::SUCCESS;
27 }
28 
31 {
32  return StatusCode::SUCCESS;
33 }
34 
36 SiPropertiesTool::getSiProperties(const IdentifierHash& elementHash, const EventContext& ctx) const {
38  if (handle.isValid()) {
39  const InDet::SiliconPropertiesVector* vector{*handle};
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);
48  return s_defaultProperties;
49 }
50 
SiPropertiesTool::initialize
virtual StatusCode initialize() override
Definition: SiPropertiesTool.cxx:16
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SiPropertiesTool::m_propertiesVector
SG::ReadCondHandleKey< InDet::SiliconPropertiesVector > m_propertiesVector
Definition: SiPropertiesTool.h:38
SiPropertiesTool::s_defaultProperties
static const InDet::SiliconProperties s_defaultProperties
Definition: SiPropertiesTool.h:40
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
vector
Definition: MultiHisto.h:13
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SiPropertiesTool::SiPropertiesTool
SiPropertiesTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: SiPropertiesTool.cxx:7
SiPropertiesTool::getSiProperties
virtual const InDet::SiliconProperties & getSiProperties(const IdentifierHash &elementHash, const EventContext &ctx) const override
Get properties for the detector element.
Definition: SiPropertiesTool.cxx:36
SiPropertiesTool::finalize
virtual StatusCode finalize() override
Definition: SiPropertiesTool.cxx:30
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
SiPropertiesTool.h
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
InDet::SiliconProperties
Definition: SiliconProperties.h:24
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
InDet::SiliconPropertiesVector
Definition: SiliconPropertiesVector.h:20
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
SiPropertiesTool::m_detectorName
std::string m_detectorName
Definition: SiPropertiesTool.h:37