In PyROOT I’m building TChains and using wildcards to add all files in a given folder. Now, I’d like to remove a few specific files from said TChains. Is there a method similar to TChain::Add that could do that? Or should I first find the files I need in the folder, then chain them in a loop?
You could find the files in that directory using gSystem->OpenDirectory() / ->GetDirEntry() / FreeDirectory(). Or you remove the entries you don’t need from the chain->GetListOfFiles(), which is a collection of TChainElements.
I’d like to go with the second option, but I can’t find anything in the TChain reference page that would allow me to remove an element from a TChain. I see there is an ls method; would looking up a particular substring in mychain.ls() then finding its index and pop()'ing that index work? Is there a simpler, more efficient method?