Hi all,
I have several branches in a tree all of the same type double, representing energy deposited across multiple detectors, and wish to use RDataFrame to create a new column that’s just the sum of all the entries in that row. I know how to use Define to do this for a fixed number of columns:
auto df2 = df1.Define(“sumColumn”, DoSum, {“column1”, “column2”, etc…});
However, the number of columns in the each file is different depending on the number of detectors, and so I’ve been struggling to implement this sum for a variable number of columns that I can apply to any file.
Does anyone have input on how to do this? I have tried to read up on variadic functions (I am still a bit novice with C++), but haven’t found anything that works with RDataFrame. Any thoughts would be greatly appreciated!