When I try to access an array branch using RDataFrame
, I get an error:
In [1]: import ROOT
In [2]: df = ROOT.RDataFrame('<treename>', 'root://<path/to/file>.root')
In [3]: h = df.Define('test', 'Lc1_Added_MotherH_M[0]').Histo1D('test')
In [4]: h.Draw()
*** Break *** segmentation violation
[/usr/lib/system/libsystem_platform.dylib] _sigtramp (no debug info)
[<unknown binary>] (no debug info)
[<unknown binary>] (no debug info)
[<unknown binary>] (no debug info)
[<unknown binary>] (no debug info)
[<unknown binary>] (no debug info)
[<unknown binary>] (no debug info)
[/Applications/root_build/lib/libROOTDataFrame.so] ROOT::Detail::RDF::RLoopManager::RunAndCheckFilters(unsigned int, long long) /Library/Developer/CommandLineTools/usr/include/c++/v1/iterator:1371
[/Applications/root_build/lib/libROOTDataFrame.so] ROOT::Detail::RDF::RLoopManager::RunTreeReader() /Applications/root/tree/dataframe/src/RLoopManager.cxx:282
[/Applications/root_build/lib/libROOTDataFrame.so] ROOT::Detail::RDF::RLoopManager::Run() /Applications/root/tree/dataframe/src/RLoopManager.cxx:468
[<unknown binary>] (no debug info)
[<unknown binary>] (no debug info)
[<unknown binary>] (no debug info)
[<unknown binary>] (no debug info)
[/Applications/root_build/lib/libPyROOT.so] FastCall(long, void*, void*, void*) /Applications/root/bindings/pyroot/src/Cppyy.cxx:407
[/Applications/root_build/lib/libPyROOT.so] Cppyy::CallR(long, void*, void*) /Applications/root/bindings/pyroot/src/Cppyy.cxx:0
[/Applications/root_build/lib/libPyROOT.so] PyROOT::TCppObjectRefExecutor::Execute(long, void*, PyROOT::TCallContext*) /Applications/root/bindings/pyroot/src/Executors.cxx:73
[/Applications/root_build/lib/libPyROOT.so] PyROOT::TMethodHolder::CallFast(void*, long, PyROOT::TCallContext*) /Applications/root/bindings/pyroot/src/TMethodHolder.cxx:110
[/Applications/root_build/lib/libPyROOT.so] PyROOT::TMethodHolder::CallSafe(void*, long, PyROOT::TCallContext*) /Applications/root/bindings/pyroot/src/TMethodHolder.cxx:122
[/Applications/root_build/lib/libPyROOT.so] PyROOT::TMethodHolder::Execute(void*, long, PyROOT::TCallContext*) /Applications/root/bindings/pyroot/src/TMethodHolder.cxx:0
[/Applications/root_build/lib/libPyROOT.so] PyROOT::TMethodHolder::Call(PyROOT::ObjectProxy*&, _object*, _object*, PyROOT::TCallContext*) /Applications/root/bindings/pyroot/src/TMethodHolder.cxx:585
[/Applications/root_build/lib/libPyROOT.so] PyROOT::(anonymous namespace)::mp_call(PyROOT::MethodProxy*, _object*, _object*) /Applications/root/bindings/pyroot/src/MethodProxy.cxx:598
[/Users/michael/anaconda2/lib/libpython2.7.dylib] PyObject_CallMethod (no debug info)
[/Applications/root_build/lib/libPyROOT.so] (anonymous namespace)::DeRefGetAttr(_object*, _object*) /Applications/root/bindings/pyroot/src/Pythonize.cxx:116
[/Applications/root_build/lib/libPyROOT.so] PyROOT::im_call(_object*, _object*, _object*) /Applications/root/bindings/pyroot/src/TCustomPyTypes.cxx:244
[/Users/michael/anaconda2/lib/libpython2.7.dylib] PyObject_CallFunctionObjArgs (no debug info)
[/Users/michael/anaconda2/lib/libpython2.7.dylib] slot_tp_getattr_hook (no debug info)
[/Users/michael/anaconda2/lib/libpython2.7.dylib] PyEval_EvalFrameEx (no debug info)
[/Users/michael/anaconda2/lib/libpython2.7.dylib] PyEval_EvalCodeEx (no debug info)
[/Users/michael/anaconda2/lib/libpython2.7.dylib] PyEval_EvalFrameEx (no debug info)
[/Users/michael/anaconda2/lib/libpython2.7.dylib] PyEval_EvalCodeEx (no debug info)
[/Users/michael/anaconda2/lib/libpython2.7.dylib] fast_function (no debug info)
[/Users/michael/anaconda2/lib/libpython2.7.dylib] PyEval_EvalFrameEx (no debug info)
[/Users/michael/anaconda2/lib/libpython2.7.dylib] PyEval_EvalCodeEx (no debug info)
[/Users/michael/anaconda2/lib/libpython2.7.dylib] fast_function (no debug info)
[/Users/michael/anaconda2/lib/libpython2.7.dylib] PyEval_EvalFrameEx (no debug info)
[/Users/michael/anaconda2/lib/libpython2.7.dylib] PyEval_EvalCodeEx (no debug info)
[/Users/michael/anaconda2/lib/libpython2.7.dylib] fast_function (no debug info)
[/Users/michael/anaconda2/lib/libpython2.7.dylib] PyEval_EvalFrameEx (no debug info)
[/Users/michael/anaconda2/lib/libpython2.7.dylib] PyEval_EvalCodeEx (no debug info)
[/Users/michael/anaconda2/lib/libpython2.7.dylib] fast_function (no debug info)
[/Users/michael/anaconda2/lib/libpython2.7.dylib] PyEval_EvalFrameEx (no debug info)
[/Users/michael/anaconda2/lib/libpython2.7.dylib] PyEval_EvalCodeEx (no debug info)
[/Users/michael/anaconda2/lib/libpython2.7.dylib] fast_function (no debug info)
[/Users/michael/anaconda2/lib/libpython2.7.dylib] PyEval_EvalFrameEx (no debug info)
[/Users/michael/anaconda2/lib/libpython2.7.dylib] PyEval_EvalCodeEx (no debug info)
[/Users/michael/anaconda2/lib/libpython2.7.dylib] fast_function (no debug info)
[/Users/michael/anaconda2/lib/libpython2.7.dylib] PyEval_EvalFrameEx (no debug info)
[/Users/michael/anaconda2/lib/libpython2.7.dylib] PyEval_EvalCodeEx (no debug info)
[/Users/michael/anaconda2/lib/libpython2.7.dylib] function_call (no debug info)
[/Users/michael/anaconda2/lib/libpython2.7.dylib] PyObject_Call (no debug info)
[/Users/michael/anaconda2/lib/libpython2.7.dylib] PyEval_EvalFrameEx (no debug info)
[/Users/michael/anaconda2/lib/libpython2.7.dylib] PyEval_EvalCodeEx (no debug info)
[/Users/michael/anaconda2/lib/libpython2.7.dylib] fast_function (no debug info)
[/Users/michael/anaconda2/lib/libpython2.7.dylib] PyEval_EvalFrameEx (no debug info)
[/Users/michael/anaconda2/lib/libpython2.7.dylib] PyEval_EvalCodeEx (no debug info)
[/Users/michael/anaconda2/lib/libpython2.7.dylib] PyEval_EvalCode (no debug info)
[/Users/michael/anaconda2/lib/libpython2.7.dylib] PyRun_FileExFlags (no debug info)
[/Users/michael/anaconda2/lib/libpython2.7.dylib] PyRun_SimpleFileExFlags (no debug info)
[/Users/michael/anaconda2/lib/libpython2.7.dylib] Py_Main (no debug info)
[/usr/lib/system/libdyld.dylib] start (no debug info)
[<unknown binary>] (no debug info)
---------------------------------------------------------------------------
SystemError Traceback (most recent call last)
<ipython-input-4-a6939a795bb1> in <module>()
----> 1 h.Draw()
SystemError: TH1D& ROOT::RDF::RResultPtr<TH1D>::operator*() =>
problem in C++; program state has been reset
The RDataFrame documentation suggests that I should declare the branch to be of type RVec<T>
, but I have not found any examples of this. Conversely, the RVec documentation suggests that RVec
is just used implicitly by RDataFrame
, i.e., that I should be able to use the array notation directly.
What am I doing wrong?
ROOT Version: 6.17/01
Platform: macOS
Compiler: Not Provided