How to Integrate a PDF in range in absolute numbers?

Hi,

I’d like to integrate a PDF in a given range, but I want the result to be not normalized. For this I tried to use createIntegral:

double Integral(RooAbsPdf *function,double lowerLimit, double upperLimit)
{
  integrationVar.setRange("integralRange", lowerLimit, upperLimit) ;

  RooAbsReal* integral = (*function).createIntegral(integrationVar, Range("integralRange")) ;

  double IntegralValue = integral->getVal();
  printf("\nIntegrating %s from %f to %f\n", (*function).GetName(),
         lowerLimit, upperLimit);
  printf("Integral value: %f\n", IntegralValue);
  return IntegralValue;
}[/code]

But it seems that I always get back a normailzed result. Is there any option in createIntegral that specifies the flag for normalisation except NormSet(), which I didn't specify by purpose?

I want this in order to be able to calculate the signal significance in a certain mass window. 

Thanks,  Peter.

Hi Peter,

I’m slightly confused what you want to do with an integral over an unnormalized p.d.f as is by definition an undefined quantity in statistical context. These integrals over unnormalized p.d.f.s are only used to constructed normalized p.d.f.s which have a well defined meaning.

For any proper use in statistical context you should integrate a normalized p.d.f, i.e.

RooAbsReal* integral = (*function).createIntegral(integrationVar, NormSet(integrationVar),Range(“integralRange”)) ;

which returns you a number between 0 and 1, which is the fraction of the p.d.f that is contained in the range with the given name. If you have a composite RooAddPdf that
is constructed as NsigFsig(x) + NbkgFbkg(x) you should simply multiply the fraction you get out from the above normalized integral over Fsig with Nsig to get the number of signal events out in the given range.

Wouter

Thank you Wouter,

You are right. I didn’t realize that, of course, I can easily get the result I want knowing the total number of events, :slight_smile:.

regards, Peter.