Manipulating TChains: enabling/adding and disabling/re files

Hi all,

I have a bunch of root files I add in a TChain using the chain->AddFile method, and it works fine, but at some point I just want torun over a subset of the files (the only ones that have an interesting information) and then again over the whole list again.

I have tried to use chain->GetListOfFiles and manipulate it, but I don’t find that if I remove a file it gets removed from the chain (maybe I need to update it somehow?).

I know I could always recreate the TChain everytime, but it looks a little bit clumsy to me. I haven’t been able to find a different solution. Any ideas?

Thanks,
Albert

Hi Albert,

Indeed you can not currently do anything but add to the list of files (you can also empty it completely via a call to chain->Reset()); there are additional information about the file being kept in other variable that are not maintained properly if you remove files from the list.

So for now you best bet is to rebuild the list of files from scratch each time.

Cheers,
Philippe.