ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
DerivationFramework
DerivationFrameworkCore
src
LockDecorations.cxx
Go to the documentation of this file.
1
// This file's extension implies that it's C, but it's really -*- C++ -*-.
8
9
10
#include "
LockDecorations.h
"
11
#include "
StoreGate/DecorKeyHelpers.h
"
12
#include "
AthContainers/AuxTypeRegistry.h
"
13
#include "
AthContainers/AuxVectorBase.h
"
14
#include "
CxxUtils/checker_macros.h
"
15
#include "GaudiKernel/ConcurrencyFlags.h"
16
17
18
namespace
DerivationFramework
{
19
20
24
StatusCode
LockDecorations::initialize
()
25
{
26
if
(Gaudi::Concurrency::ConcurrencyFlags::numThreads() > 1) {
27
ATH_MSG_WARNING
(
"LockDecoration used in MT job. This configuration is likely not thread-safe."
);
28
}
29
ATH_CHECK
(
m_decorations
.initialize() );
30
return
StatusCode::SUCCESS;
31
}
32
33
38
StatusCode
LockDecorations::execute
(
const
EventContext& ctx)
const
39
{
40
const
auto
&
r
=
SG::AuxTypeRegistry::instance
();
41
for
(
const
SG::WriteDecorHandleKey<SG::AuxVectorBase>
& k :
m_decorations
) {
42
SG::ReadHandle<SG::AuxVectorBase>
h
(k.contHandleKey(), ctx);
43
if
(
h
->size_v() > 0) {
44
SG::auxid_t
auxid =
r
.findAuxID (
SG::decorKeyFromKey
(k.key()));
45
if
(auxid ==
SG::null_auxid
) {
46
ATH_MSG_ERROR
(
"Cannot find decoration "
<< k.key() );
47
return
StatusCode::FAILURE;
48
}
49
SG::AuxVectorBase
& avd
ATLAS_THREAD_SAFE
=
const_cast<
SG::AuxVectorBase
&
>
(*h);
50
avd.
lockDecoration
(auxid);
51
}
52
}
53
return
StatusCode::SUCCESS;
54
}
55
56
57
}
// namespace DerivationFramework
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
AuxTypeRegistry.h
Handle mappings between names and auxid_t.
AuxVectorBase.h
Manage index tracking and synchronization of auxiliary data.
LockDecorations.h
Algorithm to explicitly lock a set of decorations.
DecorKeyHelpers.h
Some common helper functions used by decoration handles.
checker_macros.h
Define macros for attributes used to control the static checker.
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition
checker_macros.h:211
h
Header file for AthHistogramAlgorithm.
DerivationFramework::LockDecorations::initialize
virtual StatusCode initialize() override
Standard Gaudi initialize method.
Definition
LockDecorations.cxx:24
DerivationFramework::LockDecorations::m_decorations
SG::WriteDecorHandleKeyArray< SG::AuxVectorBase > m_decorations
The decoration to lock.
Definition
LockDecorations.h:60
DerivationFramework::LockDecorations::execute
virtual StatusCode execute(const EventContext &ctx) const override
Execute algorithm.
Definition
LockDecorations.cxx:38
SG::AuxTypeRegistry::instance
static AuxTypeRegistry & instance()
Return the singleton registry instance.
Definition
AuxTypeRegistry.cxx:640
SG::AuxVectorBase
Manage index tracking and synchronization of auxiliary data.
Definition
AuxVectorBase.h:98
SG::AuxVectorData::lockDecoration
void lockDecoration(SG::auxid_t auxid)
Explicitly lock a decoration.
Definition
AuxVectorData.cxx:704
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::WriteDecorHandleKey
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Definition
StoreGate/StoreGate/WriteDecorHandleKey.h:90
r
int r
Definition
globals.cxx:22
DerivationFramework
THE reconstruction tool.
Definition
CascadeTools.h:16
SG::null_auxid
static const auxid_t null_auxid
To signal no aux data item.
Definition
AuxTypes.h:30
SG::decorKeyFromKey
std::string decorKeyFromKey(const std::string &key, const std::string &deflt)
Extract the decoration part of key.
Definition
DecorKeyHelpers.cxx:42
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition
AuxTypes.h:27
Generated on
for ATLAS Offline Software by
1.17.0