Skim events on values of a vector variable

Dear all,
I have just started using RDataFrame and I would like to skim events based on the values of a vector variable.
My tree contains tracks made out of hits from different layers. Here it is a snapshot of the tree structure:

trackCharge Float_t Dataset
trackD0 Float_t Dataset
trackD0Err Float_t Dataset
trackDeltaZSinTheta Float_t Dataset
trackEta Float_t Dataset
[…]
hitEtaModule ROOT::VecOps::RVec Dataset
hitGlobalX ROOT::VecOps::RVec Dataset
hitGlobalY ROOT::VecOps::RVec Dataset
hitGlobalZ ROOT::VecOps::RVec Dataset
hitIsEndCap ROOT::VecOps::RVec Dataset
hitLayer ROOT::VecOps::RVec Dataset
hitLocalErrorX ROOT::VecOps::RVec Dataset
hitLocalErrorY ROOT::VecOps::RVec Dataset
hitLocalX ROOT::VecOps::RVec Dataset
hitLocalY ROOT::VecOps::RVec Dataset
[…]

For example: I would like to save only tracks that have hits in a specific layer:

df.Filter(‘hitLayer==2’).Snapshot(“myNewTree”,“myNewFile.root”)

Is it possible, please?

Many thanks in advance and best regards,
Marco Bomben


ROOT Version: 6.28
Platform: Mac OS X
Compiler: Apple clang version 16.0.0 (clang-1600.0.26.6)


Hi Marco,
@vpadulan should be able to help you with this question.

Hi @lbreitwi and @vpadulan , any hint on how to progress, please?
Many thanks in advance and best regards,
Marco Bomben

Dear @bomben ,

Thanks for reaching out to the forum!

If I understand your question correctly, for any specific branch containing information about tracks, you want to save the portion of that branch that correspond to hits in a specific layer. My understanding is that hitLayer branch is a collection of hit layers. The Filter operation applies the selection on the whole event, i.e. replying to the question can I discard this entire event or not?. Instead here you want to skim down parts of the same event, not discarding it as a whole. In this case, the Define operation should be used, to skim the branches you want to save based on which hit layer you’re interested in. I imagine something like the following pseudocode should give you a good starting point

df.Define("goodTracks", "tracks[hitLayer == 2]").Snapshot("tree","file",["goodTracks"])

As a further comment, the tree structure you report looks somehow wrong or partly modified. For example, a branch type of ROOT::VecOps::RVec doesn’t really make sense. It should be qualified with its inner data type, e.g. ROOT::VecOps::RVec<float> or similar.

Let me know how you proceed and if you need further assistance

Cheers,
Vincenzo

Dear @vpadulan , thanks a lot for your feedback.
I start from the end of your message: yes, the branch type is indeed:

ROOT::VecOps::RVec<float>

(<,> symbols have to be escaped).

Now, for the main topic, here is what I have tried:

df.Define(“goodTracks”, “tracks[hitLayer == 2]”).Snapshot(“trktree”,“newfile.root”,[“goodTracks”])

as you suggested but I still get an error:


AbortSignal Traceback (most recent call last)
Cell In[21], line 1
----> 1 df2.Define(“goodTracks”, “tracks[hitLayer == 2]”).Snapshot(“trktree”,“newfile.root”,[“goodTracks”])

File ~/mwork/mambaforge/lib/python3.10/site-packages/ROOT/_pythonization/_rdf_pyz.py:372, in _PyDefine(rdf, col_name, callable_or_str, cols, extra_args)
369 raise TypeError(f"First argument of Define must be a valid string for the new column name. {type(col_name).name} is not a string.“)
371 if isinstance(callable_or_str, str): # If string argument is passed. Invoke the Original Define.
→ 372 return rdf._OriginalDefine(col_name, callable_or_str)
374 if not callable(callable_or_str): # The 2st argument is either a string or a python callable.
375 raise TypeError(f"The second argument of a Define operation should be a callable. {type(callable_or_str).name} object is not callable.”)

AbortSignal: Template method resolution failed:
ROOT::RDF::RInterfaceROOT::Detail::RDF::RJittedFilter,void ROOT::RDF::RInterfaceROOT::Detail::RDF::RJittedFilter,void::Define(basic_string_view<char,char_traits > name, basic_string_view<char,char_traits > expression) =>
AbortSignal: abort from C++; program state was reset
ROOT::RDF::RInterfaceROOT::Detail::RDF::RJittedFilter,void ROOT::RDF::RInterfaceROOT::Detail::RDF::RJittedFilter,void::Define(basic_string_view<char,char_traits > name, basic_string_view<char,char_traits > expression) =>
AbortSignal: abort from C++; program state was reset

Many thanks again for your help and best regards,
Marco Bomben

Dear @bomben ,

Thank you for your reply. Unfortunately, the error is not very informative right now. I believe we can make it more informative with the two following strategies:

  1. Run your application with debug symbols enabled for cling. This can be done for example at the command line e.g. $: CLING_DEBUG=1 python myanalysis.py
  2. Enable verbose logging from RDataFrame. In your python script, somewhere at the top right after you import ROOT, write the following line.
verbosity = ROOT.Experimental.RLogScopedVerbosity(ROOT.Detail.RDF.RDFLogChannel(), ROOT.Experimental.ELogLevel.kDebug)

Can you then please send me back the full output of your application?
Cheers,
Vincenzo

Dear @vpadulan ,
thanks for your feedback. Below the error I get:

input_line_82:2:50: error: use of undeclared identifier ‘tracks’
auto func0(ROOT::VecOps::RVec& var0){return tracks[var0 == 2]
^
libc++abi: terminating due to uncaught exception of type std::runtime_error:
RDataFrame: An error occurred during just-in-time compilation. The lines above might indicate the cause of the crash
All RDF objects that have not run an event loop yet should be considered in an invalid state.

*** Break *** abort
[/Users/mbomben/mwork/mambaforge/lib/libcppyy_backend3_10.6.28.00.so] (anonymous namespace)::TExceptionHandlerImp::HandleException(int) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCore.6.28.00.so] TUnixSystem::DispatchSignals(ESignals) (no debug info)
[/usr/lib/system/libsystem_platform.dylib] _sigtramp (no debug info)
[/usr/lib/system/libsystem_pthread.dylib] pthread_kill (no debug info)
[/usr/lib/system/libsystem_c.dylib] abort (no debug info)
[/usr/lib/libc++abi.dylib] __cxxabiv1::__aligned_malloc_with_fallback(unsigned long) (no debug info)
[/usr/lib/libc++abi.dylib] demangling_terminate_handler() (no debug info)
[/usr/lib/libobjc.A.dylib] _objc_terminate() (no debug info)
[/usr/lib/libc++abi.dylib] std::__terminate(void ()()) (no debug info)
[/usr/lib/libc++abi.dylib] __cxa_get_exception_ptr (no debug info)
[/usr/lib/libc++abi.dylib] __cxxabiv1::failed_throw(__cxxabiv1::__cxa_exception
) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libROOTDataFrame.6.28.00.so] ROOT::Internal::RDF::InterpreterDeclare(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator> const&) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libROOTDataFrame.6.28.00.so] (anonymous namespace)::DeclareFunction(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator> const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator>>> const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator>>> const&) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libROOTDataFrame.6.28.00.so] ROOT::Internal::RDF::BookDefineJit(std::__1::basic_string_view<char, std::__1::char_traits>, std::__1::basic_string_view<char, std::__1::char_traits>, ROOT::Detail::RDF::RLoopManager&, ROOT::RDF::RDataSource*, ROOT::Internal::RDF::RColumnRegister const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator>>> const&, std::__1::shared_ptrROOT::Detail::RDF::RNodeBase) (no debug info)
[] (no debug info)
[] (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libcppyy_backend3_10.6.28.00.so] WrapperCall(long, unsigned long, void
, void*, void*) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libcppyy_backend3_10.6.28.00.so] Cppyy::CallO(long, void*, unsigned long, void*, unsigned long) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libcppyy3_10.6.28.00.so] CPyCppyy::(anonymous namespace)::InstanceExecutor::Execute(long, void*, CPyCppyy::CallContext*) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libcppyy3_10.6.28.00.so] CPyCppyy::CPPMethod::ExecuteFast(void*, long, CPyCppyy::CallContext*) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libcppyy3_10.6.28.00.so] CPyCppyy::CPPMethod::ExecuteProtected(void*, long, CPyCppyy::CallContext*) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libcppyy3_10.6.28.00.so] CPyCppyy::CPPMethod::Call(CPyCppyy::CPPInstance*&, _object*, _object*, CPyCppyy::CallContext*) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libcppyy3_10.6.28.00.so] CPyCppyy::(anonymous namespace)::mp_call(CPyCppyy::CPPOverload*, _object*, _object*) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libcppyy3_10.6.28.00.so] CPyCppyy::tpp_call(CPyCppyy::TemplateProxy*, _object*, _object*) (no debug info)
[/Users/mbomben/mwork/mambaforge/bin/python3.10] _PyObject_MakeTpCall (no debug info)
[/Users/mbomben/mwork/mambaforge/bin/python3.10] call_function (no debug info)
[/Users/mbomben/mwork/mambaforge/bin/python3.10] _PyEval_EvalFrameDefault (no debug info)
[/Users/mbomben/mwork/mambaforge/bin/python3.10] _PyEval_Vector (no debug info)
[/Users/mbomben/mwork/mambaforge/bin/python3.10] call_function (no debug info)
[/Users/mbomben/mwork/mambaforge/bin/python3.10] _PyEval_EvalFrameDefault (no debug info)
[/Users/mbomben/mwork/mambaforge/bin/python3.10] _PyEval_Vector (no debug info)
[/Users/mbomben/mwork/mambaforge/bin/python3.10] run_mod (no debug info)
[/Users/mbomben/mwork/mambaforge/bin/python3.10] _PyRun_SimpleFileObject (no debug info)
[/Users/mbomben/mwork/mambaforge/bin/python3.10] _PyRun_AnyFileObject (no debug info)
[/Users/mbomben/mwork/mambaforge/bin/python3.10] Py_RunMain (no debug info)
[/Users/mbomben/mwork/mambaforge/bin/python3.10] pymain_main (no debug info)
[/Users/mbomben/mwork/mambaforge/bin/python3.10] main (no debug info)
[/usr/lib/dyld] start (no debug info)
Traceback (most recent call last):
File “/Users/mbomben/work/Stagiare/2024-25/polytech/Raphael/tuples/debug.py”, line 12, in
df.Define(“goodTracks”, “tracks[hitLayer == 2]”).Snapshot(“trktree”,“newfile.root”,[“goodTracks”])
File “/Users/mbomben/mwork/mambaforge/lib/python3.10/site-packages/ROOT/_pythonization/_rdf_pyz.py”, line 372, in _PyDefine
return rdf._OriginalDefine(col_name, callable_or_str)
cppyy.ll.AbortSignal: Template method resolution failed:
ROOT::RDF::RInterfaceROOT::Detail::RDF::RLoopManager,void ROOT::RDF::RInterfaceROOT::Detail::RDF::RLoopManager,void::Define(basic_string_view<char,char_traits > name, basic_string_view<char,char_traits > expression) =>
AbortSignal: abort from C++; program state was reset

If I understand correctly the problem is in the second argument because tracks is not defined, which is true. What would be the ‘word’ to be used to indicate events or rows, please?

Many thanks again,
Marco Bomben

Dear @bomben ,

Ok then I must have misunderstood something about your input data and your use case. I thought tracks was a branch already existing in your TTree. I don’t understand anymore what you’re trying to do. The syntax I showed you works for thinning/slimming a collection at the current event using a condition based on another collection. Of course both collections must be existing either in the input dataset or defined by yourself via Define or similar. So the call

df.Define("goodCollection", "collection1[collection2 == N]")

Means “give me those objects from collection1 where the corresponding value in collection2 is equal to N”, similar to what you would do with numpy array slicing. Does this clarify perhaps? And how would this apply to your use case?

Cheers,
Vincenzo?

Dear @vpadulan , sorry for the confusion.
What I would like to do is to save in a new file a tree with the same branches as the original one only events satisfying a condition on a variable that is an std::vector.

For example: suppose in my events I can have a number of hits which fluctuates event per event and for each hit I save their location. I have two kinds of hits depending on the location, i.e. barrel or endcap. I want to write to the new file only events for which at least one hit is in the endcap.

How can I do that, please?

Many thanks again and best regards,
Marco Bomben

Dear @bomben,

Thank you for the explanation, I think I understand better now. The hitLayer branch is telling you which hits ended in which layer, for the current event. In that case, if you want to only keep events for which at least one hit ended in layer N(e.g.==2), you could do

df.Filter("ROOT::VecOps::Any(hitLayer == 2)").Snapshot(...)

Let me know if this gets you what you need, thanks!

Cheers,
Vincenzo

Dear @vpadulan , thanks again.
I have tried but I still have a crash.
Here is the script:

import ROOT

verbosity = ROOT.Experimental.RLogScopedVerbosity(ROOT.Detail.RDF.RDFLogChannel(), ROOT.Experimental.ELogLevel.kDebug)

fileName = "trktree-data15_13TeV.00279169.physics_Main.merge.DAOD_IDTIDE.r9264_p3083_p3083.root"
treeName = "trktree"

df = ROOT.RDataFrame(treeName, fileName)

#print(df.Describe())


df.Filter("ROOT::VecOps::Any(hitLayer == 2)").Snapshot("trktree","newfile.root")

And here is the stack and everything:

Info in <[ROOT.RDF] Info /tmp/root-feedstock/root-feedstock/miniforge3/conda-bld/root_base_1679427939945/work/root-source/tree/dataframe/src/RLoopManager.cxx:821 in void ROOT::Detail::RDF::RLoopManager::Run(bool)>: Starting event loop number 0.
*** Break *** segmentation violation
[/Users/mbomben/mwork/mambaforge/lib/libcppyy_backend3_10.6.28.00.so] (anonymous namespace)::TExceptionHandlerImp::HandleException(int) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCore.6.28.00.so] TUnixSystem::DispatchSignals(ESignals) (no debug info)
[/usr/lib/system/libsystem_platform.dylib] _sigtramp (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] (anonymous namespace)::MachineCopyPropagation::runOnMachineFunction(llvm::MachineFunction&) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] llvm::FPPassManager::runOnFunction(llvm::Function&) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] llvm::FPPassManager::runOnModule(llvm::Module&) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] llvm::legacy::PassManagerImpl::run(llvm::Module&) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] llvm::orc::SimpleCompiler::operator()(llvm::Module&) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] decltype(auto) llvm::orc::ThreadSafeModule::withModuleDollvm::orc::IRCompileLayer::IRCompiler&(llvm::orc::IRCompileLayer::IRCompiler&) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] llvm::orc::IRCompileLayer::emit(std::__1::unique_ptr<llvm::orc::MaterializationResponsibility, std::__1::default_deletellvm::orc::MaterializationResponsibility>, llvm::orc::ThreadSafeModule) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] llvm::orc::IRTransformLayer::emit(std::__1::unique_ptr<llvm::orc::MaterializationResponsibility, std::__1::default_deletellvm::orc::MaterializationResponsibility>, llvm::orc::ThreadSafeModule) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] llvm::orc::IRTransformLayer::emit(std::__1::unique_ptr<llvm::orc::MaterializationResponsibility, std::__1::default_deletellvm::orc::MaterializationResponsibility>, llvm::orc::ThreadSafeModule) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] llvm::orc::BasicIRLayerMaterializationUnit::materialize(std::__1::unique_ptr<llvm::orc::MaterializationResponsibility, std::__1::default_deletellvm::orc::MaterializationResponsibility>) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] llvm::orc::MaterializationTask::run() (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] void llvm::detail::UniqueFunctionBase<void, std::__1::unique_ptr<llvm::orc::Task, std::__1::default_deletellvm::orc::Task>>::CallImpl<void ()(std::__1::unique_ptr<llvm::orc::Task, std::__1::default_deletellvm::orc::Task>)>(void, std::__1::unique_ptr<llvm::orc::Task, std::__1::default_deletellvm::orc::Task>&) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] llvm::orc::ExecutionSession::dispatchOutstandingMUs() (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] llvm::orc::ExecutionSession::OL_completeLookup(std::__1::unique_ptr<llvm::orc::InProgressLookupState, std::__1::default_deletellvm::orc::InProgressLookupState>, std::__1::shared_ptrllvm::orc::AsynchronousSymbolQuery, std::__1::function<void (llvm::DenseMap<llvm::orc::JITDylib*, llvm::DenseSet<llvm::orc::SymbolStringPtr, llvm::DenseMapInfollvm::orc::SymbolStringPtr>, llvm::DenseMapInfollvm::orc::JITDylib*, llvm::detail::DenseMapPair<llvm::orc::JITDylib*, llvm::DenseSet<llvm::orc::SymbolStringPtr, llvm::DenseMapInfollvm::orc::SymbolStringPtr>>> const&)>) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] llvm::orc::InProgressFullLookupState::complete(std::__1::unique_ptr<llvm::orc::InProgressLookupState, std::__1::default_deletellvm::orc::InProgressLookupState>) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] llvm::orc::ExecutionSession::OL_applyQueryPhase1(std::__1::unique_ptr<llvm::orc::InProgressLookupState, std::__1::default_deletellvm::orc::InProgressLookupState>, llvm::Error) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] llvm::orc::ExecutionSession::lookup(llvm::orc::LookupKind, std::__1::vector<std::__1::pair<llvm::orc::JITDylib*, llvm::orc::JITDylibLookupFlags>, std::__1::allocator<std::__1::pair<llvm::orc::JITDylib*, llvm::orc::JITDylibLookupFlags>>> const&, llvm::orc::SymbolLookupSet, llvm::orc::SymbolState, llvm::unique_function<void (llvm::Expected<llvm::DenseMap<llvm::orc::SymbolStringPtr, llvm::JITEvaluatedSymbol, llvm::DenseMapInfollvm::orc::SymbolStringPtr, llvm::detail::DenseMapPair<llvm::orc::SymbolStringPtr, llvm::JITEvaluatedSymbol>>>)>, std::__1::function<void (llvm::DenseMap<llvm::orc::JITDylib*, llvm::DenseSet<llvm::orc::SymbolStringPtr, llvm::DenseMapInfollvm::orc::SymbolStringPtr>, llvm::DenseMapInfollvm::orc::JITDylib*, llvm::detail::DenseMapPair<llvm::orc::JITDylib*, llvm::DenseSet<llvm::orc::SymbolStringPtr, llvm::DenseMapInfollvm::orc::SymbolStringPtr>>> const&)>) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] (anonymous namespace)::JITDylibSearchOrderResolver::lookup(std::__1::set<llvm::StringRef, std::__1::lessllvm::StringRef, std::__1::allocatorllvm::StringRef> const&, llvm::unique_function<void (llvm::Expected<std::__1::map<llvm::StringRef, llvm::JITEvaluatedSymbol, std::__1::lessllvm::StringRef, std::__1::allocator<std::__1::pair<llvm::StringRef const, llvm::JITEvaluatedSymbol>>>>)>) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] llvm::RuntimeDyldImpl::finalizeAsync(std::__1::unique_ptr<llvm::RuntimeDyldImpl, std::__1::default_deletellvm::RuntimeDyldImpl>, llvm::unique_function<void (llvm::object::OwningBinaryllvm::object::ObjectFile, std::__1::unique_ptr<llvm::RuntimeDyld::LoadedObjectInfo, std::__1::default_deletellvm::RuntimeDyld::LoadedObjectInfo>, llvm::Error)>, llvm::object::OwningBinaryllvm::object::ObjectFile, std::__1::unique_ptr<llvm::RuntimeDyld::LoadedObjectInfo, std::__1::default_deletellvm::RuntimeDyld::LoadedObjectInfo>) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] llvm::jitLinkForORC(llvm::object::OwningBinaryllvm::object::ObjectFile, llvm::RuntimeDyld::MemoryManager&, llvm::JITSymbolResolver&, bool, llvm::unique_function<llvm::Error (llvm::object::ObjectFile const&, llvm::RuntimeDyld::LoadedObjectInfo&, std::__1::map<llvm::StringRef, llvm::JITEvaluatedSymbol, std::__1::lessllvm::StringRef, std::__1::allocator<std::__1::pair<llvm::StringRef const, llvm::JITEvaluatedSymbol>>>)>, llvm::unique_function<void (llvm::object::OwningBinaryllvm::object::ObjectFile, std::__1::unique_ptr<llvm::RuntimeDyld::LoadedObjectInfo, std::__1::default_deletellvm::RuntimeDyld::LoadedObjectInfo>, llvm::Error)>) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] llvm::orc::RTDyldObjectLinkingLayer::emit(std::__1::unique_ptr<llvm::orc::MaterializationResponsibility, std::__1::default_deletellvm::orc::MaterializationResponsibility>, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_deletellvm::MemoryBuffer>) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] llvm::orc::ObjectTransformLayer::emit(std::__1::unique_ptr<llvm::orc::MaterializationResponsibility, std::__1::default_deletellvm::orc::MaterializationResponsibility>, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_deletellvm::MemoryBuffer>) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] llvm::orc::IRCompileLayer::emit(std::__1::unique_ptr<llvm::orc::MaterializationResponsibility, std::__1::default_deletellvm::orc::MaterializationResponsibility>, llvm::orc::ThreadSafeModule) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] llvm::orc::IRTransformLayer::emit(std::__1::unique_ptr<llvm::orc::MaterializationResponsibility, std::__1::default_deletellvm::orc::MaterializationResponsibility>, llvm::orc::ThreadSafeModule) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] llvm::orc::IRTransformLayer::emit(std::__1::unique_ptr<llvm::orc::MaterializationResponsibility, std::__1::default_deletellvm::orc::MaterializationResponsibility>, llvm::orc::ThreadSafeModule) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] llvm::orc::BasicIRLayerMaterializationUnit::materialize(std::__1::unique_ptr<llvm::orc::MaterializationResponsibility, std::__1::default_deletellvm::orc::MaterializationResponsibility>) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] llvm::orc::MaterializationTask::run() (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] void llvm::detail::UniqueFunctionBase<void, std::__1::unique_ptr<llvm::orc::Task, std::__1::default_deletellvm::orc::Task>>::CallImpl<void ()(std::__1::unique_ptr<llvm::orc::Task, std::__1::default_deletellvm::orc::Task>)>(void, std::__1::unique_ptr<llvm::orc::Task, std::__1::default_deletellvm::orc::Task>&) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] llvm::orc::ExecutionSession::dispatchOutstandingMUs() (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] llvm::orc::ExecutionSession::OL_completeLookup(std::__1::unique_ptr<llvm::orc::InProgressLookupState, std::__1::default_deletellvm::orc::InProgressLookupState>, std::__1::shared_ptrllvm::orc::AsynchronousSymbolQuery, std::__1::function<void (llvm::DenseMap<llvm::orc::JITDylib*, llvm::DenseSet<llvm::orc::SymbolStringPtr, llvm::DenseMapInfollvm::orc::SymbolStringPtr>, llvm::DenseMapInfollvm::orc::JITDylib*, llvm::detail::DenseMapPair<llvm::orc::JITDylib*, llvm::DenseSet<llvm::orc::SymbolStringPtr, llvm::DenseMapInfollvm::orc::SymbolStringPtr>>> const&)>) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] llvm::orc::InProgressFullLookupState::complete(std::__1::unique_ptr<llvm::orc::InProgressLookupState, std::__1::default_deletellvm::orc::InProgressLookupState>) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] llvm::orc::ExecutionSession::OL_applyQueryPhase1(std::__1::unique_ptr<llvm::orc::InProgressLookupState, std::__1::default_deletellvm::orc::InProgressLookupState>, llvm::Error) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] llvm::orc::ExecutionSession::lookup(llvm::orc::LookupKind, std::__1::vector<std::__1::pair<llvm::orc::JITDylib*, llvm::orc::JITDylibLookupFlags>, std::__1::allocator<std::__1::pair<llvm::orc::JITDylib*, llvm::orc::JITDylibLookupFlags>>> const&, llvm::orc::SymbolLookupSet, llvm::orc::SymbolState, llvm::unique_function<void (llvm::Expected<llvm::DenseMap<llvm::orc::SymbolStringPtr, llvm::JITEvaluatedSymbol, llvm::DenseMapInfollvm::orc::SymbolStringPtr, llvm::detail::DenseMapPair<llvm::orc::SymbolStringPtr, llvm::JITEvaluatedSymbol>>>)>, std::__1::function<void (llvm::DenseMap<llvm::orc::JITDylib*, llvm::DenseSet<llvm::orc::SymbolStringPtr, llvm::DenseMapInfollvm::orc::SymbolStringPtr>, llvm::DenseMapInfollvm::orc::JITDylib*, llvm::detail::DenseMapPair<llvm::orc::JITDylib*, llvm::DenseSet<llvm::orc::SymbolStringPtr, llvm::DenseMapInfollvm::orc::SymbolStringPtr>>> const&)>) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] llvm::orc::ExecutionSession::lookup(std::__1::vector<std::__1::pair<llvm::orc::JITDylib*, llvm::orc::JITDylibLookupFlags>, std::__1::allocator<std::__1::pair<llvm::orc::JITDylib*, llvm::orc::JITDylibLookupFlags>>> const&, llvm::orc::SymbolLookupSet const&, llvm::orc::LookupKind, llvm::orc::SymbolState, std::__1::function<void (llvm::DenseMap<llvm::orc::JITDylib*, llvm::DenseSet<llvm::orc::SymbolStringPtr, llvm::DenseMapInfollvm::orc::SymbolStringPtr>, llvm::DenseMapInfollvm::orc::JITDylib*, llvm::detail::DenseMapPair<llvm::orc::JITDylib*, llvm::DenseSet<llvm::orc::SymbolStringPtr, llvm::DenseMapInfollvm::orc::SymbolStringPtr>>> const&)>) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] llvm::orc::ExecutionSession::lookup(std::__1::vector<std::__1::pair<llvm::orc::JITDylib*, llvm::orc::JITDylibLookupFlags>, std::__1::allocator<std::__1::pair<llvm::orc::JITDylib*, llvm::orc::JITDylibLookupFlags>>> const&, llvm::orc::SymbolStringPtr, llvm::orc::SymbolState) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] llvm::orc::LLJIT::lookupLinkerMangled(llvm::orc::JITDylib&, llvm::orc::SymbolStringPtr) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] llvm::orc::LLJIT::lookupLinkerMangled(llvm::orc::JITDylib&, llvm::StringRef) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] cling::IncrementalJIT::getSymbolAddress(llvm::StringRef, bool) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] cling::IncrementalExecutor::executeWrapper(llvm::StringRef, cling::Value*) const (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] cling::Interpreter::RunFunction(clang::FunctionDecl const*, cling::Value*) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] cling::Interpreter::EvaluateInternal(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator> const&, cling::CompilationOptions, cling::Value*, cling::Transaction**, unsigned long) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] TCling::Calc(char const*, TInterpreter::EErrorCode*) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libROOTDataFrame.6.28.00.so] ROOT::Internal::RDF::InterpreterCalc(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator> const&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator> const&) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libROOTDataFrame.6.28.00.so] ROOT::Detail::RDF::RLoopManager::Jit() (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libROOTDataFrame.6.28.00.so] ROOT::Detail::RDF::RLoopManager::Run(bool) (no debug info)
[] (no debug info)
[] (no debug info)
[] (no debug info)
[] (no debug info)
[] (no debug info)
[] (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libcppyy_backend3_10.6.28.00.so] WrapperCall(long, unsigned long, void*, void*, void*) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libcppyy_backend3_10.6.28.00.so] Cppyy::CallO(long, void*, unsigned long, void*, unsigned long) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libcppyy3_10.6.28.00.so] CPyCppyy::(anonymous namespace)::InstanceExecutor::Execute(long, void*, CPyCppyy::CallContext*) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libcppyy3_10.6.28.00.so] CPyCppyy::CPPMethod::ExecuteFast(void*, long, CPyCppyy::CallContext*) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libcppyy3_10.6.28.00.so] CPyCppyy::CPPMethod::ExecuteProtected(void*, long, CPyCppyy::CallContext*) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libcppyy3_10.6.28.00.so] CPyCppyy::CPPMethod::Call(CPyCppyy::CPPInstance*&, _object*, _object*, CPyCppyy::CallContext*) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libcppyy3_10.6.28.00.so] CPyCppyy::(anonymous namespace)::mp_call(CPyCppyy::CPPOverload*, _object*, _object*) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libcppyy3_10.6.28.00.so] CPyCppyy::tpp_call(CPyCppyy::TemplateProxy*, _object*, _object*) (no debug info)
[/Users/mbomben/mwork/mambaforge/bin/python3.10] _PyObject_MakeTpCall (no debug info)
[/Users/mbomben/mwork/mambaforge/bin/python3.10] call_function (no debug info)
[/Users/mbomben/mwork/mambaforge/bin/python3.10] _PyEval_EvalFrameDefault (no debug info)
[/Users/mbomben/mwork/mambaforge/bin/python3.10] _PyEval_Vector (no debug info)
[/Users/mbomben/mwork/mambaforge/bin/python3.10] run_mod (no debug info)
[/Users/mbomben/mwork/mambaforge/bin/python3.10] _PyRun_SimpleFileObject (no debug info)
[/Users/mbomben/mwork/mambaforge/bin/python3.10] _PyRun_AnyFileObject (no debug info)
[/Users/mbomben/mwork/mambaforge/bin/python3.10] Py_RunMain (no debug info)
[/Users/mbomben/mwork/mambaforge/bin/python3.10] pymain_main (no debug info)
[/Users/mbomben/mwork/mambaforge/bin/python3.10] main (no debug info)
[/usr/lib/dyld] start (no debug info)
Info in <[ROOT.RDF] Info /tmp/root-feedstock/root-feedstock/miniforge3/conda-bld/root_base_1679427939945/work/root-source/tree/dataframe/src/RLoopManager.cxx:821 in void ROOT::Detail::RDF::RLoopManager::Run(bool)>: Starting event loop number 0.
*** Break *** bus error
[/Users/mbomben/mwork/mambaforge/lib/libcppyy_backend3_10.6.28.00.so] (anonymous namespace)::TExceptionHandlerImp::HandleException(int) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCore.6.28.00.so] TUnixSystem::DispatchSignals(ESignals) (no debug info)
[/usr/lib/system/libsystem_platform.dylib] _sigtramp (no debug info)
[] (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] cling::IncrementalExecutor::executeWrapper(llvm::StringRef, cling::Value*) const (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] cling::Interpreter::RunFunction(clang::FunctionDecl const*, cling::Value*) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] cling::Interpreter::EvaluateInternal(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator> const&, cling::CompilationOptions, cling::Value*, cling::Transaction**, unsigned long) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libCling.6.28.00.so] TCling::Calc(char const*, TInterpreter::EErrorCode*) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libROOTDataFrame.6.28.00.so] ROOT::Internal::RDF::InterpreterCalc(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator> const&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator> const&) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libROOTDataFrame.6.28.00.so] ROOT::Detail::RDF::RLoopManager::Jit() (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libROOTDataFrame.6.28.00.so] ROOT::Detail::RDF::RLoopManager::Run(bool) (no debug info)
[] (no debug info)
[] (no debug info)
[] (no debug info)
[] (no debug info)
[] (no debug info)
[] (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libcppyy_backend3_10.6.28.00.so] WrapperCall(long, unsigned long, void*, void*, void*) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libcppyy_backend3_10.6.28.00.so] Cppyy::CallO(long, void*, unsigned long, void*, unsigned long) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libcppyy3_10.6.28.00.so] CPyCppyy::(anonymous namespace)::InstanceExecutor::Execute(long, void*, CPyCppyy::CallContext*) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libcppyy3_10.6.28.00.so] CPyCppyy::CPPMethod::ExecuteFast(void*, long, CPyCppyy::CallContext*) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libcppyy3_10.6.28.00.so] CPyCppyy::CPPMethod::ExecuteProtected(void*, long, CPyCppyy::CallContext*) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libcppyy3_10.6.28.00.so] CPyCppyy::CPPMethod::Call(CPyCppyy::CPPInstance*&, _object*, _object*, CPyCppyy::CallContext*) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libcppyy3_10.6.28.00.so] CPyCppyy::(anonymous namespace)::mp_call(CPyCppyy::CPPOverload*, _object*, _object*) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libcppyy3_10.6.28.00.so] CPyCppyy::CallMethodImp(CPyCppyy::TemplateProxy*, _object*&, _object*, _object*, bool, unsigned long long) (no debug info)
[/Users/mbomben/mwork/mambaforge/lib/libcppyy3_10.6.28.00.so] CPyCppyy::tpp_call(CPyCppyy::TemplateProxy*, _object*, _object*) (no debug info)
[/Users/mbomben/mwork/mambaforge/bin/python3.10] _PyObject_MakeTpCall (no debug info)
[/Users/mbomben/mwork/mambaforge/bin/python3.10] call_function (no debug info)
[/Users/mbomben/mwork/mambaforge/bin/python3.10] _PyEval_EvalFrameDefault (no debug info)
[/Users/mbomben/mwork/mambaforge/bin/python3.10] _PyEval_Vector (no debug info)
[/Users/mbomben/mwork/mambaforge/bin/python3.10] run_mod (no debug info)
[/Users/mbomben/mwork/mambaforge/bin/python3.10] _PyRun_SimpleFileObject (no debug info)
[/Users/mbomben/mwork/mambaforge/bin/python3.10] _PyRun_AnyFileObject (no debug info)
[/Users/mbomben/mwork/mambaforge/bin/python3.10] Py_RunMain (no debug info)
[/Users/mbomben/mwork/mambaforge/bin/python3.10] pymain_main (no debug info)
[/Users/mbomben/mwork/mambaforge/bin/python3.10] main (no debug info)
[/usr/lib/dyld] start (no debug info)
Traceback (most recent call last):
File “/Users/mbomben/work/Stagiare/2024-25/polytech/Raphael/tuples/debug.py”, line 13, in
df.Filter(“ROOT::VecOps::Any(hitLayer == 2)”).Snapshot(“trktree”,“newfile.root”)
TypeError: Template method resolution failed:
none of the 3 overloaded methods succeeded. Full details:
ROOT::RDF::RResultPtr<ROOT::RDF::RInterfaceROOT::Detail::RDF::RLoopManager,void > ROOT::RDF::RInterfaceROOT::Detail::RDF::RJittedFilter,void::Snapshot(basic_string_view<char,char_traits > treename, basic_string_view<char,char_traits > filename, initializer_list columnList, const ROOT::RDF::RSnapshotOptions& options = ROOT::RDF::RSnapshotOptions()) =>
TypeError: takes at least 3 arguments (2 given)
ROOT::RDF::RResultPtr<ROOT::RDF::RInterfaceROOT::Detail::RDF::RLoopManager,void > ROOT::RDF::RInterfaceROOT::Detail::RDF::RJittedFilter,void::Snapshot(basic_string_view<char,char_traits > treename, basic_string_view<char,char_traits > filename, const vector& columnList, const ROOT::RDF::RSnapshotOptions& options = ROOT::RDF::RSnapshotOptions()) =>
TypeError: takes at least 3 arguments (2 given)
ROOT::RDF::RResultPtr<ROOT::RDF::RInterfaceROOT::Detail::RDF::RLoopManager,void > ROOT::RDF::RInterfaceROOT::Detail::RDF::RJittedFilter,void::Snapshot(basic_string_view<char,char_traits > treename, basic_string_view<char,char_traits > filename, basic_string_view<char,char_traits > columnNameRegexp = “”, const ROOT::RDF::RSnapshotOptions& options = ROOT::RDF::RSnapshotOptions()) =>
SegmentationViolation: segfault in C++; program state was reset
ROOT::RDF::RResultPtr<ROOT::RDF::RInterfaceROOT::Detail::RDF::RLoopManager,void > ROOT::RDF::RInterfaceROOT::Detail::RDF::RJittedFilter,void::Snapshot(basic_string_view<char,char_traits > treename, basic_string_view<char,char_traits > filename, basic_string_view<char,char_traits > columnNameRegexp = “”, const ROOT::RDF::RSnapshotOptions& options = ROOT::RDF::RSnapshotOptions()) =>
SegmentationViolation: segfault in C++; program state was reset
libc++abi: terminating due to uncaught exception of type std::__1::system_error: mutex lock failed: Invalid argument
Abort trap: 6

Many thanks in advance and best regards,
Marco Bomben

Dear @bomben ,

I don’t understand the stack trace, are you able to share the file with me somehow? Or even just a few events?

Cheers,
Vincenzo