Convert root histogram file to text file?

I have about 10,000 root files each with three histograms, and so I am looking for a fast way to convert the data from these histograms into text files. The only important part of the data is the total number of entries in each histogram. There are some posts here about how to combine histograms; however I don’t need the total number of entries summed, I need to find the maximum amount of entries in a single histogram.

Thank you

GetEntries gives this information for a given histogram.

1 Like

I’m having a little bit of trouble using that command, which I think is due to the name of my histograms, since they are numbers.

Would you know how to the GetEntries command with an integer name?

I have tried TH1::1->GetEntries() and various combinations of it.

Thanks again!!

Having histogram names as numbers or starting by a numbers is a very bad idea as they are illegal C++ variables names. Before trying to work around this it would be better and much simpler for future use, if you can regenerate your histograms with proper names. Is it possible ?

1 Like

Ah perfect, thank you so much! I remade a couple named h1 instead of 1 and it works perfectly.

Thanks for all your help!

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