Skip to content

Commit 9f2938b

Browse files
authored
Fix code snippets and enhance metadata retrieval documentation
Updated code snippets in README for header retrieval and added optional parameter documentation details.
1 parent 0c957a9 commit 9f2938b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

CCDB/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ auto deadpixelsback = api.retrieveFromTFileAny<o2::FOO::DeadPixelMap>("FOO/DeadP
4242
std::map<std::string, std::string> headers;
4343
auto deadpixelsback = api.retrieveFromTFileAny<o2::FOO::DeadPixelMap>("FOO/DeadPixels", metadata /* constraint the objects retrieved to those matching the metadata */, -1 /* timestamp */, &headers /* the headers attached to the returned object */);
4444
// finally, use this method to retrieve only the headers (and thus the metadata)
45-
std::map<std::string, std::string> headers = f.api.retrieveHeaders("FOO/DeadPixels", f.metadata);
45+
std::map<std::string, std::string> headers = api.retrieveHeaders("FOO/DeadPixels", metadata);
4646
```
4747

4848
* creating a local snapshot and fetching objects therefrom
@@ -111,6 +111,12 @@ This feature is useful to avoid using newer objects if the CCDB is updated in pa
111111

112112
In cached mode, the manager can check that local objects are still valid by requiring `mgr.setLocalObjectValidityChecking(true)`, in this case a CCDB query is performed only if the cached object is no longer valid.
113113

114+
If you want the headers/metadata for the object retrieved from the CCDB there is an optional paramater to `BasicCCDBManager::getForTimeStamp`. These headers are also cached (when caching is enabled) and is updated when a CCDB query is sent.
115+
```c++
116+
std::map<std::string,std::string> headers;
117+
mgr.getForTimeStamp(path, timstamp, metadata, &headers);
118+
```
119+
114120
## Future ideas / todo:
115121

116122
- [ ] offer improved error handling / exceptions

0 commit comments

Comments
 (0)