The Gaudi Framework  master (45d96d4f)
Loading...
Searching...
No Matches
Gaudi::details Namespace Reference

Helper for type agnostic reading of data in branches. More...

Classes

class  LegacyAlgorithmAdapter
struct  overloaded_t
struct  container
 helper structure to get container type More...
class  BranchReadHelper
struct  BranchWrapper
 Encapsulates a branch within a ROOT TTree, managing the data and interaction with the TTree. More...

Functions

template<typename... lambda_ts>
 overloaded_t (lambda_ts...) -> overloaded_t< lambda_ts... >
GAUDI_API void rangeException (const long index, const size_t size)
 Helpful function to throw an "out-of-range exception" for class Range_.

Detailed Description

Helper for type agnostic reading of data in branches.

Use like this:

auto f = TFile::Open("file.root");
auto t = f->Get<TTree>("tree");
BranchReadHelper b(t->GetBranch("branch"));
for (int i = 0; i < t->GetEntries(); ++i) {
t->GetEntry(i);
std::unique_ptr<DataObject> obj = b.adoptValue();
...
}

Function Documentation

◆ overloaded_t()

template<typename... lambda_ts>
Gaudi::details::overloaded_t ( lambda_ts... ) -> overloaded_t< lambda_ts... >

◆ rangeException()

void Gaudi::details::rangeException ( const long index,
const size_t size )

Helpful function to throw an "out-of-range exception" for class Range_.

See also
GaudiException
Parameters
indexinvalid index
sizerange size

Definition at line 30 of file Range.cpp.

30 {
31 throw GaudiException( "Out-of-Range for class Gaudi::Range_", "RangeError", StatusCode::FAILURE );
32}
Define general base for Gaudi exception.
constexpr static const auto FAILURE
Definition StatusCode.h:100