Events with exactly two Taus in RDataFrame

Hello rooters,

I am having some trouble trying to figure out how to make a “cut” in a data frame, such as the only events that pass the filter are those events with two taus. I have a branch of tree called TauPt which is an array with entries TauPt[0] for the leading and TauPt[1] for the subleading. So i want those events that have both entries filled.

Best Regards,
Cesar.

This is actually simple, i just did this:

df = df.Define("nTaus", "TauPt.size()")
df = df.Filter("nTaus == 2", "Events with exactly two Taus")

And solved my problem!

3 Likes