32 auto fileName =
"df001_introduction.root";
52 auto cutb1 = [](
double b1) {
return b1 < 5.; };
53 auto cutb1b2 = [](
int b2,
double b1) {
return b2 % 2 && b1 < 4.; };
63 std::cout << *
entries1 <<
" entries passed all filters" << std::endl;
68 auto entries2 =
d.Filter(
"b1 < 5.").Count();
69 std::cout << *
entries2 <<
" entries passed the string filter" << std::endl;
79 std::cout <<
"The mean is always included between the min and the max: " << *minVal <<
" <= " << *
meanVal
80 <<
" <= " << *maxVal << std::endl;
90 std::cout <<
"Selected b1 entries" << std::endl;
93 std::cout << std::endl;
95 std::cout <<
"The type of b1Vec is " <<
b1VecCl->GetName() << std::endl;
102 auto hist =
d.Filter(
cutb1).Histo1D();
103 std::cout <<
"Filled h " << hist->GetEntries() <<
" times, mean: " << hist->GetMean() << std::endl;
109 TH1F h(
"h",
"h", 12, -1, 11);
110 d.Filter([](
int b2) {
return b2 % 2 == 0; }, {
"b2"}).Foreach([&
h](
double b1) {
h.Fill(b1); });
112 std::cout <<
"Filled h with " <<
h.GetEntries() <<
" entries" << std::endl;
146 auto entries_sum =
d.Define(
"sum", [](
double b1,
int b2) {
return b2 + b1; }, {
"b1",
"b2"})
154 auto entries_sum2 =
d.Define(
"sum2",
"b1 + b2").Filter(
"sum2 > 4.2").Count();
163 std::cout <<
"Entry: " <<
iEntry <<
" Slot: " <<
slot << std::endl;
unsigned long long ULong64_t
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
ROOT's RDataFrame offers a modern, high-level interface for analysis of data stored in TTree ,...
1-D histogram with a float per channel (see TH1 documentation)
RVec< T > Filter(const RVec< T > &v, F &&f)
Create a new collection with the elements passing the filter expressed by the predicate.
static uint64_t sum(uint64_t i)