 |
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 EventIDBase &now) 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 832 of file IOVSvc.cxx.
843 <<
" is still valid at " <<
now );
845 return StatusCode::SUCCESS;
848 IOVTime t(
now.run_number(),
now.lumi_block(), (
long long)
now.time_stamp()*1000000000+
now.time_stamp_ns_offset());
852 std::string sgKey =
id.key();
853 auto sep = sgKey.find(
'+');
854 if (
sep != std::string::npos) {
855 sgKey.erase(0,
sep+1);
858 std::unique_ptr<IOpaqueAddress> ioa;
860 ATH_MSG_ERROR(
"unable to get range from db for time " <<
t <<
" clid "
861 <<
id.clid() <<
" " << sgKey );
862 return StatusCode::FAILURE;
867 EventIDRange eidRange(
range);
872 <<
" IOA: " << ioa.get());
878 if (ccb->
range (eidRange.start(),
r) &&
879 eventIDMatch (
r.start(), eidRange.start()))
882 return StatusCode::SUCCESS;
886 if (ccb->
proxy() ==
nullptr) {
900 if (
dp->store()->createObj(
dp->loader(), ioa.get(), dobj).isFailure()) {
902 return StatusCode::FAILURE;
931 if (!
sc.isSuccess()) {
932 ATH_MSG_ERROR(
"unable to insert Object at " <<
v <<
" into CondCont "
933 << ccb->
id() <<
" for range " << eidRange );
934 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 620 of file IOVSvc.cxx.
622 std::string
store(storeName);
623 std::string toolName(
"IOVSvcTool");
638 if (
p_toolSvc->retrieveTool(
"IOVSvcTool/" + toolName, ist,
this ).isFailure()) {
639 ATH_MSG_ERROR(
"Unable to create IOVSvcTool associated with store \""
641 return StatusCode::FAILURE;
644 ist->setStoreName(
store );
645 return StatusCode::SUCCESS;
648 ATH_MSG_INFO(
"an IOVSvcTool already exists associated with store \""
651 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 776 of file IOVSvc.cxx.
778 std::string fullname, tname;
779 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 476 of file IOVSvc.cxx.
481 std::lock_guard<std::recursive_mutex>
lock(
m_lock);
487 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 EventIDBase & |
now |
|
) |
| const |
|
overridevirtual |
Get IOVRange from db for current event.
Definition at line 446 of file IOVSvc.cxx.
451 std::lock_guard<std::recursive_mutex>
lock(
m_lock);
457 return StatusCode::FAILURE;
◆ getStoreNames()
std::vector< std::string > IOVSvc::getStoreNames |
( |
| ) |
const |
|
overridevirtual |
Definition at line 801 of file IOVSvc.cxx.
803 std::vector<std::string> stores;
805 toolMap::const_iterator itr =
m_toolMap.begin();
807 stores.push_back( itr->first );
◆ getTool() [1/5]
Definition at line 732 of file IOVSvc.cxx.
735 toolMap::const_iterator itr =
m_toolMap.begin();
737 if (itr->second->holdsCallback(
c1 )) {
◆ getTool() [2/5]
Definition at line 714 of file IOVSvc.cxx.
717 toolMap::const_iterator itr =
m_toolMap.begin();
719 if (itr->second->holdsProxy( clid,
key )) {
◆ getTool() [3/5]
Definition at line 749 of file IOVSvc.cxx.
752 toolMap::const_iterator itr =
m_toolMap.begin();
754 if (itr->second->holdsAlgTool( ia )) {
◆ getTool() [4/5]
IIOVSvcTool * IOVSvc::getTool |
( |
const std::string & |
storeName, |
|
|
bool |
createIF = true |
|
) |
| |
|
private |
Definition at line 668 of file IOVSvc.cxx.
670 std::string
store(storeName);
671 if (storeName ==
"default") {
◆ getTool() [5/5]
Definition at line 695 of file IOVSvc.cxx.
699 toolMap::const_iterator itr =
m_toolMap.begin();
701 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 584 of file IOVSvc.cxx.
591 <<
"\" associated with any IOVSvcTool" );
592 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 533 of file IOVSvc.cxx.
539 ATH_MSG_ERROR(
"Cannot register 2nd callback function and assocaited"
540 <<
" object with itself" );
541 return StatusCode::FAILURE;
548 <<
"\" cannot be registered since function \"" <<
c1.name()
549 <<
"\" has not been registered first" );
550 return StatusCode::FAILURE;
◆ regFcn() [2/3]
Definition at line 560 of file IOVSvc.cxx.
565 if (
p_toolSvc->retrieveTool(toolName, ia, 0,
false).isFailure() ) {
566 ATH_MSG_ERROR(
"AlgTool " << toolName <<
" has not yet been created"
567 <<
" and thus cannot be registered" );
568 return StatusCode::FAILURE;
573 ATH_MSG_ERROR(
"No callback registered with AlgTool " << toolName );
574 return StatusCode::FAILURE;
576 return ist->
regFcn(ia,
c2, fcn2, trigger);
◆ regFcn() [3/3]
register callback functions
Definition at line 514 of file IOVSvc.cxx.
521 ATH_MSG_ERROR(
"regFcn: no IOVSvcTool found containing DataProxy "
523 <<
"-> Need to bind DataHandle first" );
524 return StatusCode::FAILURE;
526 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 603 of file IOVSvc.cxx.
609 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 497 of file IOVSvc.cxx.
504 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.
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.
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
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 B' along the line B that's closest to a second line A.
#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