This tutorial shows the potential of the VecOps approach for treating collections stored in datasets, a situation very common in HEP data analysis.
{
auto vGen = [&](int len) {
std::transform(
v.begin(),
v.end(),
v.begin(), unifGen);
};
.Define("x", vGen, {"len"})
.Define("y", vGen, {"len"});
auto d1 = d0.Define("r", "sqrt(x*x + y*y)");
auto ring_h = d1.Define("rInFig", "r > .4 && r < .8 && x*y < 0")
.Define("yFig", "y[rInFig]")
.Define("xFig", "x[rInFig]")
.Histo2D({"fig", "Two quarters of a ring", 64, -1, 1, 64, -1, 1}, "xFig", "yFig");
ring_h->DrawCopy("Colz");
return 0;
}
R__EXTERN TRandom * gRandom
ROOT's RDataFrame offers a high level interface for analyses of data stored in TTrees,...
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
- Date
- February 2018
- Author
- Danilo Piparo
Definition in file df016_vecOps.C.