Histogram with name containing "/"

hello,

I have a root file containing many histot ( ~1000 ). Many of them have name which contains one or more slashes. Now I cannot read the histograms with slashes using TFile’s Get(filename). Nor are these histograms listed using the ls() method. Still, the histograms are listed in TBrowser and can also be accessed from there normaly.

How can I access the problematic histograms using commands?

I see now that using the “/” symbol is not exactly OK and I’ll try to avoid it in the future, but I need to access already existing histos.

Are there any other special characters? Maybe a word on these in the TNamed documentation would be useful.

Thanks for help in advance.
Cheers,
javier

Hi,

Use TKey *key = myfile->GetKey(histname); if (key) { TH1F *hist = key->ReadObjectAny(TH1F::Class()); }

Cheers,
Philippe.

thanks.

Cheers,
Javier

Hi,
I’m trying to do the same thing with a TF1:

TF1 *fped;
TKey *keyfped = f1->GetKey(Form("%s%s",h->GetTitle(),"_ped")); if (keyfped) { fped = keyfped->ReadObjectAny(TF1::Class()); }

But I get an error:

error: assigning to 'TF1 *' from incompatible type 'void *'

Is this function already out-of-date?

Cheers,
J.