22void read_tree_from_rfile(
const char *fileName)
29 auto tree = file->Get<
TTree>(
"tree");
32 tree->SetBranchAddress(
"intBranch", &intVal);
34 for (
auto i = 0; i < tree->GetEntries(); ++i) {
36 std::cout <<
"value[" << i <<
"] = " << intVal <<
"\n";
42 const char *
const fileName =
"rfile_ttree.root";
47 read_tree_from_rfile(fileName);
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
R__EXTERN TSystem * gSystem
static std::unique_ptr< RFile > Open(std::string_view path, const ROpenOptions &opts=ROpenOptions())
Opens the file for reading.
RResultPtr< RInterface< RLoopManager > > Snapshot(std::string_view treename, std::string_view filename, const ColumnNames_t &columnList, const RSnapshotOptions &options=RSnapshotOptions())
RInterface< Proxied > Define(std::string_view name, F expression, const ColumnNames_t &columns={})
Define a new column.
ROOT's RDataFrame offers a modern, high-level interface for analysis of data stored in TTree ,...
virtual int Unlink(const char *name)
Unlink, i.e.
A TTree represents a columnar dataset.