atompy.load_1d_from_root#
- atompy.load_1d_from_root(fname, hname, output_format='ndarray')[source]#
Import a 1d histogram from a ROOT file.
- Parameters:
- Returns:
- output
ndarrayorHist1d Depends on output_format.
output_format == "ndarray": Return a NumPy ndarray.output[0]refers to the bin-centers of the loaded histogram,output[1]to the corresponding values.output_format == "Hist1d": Return aHist1d.output.centers(output.histogram) is analogous tooutput[0](output[1]) of the"ndarray"output.
- output
Examples
x, y = ap.load_root_hist1d("rootfile.root", "path/to/hist1d", output_format="ndarray") plt.plot(x, y) hist = ap.load_root_hist1d("rootfile.root", "path/to/hist1d", output_format="Hist1d") plt.plot(hist.centers, hist.histogram)