|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef STOREGATE_WRITECONDHANDLE_H
6 #define STOREGATE_WRITECONDHANDLE_H 1
15 #include "GaudiKernel/ServiceHandle.h"
16 #include "GaudiKernel/DataHandle.h"
17 #include "GaudiKernel/DataObjID.h"
18 #include "GaudiKernel/EventIDBase.h"
40 const std::string&
key()
const {
return m_hkey.key(); }
44 bool isValid(
const EventIDBase&
t)
const;
47 bool isValid(
const EventIDBase&
t, EventIDRange&
range)
const;
54 template <
typename R,
typename...
Args>
85 const EventContext& ctx = Gaudi::Hive::currentContext());
104 template <
typename T>
110 template <
typename T>
112 const EventContext& ctx) :
120 <<
"WriteCondHandle : ptr to CondCont<T> is zero"
134 template <
typename T>
142 <<
"WriteCondHandle::record(EventIDRange, T*): for key "
144 <<
" cannot use this method if range has already been set via dependencies"
146 return StatusCode::FAILURE;
152 return record( std::move(
t) );
155 template <
typename T>
159 return record (
r, std::unique_ptr<T> (
t));
162 template <
typename T>
165 return record (std::unique_ptr<T> (
t));
168 template <
typename T>
174 <<
"WriteCondHandle::record() : no range defined for key "
177 return StatusCode::FAILURE;
184 <<
"WriteCondHandle::record() : obj at: " <<
t.get() <<
" range: "
191 if (
sc.isFailure()) {
194 <<
"WriteCondHandle::record() : unable to insert obj in CondCont<T>"
196 return StatusCode::FAILURE;
203 <<
"WriteCondHandle::record() : IOV ranges overlap."
205 return StatusCode::FAILURE;
207 sc = StatusCode::SUCCESS;
226 template <
typename T>
230 return m_cc->extendLastRange (
r, ctx);
236 template <
typename T>
240 return (m_cc->valid(
t));
246 template <
typename T>
250 return (m_cc->valid(m_ctx.eventID()));
255 template <
typename T>
259 return (m_cc->range(
t,
range));
265 template <
typename T>
269 return (m_cc->range(m_ctx.eventID(),
range));
274 template <
typename T>
283 if (m_cc->keyType()==KeyType::RUNLBN && (
range.start().isTimeStamp() ||
range.stop().isTimeStamp())) {
285 msg << MSG::ERROR <<
"Adding a time-stamp dependency on a run-lumi indexed CondCont. Consider a mixed ConditionsContainer for type " << fullKey() <<
endmsg;
287 if (m_cc->keyType()==KeyType::TIMESTAMP && (
range.start().isRunLumi() ||
range.stop().isRunLumi())) {
289 msg << MSG::ERROR <<
"Adding a run-lumi dependency on a timestamp-indexed CondCont. Consider a mixed ConditionsContainer for type " << fullKey() <<
endmsg;
294 template <
typename T>
295 template<
typename R>
300 return addDependency(rch.
getRange());
303 template<
typename T>
304 template <
typename R,
typename...
Args>
307 addDependency( rch );
308 return addDependency(
args... );
314 const EventContext& ctx = Gaudi::Hive::currentContext()) {
const T & const_reference_type
const EventIDRange & getRange()
Hold mappings of ranges to condition objects.
singleton-like access to IMessageSvc via open function and helper
const EventIDRange & getRange() const
KeyType
Type of key used for this container.
void addDep(CondContBase *dep)
Declare another conditions container that depends on this one.
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
IMessageSvc * getMessageSvc(bool quiet=false)
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
const EventContext & m_ctx
const DataObjID & fullKey() const
::StatusCode StatusCode
StatusCode definition for legacy code.
Base class for all conditions containers.
const std::string & dbKey() const
const T * const_pointer_type
const std::string & key() const
WriteCondHandle(const WriteCondHandleKey< T > &key)
static bool isOverlap(code_t code)
Helper to test whether a code is OVERLAP.
Hold mapping of ranges to condition objects.
Exception — Tried to create a handle from an uninitialized key.
std::optional< double > intersect(const AmgVector(N)&posA, const AmgVector(N)&dirA, const AmgVector(N)&posB, const AmgVector(N)&dirB)
Calculates the point of closest approach of two lines.
=============================================================================
StatusCode extendLastRange(const EventIDRange &range, const EventContext &ctx=Gaudi::Hive::currentContext())
Extend the range of the last IOV.
const SG::WriteCondHandleKey< T > & m_hkey
void addDependency(const EventIDRange &range)