Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
readTreeDF.cxx
Go to the documentation of this file.
1// Author: Alvaro Tolosa-Delgado CERN 07/2023
2// Author: Jorge Agramunt Ros IFIC(Valencia,Spain) 07/2023
3
4/*************************************************************************
5 * Copyright (C) 1995-2023, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12/* Example of reading a TTree using the RDataFrame interface
13 * Documentation of RDataFrame: https://root.cern/doc/master/classROOT_1_1RDataFrame.html
14 */
15
16#include <ROOT/RDataFrame.hxx>
17
18#include "data2Tree.hxx"
19
21{
22
23 ROOT::RDataFrame df{"myTree", "testFile.root"};
24 df.Display({"branch1.time", "branch1.energy", "branch2.time", "branch2.energy"}, /*nRows*/ 10)->Print();
25}
void Print(GNN_Data &d, std::string txt="")
RResultPtr< RDisplay > Display(const ColumnNames_t &columnList, size_t nRows=5, size_t nMaxCollectionElements=10)
Provides a representation of the columns in the dataset.
ROOT's RDataFrame offers a modern, high-level interface for analysis of data stored in TTree ,...
void readTreeDF()