4 map<string, vector<TObject*>>
got {};
5 map <string, TFile*>
files {};
10 if (f_name.find(
".root") == string::npos) f_name +=
".root";
11 TFile *
f = (
files.count(f_name) ?
files[f_name] :
new TFile(f_name.c_str(),
"read") );
13 cout <<
" Fatal error, cannot open file: " << f_name << endl;
20 TFile *s_current = gDirectory->GetFile();
23 f->GetObject(object_name.c_str(), obj);
25 cout <<
" !fatal: failed to get object " << object_name
26 <<
" from file " << f_name << endl;
31 if (
got.count(object_name) != 0)
got[object_name].push_back(obj);
32 else got[object_name].push_back({obj});
34 if (s_current!=
nullptr) s_current->cd();