Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CCDB/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

There are currently 2 different kinds of store/retrieve functions, which we expect to unify in the immediate future:
2. `storeAsTFile/retrieveFromTFile` API serializing a `TObject` in a ROOT `TFile`.
3. A strongly-typed `storeAsTFileAny<T>/retrieveFromTFileAny<T>` API allowing to handle any type T

Check failure on line 16 in CCDB/README.md

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Trailing spaces

Remove the trailing spaces at the end of the line.
having a ROOT dictionary. We encourage to use this API by default.

## Central and local instances of the CCDB
Expand All @@ -31,18 +31,18 @@
```c++
// init
CcdbApi api;
map<string, string> metadata; // can be empty
std::map<std::string, std::string> metadata; // can be empty
api.init("http://ccdb-test.cern.ch:8080"); // or http://localhost:8080 for a local installation
// store abitrary user object in strongly typed manner
auto deadpixels = new o2::FOO::DeadPixelMap();
api.storeAsTFileAny(deadpixels, "FOO/DeadPixels", metadata);
// read like this (you have to specify the type)
auto deadpixelsback = api.retrieveFromTFileAny<o2::FOO::DeadPixelMap>("FOO/DeadPixels", metadata);

Check failure on line 40 in CCDB/README.md

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Trailing spaces

Remove the trailing spaces at the end of the line.
// read like this to get the headers as well, and thus the metadata attached to the object

Check failure on line 41 in CCDB/README.md

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Trailing spaces

Remove the trailing spaces at the end of the line.
map<string, string> headers;
std::map<std::string, std::string> headers;
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 */);

Check failure on line 43 in CCDB/README.md

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Trailing spaces

Remove the trailing spaces at the end of the line.
// finally, use this method to retrieve only the headers (and thus the metadata)
std::map<std::string, std::string> headers = f.api.retrieveHeaders("FOO/DeadPixels", f.metadata);

Check failure on line 45 in CCDB/README.md

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Trailing spaces

Remove the trailing spaces at the end of the line.
```

* creating a local snapshot and fetching objects therefrom
Expand All @@ -50,7 +50,7 @@
```c++
// init
CcdbApi api;
map<string, string> metadata; // can be empty
std::map<std::string, std::string> metadata; // can be empty
api.init("http://ccdb-test.cern.ch:8080"); // or http://localhost:8080 for a local installation
// create a local snapshot of everthing in or below the FOO folder valid for timestamp 12345
api.snapshot("FOO", "/tmp/CCDBSnapshot/", 12345);
Expand Down Expand Up @@ -85,7 +85,7 @@
The class was written for the use-case of transport MC simulation. Typical usage should be like

```c++
// setup manager once (at start of processing)

Check failure on line 88 in CCDB/README.md

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Trailing spaces

Remove the trailing spaces at the end of the line.
auto& mgr = o2::ccdb::BasicCCDBManager::instance();
mgr.setURL("http://ourccdbserverver.cern.ch");
mgr.setTimestamp(timestamp_which_we_want_to_anchor_to);
Expand Down Expand Up @@ -129,22 +129,22 @@
and facilitate the following tasks:

1. Upload and annotate a generic C++ object serialized in a ROOT file

Check failure on line 132 in CCDB/README.md

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Trailing spaces

Remove the trailing spaces at the end of the line.
```bash
o2-ccdb-upload -f myRootFile.root --key histogram1 --path /Detector1/QA/ --meta "Description=Foo;Author=Person1;Uploader=Person2"
```
This will upload the object serialized in `myRootFile.root` under the key `histogram1`. Object will be put to the CCDB path `/Detector1/QA`.
For full list of options see `o2-ccdb-upload --help`.

Check failure on line 138 in CCDB/README.md

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Trailing spaces

Remove the trailing spaces at the end of the line.
2. Download a CCDB object to a local ROOT file (including its meta information)

Check failure on line 140 in CCDB/README.md

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Trailing spaces

Remove the trailing spaces at the end of the line.
```bash
o2-ccdb-downloadccdbfile --path /Detector1/QA/ --dest /tmp/CCDB --timestamp xxx
```
This will download the CCDB object under path given by `--path` to a directory given by `--dest` on the disc.
(The final filename will be `/tmp/CCDB/Detector1/QA/snapshot.root` for the moment).
All meta-information as well as the information associated to this query will be appended to the file.

Check failure on line 147 in CCDB/README.md

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Trailing spaces

Remove the trailing spaces at the end of the line.
For full list of options see `o2-ccdb-downloadccdbfile --help`.

3. Inspect the content of a ROOT file and print summary about type of contained (CCDB) objects and its meta information
Expand Down