ATLAS Offline Software
Loading...
Searching...
No Matches
IOVDbConditionsSource.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5// IOVDbConditionsSource.h
6// Backend-neutral abstract interface through which IOVDbSvc drives one
7// conditions folder, implemented by IOVDbFolder (COOL) and IOVDbCrestTag (CREST/CHAI)
8
9#ifndef IOVDBSVC_IOVDBCONDITIONSSOURCE_H
10#define IOVDBSVC_IOVDBCONDITIONSSOURCE_H
11
12#include <memory>
13#include <string>
14
15#include "GaudiKernel/ClassID.h"
16#include "GaudiKernel/ServiceHandle.h"
17
21
22#include "CoolKernel/IDatabase.h"
23#include "CoolKernel/ValidityKey.h"
25
26#include "FolderTypes.h"
27
28class IOVDbConn;
29class IOpaqueAddress;
30class IAddressCreator;
31class ITagInfoMgr;
32
34public:
35 // Backend a folder reads its conditions from.
36 enum class source_t {
39 };
40
41 virtual ~IOVDbConditionsSource() = default;
42 // Fill in object details from cache
43 // Set poolPayloadRequested flag if a POOL file was referenced
44 virtual bool getAddress(const cool::ValidityKey reftime,IAddressCreator* persSvc,
45 const unsigned int poolSvcContext,
46 std::unique_ptr<IOpaqueAddress>& address,
47 IOVRange& range,bool& poolPayloadRequested) = 0;
48
49 // Preload address to Storegate (does folder initialization from the backend)
50 virtual std::unique_ptr<SG::TransientAddress>
51 preload(ITagInfoMgr *tagInfoMgr,
52 const unsigned int cacheRun,
53 const unsigned int cacheTime) = 0;
54 // Print out cache
55 virtual void printState() = 0;
56 // Reset cache to empty
57 virtual void reset() = 0;
58 // Make summary of usage
59 virtual void summary() =0;
60
61 // Access methods to various internal information
62 const std::string& folderName() const {return m_foldername;};
63 virtual const std::string& key() const =0;
64 virtual IOVDbConn* conn() = 0;
65 virtual bool multiVersion() const = 0;
66 virtual bool timeStamp() const = 0;
67 virtual bool tagOverride() const = 0;
68 virtual bool retrieved() const = 0;
69 virtual bool noOverride() const = 0;
71 virtual bool readMeta() const = 0;
72 virtual bool writeMeta() const = 0;
73 // Read from meta data only, otherwise ignore folder
74 virtual bool fromMetaDataOnly() const = 0;
75 // If true, then the end time for an open-ended range will be set to just past
76 // the current event. The end time will be automatically updated on
77 // accesses in subsequent events.
78 virtual bool extensible() const = 0;
79 virtual bool dropped() const = 0;
80 virtual bool iovOverridden() const = 0;
81 // Tag from job options, if any. Used for TagInfo output
82 virtual const std::string& joTag() const = 0;
83 virtual const std::string& resolvedTag() const = 0;
84 virtual const std::string& eventStore() const = 0;
85 virtual const source_t& source() const = 0;
86 virtual CLID clid() const = 0;
87 virtual unsigned long long bytesRead() const = 0;
88 virtual float readTime() const = 0;
89 virtual const IOVRange& currentRange() const = 0;
90 // Mark this folder as using metadata from an input file
91 virtual void useFileMetaData() = 0;
92 // Set folder description
93 virtual void setFolderDescription(const std::string& description) = 0;
94 // Set tag override, set override flag as well if setFlag is true
95 // Override flag prevents reading of FLMD for this folder if present
96 virtual void setTagOverride(const std::string& tag,const bool setFlag) = 0;
97 // Set writeMeta flag
98 virtual void setWriteMeta() = 0;
99 // Set IOV overrides
100 virtual void setIOVOverride(const unsigned int run,const unsigned int lumiblock,
101 const unsigned int time) = 0;
102 // Mark object as dropped from Storegate
103 virtual void setDropped(const bool dropped) = 0;
104
105 // Get validityKey for folder, given current time, accounting for overrides
106 virtual cool::ValidityKey iovTime(const IOVTime& reftime) const = 0;
107
108 // Check cache is valid (resident) for current time
109 virtual bool isResident(const cool::ValidityKey reftime) const = 0;
110 // Load cache for given validitykey; job-level tuning constants
111 // (cache alignment, global tag, online mode) are fixed at construction
112 virtual bool loadAt(const cool::ValidityKey vkey) = 0;
113 // Reload cache in online mode if ValidityKey returns a new object
114 // with start > previously used start. COOL-only. The CREST implementation
115 // is a no-op that returns true.
116 virtual bool loadCacheIfDbChanged(const cool::ValidityKey vkey,
117 const cool::IDatabasePtr& dbPtr,
118 const ServiceHandle<IIOVSvc>& iovSvc) = 0;
119
120
121protected:
122
123 std::string m_foldername;
124 std::string m_key;
125
126};
127#endif
uint32_t CLID
The Class ID type.
Validity Range object.
Basic time unit for IOVSvc.
virtual const std::string & joTag() const =0
virtual void summary()=0
virtual const std::string & key() const =0
virtual IOVDbNamespace::FolderType folderType() const =0
virtual bool tagOverride() const =0
virtual bool fromMetaDataOnly() const =0
virtual unsigned long long bytesRead() const =0
virtual IOVDbConn * conn()=0
virtual void setDropped(const bool dropped)=0
virtual bool noOverride() const =0
virtual bool retrieved() const =0
virtual cool::ValidityKey iovTime(const IOVTime &reftime) const =0
virtual bool dropped() const =0
virtual bool timeStamp() const =0
virtual bool getAddress(const cool::ValidityKey reftime, IAddressCreator *persSvc, const unsigned int poolSvcContext, std::unique_ptr< IOpaqueAddress > &address, IOVRange &range, bool &poolPayloadRequested)=0
virtual const std::string & resolvedTag() const =0
virtual bool readMeta() const =0
virtual bool loadCacheIfDbChanged(const cool::ValidityKey vkey, const cool::IDatabasePtr &dbPtr, const ServiceHandle< IIOVSvc > &iovSvc)=0
virtual void setIOVOverride(const unsigned int run, const unsigned int lumiblock, const unsigned int time)=0
virtual std::unique_ptr< SG::TransientAddress > preload(ITagInfoMgr *tagInfoMgr, const unsigned int cacheRun, const unsigned int cacheTime)=0
virtual const std::string & eventStore() const =0
std::string m_foldername
Folder name, as it appears in COOL or as a CREST tag label.
virtual bool isResident(const cool::ValidityKey reftime) const =0
virtual bool extensible() const =0
virtual bool multiVersion() const =0
virtual const IOVRange & currentRange() const =0
virtual void setWriteMeta()=0
virtual void printState()=0
virtual CLID clid() const =0
virtual bool loadAt(const cool::ValidityKey vkey)=0
virtual void setTagOverride(const std::string &tag, const bool setFlag)=0
const std::string & folderName() const
virtual void reset()=0
virtual ~IOVDbConditionsSource()=default
std::string m_key
SG key where data is loaded (unique).
virtual bool writeMeta() const =0
virtual float readTime() const =0
virtual const source_t & source() const =0
virtual bool iovOverridden() const =0
virtual void useFileMetaData()=0
virtual void setFolderDescription(const std::string &description)=0
Validity Range object.
Definition IOVRange.h:30
Basic time unit for IOVSvc.
Definition IOVTime.h:34
This is a Athena service which manages detector description tag information.
Definition ITagInfoMgr.h:58
std::string description
glabal timer - how long have I taken so far?
Definition hcg.cxx:93
int run(int argc, char *argv[])