Logo ROOT  
Reference Guide
FeldmanCousins.C File Reference

Detailed Description

View in nbviewer Open in SWAN Example macro of using the TFeldmanCousins class in root.

get a FeldmanCousins calculation object with the default limits of calculating a 90% CL with the minimum signal value scanned = 0.0 and the maximum signal value scanned of 50.0

For 10 data observed with and estimated background
of 3 candidates, the Feldman-Cousins method of
calculating confidence limits gives:
Upper Limit = 13.505
Lower Limit = 2.635
at the 90% CL
void FeldmanCousins()
{
if (!gROOT->GetClass("TFeldmanCousins"))
R__LOAD_LIBRARY(libPhysics);
// calculate either the upper or lower limit for 10 observed
// events with an estimated background of 3. The calculation of
// either upper or lower limit will return that limit and fill
// data members with both the upper and lower limit for you.
Double_t Nobserved = 10.0;
Double_t Nbackground = 3.0;
Double_t ul = f.CalculateUpperLimit(Nobserved, Nbackground);
Double_t ll = f.GetLowerLimit();
cout << "For " << Nobserved << " data observed with and estimated background"<<endl;
cout << "of " << Nbackground << " candidates, the Feldman-Cousins method of "<<endl;
cout << "calculating confidence limits gives:"<<endl;
cout << "\tUpper Limit = " << ul << endl;
cout << "\tLower Limit = " << ll << endl;
cout << "at the 90% CL"<< endl;
}
#define f(i)
Definition: RSha256.hxx:104
double Double_t
Definition: RtypesCore.h:57
#define R__LOAD_LIBRARY(LIBRARY)
Definition: Rtypes.h:469
#define gROOT
Definition: TROOT.h:406
Class to calculate the CL upper limit using the Feldman-Cousins method as described in PRD V57 #7,...
Author
Adrian John Bevan bevan.nosp@m.@SLA.nosp@m.C.Sta.nosp@m.nfor.nosp@m.d.EDU

Definition in file FeldmanCousins.C.