I am trying to open multiple files with the same TTree using RDataFrame in pyROOT. I am trying something along
from ROOT import RDataFrame
frame = RDataFrame("TTreeName", ["filename1", "filename2", "filename3"])
but that does not seem to work. Is it possible to open multiple ROOT files in one RDataFrame in pyROOT somehow? If yes, are the TTrees from the ROOT files merged by RDataFrame?
nice question. The code is not working since you are trying to pass a Python list to a C++ interface which expects a vector of strings and PyROOT is not (yet) able to convert between these types (not that one exists only in Python!).
There are 2 solutions: use a wildcard string or fill a vector of strings.
wildcard (the same wildcard of TChain::Add)
from ROOT import RDataFrame
frame = RDataFrame("TTreeName", "filename*")
vector of strings
from ROOT import RDataFrame
names = ROOT.std.vector('string')()
for n in ["filename1", "filename2", "filename3"]: names.push_back(n)
frame = RDataFrame("TTreeName", names)