Logo ROOT   6.14/05
Reference Guide
df008_createDataSetFromScratch.C
Go to the documentation of this file.
1 /// \file
2 /// \ingroup tutorial_dataframe
3 /// \notebook -nodraw
4 /// This tutorial shows how to create a dataset from scratch with RDataFrame
5 /// \macro_code
6 ///
7 /// \date June 2017
8 /// \author Danilo Piparo
9 
11 {
12  // We create an empty data frame of 100 entries
13  ROOT::RDataFrame tdf(100);
14 
15  // We now fill it with random numbers
16  gRandom->SetSeed(1);
17  auto tdf_1 = tdf.Define("rnd", []() { return gRandom->Gaus(); });
18 
19  // And we write out the dataset on disk
20  tdf_1.Snapshot("randomNumbers", "df008_createDataSetFromScratch.root");
21 }
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...
Definition: TRandom.cxx:256
virtual void SetSeed(ULong_t seed=0)
Set the random generator seed.
Definition: TRandom.cxx:589
R__EXTERN TRandom * gRandom
Definition: TRandom.h:62
ROOT's RDataFrame offers a high level interface for analyses of data stored in TTrees, CSV's and other data formats.
Definition: RDataFrame.hxx:42