ATLAS Offline Software
LockDecoration.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 "LockDecoration.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  }
30  return StatusCode::SUCCESS;
31 }
32 
33 
38 StatusCode LockDecoration::execute (const EventContext& ctx) const
39 {
40  const auto& r = SG::AuxTypeRegistry::instance();
42  SG::auxid_t auxid = r.findAuxID (SG::decorKeyFromKey (m_decoration.key()));
43  if (auxid == SG::null_auxid) {
44  ATH_MSG_ERROR( "Cannot find decoration " << m_decoration.key() );
45  return StatusCode::FAILURE;
46  }
47  SG::AuxVectorBase& avd ATLAS_THREAD_SAFE = const_cast<SG::AuxVectorBase&> (*h);
48  avd.lockDecoration (auxid);
49  return StatusCode::SUCCESS;
50 }
51 
52 
53 } // namespace DerivationFramework
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
DerivationFramework::LockDecoration::m_decoration
SG::WriteDecorHandleKey< SG::AuxVectorBase > m_decoration
The decoration to lock.
Definition: LockDecoration.h:60
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
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
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
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
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
DerivationFramework::LockDecoration::execute
virtual StatusCode execute(const EventContext &ctx) const override
Execute algorithm.
Definition: LockDecoration.cxx:38
SG::WriteDecorHandleKey::contHandleKey
const ReadHandleKey< T > & contHandleKey() const
Return the handle key for the container.
DerivationFramework::LockDecoration::initialize
virtual StatusCode initialize() override
Standard Gaudi initialize method.
Definition: LockDecoration.cxx:24
SG::WriteDecorHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
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.
LockDecoration.h
Algorithm to explicitly lock a decoration.