ROOT
Version v6.34
master
v6.32
v6.30
v6.28
v6.26
v6.24
v6.22
v6.20
v6.18
v6.16
v6.14
v6.12
v6.10
v6.08
v6.06
Reference Guide
►
ROOT
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
df000_simple.C
Go to the documentation of this file.
1
/// \file
2
/// \ingroup tutorial_dataframe
3
/// \notebook -draw
4
/// Simple RDataFrame example in C++.
5
///
6
/// This tutorial shows a minimal example of RDataFrame. It starts without input
7
/// data, generates a new column `x` with random numbers, and finally draws
8
/// a histogram for `x`.
9
///
10
/// \macro_code
11
/// \macro_output
12
///
13
/// \date September 2021
14
/// \author Enric Tejedor (CERN)
15
16
void
df000_simple
()
17
{
18
// Create a data frame with 100 rows
19
ROOT::RDataFrame
rdf
(100);
20
21
// Define a new column `x` that contains random numbers
22
auto
rdf_x
=
rdf
.Define(
"x"
, [](){
return
gRandom
->
Rndm
(); });
23
24
// Create a histogram from `x`
25
auto
h
=
rdf_x
.Histo1D(
"x"
);
26
27
// At the end of this function, the histogram pointed to by `h` will be deleted.
28
// Draw a copy of the histogram object instead:
29
h
->DrawClone();
30
}
h
#define h(i)
Definition
RSha256.hxx:106
TRangeDynCast
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Definition
TCollection.h:358
gRandom
R__EXTERN TRandom * gRandom
Definition
TRandom.h:62
ROOT::Detail::TRangeCast
Definition
TCollection.h:311
ROOT::RDataFrame
ROOT's RDataFrame offers a modern, high-level interface for analysis of data stored in TTree ,...
Definition
RDataFrame.hxx:41
TRandom::Rndm
Double_t Rndm() override
Machine independent random number generator.
Definition
TRandom.cxx:559
df000_simple
Definition
df000_simple.py:1
tutorials
dataframe
df000_simple.C
ROOT tags/6-34-04 - Reference Guide Generated on Wed Mar 26 2025 04:46:23 (GVA Time) using Doxygen 1.10.0