Opening a histogram with hyphen in its name

Hi,

I have a problem opening histogram whose name has a hyphen in its name.

Details:
histogram name: ggd-bg
When I try to display the histogram with:

root [11] ggd-bg->Draw(“colz”)

I get the following error:

Error: Symbol bg is not defined in current scope (tmpfile):1:
Error: Failed to evaluate bg->Draw(“colz”)
(class TH2F*)0x134f9e20
*** Interpreter error recovered ***

Are names with a “-”(hyphen) forbidden in ROOT?

Please help.

Ajay

Well, the answer is quite obvious when you see the command you typed and you keep in mid that CINT is a C++ interpreter.
Looking at :

root [11] ggd-bg->Draw(“colz”)

you can tell that’s not valid C++ …

So you should:

TH2F *h = yourrootfile->Get(“ggd-bg”);
h->Draw()

So, yes, it is not a good idea to put “-” in histograms names.

Hi,

Thank you very much for your quick reply.

Regards,

Ajay