Logo ROOT   6.12/06
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Namespaces
tdf010_trivialDataSource.py File Reference

Namespaces

 tdf010_trivialDataSource
 

Detailed Description

This tutorial illustrates how use the TDataFrame in combination with a TDataSource.

In this case we use a TTrivialDS, which is nothing more than a simple generator: it does not interface to any existing dataset. The TTrivialDS has a single column, col0, which has value n for entry n.

1 
2 import ROOT
3 
4 # Create the data frame
5 MakeTrivialDataFrame = ROOT.ROOT.Experimental.TDF.MakeTrivialDataFrame
6 
7 nEvents = 128
8 
9 d_s = MakeTrivialDataFrame(nEvents)
10 
11 # Now we have a regular TDataFrame: the ingestion of data is delegated to
12 # the TDataSource. At this point everything works as before.
13 h_s = d_s.Define("x", "1./(1. + col0)").Histo1D(("h_s", "h_s", 128, 0, .6), "x")
14 
15 c = ROOT.TCanvas()
16 c.SetLogy()
17 h_s.Draw()
18 
Date
September 2017
Author
Danilo Piparo

Definition in file tdf010_trivialDataSource.py.