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");
cring.
Print(
"df016_vecOps.png");
return 0;
}
- Date
- February 2018
- Author
- Danilo Piparo
Definition in file df016_vecOps.C.