21 auto vGen = [&](
int len) {
23 std::transform(
v.begin(),
v.end(),
v.begin(), unifGen);
27 auto d0 =
d.Define(
"len", []() {
return (
int)
gRandom->
Uniform(0, 16); })
28 .Define(
"x", vGen, {
"len"})
29 .Define(
"y", vGen, {
"len"});
35 auto d1 = d0.Define(
"r",
"sqrt(x*x + y*y)");
40 auto ring_h = d1.Define(
"rInFig",
"r > .4 && r < .8 && x*y < 0")
41 .Define(
"yFig",
"y[rInFig]")
42 .Define(
"xFig",
"x[rInFig]")
43 .Histo2D({
"fig",
"Two quarters of a ring", 64, -1, 1, 64, -1, 1},
"xFig",
"yFig");
46 ring_h->DrawCopy(
"Colz");
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).