ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthenaBaseComps
src
AthCommonAlgorithm.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// AthenaBaseComps includes
6
#include "
AthenaBaseComps/AthCommonAlgorithm.h
"
7
#include "
AthAlgorithmDHUpdate.h
"
8
#include "GaudiKernel/ICondSvc.h"
9
#include "GaudiKernel/ServiceHandle.h"
10
11
// Gaudi includes
12
#include "Gaudi/Algorithm.h"
13
#include "Gaudi/AsynchronousAlgorithm.h"
14
15
16
template
<
class
BaseAlg>
17
AthCommonAlgorithm<BaseAlg>::AthCommonAlgorithm
(
const
std::string& name,
18
ISvcLocator* pSvcLocator ) :
19
::
AthCommonDataStore
<
AthCommonMsg
<BaseAlg>> ( name, pSvcLocator )
20
{
21
22
// Set up to run AthAlgorithmDHUpdate in sysInitialize before
23
// merging depedency lists. This extends the output dependency
24
// list with any symlinks implied by inheritance relations.
25
m_updateDataHandles =
26
std::make_unique<AthenaBaseComps::AthAlgorithmDHUpdate>
27
(
m_extendedExtraObjects
,
28
std::move (m_updateDataHandles));
29
}
30
31
39
template
<
class
BaseAlg>
40
StatusCode
AthCommonAlgorithm<BaseAlg>::sysExecute
(
const
EventContext& ctx)
41
{
42
return
BaseAlg::sysExecute (ctx);
43
}
44
45
49
* This list is extended to include symlinks implied by inheritance
50
* relations.
51
*/
52
template
<
class
BaseAlg>
53
const
DataObjIDColl&
AthCommonAlgorithm<BaseAlg>::extraOutputDeps
()
const
54
{
55
// If we didn't find any symlinks to add, just return the collection
56
// from the base class. Otherwise, return the extended collection.
57
if
(!
m_extendedExtraObjects
.empty()) {
58
return
m_extendedExtraObjects
;
59
}
60
return
BaseAlg::extraOutputDeps();
61
}
62
63
70
template
<
class
BaseAlg>
71
StatusCode
AthCommonAlgorithm<BaseAlg>::sysInitialize
() {
72
StatusCode
sc
=
AthCommonDataStore<AthCommonMsg<BaseAlg>
>
::sysInitialize
();
73
74
if
(
sc
.isFailure()) {
75
return
sc
;
76
}
77
78
ServiceHandle<ICondSvc>
cs(
"CondSvc"
,name());
79
for
(
auto
h
:
outputHandles
()) {
80
if
(
h
->isCondition() &&
h
->mode() == Gaudi::DataHandle::Writer) {
81
// do this inside the loop so we don't create the CondSvc until needed
82
if
( cs.retrieve().isFailure() ) {
83
ATH_MSG_WARNING
(
"no CondSvc found: won't autoreg WriteCondHandles"
);
84
return
StatusCode::SUCCESS;
85
}
86
if
(cs->regHandle(
this
,*
h
).isFailure()) {
87
sc
= StatusCode::FAILURE;
88
ATH_MSG_ERROR
(
"unable to register WriteCondHandle "
<<
h
->fullKey()
89
<<
" with CondSvc"
);
90
}
91
}
92
}
93
return
sc
;
94
}
95
97
template
class
AthCommonAlgorithm<Gaudi::Algorithm>
;
99
template
class
AthCommonAlgorithm<Gaudi::AsynchronousAlgorithm>
;
AthAlgorithmDHUpdate.h
Update output dependencies to include symlinks.
AthCommonAlgorithm.h
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:32
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:31
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
AthCommonAlgorithm
Common base class for algorithms.
Definition
AthCommonAlgorithm.h:38
AthCommonAlgorithm::AthCommonAlgorithm
AthCommonAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Definition
AthCommonAlgorithm.cxx:17
AthCommonAlgorithm::extraOutputDeps
virtual const DataObjIDColl & extraOutputDeps() const override
Return the list of extra output dependencies.
Definition
AthCommonAlgorithm.cxx:53
AthCommonAlgorithm::sysExecute
virtual StatusCode sysExecute(const EventContext &ctx) override
Execute an algorithm.
Definition
AthCommonAlgorithm.cxx:40
AthCommonAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Definition
AthCommonAlgorithm.h:108
AthCommonAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition
AthCommonAlgorithm.cxx:71
AthCommonDataStore< AthCommonMsg< BaseAlg > >::AthCommonDataStore
AthCommonDataStore(const std::string &name, T... args)
Definition
AthCommonDataStore.h:55
AthCommonDataStore< AthCommonMsg< BaseAlg > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
AthCommonMsg
Definition
AthCommonMsg.h:19
h
Header file for AthHistogramAlgorithm.
ServiceHandle
Definition
ClusterMakerTool.h:36
Generated on
for ATLAS Offline Software by
1.17.0