Loading [MathJax]/extensions/tex2jax.js
 |
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 EventContext& ctx) =
delete;
44 const std::string&
key()
const {
return m_hkey.key(); }
48 bool isValid(
const EventIDBase&
t)
const;
51 bool isValid(
const EventIDBase&
t, EventIDRange&
range)
const;
58 template <
typename R,
typename...
Args>
89 const EventContext& ctx = Gaudi::Hive::currentContext());
108 template <
typename T>
114 template <
typename T>
116 const EventContext& ctx) :
124 <<
"WriteCondHandle : ptr to CondCont<T> is zero"
138 template <
typename T>
146 <<
"WriteCondHandle::record(EventIDRange, T*): for key "
148 <<
" cannot use this method if range has already been set via dependencies"
150 return StatusCode::FAILURE;
156 return record( std::move(
t) );
159 template <
typename T>
163 return record (
r, std::unique_ptr<T> (
t));
166 template <
typename T>
169 return record (std::unique_ptr<T> (
t));
172 template <
typename T>
178 <<
"WriteCondHandle::record() : no range defined for key "
181 return StatusCode::FAILURE;
188 <<
"WriteCondHandle::record() : obj at: " <<
t.get() <<
" range: "
195 if (
sc.isFailure()) {
198 <<
"WriteCondHandle::record() : unable to insert obj in CondCont<T>"
200 return StatusCode::FAILURE;
207 <<
"WriteCondHandle::record() : IOV ranges overlap."
209 return StatusCode::FAILURE;
211 sc = StatusCode::SUCCESS;
230 template <
typename T>
234 return m_cc->extendLastRange (
r, ctx);
240 template <
typename T>
244 return (m_cc->valid(
t));
250 template <
typename T>
254 return (m_cc->valid(m_ctx.eventID()));
259 template <
typename T>
263 return (m_cc->range(
t,
range));
269 template <
typename T>
273 return (m_cc->range(m_ctx.eventID(),
range));
278 template <
typename T>
287 if (m_cc->keyType()==KeyType::RUNLBN && (
range.start().isTimeStamp() ||
range.stop().isTimeStamp())) {
289 msg << MSG::ERROR <<
"Adding a time-stamp dependency on a run-lumi indexed CondCont. Consider a mixed ConditionsContainer for type " << fullKey() <<
endmsg;
291 if (m_cc->keyType()==KeyType::TIMESTAMP && (
range.start().isRunLumi() ||
range.stop().isRunLumi())) {
293 msg << MSG::ERROR <<
"Adding a run-lumi dependency on a timestamp-indexed CondCont. Consider a mixed ConditionsContainer for type " << fullKey() <<
endmsg;
298 template <
typename T>
299 template<
typename R>
304 return addDependency(rch.
getRange());
307 template<
typename T>
308 template <
typename R,
typename...
Args>
311 addDependency( rch );
312 return addDependency(
args... );
318 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
WriteCondHandle(SG::WriteCondHandleKey< T > &&key, const EventContext &ctx)=delete
::StatusCode StatusCode
StatusCode definition for legacy code.
Base class for all conditions containers.
const std::string & dbKey() const
const T * const_pointer_type
WriteCondHandle(SG::WriteCondHandleKey< T > &&key)=delete
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 B' along the line B that's closest to a second line A.
=============================================================================
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)