e15190.utilities.root6.histo_conversion

e15190.utilities.root6.histo_conversion(histo, *args, **kwargs)

Automatically convert 1D or 2D ROOT histograms to pandas.DataFrame.

Parameters
  • histo (ROOT.TH1 or ROOT.TH2 or ROOT.RDF.RResultPtr) – ROOT histogram to be converted.

  • xname (str, optional) – Name of the x-axis, by default ‘x’.

  • yname (str, optional) – Name of the y-axis, by default ‘y’.

  • zname (str, optional) – Name of the z-axis, by default ‘z’. Only used for 2D histograms.

  • keep_zeros (bool, default True) – Whether to keep bins with zero content, i.e. z = 0, by default True. Only used for 2D histograms.

  • ignore_errors (bool, default False) – Whether to ignore errors. Only used for 2D histograms.

Returns

histo – Converted histogram.

Return type

pandas.DataFrame