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(),
129 if (
m_hkey.getCS()->retrieve(cb,
m_hkey.key()).isFailure()) {
142 template <
typename T>
146 if (
m_obj != 0)
return true;
159 template <
typename T>
182 template <
typename T>
191 if (! (
m_cc->find(eid, cobj) ) ) {
203 template <
typename T>
212 template <
typename T>
216 return (
m_cc->valid(t));
221 template <
typename T>
239 template <
typename T>
259 template <
typename T>
263 return (
m_cc->range(eid,
r) );
270 const EventContext& ctx = Gaudi::Hive::currentContext()) {
283 const EventContext& ctx)
285 if (key.key().empty())
return nullptr;
305 StatusCode
get (
const T*& ptr,
307 const EventContext& ctx)
310 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()
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())