Combing 1D histograms from different files into a single 2D histogram using the file ID?

Hi everyone,

I have a set of .root files of the form
xyz_1.root
xyz_2.root

xyz_2362.root (various numbers are missing in between the files)

Each file has a stored 1D histogram containing energy spectra.

I am trying to merge these 1D histograms into a single 2D histogram such that the X-axis is the unique file number and the Y-axis has the corresponding energies of that file.

Is there any built-in command (n similar lines of hadd ) that can help me achieve this? Any suggestions/examples in this regard will be helpful and appreciated.

Thanks a lot !

Hi,

Thanks for the question.
I don’t think we have native support for this interesting, but very custom, operation. It should not be a lot of work to combine in a loop all histos as slices of a 2D histo though.

Cheers,
D