TFile::Open by using string instead of filename

Hi all,
I would like to ask about TFile::Open, I open my files in the macro like this

  TFile *f_nom_gg = TFile::Open("2950_ZCR/histo.16.AllData.root");

but since I would like to change the part of the filename, actually the foldername, separately, like this:

  string filename_open ="2950_ZCR/histo.16.AllData.root";
 TFile *f_nom_gg = TFile::Open(filename_open);

and I get the following error
Error: Function Open(filename_open) is not defined in current scope dokimes.C:5:
*** Interpreter error recovered ***

Is there a solution for that?
Thanks!!

TFile *f_nom_gg = TFile::Open(filename_open.c_str());

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.