ATLAS Offline Software
LockDecorations.cxx
Go to the documentation of this file.
1 // This file's extension implies that it's C, but it's really -*- C++ -*-.
10 #include "LockDecorations.h"
15 #include "GaudiKernel/ConcurrencyFlags.h"
16 
17 
18 namespace DerivationFramework {
19 
20 
25 {
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();
42  SG::ReadHandle<SG::AuxVectorBase> h (k.contHandleKey(), ctx);
43  SG::auxid_t auxid = r.findAuxID (SG::decorKeyFromKey (k.key()));
44  if (auxid == SG::null_auxid) {
45  ATH_MSG_ERROR( "Cannot find decoration " << k.key() );
46  return StatusCode::FAILURE;
47  }
48  SG::AuxVectorBase& avd ATLAS_THREAD_SAFE = const_cast<SG::AuxVectorBase&> (*h);
49  avd.lockDecoration (auxid);
50  }
51  return StatusCode::SUCCESS;
52 }
53 
54 
55 } // namespace DerivationFramework
SG::WriteDecorHandleKey
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Definition: StoreGate/StoreGate/WriteDecorHandleKey.h:89
beamspotman.r
def r
Definition: beamspotman.py:676
SG::AuxTypeRegistry::instance
static AuxTypeRegistry & instance()
Return the singleton registry instance.
Definition: AuxTypeRegistry.cxx:640
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
SG::decorKeyFromKey
std::string decorKeyFromKey(const std::string &key)
Extract the decoration part of key.
Definition: DecorKeyHelpers.cxx:41
SG::AuxVectorData::lockDecoration
void lockDecoration(SG::auxid_t auxid)
Explicitly lock a decoration.
Definition: AuxVectorData.cxx:687
DecorKeyHelpers.h
Some common helper functions used by decoration handles.
AuxVectorBase.h
Manage index tracking and synchronization of auxiliary data.
SG::AuxVectorBase
Manage index tracking and synchronization of auxiliary data.
Definition: AuxVectorBase.h:98
LockDecorations.h
Algorithm to explicitly lock a set of decorations.
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition: AuxTypes.h:27
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
extractSporadic.h
list h
Definition: extractSporadic.py:97
DerivationFramework::LockDecorations::initialize
virtual StatusCode initialize() override
Standard Gaudi initialize method.
Definition: LockDecorations.cxx:24
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h: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
python.BackTrackingConfig.numThreads
int numThreads
Definition: BackTrackingConfig.py:61
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
AuxTypeRegistry.h
Handle mappings between names and auxid_t.
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition: checker_macros.h:211
checker_macros.h
Define macros for attributes used to control the static checker.
fitman.k
k
Definition: fitman.py:528