Using Tables in ROOT

Dear users,

I write this topic because I don’t know how to work with tables in ROOT. I am a new user and I did not find any tutorial or information in the User’s guide and root page about how to use tables in ROOT. Basically, I need to store some information that I have in a histogram to a nice table to present in the future. I would really thank if you could give me some references to start my learning with this new tool.

Thanks in advance.

Best,

Diego

Dear Diego
I also struggled to find some code example using TTable objects. I guess one has to try it and follow the Doxygen to see whether it works fine for you .

Alternatively if you work within a python environment I would suggest to try one of the many packages for table printing , I usually use PrettyTable module or if you want to deal with latex directly you might want to look up pylatex.

Within c++ you can also find several tables c++ implementation. Among the ones I found , I guess the single header one from GitHub - p-ranav/tabulate: Table Maker for Modern C++ looks quite nice.

I hope this is what you meant by using tables in ROOT. I am not aware of direct conversion of histograms to tables, you can however navigate the histogram content and produce a nicely printed table with any external class or custom code.

Cheers
Renato

TTable” no longer exists in newer ROOT versions.

And btw TTable wasn’t about text output :slight_smile: Are you looking for a tool that prints a table of data? Then indeed, Renato’s answer is perfect! (ROOT doesn’t need to provide everything itself if there are nice packages that it can interface with :slight_smile: )

Hi all!

Thanks for the references and the help. I left a bit this task for later but I recently could find a way to obtain a nice table using python and pylatex, so I could use it for future reports/presentations! It is just what I wanted.

Cheers,

Diego