21#include "TParameter.h"
30 std::cerr <<
"CMVFileHandle: failed to open: " <<
path <<
"\n";
33 file->GetObject(
"ccdb_object",
tree);
35 std::cerr <<
"CMVFileHandle: TTree 'ccdb_object' not found in: " <<
path <<
"\n";
41 if (
auto* ui =
tree->GetUserInfo()) {
42 if (
auto* p =
dynamic_cast<TParameter<long>*
>(ui->FindObject(
"firstTF"))) {
45 if (
auto* p =
dynamic_cast<TParameter<long>*
>(ui->FindObject(
"lastTF"))) {
51 const bool isRaw = (
tree->GetBranch(
"CMVPerTF") !=
nullptr);
53 std::cerr <<
"CMVFileHandle: no recognised branch (CMVPerTFCompressed / CMVPerTF) in: "
63 tree->SetBranchAddress(
"CMVPerTF", &
tfRaw);
70 tree->GetEntry(iEntry);
84 tree->ResetBranchAddresses();
Structs for storing CMVs to the CCDB.
Helper utilities for reading CMV ROOT files.
GLsizei const GLchar *const * path
Global TPC definitions and constants.
CMVPerTFCompressed * tfCompressed
long firstTFInTree
first global TF index from tree UserInfo ("firstTF"); -1 if absent
const CMVPerTF * getEntry(long long iEntry)
Load entry iEntry and return a pointer to the decoded CMVPerTF, or nullptr on error.
long lastTFInTree
last global TF index from tree UserInfo ("lastTF"); -1 if absent
bool open(const std::string &path)
Open path and set up branch addresses. Returns false on any error.
CMVPerTF * tfDecoded
scratch buffer used when decompressing
void close()
Release all resources.
void decompress(CMVPerTF *cmv) const
Restore a CMVPerTF from this compressed object into *cmv (must not be null)