Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Loading...
Searching...
No Matches

Detailed Description

View in nbviewer Open in SWAN
Simple RDataFrame example in C++.

This tutorial shows a minimal example of RDataFrame. It starts without input data, generates a new column x with random numbers, and finally draws a histogram for x.

void df000_simple()
{
// Create a data frame with 100 rows
// Define a new column `x` that contains random numbers
auto rdf_x = rdf.Define("x", [](){ return gRandom->Rndm(); });
// Create a histogram from `x`
auto h = rdf_x.Histo1D("x");
// At the end of this function, the histogram pointed to by `h` will be deleted.
// Draw a copy of the histogram object instead:
h->DrawClone();
}
#define h(i)
Definition RSha256.hxx:106
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
R__EXTERN TRandom * gRandom
Definition TRandom.h:62
ROOT's RDataFrame offers a modern, high-level interface for analysis of data stored in TTree ,...
Double_t Rndm() override
Machine independent random number generator.
Definition TRandom.cxx:559
Date
September 2021
Author
Enric Tejedor (CERN)

Definition in file df000_simple.C.