ATLAS Offline Software
Loading...
Searching...
No Matches
SiElementPropertiesTableCondAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
6
9
10#include <memory>
11
12namespace InDet {
13
14 SiElementPropertiesTableCondAlg::SiElementPropertiesTableCondAlg(const std::string& name, ISvcLocator* pSvcLocator)
15 : ::AthCondAlgorithm(name, pSvcLocator)
16{
17}
18
20 {
21 // Read Handle
22 ATH_CHECK(m_readKey.initialize());
23
24 // Write Handle
25 ATH_CHECK(m_writeKey.initialize());
26
27 ATH_CHECK(detStore()->retrieve(m_idHelper, "SCT_ID"));
28
30 ATH_MSG_INFO("Processing eta neighbour module also for strip endcaps");
31 }
32
33 return StatusCode::SUCCESS;
34 }
35
36 StatusCode SiElementPropertiesTableCondAlg::execute(const EventContext& ctx) const
37 {
38 ATH_MSG_DEBUG("execute " << name());
39
40 // ____________ Construct Write Cond Handle and check its validity ____________
42
43 // Do we have a valid Write Cond Handle for current time?
44 if (writeHandle.isValid()) {
45 ATH_MSG_DEBUG("CondHandle " << writeHandle.fullKey() << " is already valid."
46 << ". In theory this should not be called, but may happen"
47 << " if multiple concurrent events are being processed out of order.");
48 return StatusCode::SUCCESS;
49 }
50
51 // ____________ Get Read Cond Object ____________
53 const InDetDD::SiDetectorElementCollection* readCdo{*readHandle};
54 if (readCdo==nullptr) {
55 ATH_MSG_FATAL("Null pointer to the read conditions object of " << m_readKey.key());
56 return StatusCode::FAILURE;
57 }
58
59 // Add dependency
60 writeHandle.addDependency(readHandle);
61
62 // ____________ Construct new Write Cond Object ____________
63 std::unique_ptr<InDet::SiElementPropertiesTable> writeCdo{std::make_unique<InDet::SiElementPropertiesTable>(*m_idHelper, *readCdo, m_epsWidth, m_doEndcapEtaNeighbour)};
64
65 // ____________ Fill writeCdo using readCdo ____________
66
67 // Record WriteCondHandle
68 if (writeHandle.record(std::move(writeCdo)).isFailure()) {
69 ATH_MSG_FATAL("Could not record " << writeHandle.key()
70 << " with EventRange " << writeHandle.getRange()
71 << " into Conditions Store");
72 return StatusCode::FAILURE;
73 }
74 ATH_MSG_DEBUG("recorded new CDO " << writeHandle.key() << " with range " << writeHandle.getRange() << " into ConditionStore");
75
76 return StatusCode::SUCCESS;
77 }
78
80 {
81 return StatusCode::SUCCESS;
82 }
83
84}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
This is an Identifier helper class for the SCT subdetector.
const ServiceHandle< StoreGateSvc > & detStore() const
Base class for conditions algorithms.
Class to hold the SiDetectorElement objects to be put in the detector store.
SG::WriteCondHandleKey< InDet::SiElementPropertiesTable > m_writeKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_readKey
SiElementPropertiesTableCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode execute(const EventContext &ctx) const override final
const std::string & key() const
void addDependency(const EventIDRange &range)
const EventIDRange & getRange() const
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
const DataObjID & fullKey() const
Primary Vertex Finder.