Integral of 1-D histos

Nick van Eijndhoven (Nick@phys.uu.nl)
Thu, 11 Jun 1998 11:19:43 +0200


Dear friends,
I have several 1-D histos of which I want to determine the
integral of the bin contents above some x-value and the error
on the integral value.
Currently I do this in my private C++ code by looping over the
bins and calculating everything myself, however I saw the
TH1F::Integral in the docs and wonder if there is something
available to obtain the above.
What would be convenient to my opinion is something like

TH1F* h // The 1-D histo which is then filled with data

float lower,upper; // The lower- and upper bounds for the integral

float val,err; // Value and error of the integral

val=h->Integral(lower,upper,err)

Is something like this available already ?
Note that I prefer the integral to be specified between the real
boundaries instead if the bin numbers. To my opinion this makes
complicated operations more clear in the code.

-- 

Cheers,

_/_/ _/ _/ _/_/_/_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/_/ _/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/_/_/_/ _/ _/

*----------------------------------------------------------------------* Dr. Nick van Eijndhoven Department of Subatomic Physics email : nick@phys.uu.nl Utrecht University / NIKHEF tel. +31-30-2532331 (direct) P.O. Box 80.000 tel. +31-30-2531492 (secr.) NL-3508 TA Utrecht fax. +31-30-2518689 The Netherlands WWW : http://www.phys.uu.nl/~nick Office : Ornstein lab. 172 ---------------------------------------------------------------------- tel. +41-22-7679751 (direct) CERN PPE Division / ALICE exp. tel. +41-22-7675857 (secr.) CH-1211 Geneva 23 fax. +41-22-7679480 Switzerland CERN beep : 13+7294 Office : B 160 1-012 *----------------------------------------------------------------------*