using namespace ROOT::Experimental;
TDataFrame df("ntuple", "file.root");
df.Filter("value < 300").Foreach(doStuff);
TDataFrame uses TTreeReader under the hood and has one notable advantage which is easy parallel execution: you just need to call ROOT::EnableImplicitMT() before constructing the TDataFrame object.
Hope this helps, just ask if you have more questions.
I already came across TDataFrame. It should give what I am looking for but right now I am not able to update to 6.10 without some testing of my code.
However, the first solution should do the trick.
But i think I do not gain much compared to just using if-statements right?
My idea was to do such selections without to much overhead of defining variables and such (by simply defining a string as in TTree->CloneTree ) since I am usually evaluating multiple and more complex logical expressions.