19auto filename =
gROOT->GetTutorialDir() +
"/dataframe/df017_vecOpsHEP.root";
20auto treename =
"myDataset";
33 TH1F h(
"pt",
"pt", 16, 0, 4);
36 for (
auto i=0U;i < px.GetSize(); ++i) {
37 if (E[i] > 100)
h.Fill(
sqrt(px[i]*px[i] + py[i]*py[i]));
48 for (
auto i=0U;i < px.
size(); ++i) {
55 f.Define(
"pt", CalcPt, {
"px",
"py",
"E"})
56 .Histo1D<RVecD>({
"pt",
"pt", 16, 0, 4},
"pt")->DrawCopy();
59void WithRDataFrameVecOps()
63 auto pt =
sqrt(px*px + py*py);
66 f.Define(
"good_pt", CalcPt, {
"px",
"py",
"E"})
67 .Histo1D<RVecD>({
"pt",
"pt", 16, 0, 4},
"good_pt")->DrawCopy();
70void WithRDataFrameVecOpsJit()
73 f.Define(
"good_pt",
"sqrt(px*px + py*py)[E>100]")
74 .Histo1D({
"pt",
"pt", 16, 0, 4},
"good_pt")->DrawCopy();
88 WithRDataFrameVecOps();
90 WithRDataFrameVecOpsJit();
reference emplace_back(ArgTypes &&...Args)
ROOT's RDataFrame offers a high level interface for analyses of data stored in TTree,...
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
1-D histogram with a float per channel (see TH1 documentation)}
An interface for reading collections stored in ROOT columnar datasets.
A simple, robust and fast interface to read values from ROOT columnar datasets such as TTree,...
VecExpr< UnaryOp< Sqrt< T >, VecExpr< A, T, D >, T >, T, D > sqrt(const VecExpr< A, T, D > &rhs)
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
constexpr Double_t E()
Base of natural log: