Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
master
-
None
-
None
-
any
Description
Thanks to Wolf Behrenhoff for reporting the problem.
Reproducer:
#include <ROOT/TDataFrame.hxx>
|
#include <TBrowser.h>
|
#include <TCanvas.h>
|
#include <TTree.h>
|
#include <iostream>
|
#include <random>
|
|
using namespace std; |
|
struct BrVal { |
Float_t a;
|
Int_t i;
|
};
|
|
int main() { |
auto t = new TTree("t", "t"); |
BrVal val;
|
t->Branch("b", &val, "a/F:i/I"); |
mt19937 rng;
|
normal_distribution<Float_t> nd1(0, 1);
|
uniform_int_distribution<Int_t> ud(-10, 10);
|
for (size_t n = 1000; n; --n) { |
val.a = nd1(rng);
|
val.i = ud(rng);
|
t->Fill();
|
}
|
|
using TDF = ROOT::Experimental::TDataFrame; |
try { |
TDF df(*t);
|
|
df.Histo1D("b.a")->Draw(); |
|
auto h = df.Define("aa", [](Float_t bv) { return bv; }, {"b.a"}).Histo1D("aa"); |
h->GetEntries();
|
|
} catch (std::runtime_error &e) { |
cout << e.what() << '\n'; |
}
|
return 0; |
}
|