The BookStore is an Object which managed Histograms for later universal access.

See dependency diagram for further information. dependency diagram

Entry Types

Depending on the use case, the BookStore can provide your object in different ways.

Creating new objects

  1. Construct EntryData (blueprint) for the object to book
  2. Book object with book(absolute-path, name, entry-data)

examples

    EntryData entry-data = EntryData<Hist1F>("title", {"axis title", bins, min, max});
    auto entry = store.book("/path/to/object/", "name", entry-data.single());
    auto entry = store.book("/path/", "name", EntryData<Hist1F>(axis).multiCopy(4));
    auto entry = store.book("/path/", "name", EntryData<Hist2F>(axis1, axis2).single());

Writing to an object

creating a handle

entry.handle() will produce a new handle.
For EntryMultiCopy you need to pass the id of the instance you want to access entry.handle(id).

example Hist1F

    // single
    Handle<Hist1F> entrySingle.handle();

    // multi copy
    Handle<Hist1F> entryMultiCopy.handle(0);

    //multi shared
    Handle<Hist1F> entryMultiShared.handle();

use the object specific modification functions.

example Hist1F

    handle.fill({1}, 1);

    std::vector<typename Hist1F::Point_t> points = {…};
    std::vector<typename Hist1F::Weight_t> weights = {…};
    handle.fillN(points, weights);

reading final version of object

entry.merged() returns a const reference to the final object.

example Hist1F

    const Hist1F& hist = entry.merged();
    // now you can read the histogram normally
    std::cout << hist.GetBinContent({0}) << '\n';

Access created objects

selection

Set of entries which full fill a condition. Can created from a BookStore or an other Selection.

features * iterate able
* manually removing from elements * access entries

Condition

A Condition for filtering entries. Constructed with ConditionBuilder.

attributes to filter

example

    Condition condition = ConditionBuilder()
        .setName("name") // perfect match to name required
        .setPath(std::regex("^p[^/]*h")); // path must match regex

example get a handle from every Hist1F in /path/to/dir

    Selection selection = store.find(
        ConditionBuilder().setPath("/path/to/dir/")
    );

    try {
        for(const entry& : selection) {
            handles<Hist1F>.push_back(entry.handle<Hist1F>());
        }
    } catch (const marlin::BookStoreException&){}