umami-hep / puma

puma - Plotting UMami Api
Apache License 2.0
4 stars 27 forks source link

Adding weight support to histogram plots #55

Closed manuguth closed 2 years ago

manuguth commented 2 years ago

Currently only jets/events without any weight can be plotted while it is important to support also weights for the histograms

joschkabirk commented 2 years ago

You are thinking of giving each entry a weight, right?

So we could add an optional weights argument which needs to be of the same shape as the values to puma.Histogram such that one can do

histogram = puma.Histogram(values=[1, 2, 1], weights=[1, 1, 2])

This way we can also preserve our analogy to np.histogram(), since we can just hand it to that function.

manuguth commented 2 years ago

You are thinking of giving each entry a weight, right?

So we could add an optional weights argument which needs to be of the same shape as the values to puma.Histogram such that one can do

histogram = puma.Histogram(values=[1, 2, 1], weights=[1, 1, 2])

This way we can also preserve our analogy to np.histogram(), since we can just hand it to that function.

exactly that's what I had in mind, the only thing we need to be careful are the uncertainty calculations