ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetRecAlgs
SiSpacePointFormation
src
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
5
#include "
SiElementPropertiesTableCondAlg.h
"
6
7
#include "
InDetIdentifier/SCT_ID.h
"
8
#include "
InDetReadoutGeometry/SiDetectorElement.h
"
9
10
#include <memory>
11
12
namespace
InDet
{
13
14
SiElementPropertiesTableCondAlg::SiElementPropertiesTableCondAlg
(
const
std::string& name, ISvcLocator* pSvcLocator)
15
: ::
AthCondAlgorithm
(name, pSvcLocator)
16
{
17
}
18
19
StatusCode
SiElementPropertiesTableCondAlg::initialize
()
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
29
if
(
m_doEndcapEtaNeighbour
){
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 ____________
41
SG::WriteCondHandle<InDet::SiElementPropertiesTable>
writeHandle{
m_writeKey
, ctx};
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 ____________
52
SG::ReadCondHandle<InDetDD::SiDetectorElementCollection>
readHandle{
m_readKey
, ctx};
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
79
StatusCode
SiElementPropertiesTableCondAlg::finalize
()
80
{
81
return
StatusCode::SUCCESS;
82
}
83
84
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x,...)
Definition
AthMsgStreamMacros.h:43
ATH_MSG_INFO
#define ATH_MSG_INFO(x,...)
Definition
AthMsgStreamMacros.h:45
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x,...)
Definition
AthMsgStreamMacros.h:48
SCT_ID.h
This is an Identifier helper class for the SCT subdetector.
SiDetectorElement.h
SiElementPropertiesTableCondAlg.h
AthCommonAlgorithm< Gaudi::Algorithm >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
Definition
AthCommonDataStore.h:95
AthCondAlgorithm
Base class for conditions algorithms.
Definition
AthCondAlgorithm.h:22
InDetDD::SiDetectorElementCollection
Class to hold the SiDetectorElement objects to be put in the detector store.
Definition
SiDetectorElementCollection.h:27
InDet::SiElementPropertiesTableCondAlg::m_idHelper
const SCT_ID * m_idHelper
Definition
SiElementPropertiesTableCondAlg.h:70
InDet::SiElementPropertiesTableCondAlg::initialize
virtual StatusCode initialize() override final
Definition
SiElementPropertiesTableCondAlg.cxx:19
InDet::SiElementPropertiesTableCondAlg::m_writeKey
SG::WriteCondHandleKey< InDet::SiElementPropertiesTable > m_writeKey
Definition
SiElementPropertiesTableCondAlg.h:55
InDet::SiElementPropertiesTableCondAlg::m_readKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_readKey
Definition
SiElementPropertiesTableCondAlg.h:48
InDet::SiElementPropertiesTableCondAlg::SiElementPropertiesTableCondAlg
SiElementPropertiesTableCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition
SiElementPropertiesTableCondAlg.cxx:14
InDet::SiElementPropertiesTableCondAlg::m_doEndcapEtaNeighbour
BooleanProperty m_doEndcapEtaNeighbour
Definition
SiElementPropertiesTableCondAlg.h:63
InDet::SiElementPropertiesTableCondAlg::finalize
virtual StatusCode finalize() override final
Definition
SiElementPropertiesTableCondAlg.cxx:79
InDet::SiElementPropertiesTableCondAlg::m_epsWidth
FloatProperty m_epsWidth
Definition
SiElementPropertiesTableCondAlg.h:62
InDet::SiElementPropertiesTableCondAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override final
Definition
SiElementPropertiesTableCondAlg.cxx:36
SG::ReadCondHandle
Definition
ReadCondHandle.h:39
SG::WriteCondHandle
Definition
WriteCondHandle.h:26
SG::WriteCondHandle::key
const std::string & key() const
Definition
WriteCondHandle.h:44
SG::WriteCondHandle::addDependency
void addDependency(const EventIDRange &range)
Definition
WriteCondHandle.h:279
SG::WriteCondHandle::getRange
const EventIDRange & getRange() const
Definition
WriteCondHandle.h:93
SG::WriteCondHandle::record
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
Definition
WriteCondHandle.h:161
SG::WriteCondHandle::isValid
bool isValid() const
Definition
WriteCondHandle.h:252
SG::WriteCondHandle::fullKey
const DataObjID & fullKey() const
Definition
WriteCondHandle.h:45
InDet
Primary Vertex Finder.
Definition
VP1ErrorUtils.h:36
Generated on
for ATLAS Offline Software by
1.17.0