I was trying to store integer numbers for which I know the range is limited as int8_t or uint8_t in TTrees (using the b or B branch type qualifiers) (I assumed compression should be fairly efficient in taking care of it ,but I still nocited that this resulted in a file size reduction).
Unfortunately, this completely messes up the drawing of the branches in a TBrowser (both the new web-based and the legacy one):
instead of:
This is not the end of the world, but it’s still quite annoying for quick checks of the file content…
Is there a way to specify that I want those to be drawn as integers and not characters?
Thanks for reporting this here. I guess it also happens if you manually create and fill a TH1? @linev is this a know bug? Otherwise, I’ll open a new issue on GitHub.
I guess it is question for @pcanal how to correctly invoke TTree::Draw() to get expected results with int8_t data. Seems to be, it tries to use it as const char *.
It seems that the cite by @yus does not refer to the same issue.
That said, I was unable to reproduce the initial problem that you reported neither in ROOT master nor v6-26-00-patches, i.e. 6.26/11.
@swertz Could you please share a minimal reproducer? @pcanal Does this ring a bell or anything?
Thanks @pcanal . Is there any way to get Draw or Scan to treat them as integers instead? It seems to me that that use case would be far more common than using it to store strings…
However this will not work when clicking on a branch when inspecting a file in a TBrowser… Why can’t int8_t be interpreted as a number by default? I don’t see why anyone in HEP would want to make a histogram of characters, whereas storing small integers as int8_t seems like a common use case.