Hi.
ROOT crashes when I run the following macro, but I have no idea why.
No “barbarbar” in output, so it seems thet my macro crashes when drawing the histogram.
I would appreciate if you could help me.
I’m a beginner at RDataFrame. Please forgive me if the cause is my lack of understanding about RDataFrame.
Thanks.
int myMacro()
{
auto fileName = "target.root";
auto treeName = "tree";
auto c = new TCanvas();
c->SetLogy();
ROOT::RDataFrame df(treeName, fileName);
auto sq = [](double x){ return x*x; };
auto h_squared = df.Define("sq", sq, {"Esum"})
.Histo1D({"h_squared", "test", 1000, 0, 10000}, {"sq"});
std::cout << "foofoofoo" << std::endl;
h_noCut->Draw();
std::cout << "barbarbar" << std::endl;
return 0;
}
output
[/opt/homebrew/Cellar/root/6.22.08_1/lib/root/libCore.so] TUnixSystem::DispatchSignals(ESignals) (no debug info)
[/opt/homebrew/Cellar/root/6.22.08_1/lib/root/libCore.so] SigHandler(ESignals) (no debug info)
[/opt/homebrew/Cellar/root/6.22.08_1/lib/root/libCore.so] sighandler(int) (no debug info)
[/opt/homebrew/Cellar/root/6.22.08_1/lib/root/libCore.so] textinput::TerminalConfigUnix::HandleSignal(int) (no debug info)
[/opt/homebrew/Cellar/root/6.22.08_1/lib/root/libCore.so] (anonymous namespace)::TerminalConfigUnix__handleSignal(int) (no debug info)
[/usr/lib/system/libsystem_platform.dylib] _sigtramp (no debug info)
[/Users/harada/SingleBeta/Fitting_with_BG/kaiseki_cpp.so] void ROOT::Internal::RDF::InitRDFValues<std::__1::tuple<ROOT::Internal::RDF::RColumnValue<double> >, 0ul>(unsigned int, std::__1::tuple<ROOT::Internal::RDF::RColumnValue<double> >&, TTreeReader*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, ROOT::Internal::RDF::RBookedCustomColumns const&, std::__1::integer_sequence<unsigned long, 0ul>, std::__1::array<bool, sizeof...(0ul)> const&) (no debug info)
[<unknown binary>] (no debug info)
[<unknown binary>] (no debug info)
[/opt/homebrew/Cellar/root/6.22.08_1/lib/root/libROOTDataFrame.so] ROOT::Internal::RDF::RJittedAction::InitSlot(TTreeReader*, unsigned int) (no debug info)
[/opt/homebrew/Cellar/root/6.22.08_1/lib/root/libROOTDataFrame.so] ROOT::Detail::RDF::RLoopManager::InitNodeSlots(TTreeReader*, unsigned int) (no debug info)
[/opt/homebrew/Cellar/root/6.22.08_1/lib/root/libROOTDataFrame.so] ROOT::Detail::RDF::RLoopManager::RunTreeReader() (no debug info)
[/opt/homebrew/Cellar/root/6.22.08_1/lib/root/libROOTDataFrame.so] ROOT::Detail::RDF::RLoopManager::Run() (no debug info)
[/Users/harada/SingleBeta/Fitting_with_BG/kaiseki_cpp.so] ROOT::RDF::RResultPtr<TH1D>::TriggerRun() (no debug info)
[/Users/harada/SingleBeta/Fitting_with_BG/kaiseki_cpp.so] ROOT::RDF::RResultPtr<TH1D>::Get() (no debug info)
[/Users/harada/SingleBeta/Fitting_with_BG/kaiseki_cpp.so] ROOT::RDF::RResultPtr<TH1D>::operator->() (no debug info)
[/Users/harada/SingleBeta/Fitting_with_BG/kaiseki_cpp.so] kaiseki() (no debug info)
[<unknown binary>] (no debug info)
[/opt/homebrew/Cellar/root/6.22.08_1/lib/root/libCling.so] cling::IncrementalExecutor::executeWrapper(llvm::StringRef, cling::Value*) const (no debug info)
[/opt/homebrew/Cellar/root/6.22.08_1/lib/root/libCling.so] cling::Interpreter::RunFunction(clang::FunctionDecl const*, cling::Value*) (no debug info)
[/opt/homebrew/Cellar/root/6.22.08_1/lib/root/libCling.so] cling::Interpreter::EvaluateInternal(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, cling::CompilationOptions, cling::Value*, cling::Transaction**, unsigned long) (no debug info)
[/opt/homebrew/Cellar/root/6.22.08_1/lib/root/libCling.so] cling::Interpreter::process(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, cling::Value*, cling::Transaction**, bool) (no debug info)
[/opt/homebrew/Cellar/root/6.22.08_1/lib/root/libCling.so] cling::MetaProcessor::process(llvm::StringRef, cling::Interpreter::CompilationResult&, cling::Value*, bool) (no debug info)
[/opt/homebrew/Cellar/root/6.22.08_1/lib/root/libCling.so] HandleInterpreterException(cling::MetaProcessor*, char const*, cling::Interpreter::CompilationResult&, cling::Value*) (no debug info)
[/opt/homebrew/Cellar/root/6.22.08_1/lib/root/libCling.so] TCling::ProcessLine(char const*, TInterpreter::EErrorCode*) (no debug info)
[/opt/homebrew/Cellar/root/6.22.08_1/lib/root/libCling.so] TCling::ProcessLineSynch(char const*, TInterpreter::EErrorCode*) (no debug info)
[/opt/homebrew/Cellar/root/6.22.08_1/lib/root/libCore.so] TApplication::ExecuteFile(char const*, int*, bool) (no debug info)
[/opt/homebrew/Cellar/root/6.22.08_1/lib/root/libCore.so] TApplication::ProcessFile(char const*, int*, bool) (no debug info)
[/opt/homebrew/Cellar/root/6.22.08_1/lib/root/libCore.so] TApplication::ProcessLine(char const*, bool, int*) (no debug info)
[/opt/homebrew/Cellar/root/6.22.08_1/lib/root/libRint.so] TRint::ProcessLineNr(char const*, char const*, int*) (no debug info)
[/opt/homebrew/Cellar/root/6.22.08_1/lib/root/libRint.so] TRint::Run(bool) (no debug info)
[/opt/homebrew/Cellar/root/6.22.08_1/bin/root.exe] main (no debug info)
[/usr/lib/system/libdyld.dylib] start (no debug info)