Opening files using delimiters

Hello everyone,

I have an interesting situation for which I need solution.

When I do analysis I have separate folders for each analysis. I change the name of folder with analysis, but the name of inner sub-folders remain unchanged. I store my results in a sub-folder “merge”, which contains root file, which starts with something like “wave_AAA”, AAA is the name of main folder.

When I do “root -l” inside a main folder, I can in principle open my root file by just writing

TFile file_ntuple_rec(“merge/name_of_wavefile”);

problem is that I have to change name of this file every time I have a different main folder. Is there a way that root can open the file by just looking at the tag “wave”, there is only one file with this tag so there is no option for conflict.

Thank You!

It sounds like you need to use the TString::Format to form the desired filename from other string variables.