Running that logic in the lambda should be exactly the same as running it outside (I assume you are not using ROOT::EnableImplicitMT()
, because that code is not thread-safe and cannot be run in a multi-thread event loop).
Ah, wait! You are calling inFile.Close()
too soon. RDataFrame is lazy, it doesn’t actually compute the Define
s until you call Snapshot
!