20 auto vGen = [&](
int len) {
22 std::transform(
v.begin(),
v.end(),
v.begin(), unifGen);
26 auto d0 =
d.Define(
"len", []() {
return (
int)
gRandom->
Uniform(0, 16); })
27 .Define(
"x", vGen, {
"len"})
28 .Define(
"y", vGen, {
"len"});
34 auto d1 = d0.Define(
"r",
"sqrt(x*x + y*y)");
39 auto ring_h = d1.Define(
"rInFig",
"r > .4 && r < .8 && x*y < 0")
40 .Define(
"yFig",
"y[rInFig]")
41 .Define(
"xFig",
"x[rInFig]")
42 .Histo2D({
"fig",
"Two quarters of a ring", 64, -1, 1, 64, -1, 1},
"xFig",
"yFig");
46 cring.
Print(
"df016_vecOps.png");
A "std::vector"-like collection of values implementing handy operation to analyse them...
R__EXTERN TRandom * gRandom
virtual void Print(const char *filename="") const
Save Pad contents in a file in one of various formats.
ROOT's RDataFrame offers a high level interface for analyses of data stored in TTrees, CSV's and other data formats.
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
virtual void Draw(Option_t *option="")
Draw a canvas.