ATLAS Offline Software
Loading...
Searching...
No Matches
IOVSvc.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5/*****************************************************************************
6 *
7 * IOVSvc.cxx
8 * IOVSvc
9 *
10 * Author: Charles Leggett
11 *
12 * Provides automatic updating and callbacks for time dependent data
13 *
14 *****************************************************************************/
15
16#include "IOVSvc.h"
17
18#include "GaudiKernel/ISvcLocator.h"
19#include "GaudiKernel/IAlgTool.h"
20#include "GaudiKernel/IToolSvc.h"
21#include "GaudiKernel/IClassIDSvc.h"
22#include "GaudiKernel/IConversionSvc.h"
23
28#include "IOVSvc/IIOVSvcTool.h"
29#include "SGTools/DataProxy.h"
30
31#include <ranges>
32
33
34namespace {
35
36const std::string defaultStore = "StoreGateSvc";
37
43bool eventIDMatch (const EventIDBase& e1, const EventIDBase& e2)
44{
45 if (e1.isRunLumi()) {
46 if (e1.run_number() != e2.run_number()) return false;
47 if (e1.lumi_block() != e2.lumi_block()) return false;
48 }
49 if (e1.isTimeStamp()) {
50 if (e1.time_stamp() != e2.time_stamp()) return false;
51 if (e1.time_stamp_ns_offset() != e2.time_stamp_ns_offset()) return false;
52 }
53 return true;
54}
55
56
57} // anonymous namespace
58
59
60
61//
63//
64
65IOVSvc::IOVSvc( const std::string& name, ISvcLocator* svc )
66 : base_class( name, svc ),
67 p_toolSvc("ToolSvc",name),
68 p_CLIDSvc("ClassIDSvc",name),
69 p_sgs("StoreGateSvc",name),
70 p_detStore("StoreGateSvc/DetectorStore",name),
71 p_condSvc("CondSvc",name)
72{
73}
74
75/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
76
77StatusCode IOVSvc::initialize() {
78
79 msg().setLevel( m_outputLevel.value() );
80 ATH_MSG_DEBUG( "Initializing IOVSvc" );
81
82 ATH_CHECK( p_sgs.retrieve() );
83 ATH_CHECK( p_detStore.retrieve() );
84 ATH_CHECK( p_condSvc.retrieve() );
85
86 return StatusCode::SUCCESS;
87}
88
89/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
90
94StatusCode
95IOVSvc::regProxy( SG::DataProxy *proxy, const std::string& key,
96 const std::string& storeName ) {
97
98 std::scoped_lock lock(m_lock);
99 IIOVSvcTool *ist = getTool( storeName );
100 if (ist == nullptr) {
101 ATH_MSG_ERROR( "regProxy: no IOVSvcTool associated with store \""
102 << storeName << "\" and failed to create one" );
103 return (StatusCode::FAILURE);
104 }
105
106 IIOVSvcTool *ist2 = getTool( proxy );
107 if (ist2 != nullptr) {
108 if (ist2 != ist) {
109 ATH_MSG_ERROR( "regProxy: when registering proxy for "
110 << fullProxyName(proxy) << " with store \"" << storeName
111 << "\", it is already registered with store \""
112 << ist2->getStoreName() << "\"" );
113 return StatusCode::FAILURE;
114 } else {
115 ATH_MSG_DEBUG( "regProxy: proxy for " << fullProxyName(proxy)
116 << " already registered with store \"" << storeName << "\""
117 );
118 return StatusCode::SUCCESS;
119 }
120 }
121
122 return ist->regProxy( proxy, key );
123
124}
125
126/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
127
131StatusCode
132IOVSvc::regProxy( const CLID& clid, const std::string& key,
133 const std::string& storeName ) {
134
135 std::scoped_lock lock(m_lock);
136 IIOVSvcTool *ist = getTool( storeName );
137 if (ist == nullptr) {
138 ATH_MSG_ERROR( "regProxy: no IOVSvcTool associated with store \""
139 << storeName << "\" and failed to create one." );
140 return (StatusCode::FAILURE);
141 }
142
143 IIOVSvcTool *ist2 = getTool( clid, key );
144 if (ist2 != nullptr) {
145 if (ist2 != ist) {
146 ATH_MSG_ERROR( "regProxy: when registering proxy for "
147 << fullProxyName(clid,key)
148 << " with store " << storeName
149 << ", it is already registered with store \""
150 << ist2->getStoreName() << "\"" );
151 return StatusCode::FAILURE;
152 } else {
153 ATH_MSG_DEBUG( "regProxy: proxy for " << fullProxyName(clid,key)
154 << " already registered with store \"" << storeName << "\""
155 );
156 return StatusCode::SUCCESS;
157 }
158 }
159
160 return ist->regProxy( clid, key );
161
162}
163
164/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
165
169StatusCode
171
172 std::scoped_lock lock(m_lock);
173 IIOVSvcTool *ist = getTool( proxy );
174 if (ist == nullptr) {
175 ATH_MSG_ERROR( "deregProxy: no IOVSvcTool found for proxy "
176 << fullProxyName( proxy ) );
177 return StatusCode::FAILURE;
178 }
179
180 return ist->deregProxy( proxy );
181
182}
183
184/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
185
189StatusCode
190IOVSvc::deregProxy( const CLID& clid, const std::string& key ) {
191
192 std::scoped_lock lock(m_lock);
193 IIOVSvcTool *ist = getTool( clid, key );
194 if (ist == nullptr) {
195 ATH_MSG_ERROR( "deregProxy: no IOVSvcTool found for proxy "
196 << fullProxyName(clid,key) );
197 return StatusCode::FAILURE;
198 }
199
200 return ist->deregProxy( clid, key );
201
202}
203
204/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
205
209void
210IOVSvc::ignoreProxy( const CLID& clid, const std::string& key,
211 const std::string& storeName ) {
212
213 IIOVSvcTool *ist = getTool( storeName );
214 if (ist == nullptr) {
215 ATH_MSG_ERROR( "ignoreProxy: no IOVSvcTool found for store "
216 << storeName << " and failed to create one" );
217 return;
218 }
219
220 return ist->ignoreProxy( clid, key );
221}
222
223
224/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
225
229StatusCode
231 const std::string& storeName ) {
232
233 StatusCode sc(StatusCode::FAILURE);
234 IIOVSvcTool *ist = getTool( storeName );
235 if (ist != nullptr) {
236 sc = ist->replaceProxy(pOld, pNew);
237 } else {
238 ATH_MSG_ERROR( "regProxy: no IOVSvcTool associated with store \""
239 << storeName << "\" and failed to create one." );
240 }
241 return sc;
242}
243
244
245/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
246
250
251StatusCode
253 const std::string& storeName ) {
254
255
256 IIOVSvcTool *ist = getTool( storeName );
257 if (ist == nullptr) {
258 ATH_MSG_ERROR( "preLoadTAD: no IOVSvcTool associated with store \""
259 << storeName << "\" and failed to create one." );
260 return StatusCode::FAILURE;
261 } else {
262 return ist->preLoadTAD( tad );
263 }
264
265}
266
267/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
268
272StatusCode
274 const std::string& storeName ) {
275
276 IIOVSvcTool *ist = getTool( storeName );
277 if (ist == nullptr) {
278 ATH_MSG_ERROR( "preLoadDataTAD: no IOVSvcTool associated with store \""
279 << storeName << "\" and failed to create one." );
280 return StatusCode::FAILURE;
281 } else {
282 return ist->preLoadDataTAD( tad );
283 }
284
285}
286
287/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
288
289StatusCode
290IOVSvc::setRange(const CLID& clid, const std::string& key,
291 IOVRange& iovr, const std::string& storeName) {
292
293 std::scoped_lock lock(m_lock);
294
295 IIOVSvcTool *ist = getTool( storeName );
296 if (ist == nullptr) {
297 ATH_MSG_ERROR( "setRange: no IOVSvcTool associated with store \""
298 << storeName << "\" and failed to create one." );
299 return StatusCode::FAILURE;
300 }
301
302 IIOVSvcTool *ist2 = getTool( clid, key );
303 if (ist2 == nullptr) {
304 ATH_MSG_INFO( "setRange: proxy for " << fullProxyName(clid,key)
305 << " not registered with store \"" << storeName << "\". Doing it now"
306 );
307 if (ist->regProxy(clid, key).isFailure()) {
308 return StatusCode::FAILURE;
309 }
310 } else if (ist2 != ist) {
311 ATH_MSG_INFO( "setRange: when registering proxy (clid: "
312 << clid << " key: " << key << ") with store \"" << storeName
313 << "\" --> already registered with store \"" << ist2->getStoreName()
314 << "\"" );
315 return StatusCode::FAILURE;
316 }
317
318 return ist->setRange( clid, key, iovr );
319
320}
321
322/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
323
324StatusCode
325IOVSvc::dropObjectFromDB(const CLID& clid, const std::string& key,
326 const std::string& storeName) {
327
328 std::scoped_lock lock(m_lock);
329
330 IIOVSvcTool *ist = getTool( clid, key );
331 if (ist == nullptr) {
332 ATH_MSG_ERROR( "dropObjectFromDB: no IOVSvcTool associated with store "
333 << storeName << " and failed to create one." );
334 return StatusCode::FAILURE;
335 }
336
337 SG::DataProxy* proxy = p_detStore->proxy(clid, key);
338 if (proxy == nullptr) {
339 ATH_MSG_DEBUG("Proxy for (clid: " << clid << " key: " << key << ") in store " << storeName
340 << " does not exist. Cannot drop associated object.");
341 return StatusCode::SUCCESS;
342 }
343
344 // Set IOV in the past to trigger reload on next range check
345 IOVRange iovr(IOVTime(0, 0), IOVTime(0, 0));
346 ATH_CHECK( ist->setRange(clid, key, iovr) );
347
348 IIOVDbSvc *iovDB = dynamic_cast<IIOVDbSvc*>(proxy->provider());
349 if (iovDB != nullptr) {
350 ATH_MSG_DEBUG("Dropping " << key << "via IOVDBSvc");
351 ATH_CHECK( iovDB->dropObject(key, /*resetCache=*/true) );
352 } else {
353 ATH_MSG_ERROR("dropObjectFromDB: Provider for " << key << " is not an IIOVDbSvc.");
354 return StatusCode::FAILURE;
355 }
356
357 return StatusCode::SUCCESS;
358}
359
360
361/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
362
363StatusCode
364IOVSvc::getRange(const CLID& clid, const std::string& key,
365 IOVRange& iov) const {
366
367 IIOVSvcTool *ist = getTool( clid, key );
368 if (ist == nullptr) {
369 ATH_MSG_ERROR( "getRange: proxy for " << fullProxyName(clid,key)
370 << " not registered" );
371 return StatusCode::FAILURE;
372 } else {
373 return ist->getRange( clid, key, iov );
374 }
375
376}
377
378/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
379
380StatusCode
381IOVSvc::getRangeFromDB(const CLID& clid, const std::string& key,
382 IOVRange& range, std::string& tag,
383 std::unique_ptr<IOpaqueAddress>& ioa,
384 const EventIDBase& now) const {
385
386 std::scoped_lock lock(m_lock);
387
388 IIOVSvcTool *ist = getTool( clid, key );
389 if (ist == nullptr) {
390 ATH_MSG_ERROR( "getRangeFromDB: proxy for "
391 << fullProxyName(clid,key) << " not registered" );
392 return StatusCode::FAILURE;
393 } else {
394
395 uint32_t event = now.lumi_block();
396 uint32_t run = now.run_number();
397 IOVTime curTime;
398 curTime.setRunEvent(run,event);
399 // get ns timestamp from event
400 curTime.setTimestamp(1000000000L*static_cast<uint64_t>(now.time_stamp()) + now.time_stamp_ns_offset());
401
402
403 return ist->getRangeFromDB( clid, key, range, tag, ioa, curTime );
404 }
405
406}
407
408/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
409
410StatusCode
411IOVSvc::getRangeFromDB(const CLID& clid, const std::string& key,
412 const IOVTime& time, IOVRange& range,
413 std::string& tag,
414 std::unique_ptr<IOpaqueAddress>& ioa) const {
415
416 std::scoped_lock lock(m_lock);
417
418 IIOVSvcTool *ist = getTool( clid, key );
419 if (ist == nullptr) {
420 ATH_MSG_ERROR( "getRangeFromDB: proxy for "
421 << fullProxyName(clid, key) << " not registered" );
422 return StatusCode::FAILURE;
423 } else {
424 return ist->getRangeFromDB( clid, key, time, range, tag, ioa );
425 }
426
427}
428
429/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
430
431StatusCode
432IOVSvc::setRangeInDB(const CLID& clid, const std::string& key,
433 const IOVRange& range, const std::string &tag) {
434
435 IIOVSvcTool *ist = getTool( clid, key );
436 if (ist == nullptr) {
437 ATH_MSG_ERROR( "setRangeInDB: proxy for "
438 << fullProxyName(clid,key) << " not registered" );
439 return StatusCode::FAILURE;
440 } else {
441 return ist->setRangeInDB( clid, key, range, tag );
442 }
443
444}
445
446/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
447
448StatusCode
450{
451 StatusCode sc;
452 for (const auto& [name, ist] : m_toolMap) {
453 sc &= ist->reinitialize();
454 }
455 return sc;
456
457}
458
459
460
461/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
462
463StatusCode
464IOVSvc::createIOVTool( const std::string& storeName, IIOVSvcTool*& ist ) {
465
466 std::string store(storeName);
467 std::string toolName("IOVSvcTool");
468 if (storeName == "default") {
469 store = defaultStore;
470 }
471 else {
472 // Append the store name if not default
473 toolName += '_';
474 toolName += store;
475 }
476
477 ATH_MSG_DEBUG( "Creating " << toolName << " associated with store \"" << store
478 << "\"" );
479
480 const auto itr = m_toolMap.find( store );
481 if ( itr == m_toolMap.end() ) {
482 ist = nullptr;
483 if (p_toolSvc->retrieveTool( "IOVSvcTool/" + toolName, ist, this ).isFailure()) {
484 ATH_MSG_ERROR( "Unable to create IOVSvcTool associated with store \""
485 << store << "\"" );
486 return StatusCode::FAILURE;
487 } else {
488 m_toolMap[ store ] = ist;
489 ist->setStoreName( store );
490 return StatusCode::SUCCESS;
491 }
492 } else {
493 ATH_MSG_INFO( "an IOVSvcTool already exists associated with store \""
494 << store << "\"" );
495 ist = itr->second;
496 return StatusCode::SUCCESS;
497 }
498
499}
500 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
501
502StatusCode
503IOVSvc::createIOVTool( const std::string& storeName )
504{
505 IIOVSvcTool* ist = nullptr;
506 return createIOVTool (storeName, ist);
507}
508
509
510/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
511
513IOVSvc::getTool( const std::string& storeName, bool createIF ) {
514
515 const std::string store = (storeName=="default" ? defaultStore : storeName);
516
517 const auto itr = m_toolMap.find( store );
518 IIOVSvcTool *ist = nullptr;
519 if ( itr == m_toolMap.end() ) {
520 ATH_MSG_INFO( "No IOVSvcTool associated with store \"" << store
521 << "\"" );
522
523 if (createIF) {
524 createIOVTool(store, ist).ignore();
525 }
526
527 } else {
528 ist = itr->second;
529 }
530
531 return ist;
532}
533
534/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
535
538
539 for (const auto& [name, ist] : m_toolMap) {
540 if (ist->holdsProxy( proxy )) {
541 return ist;
542 }
543 }
544
545 return nullptr;
546
547}
548
549/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
550
552IOVSvc::getTool( const CLID& clid, const std::string& key ) const {
553
554 for (const auto& [name, ist] : m_toolMap) {
555 if (ist->holdsProxy( clid, key )) {
556 return ist;
557 }
558 }
559
560 return nullptr;
561
562}
563
564/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
565
566std::string
568
569 return fullProxyName(dp->clID(), dp->name());
570
571}
572
573/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
574
575std::string
576IOVSvc::fullProxyName( const CLID& clid, const std::string& key ) const {
577
578 std::string fullname, tname;
579 if (p_CLIDSvc->getTypeNameOfID( clid, tname ).isFailure()) {
580 fullname = "[";
581 fullname += std::to_string(clid);
582 fullname += '/';
583 fullname += key;
584 fullname += ']';
585 } else {
586 fullname = "[";
587 fullname += tname;
588 fullname += ':';
589 fullname += std::to_string(clid);
590 fullname += '/';
591 fullname += key;
592 fullname += ']';
593 }
594
595 return fullname;
596}
597
598/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
599
600std::vector<std::string>
602
603 auto keys = m_toolMap | std::views::keys;
604 return std::vector<std::string>(keys.begin(), keys.end());
605
606}
607
608/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
609
610void
612
613 for (auto& [name, ist] : m_toolMap) {
614 ATH_MSG_DEBUG( "resetting all proxies for store \""
615 << ist->getStoreName() << "\"" );
616 ist->resetAllProxies();
617 }
618
619}
620
621/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
622
623StatusCode
624IOVSvc::createCondObj(CondContBase* ccb, const DataObjID& id,
625 const EventIDBase& now) {
626
627 const EventContext& ctx = Gaudi::Hive::currentContext();
628
629 ATH_MSG_DEBUG("createCondObj: id: " << id << " t: " << now << " valid: "
630 << ccb->valid(now));
631
632 if (ccb->valid(now)) {
633 if (msgLvl(MSG::DEBUG)) {
634 EventIDRange r;
635 ccb->range(now,r);
636 ATH_MSG_DEBUG( " range " << r << " for " << id
637 << " is still valid at " << now );
638 }
639 return StatusCode::SUCCESS;
640 }
641
642 IOVTime t(now.run_number(), now.lumi_block(),
643 now.time_stamp()*1000000000LL + now.time_stamp_ns_offset());
644
645 // remove storename from key
646 std::string sgKey = id.key();
647 auto sep = sgKey.find('+');
648 if (sep != std::string::npos) {
649 sgKey.erase(0,sep+1);
650 }
651
652 std::unique_ptr<IOpaqueAddress> ioa;
653 std::string tag;
654 IOVRange range;
655 if (getRangeFromDB(id.clid(), sgKey, t, range, tag, ioa).isFailure()) {
656 ATH_MSG_ERROR( "unable to get range from db for time " << t << " clid "
657 << id.clid() << " " << sgKey );
658 return StatusCode::FAILURE;
659 }
660
661 //In case the conditons-container is a 'mixed' type, we need both run/lb and time-stamps in the range.
662 //Assume infinite IOV in the other dimension
663 EventIDRange eidRange(range);
665 eidRange=EventIDRange::intersect(IOVInfiniteRange::infiniteMixed(),eidRange);
666 }
667 ATH_MSG_DEBUG( " new range for ID " << id << " : " << range
668 << " IOA: " << ioa.get());
669
670 // If the start of the new range matches the start of the last range, then
671 // extend the last range rather than trying to insert a new range.
672 // This can happen when a folder is tagged as `extensible' in IOVDbSvc.
673 EventIDRange r;
674 if (ccb->range (eidRange.start(), r) &&
675 eventIDMatch (r.start(), eidRange.start()))
676 {
677 if (ccb->extendLastRange (eidRange, ctx).isSuccess()) {
678 return StatusCode::SUCCESS;
679 }
680 }
681
682 if (ccb->proxy() == nullptr) {
683 // nb. We don't want to be holding the IOVSvc lock here,
684 // as SGImplSvc can call to IOVSvc with the store lock held.
685 SG::DataProxy* dp = p_detStore->proxy (id.clid(), sgKey);
686 ATH_MSG_DEBUG( " found DataProxy " << dp << " for " << id );
687 ccb->setProxy(dp);
688 }
689
690 // this will talk to the IOVDbSvc, get current run/event from EventInfo
691 // object, load
692 SG::DataProxy* dp = ccb->proxy();
693 DataObject* dobj = nullptr;
694 void* v = nullptr;
695
696 if (dp->store()->createObj(dp->loader(), ioa.get(), dobj).isFailure()) {
697 ATH_MSG_ERROR(" could not create a new DataObject ");
698 return StatusCode::FAILURE;
699 } else {
700 ATH_MSG_DEBUG(" created new obj at " << dobj );
701
702 v = SG::Storable_cast(dobj, id.clid());
703 }
704
705 // Free the DataBucket that was created along with the object we read.
706 if (DataBucketBase* dbb = dynamic_cast<DataBucketBase*> (dobj)) {
707 dbb->relinquish();
708 delete dobj;
709 dobj = nullptr;
710 }
711
712 // Some data objects may be reference counted by the address.
713 // CondCont will take ownership of the object, but doesn't
714 // do refcounting. We'll have gotten a reference via the Storable_cast
715 // above, so it should be ok ... unless CondCont deletes
716 // the new object immediately instead of inserting.
717 // In that case, when we delete the address, it will
718 // follow an invalid pointer. So be sure to delete
719 // the address before the object is added to CondCont.
720 ioa.reset();
721
722 // DataObject *d2 = static_cast<DataObject*>(v);
723
724 ATH_MSG_DEBUG( " SG::Storable_cast to obj: " << v );
725
726 StatusCode sc = ccb->typelessInsert (eidRange, v, ctx);
727 if (!sc.isSuccess()) {
728 ATH_MSG_ERROR("unable to insert Object at " << v << " into CondCont "
729 << ccb->id() << " for range " << eidRange );
730 return StatusCode::FAILURE;
731 }
733 // Disable this for now... IOVDbSvc can sometimes produce overlapping
734 // ranges.
735 //ATH_MSG_ERROR ("IOV range overlap.");
736 //return StatusCode::FAILURE;
737 }
738
739 return sc;
740
741}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
uint32_t CLID
The Class ID type.
Abstract interface to IOVDbSvc to access IOVRange and tag information.
virtual void lock()=0
Interface to allow an object to lock itself when made const in SG.
static Double_t sc
static bool isOverlap(code_t code)
Helper to test whether a code is OVERLAP.
Definition CondCont.cxx:242
Base class for all conditions containers.
Definition CondCont.h:140
virtual StatusCode typelessInsert(const EventIDRange &r, void *obj, const EventContext &ctx)=0
Insert a new conditions object.
void setProxy(SG::DataProxy *)
Set the associated DataProxy.
Definition CondCont.cxx:276
@ MIXED
Mixed Run+lbn / timestamp container.
Definition CondCont.h:192
virtual StatusCode extendLastRange(const EventIDRange &newRange, const EventContext &ctx)=0
Extend the range of the last IOV.
virtual bool valid(const EventIDBase &t) const =0
Test to see if a given IOV time is mapped in the container.
KeyType keyType() const
Return the key type for this container.
virtual bool range(const EventIDBase &t, EventIDRange &r) const =0
Return the mapped validity range for an IOV time.
SG::DataProxy * proxy()
Return the associated DataProxy, if any.
const DataObjID & id() const
Return CLID/key corresponding to this container.
A non-templated base class for DataBucket, allows to access the transient object address as a void*.
Abstract interface to IOVDbSvc to access IOVRange and tag information.
Definition IIOVDbSvc.h:38
virtual bool dropObject(const std::string &key, const bool resetCache=false)=0
virtual StatusCode getRangeFromDB(const CLID &clid, const std::string &key, IOVRange &range, std::string &tag, std::unique_ptr< IOpaqueAddress > &ioa, const IOVTime &curTime) const =0
virtual void setStoreName(const std::string &storeName)=0
virtual StatusCode setRangeInDB(const CLID &clid, const std::string &key, const IOVRange &range, const std::string &tag)=0
virtual StatusCode setRange(const CLID &clid, const std::string &key, IOVRange &)=0
virtual StatusCode preLoadTAD(const SG::TransientAddress *)=0
virtual StatusCode preLoadDataTAD(const SG::TransientAddress *)=0
virtual StatusCode replaceProxy(SG::DataProxy *pOld, SG::DataProxy *pNew)=0
virtual StatusCode regProxy(SG::DataProxy *proxy, const std::string &key)=0
virtual const std::string & getStoreName() const =0
virtual void ignoreProxy(SG::DataProxy *proxy)=0
virtual StatusCode deregProxy(SG::DataProxy *proxy)=0
virtual StatusCode getRange(const CLID &clid, const std::string &key, IOVRange &iov) const =0
static EventIDRange infiniteMixed()
Produces an mixed EventIDRange that is infinite in Time and RunLumi.
Validity Range object.
Definition IOVRange.h:30
virtual StatusCode preLoadDataTAD(const SG::TransientAddress *, const std::string &storeName) override
supply a list of TADs whose data will be preloaded
Definition IOVSvc.cxx:273
std::map< std::string, IIOVSvcTool * > m_toolMap
Definition IOVSvc.h:147
virtual std::vector< std::string > getStoreNames() const override
Definition IOVSvc.cxx:601
virtual StatusCode createIOVTool(const std::string &storeName) override
Definition IOVSvc.cxx:503
ServiceHandle< StoreGateSvc > p_detStore
Definition IOVSvc.h:144
virtual StatusCode preLoadTAD(const SG::TransientAddress *, const std::string &storeName) override
supply a list of TADs whose proxies will be preloaded
Definition IOVSvc.cxx:252
IOVSvc(const std::string &name, ISvcLocator *svc)
Definition IOVSvc.cxx:65
virtual StatusCode getRange(const CLID &clid, const std::string &key, IOVRange &io) const override
Definition IOVSvc.cxx:364
virtual StatusCode replaceProxy(SG::DataProxy *pOld, SG::DataProxy *pNew, const std::string &storeName) override
replace a registered DataProxy with a new version
Definition IOVSvc.cxx:230
ServiceHandle< IClassIDSvc > p_CLIDSvc
Definition IOVSvc.h:143
virtual void resetAllProxies() override
Definition IOVSvc.cxx:611
virtual StatusCode deregProxy(SG::DataProxy *proxy) override
Deregister a DataProxy with the service.
Definition IOVSvc.cxx:170
std::recursive_mutex m_lock
Definition IOVSvc.h:151
IIOVSvcTool * getTool(const std::string &storeName, bool createIF=true)
Definition IOVSvc.cxx:513
virtual StatusCode setRange(const CLID &clid, const std::string &key, IOVRange &io, const std::string &storeName) override
Update Range from dB.
Definition IOVSvc.cxx:290
virtual StatusCode getRangeFromDB(const CLID &clid, const std::string &key, IOVRange &range, std::string &tag, std::unique_ptr< IOpaqueAddress > &ioa, const EventIDBase &now) const override
Get IOVRange from db for current event.
Definition IOVSvc.cxx:381
ServiceHandle< StoreGateSvc > p_sgs
Definition IOVSvc.h:144
virtual StatusCode setRangeInDB(const CLID &clid, const std::string &key, const IOVRange &range, const std::string &tag) override
Set a particular IOVRange in db (and memory).
Definition IOVSvc.cxx:432
virtual StatusCode regProxy(SG::DataProxy *proxy, const std::string &key, const std::string &storeName) override
Subscribe method for DataProxy. key StoreGate key.
Definition IOVSvc.cxx:95
virtual StatusCode createCondObj(CondContBase *, const DataObjID &, const EventIDBase &) override
Definition IOVSvc.cxx:624
ServiceHandle< IToolSvc > p_toolSvc
Definition IOVSvc.h:142
virtual void ignoreProxy(const CLID &clid, const std::string &key, const std::string &storeName) override
ignore proxy
Definition IOVSvc.cxx:210
virtual StatusCode reinitialize() override
Definition IOVSvc.cxx:449
virtual StatusCode initialize() override
Definition IOVSvc.cxx:77
std::string fullProxyName(const SG::DataProxy *proxy) const
Definition IOVSvc.cxx:567
virtual StatusCode dropObjectFromDB(const CLID &clid, const std::string &key, const std::string &storeName) override
Drop the associated object from the db and trigger reload.
Definition IOVSvc.cxx:325
ServiceHandle< ICondSvc > p_condSvc
Definition IOVSvc.h:145
Basic time unit for IOVSvc.
Definition IOVTime.h:33
void setRunEvent(uint32_t run, uint32_t event) noexcept
Definition IOVTime.cxx:96
void setTimestamp(uint64_t timestamp) noexcept
Definition IOVTime.cxx:72
int r
Definition globals.cxx:22
T * Storable_cast(DataObject *pDObj, bool quiet=true, IRegisterTransient *irt=0, bool isConst=true)
double e2(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 2nd sampling
double e1(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 1st sampling
MsgStream & msg
Definition testRead.cxx:32
int run(int argc, char *argv[])