RDataFrame
crashes when making a histogram if it has a friend and multithreading is enabled before declaring the RDataFrame
.
Reproduce:
import ROOT
f = ROOT.TFile.Open('f.root')
t = f.Get('tree')
t.AddFriend('otree', 'ff.root')
ROOT.ROOT.EnableImplicitMT()
df = ROOT.RDataFrame(t)
h = df.Histo1D('branch_in_t')
h.Sumw2()
result:
*** Break *** segmentation violation
...
---------------------------------------------------------------------------
SystemError Traceback (most recent call last)
<ipython-input-6-6684c9e62ba9> in <module>()
----> 1 h1.Sumw2()
SystemError: TH1D& ROOT::RDF::RResultPtr<TH1D>::operator*() =>
problem in C++; program state has been reset
ROOT Version: 6.17/01
Platform: macOS
Compiler: Not Provided
PS: Examples that do not crash:
No multithreading:
import ROOT
f = ROOT.TFile.Open('f.root')
t = f.Get('tree')
t.AddFriend('otree', 'ff.root')
df = ROOT.RDataFrame(t)
h = df.Histo1D('branch_in_t')
h.Sumw2()
Multithreading after RDataFrame
declaration:
import ROOT
f = ROOT.TFile.Open('f.root')
t = f.Get('tree')
t.AddFriend('otree', 'ff.root')
df = ROOT.RDataFrame(t)
ROOT.ROOT.EnableImplicitMT()
h = df.Histo1D('branch_in_t')
h.Sumw2()
No friend:
import ROOT
f = ROOT.TFile.Open('f.root')
t = f.Get('tree')
ROOT.ROOT.EnableImplicitMT()
df = ROOT.RDataFrame(t)
h = df.Histo1D('branch_in_t')
h.Sumw2()