|
ATLAS Offline Software
|
#include <IOVSvc.h>
|
| IOVSvc (const std::string &name, ISvcLocator *svc) |
|
virtual | ~IOVSvc () |
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | reinitialize () override |
|
virtual StatusCode | finalize () override |
|
virtual StatusCode | createIOVTool (const std::string &storeName) override |
|
virtual std::vector< std::string > | getStoreNames () const override |
|
virtual StatusCode | regFcn (SG::DataProxy *dp, const CallBackID &c, const IOVSvcCallBackFcn &fcn, bool trigger=false) override |
| register callback functions More...
|
|
virtual StatusCode | regFcn (const CallBackID &c1, const CallBackID &c2, const IOVSvcCallBackFcn &fcn2, bool trigger) override |
|
virtual StatusCode | regFcn (const std::string &toolName, const CallBackID &c2, const IOVSvcCallBackFcn &fcn2, bool trigger) override |
|
virtual StatusCode | setRange (const CLID &clid, const std::string &key, IOVRange &) override |
| Update Range from dB. More...
|
|
virtual StatusCode | setRange (const CLID &clid, const std::string &key, IOVRange &io, const std::string &storeName) override |
|
virtual StatusCode | getRange (const CLID &clid, const std::string &key, IOVRange &io) const override |
|
virtual StatusCode | regProxy (SG::DataProxy *proxy, const std::string &key, const std::string &storeName) override |
| Subscribe method for DataProxy. key StoreGate key. More...
|
|
virtual StatusCode | replaceProxy (SG::DataProxy *pOld, SG::DataProxy *pNew, const std::string &storeName) override |
| replace a registered DataProxy with a new version More...
|
|
virtual StatusCode | regProxy (const CLID &clid, const std::string &key, const std::string &storeName) override |
| Another way to subscribe. More...
|
|
virtual StatusCode | deregProxy (SG::DataProxy *proxy) override |
| Deregister a DataProxy with the service. More...
|
|
virtual StatusCode | deregProxy (const CLID &clid, const std::string &key) override |
| Deregister a DataProxy with the service. More...
|
|
virtual StatusCode | getRangeFromDB (const CLID &clid, const std::string &key, IOVRange &range, std::string &tag, std::unique_ptr< IOpaqueAddress > &ioa) const override |
| Get IOVRange from db for current event. More...
|
|
virtual StatusCode | getRangeFromDB (const CLID &clid, const std::string &key, const IOVTime &time, IOVRange &range, std::string &tag, std::unique_ptr< IOpaqueAddress > &ioa) const override |
| Get IOVRange from db for a particular event. More...
|
|
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) More...
|
|
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. More...
|
|
virtual StatusCode | preLoadTAD (const SG::TransientAddress *, const std::string &storeName) override |
| supply a list of TADs whose proxies will be preloaded More...
|
|
virtual StatusCode | preLoadDataTAD (const SG::TransientAddress *, const std::string &storeName) override |
| supply a list of TADs whose data will be preloaded More...
|
|
virtual StatusCode | getTriggeredTools (const std::string &key, std::set< std::string > &tools, const std::string &storeName) override |
| return list of tools (or functions) that have been triggered by key will return FAILURE if no tools found, or no key found More...
|
|
virtual void | resetAllProxies () override |
|
virtual void | ignoreProxy (const CLID &clid, const std::string &key, const std::string &storeName) override |
| ignore proxy More...
|
|
virtual StatusCode | createCondObj (CondContBase *, const DataObjID &, const EventIDBase &) override |
|
Definition at line 53 of file IOVSvc.h.
◆ toolMap
◆ IOVSvc()
IOVSvc::IOVSvc |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
svc |
|
) |
| |
◆ ~IOVSvc()
◆ createCondObj()
Definition at line 834 of file IOVSvc.cxx.
845 <<
" is still valid at " <<
now );
847 return StatusCode::SUCCESS;
850 IOVTime t(
now.run_number(),
now.lumi_block(), (
long long)
now.time_stamp()*1000000000+
now.time_stamp_ns_offset());
854 std::string sgKey =
id.key();
855 auto sep = sgKey.find(
'+');
856 if (
sep != std::string::npos) {
857 sgKey.erase(0,
sep+1);
860 std::unique_ptr<IOpaqueAddress> ioa;
863 <<
id.clid() <<
" " << sgKey );
864 return StatusCode::FAILURE;
869 EventIDRange eidRange(
range);
874 <<
" IOA: " << ioa.get());
880 if (ccb->
range (eidRange.start(),
r) &&
881 eventIDMatch (
r.start(), eidRange.start()))
884 return StatusCode::SUCCESS;
888 if (ccb->
proxy() ==
nullptr) {
902 if (
dp->store()->createObj(
dp->loader(), ioa.get(), dobj).isFailure()) {
904 return StatusCode::FAILURE;
933 if (!
sc.isSuccess()) {
934 ATH_MSG_ERROR(
"unable to insert Object at " <<
v <<
" into CondCont "
935 << ccb->
id() <<
" for range " << eidRange );
936 return StatusCode::FAILURE;
◆ createIOVTool() [1/2]
StatusCode IOVSvc::createIOVTool |
( |
const std::string & |
storeName | ) |
|
|
overridevirtual |
◆ createIOVTool() [2/2]
StatusCode IOVSvc::createIOVTool |
( |
const std::string & |
storeName, |
|
|
IIOVSvcTool *& |
tool |
|
) |
| |
|
private |
Definition at line 622 of file IOVSvc.cxx.
624 std::string
store(storeName);
625 std::string toolName(
"IOVSvcTool");
640 if (
p_toolSvc->retrieveTool(
"IOVSvcTool/" + toolName, ist,
this ).isFailure()) {
641 ATH_MSG_ERROR(
"Unable to create IOVSvcTool associated with store \""
643 return StatusCode::FAILURE;
646 ist->setStoreName(
store );
647 return StatusCode::SUCCESS;
650 ATH_MSG_INFO(
"an IOVSvcTool already exists associated with store \""
653 return StatusCode::SUCCESS;
◆ deregProxy() [1/2]
StatusCode IOVSvc::deregProxy |
( |
const CLID & |
clid, |
|
|
const std::string & |
key |
|
) |
| |
|
overridevirtual |
Deregister a DataProxy with the service.
Definition at line 226 of file IOVSvc.cxx.
229 std::lock_guard<std::recursive_mutex> lock(
m_lock);
234 return StatusCode::FAILURE;
◆ deregProxy() [2/2]
Deregister a DataProxy with the service.
Definition at line 205 of file IOVSvc.cxx.
208 std::lock_guard<std::recursive_mutex> lock(
m_lock);
213 return (StatusCode::FAILURE);
◆ dropObjectFromDB()
StatusCode IOVSvc::dropObjectFromDB |
( |
const CLID & |
clid, |
|
|
const std::string & |
key, |
|
|
const std::string & |
storeName |
|
) |
| |
|
overridevirtual |
Drop the associated object from the db and trigger reload.
Definition at line 389 of file IOVSvc.cxx.
392 std::lock_guard<std::recursive_mutex> lock(
m_lock);
395 if (ist ==
nullptr) {
396 ATH_MSG_ERROR(
"dropObjectFromDB: no IOVSvcTool associated with store "
397 << storeName <<
" and failed to create one." );
398 return StatusCode::FAILURE;
402 if (
proxy ==
nullptr) {
403 ATH_MSG_DEBUG(
"Proxy for (clid: " << clid <<
" key: " <<
key <<
") in store " << storeName
404 <<
" does not exist. Cannot drop associated object.");
405 return StatusCode::SUCCESS;
413 if (iovDB !=
nullptr) {
417 ATH_MSG_ERROR(
"dropObjectFromDB: Provider for " <<
key <<
" is not an IIOVDbSvc.");
418 return StatusCode::FAILURE;
421 return StatusCode::SUCCESS;
◆ finalize()
StatusCode IOVSvc::finalize |
( |
| ) |
|
|
overridevirtual |
Definition at line 118 of file IOVSvc.cxx.
121 return StatusCode::SUCCESS;
◆ fullProxyName() [1/2]
std::string IOVSvc::fullProxyName |
( |
const CLID & |
clid, |
|
|
const std::string & |
key |
|
) |
| const |
|
private |
Definition at line 778 of file IOVSvc.cxx.
780 std::string fullname, tname;
781 if (
p_CLIDSvc->getTypeNameOfID( clid, tname ).isFailure()) {
◆ fullProxyName() [2/2]
◆ getRange()
Definition at line 428 of file IOVSvc.cxx.
435 <<
" not registered" );
436 return StatusCode::FAILURE;
◆ getRangeFromDB() [1/2]
StatusCode IOVSvc::getRangeFromDB |
( |
const CLID & |
clid, |
|
|
const std::string & |
key, |
|
|
const IOVTime & |
time, |
|
|
IOVRange & |
range, |
|
|
std::string & |
tag, |
|
|
std::unique_ptr< IOpaqueAddress > & |
ioa |
|
) |
| const |
|
overridevirtual |
Get IOVRange from db for a particular event.
Definition at line 478 of file IOVSvc.cxx.
483 std::lock_guard<std::recursive_mutex> lock(
m_lock);
489 return StatusCode::FAILURE;
◆ getRangeFromDB() [2/2]
StatusCode IOVSvc::getRangeFromDB |
( |
const CLID & |
clid, |
|
|
const std::string & |
key, |
|
|
IOVRange & |
range, |
|
|
std::string & |
tag, |
|
|
std::unique_ptr< IOpaqueAddress > & |
ioa |
|
) |
| const |
|
overridevirtual |
Get IOVRange from db for current event.
Definition at line 446 of file IOVSvc.cxx.
450 std::lock_guard<std::recursive_mutex> lock(
m_lock);
456 return StatusCode::FAILURE;
460 const EventContext& context = Gaudi::Hive::currentContext();
461 const EventIDBase& eventID = context.eventID();
462 uint32_t event = eventID.lumi_block();
467 curTime.
setTimestamp(1000000000L*(
uint64_t)eventID.time_stamp() + eventID.time_stamp_ns_offset());
◆ getStoreNames()
std::vector< std::string > IOVSvc::getStoreNames |
( |
| ) |
const |
|
overridevirtual |
Definition at line 803 of file IOVSvc.cxx.
805 std::vector<std::string> stores;
807 toolMap::const_iterator itr =
m_toolMap.begin();
809 stores.push_back( itr->first );
◆ getTool() [1/5]
Definition at line 734 of file IOVSvc.cxx.
737 toolMap::const_iterator itr =
m_toolMap.begin();
739 if (itr->second->holdsCallback(
c1 )) {
◆ getTool() [2/5]
Definition at line 716 of file IOVSvc.cxx.
719 toolMap::const_iterator itr =
m_toolMap.begin();
721 if (itr->second->holdsProxy( clid,
key )) {
◆ getTool() [3/5]
Definition at line 751 of file IOVSvc.cxx.
754 toolMap::const_iterator itr =
m_toolMap.begin();
756 if (itr->second->holdsAlgTool( ia )) {
◆ getTool() [4/5]
IIOVSvcTool * IOVSvc::getTool |
( |
const std::string & |
storeName, |
|
|
bool |
createIF = true |
|
) |
| |
|
private |
Definition at line 670 of file IOVSvc.cxx.
672 std::string
store(storeName);
673 if (storeName ==
"default") {
◆ getTool() [5/5]
Definition at line 697 of file IOVSvc.cxx.
701 toolMap::const_iterator itr =
m_toolMap.begin();
703 if (itr->second->holdsProxy(
proxy )) {
◆ getTriggeredTools()
StatusCode IOVSvc::getTriggeredTools |
( |
const std::string & |
key, |
|
|
std::set< std::string > & |
tools, |
|
|
const std::string & |
storeName |
|
) |
| |
|
overridevirtual |
return list of tools (or functions) that have been triggered by key will return FAILURE if no tools found, or no key found
Definition at line 586 of file IOVSvc.cxx.
593 <<
"\" associated with any IOVSvcTool" );
594 return StatusCode::FAILURE;
◆ ignoreProxy()
void IOVSvc::ignoreProxy |
( |
const CLID & |
clid, |
|
|
const std::string & |
key, |
|
|
const std::string & |
storeName |
|
) |
| |
|
overridevirtual |
ignore proxy
Definition at line 247 of file IOVSvc.cxx.
254 << storeName <<
" and failed to create one" );
◆ initialize()
StatusCode IOVSvc::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 93 of file IOVSvc.cxx.
95 msg().setLevel( m_outputLevel.value() );
98 if (!
p_sgs.isValid()) {
100 return StatusCode::FAILURE;
105 return StatusCode::FAILURE;
110 return StatusCode::FAILURE;
113 return StatusCode::SUCCESS;
◆ preLoadDataTAD()
supply a list of TADs whose data will be preloaded
add to a set of TADs that who's data will be preLoaded
Definition at line 311 of file IOVSvc.cxx.
316 ATH_MSG_ERROR(
"preLoadDataTAD: no IOVSvcTool associated with store \""
317 << storeName <<
"\" and failed to create one." );
318 return StatusCode::FAILURE;
◆ preLoadTAD()
supply a list of TADs whose proxies will be preloaded
add to a set of TADs that will be registered at start of first event
Definition at line 290 of file IOVSvc.cxx.
296 ATH_MSG_ERROR(
"preLoadTAD: no IOVSvcTool associated with store \""
297 << storeName <<
"\" and failed to create one." );
298 return StatusCode::FAILURE;
◆ regFcn() [1/3]
Definition at line 535 of file IOVSvc.cxx.
541 ATH_MSG_ERROR(
"Cannot register 2nd callback function and assocaited"
542 <<
" object with itself" );
543 return StatusCode::FAILURE;
550 <<
"\" cannot be registered since function \"" <<
c1.name()
551 <<
"\" has not been registered first" );
552 return StatusCode::FAILURE;
◆ regFcn() [2/3]
Definition at line 562 of file IOVSvc.cxx.
567 if (
p_toolSvc->retrieveTool(toolName, ia, 0,
false).isFailure() ) {
568 ATH_MSG_ERROR(
"AlgTool " << toolName <<
" has not yet been created"
569 <<
" and thus cannot be registered" );
570 return StatusCode::FAILURE;
575 ATH_MSG_ERROR(
"No callback registered with AlgTool " << toolName );
576 return StatusCode::FAILURE;
578 return ist->
regFcn(ia,
c2, fcn2, trigger);
◆ regFcn() [3/3]
register callback functions
Definition at line 516 of file IOVSvc.cxx.
523 ATH_MSG_ERROR(
"regFcn: no IOVSvcTool found containing DataProxy "
525 <<
"-> Need to bind DataHandle first" );
526 return StatusCode::FAILURE;
528 return ist->
regFcn(
dp,
c, fcn, trigger );
◆ regProxy() [1/2]
StatusCode IOVSvc::regProxy |
( |
const CLID & |
clid, |
|
|
const std::string & |
key, |
|
|
const std::string & |
storeName |
|
) |
| |
|
overridevirtual |
Another way to subscribe.
Register a DataProxy with the service.
Definition at line 167 of file IOVSvc.cxx.
170 std::lock_guard<std::recursive_mutex> lock(
m_lock);
173 ATH_MSG_ERROR(
"regProxy: no IOVSvcTool associated with store \""
174 << storeName <<
"\" and failed to create one." );
175 return (StatusCode::FAILURE);
183 <<
" with store " << storeName
184 <<
", it is already registered with store \""
186 return StatusCode::FAILURE;
189 <<
" already registered with store \"" << storeName <<
"\""
191 return StatusCode::SUCCESS;
◆ regProxy() [2/2]
Subscribe method for DataProxy. key StoreGate key.
Register a DataProxy with the service.
Definition at line 130 of file IOVSvc.cxx.
133 std::lock_guard<std::recursive_mutex> lock(
m_lock);
136 ATH_MSG_ERROR(
"regProxy: no IOVSvcTool associated with store \""
137 << storeName <<
"\" and failed to create one" );
138 return (StatusCode::FAILURE);
146 <<
"\", it is already registered with store \""
148 return StatusCode::FAILURE;
151 <<
" already registered with store \"" << storeName <<
"\""
153 return StatusCode::SUCCESS;
◆ reinitialize()
StatusCode IOVSvc::reinitialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 605 of file IOVSvc.cxx.
611 sc &= itr->second->reinitialize();
◆ replaceProxy()
replace a registered DataProxy with a new version
Replace a registered DataProxy with a new version.
Definition at line 268 of file IOVSvc.cxx.
276 ATH_MSG_ERROR(
"regProxy: no IOVSvcTool associated with store \""
277 << storeName <<
"\" and failed to create one." );
◆ resetAllProxies()
void IOVSvc::resetAllProxies |
( |
| ) |
|
|
overridevirtual |
◆ setRange() [1/2]
Update Range from dB.
Definition at line 328 of file IOVSvc.cxx.
331 std::lock_guard<std::recursive_mutex> lock(
m_lock);
340 <<
"is deprecated - you need to specify a store! "
341 <<
"This will be an ERROR soon!" );
◆ setRange() [2/2]
Definition at line 354 of file IOVSvc.cxx.
357 std::lock_guard<std::recursive_mutex> lock(
m_lock);
361 ATH_MSG_ERROR(
"setRange: no IOVSvcTool associated with store \""
362 << storeName <<
"\" and failed to create one." );
363 return StatusCode::FAILURE;
369 <<
" not registered with store \"" << storeName <<
"\". Doing it now"
372 return StatusCode::FAILURE;
374 }
else if (ist2 != ist) {
375 ATH_MSG_INFO(
"setRange: when registering proxy (clid: "
376 << clid <<
" key: " <<
key <<
") with store \"" << storeName
377 <<
"\" --> already registered with store \"" << ist2->
getStoreName()
379 return StatusCode::FAILURE;
◆ setRangeInDB()
Set a particular IOVRange in db (and memory)
Definition at line 499 of file IOVSvc.cxx.
506 return StatusCode::FAILURE;
◆ m_forceReset
BooleanProperty IOVSvc::m_forceReset |
|
private |
◆ m_lock
std::recursive_mutex IOVSvc::m_lock |
|
mutableprivate |
◆ m_partialPreLoadData
BooleanProperty IOVSvc::m_partialPreLoadData |
|
private |
◆ m_preLoadData
BooleanProperty IOVSvc::m_preLoadData |
|
private |
◆ m_preLoadExtensibleFolders
BooleanProperty IOVSvc::m_preLoadExtensibleFolders |
|
private |
◆ m_preLoadRanges
BooleanProperty IOVSvc::m_preLoadRanges |
|
private |
◆ m_sortKeys
BooleanProperty IOVSvc::m_sortKeys |
|
private |
◆ m_toolMap
◆ m_updateInterval
std::string IOVSvc::m_updateInterval |
|
private |
◆ p_CLIDSvc
◆ p_condSvc
◆ p_detStore
◆ p_sgs
◆ p_toolSvc
The documentation for this class was generated from the following files:
JetConstituentVector::iterator iterator
virtual StatusCode typelessInsert(const EventIDRange &r, void *obj, const EventContext &ctx=Gaudi::Hive::currentContext())=0
Insert a new conditions object.
Validity Range object. Holds two IOVTimes (start and stop)
A non-templated base class for DataBucket, allows to access the transient object address as a void*.
BooleanProperty m_partialPreLoadData
IIOVSvcTool * getTool(const std::string &storeName, bool createIF=true)
ServiceHandle< StoreGateSvc > p_detStore
const std::string defaultStore
static EventIDRange infiniteMixed()
Produces an mixed EventIDRange that is infinite in Time and RunLumi.
std::recursive_mutex m_lock
KeyType keyType() const
Return the key type for this container.
virtual bool valid(const EventIDBase &t) const =0
Test to see if a given IOV time is mapped in the container.
Abstract interface to IOVDbSvc to access IOVRange and tag information.
BooleanProperty m_preLoadData
std::string m_updateInterval
Basic time unit for IOVSvc. Hold time as a combination of run and event numbers.
BooleanProperty m_sortKeys
ServiceHandle< IToolSvc > p_toolSvc
virtual StatusCode getRangeFromDB(const CLID &clid, const std::string &key, IOVRange &range, std::string &tag, std::unique_ptr< IOpaqueAddress > &ioa) const override
Get IOVRange from db for current event.
BooleanProperty m_forceReset
POOL::TEvent event(POOL::TEvent::kClassAccess)
virtual bool range(const EventIDBase &t, EventIDRange &r) const =0
Return the mapped validity range for an IOV time.
const DataObjID & id() const
Return CLID/key corresponding to this container.
::StatusCode StatusCode
StatusCode definition for legacy code.
std::string fullProxyName(const SG::DataProxy *proxy) const
ServiceHandle< IClassIDSvc > p_CLIDSvc
virtual bool dropObject(const std::string &key, const bool resetCache=false)=0
AthROOTErrorHandlerSvc * svc
void setTimestamp(uint64_t timestamp) noexcept
virtual StatusCode setRange(const CLID &clid, const std::string &key, IOVRange &) override
Update Range from dB.
std::string to_string(const DetectorType &type)
virtual StatusCode extendLastRange(const EventIDRange &newRange, const EventContext &ctx=Gaudi::Hive::currentContext())=0
Extend the range of the last IOV.
@ MIXED
Mixed Run+lbn / timestamp container.
static bool isOverlap(code_t code)
Helper to test whether a code is OVERLAP.
ServiceHandle< StoreGateSvc > p_sgs
ServiceHandle< ICondSvc > p_condSvc
T * Storable_cast(DataObject *pDObj, bool quiet=true, IRegisterTransient *irt=0, bool isConst=true)
def time(flags, cells_name, *args, **kw)
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.
#define ATH_MSG_WARNING(x)
void setRunEvent(uint32_t run, uint32_t event) noexcept
BooleanProperty m_preLoadExtensibleFolders
void setProxy(SG::DataProxy *)
Set the associated DataProxy.
SG::DataProxy * proxy()
Return the associated DataProxy, if any.
virtual StatusCode createIOVTool(const std::string &storeName) override
BooleanProperty m_preLoadRanges