Use the Stats action to extract the statistics of a column.
Extract the statistics relative to RDataFrame columns and store them in TStatistic instances.
auto rr =
r.Define(
"v", [](
ULong64_t e){
return e;}, {
"rdfentry_"})
.Define(
"w", [](
ULong64_t e){
return 1./(
e+1);}, {
"v"});
auto stats_ew = rr.Stats<
ULong64_t,
double>(
"v",
"w");
auto stats_iu = rr.Stats("v");
auto stats_iw = rr.Stats("v", "w");
stats_eu->Print();
stats_ew->Print();
stats_iu->Print();
stats_iw->Print();
}
unsigned long long ULong64_t
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
ROOT's RDataFrame offers a modern, high-level interface for analysis of data stored in TTree ,...
OBJ: TStatistic Mean = 127.5 +- 4.628 RMS = 74.045 Count = 256 Min = 0 Max = 255
OBJ: TStatistic Mean = 40.8 +- 12.86 RMS = 60.318 Count = 256 Min = 0 Max = 255
OBJ: TStatistic Mean = 127.5 +- 4.628 RMS = 74.045 Count = 256 Min = 0 Max = 255
OBJ: TStatistic Mean = 40.8 +- 12.86 RMS = 60.318 Count = 256 Min = 0 Max = 255
- Date
- April 2019
- Author
- Danilo Piparo (CERN)
Definition in file df031_Stats.C.