Process collections in RDataFrame with the help of RVec.
This tutorial shows the potential of the VecOps approach for treating collections stored in datasets, a situation very common in HEP data analysis.
import ROOT
coordDefineCode = '''ROOT::RVecD {0}(len);
std::transform({0}.begin(), {0}.end(), {0}.begin(), [](double){{return gRandom->Uniform(-1.0, 1.0);}});
return {0};'''
d =
df.Define(
"len",
"gRandom->Uniform(0, 16)")\
ring_h =
d1.Define(
"rInFig",
"r > .5 && r < 1 && x*y < 0")\
.Define("yFig", "y[rInFig]")\
.Define("xFig", "x[rInFig]")\
.Histo2D(("fig", "Two quarters of a ring", 64, -1.1, 1.1, 64, -1.1, 1.1), "xFig", "yFig")
print("Saved figure to df016_ring.png")
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
ROOT's RDataFrame offers a modern, high-level interface for analysis of data stored in TTree ,...
- Date
- February 2018
- Author
- Danilo Piparo (CERN)
Definition in file df016_vecOps.py.