Histogram with "/" in name


Please read tips for efficient and successful posting and posting code

ROOT Version: 6.24.02 (pyROOT)
Platform: Linux WSL1
Compiler: Not Provided


Good morning ROOT experts,

I want to ask regarding a possible bug
that I am facing, when trying to ‘Get’ a histogram whose name includes “/”
but is not in any directory.

I re-produce this behaviour if I do the following:

file = ROOT.TFile.Open("test.root","RECREATE")
hist = ROOT.TH1F( '/a/test', '', 100, -4, 4 )
hist.Write()
file.Close()

file = ROOT.TFile.Open("test.root","READ")
file.Get('/a/test/')

returns: <cppyy.gbl.TH1F object at 0x(nil)>

This appears to be a null-pointer.
The histogram is clearly visible and functioning in the TBrowser,
however I cannot seem to be able to escape the “/” character to ‘.Get’
it from the file. Perhaps ROOT is trying to find directories with that structure
and fails to find them thus returning a null-pointer?

Please excuse this post if this is mentioned as a no-go somewhere in the documentation.
Thank you very much in advance,
Ioannis

May be this FAQ can help you.

Thank you, this fixes the issue!

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