Using wildcard in columnList in RDataFrames


Im wondering if there is any way to use wildcards in the columnList when calling snapshot on an RDataFrame? If not is there any plans to make this a feature?
For example, I only want to keep a small subset of the original branches but there are a lot of weights(~30) which I would like to keep but it would be time consuming to have to list them all manually.



_ROOT Version: 6.16.00
Platform: Not Provided
Compiler: Not Provided

Realised there is a regex option. Ignore!


1 Like


Now have a question relating to using regex. I seem to be having trouble including any OR in the regex. For example:

^lep_pt$ works fine. As does:
^jet_pt$. However:
^lep_pt|jet_pt$ does not. Does anyone know of a reason for this? I have tried a toy example using TPRegexp and it matches fine, it just seems to be when using it in the RDataFrame.



In ROOT v6.16 Snapshot is still using TRegexp (a home-grown regex implementation) which does not support OR.

In master and in the upcoming v6.18, this has been changed: Snapshot now uses TPRegexp, which supports OR and everything else you’d expect.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.