16with ROOT.TFile.Open(
"outfile_uhi.root",
"RECREATE")
as outFile:
20 histogram = ROOT.TH1D(
"histogram",
"My first ROOT histogram", nbinsx=30, xlow=0.0, xup=10.0)
26 values = np.array([1, 2, 3, 3, 3, 4, 3, 2, 1, 0])
27 counts, edges = np.histogram(values, bins=30, range=(0.0, 10.0))
28 histogram[...] = counts
31 outFile.WriteObject(histogram, histogram.GetName())