Hi,
I have to find error of a TH2 histogram bin by bin, and put them in a new histogram. Is there any function that allows me to do so ?
Gunn
Hi,
I have to find error of a TH2 histogram bin by bin, and put them in a new histogram. Is there any function that allows me to do so ?
Gunn
If h2 is your histogram, I would:
This loop works but only when the bin numbering is the same as axis points (in other words, when the bin size is of value 1 and when it starts with 1 and ends with maxmum bin number).
What you do in this loop is taking error of bin(i,j), e, and filling this e value in a new histogram with (x,y) value of e.
In my case, the x axis is -180 to +180 and total bins are 72 and resulting picture shows as attachment (original top panel and sqrt on bottom panel).
UPDATE:
I just figured out through manual, replacing “Fill” with “SetBinContent” solves the problem.
i.e
…
h2n->SetBinContent(i,j,e)
…
Yes sure. I meant that… sorry. … anyway you got the idea with the pseudo code I sent you