ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetRecTools
SiCombinatorialTrackFinderTool_xk
src
SiDetElementBoundaryLinksCondAlg_xk.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 "
SiDetElementBoundaryLinksCondAlg_xk.h
"
6
7
#include "
InDetReadoutGeometry/SiDetectorElement.h
"
8
#include "
SiSPSeededTrackFinderData/SiDetElementBoundaryLink_xk.h
"
9
#include "
StoreGate/ReadCondHandle.h
"
10
#include "
StoreGate/WriteCondHandle.h
"
11
12
namespace
InDet
{
13
14
SiDetElementBoundaryLinksCondAlg_xk::SiDetElementBoundaryLinksCondAlg_xk
(
const
std::string& name, ISvcLocator* pSvcLocator)
15
: ::
AthCondAlgorithm
(name, pSvcLocator)
16
{
17
}
18
19
StatusCode
SiDetElementBoundaryLinksCondAlg_xk::initialize
()
20
{
21
ATH_MSG_DEBUG
(
"initialize "
<< name());
22
23
// Read Handle
24
ATH_CHECK
(
m_readKey
.initialize());
25
26
// Write Handle
27
ATH_CHECK
(
m_writeKey
.initialize());
28
29
return
StatusCode::SUCCESS;
30
}
31
32
StatusCode
SiDetElementBoundaryLinksCondAlg_xk::execute
(
const
EventContext& ctx)
const
33
{
34
ATH_MSG_DEBUG
(
"execute "
<< name());
35
36
// ____________ Construct Write Cond Handle and check its validity ____________
37
SG::WriteCondHandle<InDet::SiDetElementBoundaryLinks_xk>
writeHandle{
m_writeKey
, ctx};
38
39
// Do we have a valid Write Cond Handle for current time?
40
if
(writeHandle.
isValid
()) {
41
ATH_MSG_DEBUG
(
"CondHandle "
<< writeHandle.
fullKey
() <<
" is already valid."
42
<<
". In theory this should not be called, but may happen"
43
<<
" if multiple concurrent events are being processed out of order."
);
44
return
StatusCode::SUCCESS;
45
}
46
47
// ____________ Get Read Cond Object ____________
48
SG::ReadCondHandle<InDetDD::SiDetectorElementCollection>
readHandle{
m_readKey
, ctx};
49
const
InDetDD::SiDetectorElementCollection
* readCdo{*readHandle};
50
if
(readCdo==
nullptr
) {
51
ATH_MSG_FATAL
(
"Null pointer to the read conditions object of "
<<
m_readKey
.key());
52
return
StatusCode::FAILURE;
53
}
54
55
// Add dependency
56
writeHandle.
addDependency
(readHandle);
57
58
// ____________ Construct new Write Cond Object ____________
59
// Copied from
60
// InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiCombinatorialTrackFinder_xk.cxx
61
std::unique_ptr<InDet::SiDetElementBoundaryLinks_xk> writeCdo{std::make_unique<InDet::SiDetElementBoundaryLinks_xk>()};
62
// ____________ Fill writeCdo using readCdo ____________
63
for
(
const
InDetDD::SiDetectorElement
* newEl: *readCdo) {
64
InDet::SiDetElementBoundaryLink_xk
dl{newEl,
m_ITkGeometry
};
65
writeCdo->push_back(dl);
66
}
67
68
// Record WriteCondHandle
69
if
(writeHandle.
record
(std::move(writeCdo)).isFailure()) {
70
ATH_MSG_FATAL
(
"Could not record "
<< writeHandle.
key
()
71
<<
" with EventRange "
<< writeHandle.
getRange
()
72
<<
" into Conditions Store"
);
73
return
StatusCode::FAILURE;
74
}
75
ATH_MSG_DEBUG
(
"recorded new CDO "
<< writeHandle.
key
() <<
" with range "
<< writeHandle.
getRange
() <<
" into ConditionStore"
);
76
77
return
StatusCode::SUCCESS;
78
}
79
80
StatusCode
SiDetElementBoundaryLinksCondAlg_xk::finalize
()
81
{
82
ATH_MSG_DEBUG
(
"finalize "
<< name());
83
84
return
StatusCode::SUCCESS;
85
}
86
87
}
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_FATAL
#define ATH_MSG_FATAL(x,...)
Definition
AthMsgStreamMacros.h:48
ReadCondHandle.h
SiDetElementBoundaryLink_xk.h
SiDetElementBoundaryLinksCondAlg_xk.h
SiDetectorElement.h
WriteCondHandle.h
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
InDetDD::SiDetectorElement
Class to hold geometrical description of a silicon detector element.
Definition
SiDetectorElement.h:109
InDet::SiDetElementBoundaryLink_xk
Definition
SiDetElementBoundaryLink_xk.h:25
InDet::SiDetElementBoundaryLinksCondAlg_xk::m_writeKey
SG::WriteCondHandleKey< InDet::SiDetElementBoundaryLinks_xk > m_writeKey
Output condition object for SiCombinatorialTrackFinder_xk.
Definition
SiDetElementBoundaryLinksCondAlg_xk.h:41
InDet::SiDetElementBoundaryLinksCondAlg_xk::initialize
virtual StatusCode initialize() override
Definition
SiDetElementBoundaryLinksCondAlg_xk.cxx:19
InDet::SiDetElementBoundaryLinksCondAlg_xk::m_readKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_readKey
Input condition object, detector elements of Pixel or SCT in condition store.
Definition
SiDetElementBoundaryLinksCondAlg_xk.h:39
InDet::SiDetElementBoundaryLinksCondAlg_xk::SiDetElementBoundaryLinksCondAlg_xk
SiDetElementBoundaryLinksCondAlg_xk(const std::string &name, ISvcLocator *pSvcLocator)
Definition
SiDetElementBoundaryLinksCondAlg_xk.cxx:14
InDet::SiDetElementBoundaryLinksCondAlg_xk::m_ITkGeometry
BooleanProperty m_ITkGeometry
Definition
SiDetElementBoundaryLinksCondAlg_xk.h:42
InDet::SiDetElementBoundaryLinksCondAlg_xk::finalize
virtual StatusCode finalize() override
Definition
SiDetElementBoundaryLinksCondAlg_xk.cxx:80
InDet::SiDetElementBoundaryLinksCondAlg_xk::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition
SiDetElementBoundaryLinksCondAlg_xk.cxx:32
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