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(); }
71 bool isValid(
const EventIDBase& t)
const ;
74 bool range(
const EventIDBase& t, EventIDRange&
r)
const;
103 template <
typename T>
105 const EventContext& ctx):
106 m_eid( ctx.eventID() ),
111 EventIDBase::number_type conditionsRun =
113 if (conditionsRun != EventIDBase::UNDEFNUM) {
114 m_eid.set_run_number (conditionsRun);
117 catch (
const std::bad_any_cast& e) {
122 throw SG::ExcUninitKey (key.clid(), key.key(), key.storeHandle().name(),
143 template <
typename T>
147 if (
m_obj != 0)
return true;
160 template <
typename T>
183 template <
typename T>
192 if (! (
m_cc->find(eid, cobj) ) ) {
204 template <
typename T>
213 template <
typename T>
217 return (
m_cc->valid(t));
222 template <
typename T>
240 template <
typename T>
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;
306 StatusCode
get (
const T*& ptr,
308 const EventContext& ctx)
311 return (ptr || key.empty()) ? StatusCode::SUCCESS : StatusCode::FAILURE;
Hold mappings of ranges to condition objects.
Exceptions that can be thrown from StoreGate.
Handle class for reading from StoreGate.
Header file for AthHistogramAlgorithm.
EventIDBase::number_type conditionsRun() const
Base class for all conditions containers.
Hold mapping of ranges to condition objects.
Exception — Bad EventContext extension while building ReadCondHandle.
Exception — ReadCondHandle didn't initialize in getRange().
Exception — Can't retrieve CondCont from ReadCondHandle.
Exception — Range not set in ReadCondHandle::getRange().
const_pointer_type operator->()
const_pointer_type operator*()
ReadCondHandle(const SG::ReadCondHandleKey< T > &key)
const_pointer_type retrieve()
bool range(EventIDRange &r)
const EventIDRange * m_range
const SG::ReadCondHandleKey< T > & m_hkey
const std::string & key() const
ReadCondHandle(SG::ReadCondHandleKey< T > &&key)=delete
const DataObjID & fullKey() const
const T & const_reference_type
const T * const_pointer_type
ReadCondHandle(SG::ReadCondHandleKey< T > &&key, const EventContext &ctx)=delete
const EventIDRange & getRange()
const_pointer_type cptr()
The Athena Transient Store API.
StatusCode retrieve(const T *&ptr) const
Retrieve the default object into a const T*.
const ExtendedEventContext & getExtendedEventContext(const EventContext &ctx)
Retrieve an extended context from a context object.
=============================================================================
void ReadCondHandleNotFound(const CondContBase &cc, const EventIDBase &eid, const std::string &key)
Report a conditions container lookup failure.
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())