Integrating over a histogram

How do you integrate over a histogram? Like splitting up histogram into sections with each section in a bin? this is what I have.

TH1D *h1=new TH1D(“h1”,”Rings”,400,0,1300)
h1->Integral(600,800)

I’m not sure I understand your question. What you do seems correct, see the documentation of TH1D::Integral (Int_t binx1, binx2, *option="")

@bellenot mentioned - what you are doing is correct.

Just in case, you are putting ; after

h1->Integral(600,800)

then remove it and try!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.