Hello, I’ve this root file made by compass software.
When I try to open the histograms in Energy TDirectory, as for example
_R_EnergyCH0@V1724_1113
I get error related to the @ in the histogram name (but I didn’t set the name…compass did it).
Thanks for posting this question: it’s an interesting one.
ROOT, at the prompt, allows to use names of objects written in an open TFile as if they were C++ variable names: this is a nice feature, which allows to comfortably explore files.
However, the name of an object in a file is not necessarily a valid C++ variable name, as you pointed out. In this cases, the aforementioned “shortcut” cannot be used and the full TFile API enters the game. In your case you can do:
auto myHist = myfile.Get<TH1D>("_R_EnergyCH0@V1724_1113");