 |
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef STOREGATE_READCONDHANDLE_H
6 #define STOREGATE_READCONDHANDLE_H 1
16 #include "GaudiKernel/DataObjID.h"
17 #include "GaudiKernel/EventIDBase.h"
18 #include "GaudiKernel/EventContext.h"
19 #include "GaudiKernel/ThreadLocalContext.h"
36 const EventIDBase& eid,
37 const std::string&
key);
51 const EventContext& ctx);
55 const EventContext& ctx) =
delete;
59 const std::string&
key()
const {
return m_hkey.key(); }
74 bool range(
const EventIDBase&
t, EventIDRange&
r)
const;
103 template <
typename T>
105 const EventContext& ctx):
106 m_eid( ctx.eventID() ),
113 if (conditionsRun != EventIDBase::UNDEFNUM) {
114 m_eid.set_run_number (conditionsRun);
117 catch (
const std::bad_any_cast&
e) {
143 template <
typename T>
147 if (m_obj != 0)
return true;
160 template <
typename T>
165 if (!initCondHandle()) {
183 template <
typename T>
192 if (! (m_cc->find(eid, cobj) ) ) {
204 template <
typename T>
208 return initCondHandle();
213 template <
typename T>
217 return (m_cc->valid(
t));
222 template <
typename T>
227 if (!initCondHandle()) {
240 template <
typename T>
245 if (!initCondHandle()) {
260 template <
typename T>
264 return ( m_cc->range(eid,
r) );
271 const EventContext& ctx = Gaudi::Hive::currentContext()) {
284 const EventContext& ctx)
286 if (
key.key().empty())
return nullptr;
308 const EventContext& ctx)
311 return (
ptr ||
key.empty()) ? StatusCode::SUCCESS : StatusCode::FAILURE;
def retrieve(aClass, aKey=None)
const EventIDRange * m_range
bool range(const EventIDBase &t, EventIDRange &r) const
Exception — Bad EventContext extension while building ReadCondHandle.
const_pointer_type operator->()
const EventIDRange & getRange()
const DataObjID & fullKey() const
Hold mappings of ranges to condition objects.
EventIDBase::number_type conditionsRun() const
bool range(EventIDRange &r)
Exception — ReadCondHandle didn't initialize in getRange().
void ReadCondHandleNotFound(const CondContBase &cc, const EventIDBase &eid, const std::string &key)
Report a conditions container lookup failure.
Exception — Range not set in ReadCondHandle::getRange().
Exception — Can't retrieve CondCont from ReadCondHandle.
StatusCode retrieve(const T *&ptr) const
Retrieve the default object into a const T*.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
const ExtendedEventContext & getExtendedEventContext(const EventContext &ctx)
Retrieve an extended context from a context object.
const SG::ReadCondHandleKey< T > & m_hkey
ReadCondHandle(SG::ReadCondHandleKey< T > &&key)=delete
The Athena Transient Store API.
const_pointer_type retrieve()
Exceptions that can be thrown from StoreGate.
ReadCondHandle(const SG::ReadCondHandleKey< T > &key)
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
ReadCondHandle(SG::ReadCondHandleKey< T > &&key, const EventContext &ctx)=delete
::StatusCode StatusCode
StatusCode definition for legacy code.
Base class for all conditions containers.
const_pointer_type operator*()
bool isValid(const EventIDBase &t) const
ReadCondHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx)
Hold mapping of ranges to condition objects.
Exception — Tried to create a handle from an uninitialized key.
const T & const_reference_type
const T * const_pointer_type
=============================================================================
Handle class for reading from StoreGate.
const std::string & key() const
const_pointer_type retrieve(const EventIDBase &t)
const_pointer_type cptr()