16#ifndef IOVDbSvc_IOVDbSvc_h
17#define IOVDbSvc_IOVDbSvc_h
22#include "GaudiKernel/StatusCode.h"
23#include "GaudiKernel/ClassID.h"
24#include "GaudiKernel/IIncidentListener.h"
25#include "GaudiKernel/ServiceHandle.h"
26#include "GaudiKernel/ToolHandle.h"
27#include "GaudiKernel/IAddressCreator.h"
28#include "GaudiKernel/IIoComponent.h"
35#include "CoolKernel/IDatabase.h"
36#include "CoolKernel/ValidityKey.h"
76 using base_class::base_class;
83 virtual StatusCode
finalize()
override;
89 virtual cool::IDatabasePtr
getDatabase(
bool readOnly )
override;
107 const EventContext& ctx )
override;
116 const std::string& dbKey,
120 std::unique_ptr<IOpaqueAddress>& ioa)
override;
126 const std::string& dbKey,
128 const std::string& tag )
override;
132 const EventContext& ctx)
override;
142 virtual void handle(
const Incident& incident )
override;
148 virtual std::vector<std::string>
getKeyList()
override;
161 bool dropObject(
const std::string& key,
const bool resetCache=
false)
override;
174 Gaudi::Property<std::string>
m_par_defaultConnection{
this,
"dbConnection",
"sqlite://;schema=cooldummy.db;dbname=OFLP200",
"default DB connection string"};
176 Gaudi::Property<std::string>
m_par_globalTag{
this,
"GlobalTag",
"",
"Global database tag"};
178 Gaudi::Property<std::string>
m_par_dbinst{
this,
"DBInstance",
"",
"Database instance (like OFLP200)"};
180 Gaudi::Property<std::vector<std::string> >
m_par_folders{
this,
"Folders",{},
"List of database folders to preload",
"OrderedSet<std::string>"};
182 Gaudi::Property<std::vector<std::string> >
m_par_overrideTags{
this,
"overrideTags",{},
"List of xml-modifiers for folders like <prefix>/My/Folder</prefix><tag>MyFolderTag</tag>",
"OrderedSet<std::string>"};
184 Gaudi::Property<std::vector<std::string> >
m_par_foldersToWrite{
this,
"FoldersToMetaData",{},
"list of folders to write to file meta data",
"OrderedSet<std::string>"};
196 IntegerProperty
m_par_maxNumPoolFiles{
this,
"MaxPoolFilesOpen",5,
"max number of pool files open allowed (0 means no limit)"};
198 FloatProperty
m_par_timeStampSlop{
this,
"TimeStampSlop",0.0,
"backdata timestamp IOVs by this many seconds"};
200 IntegerProperty
m_par_cacheRun{
this,
"CacheRun",0,
"force larger numbers of runs to be cached"};
202 IntegerProperty
m_par_cacheTime{
this,
"CacheTime",0,
"force larger timeranges to be cached (seconds)"};
205 UnsignedIntegerProperty
m_par_cacheAlign{
this,
"CacheAlign",0,
"cache alignment - divide cache into N slices and align queries on slice"};
207 BooleanProperty
m_par_onlineMode{
this,
"OnlineMode",
false,
"online mode flag to ignore missing channels outside cache range"};
209 BooleanProperty
m_par_checklock{
this,
"CheckLock",
false,
"check to ensure global/HVS tags are locked (for production)"};
211 StringProperty
m_par_source{
this,
"Source",
"COOL_DATABASE",
"source of data as a string (default COOL_DATABASE)"};
213 StringProperty
m_par_crestServer{
this,
"crestServer",
"https://crest.cern.ch",
"CREST URL with the port number as a string (default https://crest.cern.ch)"};
217 StringProperty
m_par_format{
this,
"Format",{},
"Format of data; default is empty string (default for a given source)"};
219 BooleanProperty
m_outputToFile{
this,
"OutputToFile",
false,
"output to file for debugging purposes"};
220 BooleanProperty
m_crestCoolToFile{
this,
"CrestCoolToFile",
false,
"output to file crest or cool data in the same format for debugging purposes"};
230 PublicToolHandle<IIOVDbMetaDataTool>
m_h_metaDataTool{
this,
"IOVDbMetaDataTool",
"IOVDbMetaDataTool"};
269 typedef std::map<std::string, std::unique_ptr<IOVDbFolder>>
FolderMap;
uint32_t CLID
The Class ID type.
Abstract interface to IOVDbSvc to access IOVRange and tag information.
Basic time unit for IOVSvc.
This file contains the class definition for the IPoolSvc interface class.
This class is a collection of AttributeLists where each one is associated with a channel number.
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
std::list< SG::TransientAddress * > tadList
tadList::iterator tadListIterator
Athena service for Interval Of Validity database.
virtual StatusCode finalize() override
Service finalize.
StringProperty m_par_format
BooleanProperty m_par_managePoolConnections
StatusCode loadCaches(IOVDbConn *conn, const IOVTime *time=nullptr)
PublicToolHandle< IIOVDbMetaDataTool > m_h_metaDataTool
ServiceHandle< StoreGateSvc > m_h_sgSvc
Gaudi::Property< std::vector< std::string > > m_par_overrideTags
virtual void handle(const Incident &incident) override
Incident service handle for EndEvent.
Gaudi::Property< std::vector< std::string > > m_par_folders
virtual cool::IDatabasePtr getDatabase(bool readOnly) override
Access to COOL database for a given folder.
BooleanProperty m_crestCoolToFile
virtual bool dropObject(const std::string &key, const bool resetCache=false) override
IAddressProvider::tadList tadList
BooleanProperty m_outputToFile
BooleanProperty m_par_checklock
IntegerProperty m_par_forceLumiblockNumber
BooleanProperty m_par_manageConnections
virtual StatusCode preLoadAddresses(StoreID::type storeID, tadList &list) override
Get all addresses that the provider wants to preload in SG maps.
StatusCode io_finalize() override final
ServiceHandle< IAddressCreator > m_h_persSvc
std::map< std::string, std::string > m_cresttagmap
StatusCode checkConfigConsistency() const
IntegerProperty m_par_maxNumPoolFiles
UnsignedIntegerProperty m_par_cacheAlign
StatusCode io_reinit() override final
IntegerProperty m_par_forceTimestamp
virtual StatusCode setRange(const CLID &clid, const std::string &dbKey, const IOVRange &range, const std::string &tag) override
Set range for a particular data object.
IntegerProperty m_par_cacheRun
IAddressProvider::tadListIterator tadListIterator
virtual StatusCode initialize() override
Service init.
StatusCode checkEventSel()
virtual void postConditionsLoad() override
May be called once conditions are loaded to let IOVDbSvc release resources.
BooleanProperty m_par_onlineMode
ServiceHandle< StoreGateSvc > m_h_metaDataStore
ServiceHandle< IClassIDSvc > m_h_clidSvc
ServiceHandle< ITagInfoMgr > m_h_tagInfoMgr
Gaudi::Property< std::string > m_par_dbinst
virtual StatusCode signalBeginRun(const IOVTime &beginRunTime, const EventContext &ctx) override
Set time for begin run.
ServiceHandle< IPoolSvc > m_h_poolSvc
bool m_poolPayloadRequested
StatusCode setupFolders()
ServiceHandle< StoreGateSvc > m_h_detStore
virtual bool getKeyInfo(const std::string &key, IIOVDbSvc::KeyInfo &info) override
Return information about SG key return false if this key is not known to IOVDbSvc.
Gaudi::Property< std::string > m_par_defaultConnection
virtual StatusCode loadAddresses(StoreID::type storeID, tadList &list) override
Get all new addresses from Provider for this Event.
virtual StatusCode updateAddress(StoreID::type storeID, SG::TransientAddress *tad, const EventContext &ctx) override
Update a transient Address.
virtual std::vector< std::string > getKeyList() override
virtual void signalEndProxyPreload() override
Signal that callback has been fired.
IntegerProperty m_par_cacheTime
Gaudi::Property< std::vector< std::string > > m_par_foldersToWrite
Gaudi::Property< std::string > m_par_globalTag
IntegerProperty m_par_forceRunNumber
StringProperty m_par_crestServer
virtual StatusCode processTagInfo() override
Process TagInfo.
StringProperty m_par_source
virtual StatusCode getRange(const CLID &clid, const std::string &dbKey, const IOVTime &time, IOVRange &range, std::string &tag, std::unique_ptr< IOpaqueAddress > &ioa) override
Get range for a particular data object identified by its clid and key and a requested IOVTime.
FloatProperty m_par_timeStampSlop
cool::ValidityKey m_iovslop
std::vector< std::unique_ptr< IOVDbConn > > m_connections
std::map< std::string, std::unique_ptr< IOVDbFolder > > FolderMap
ServiceHandle< IIOVSvc > m_h_IOVSvc
Basic time unit for IOVSvc.
The Athena Transient Store API.
Filled by IIOVDbSvc::getKeyInfo.