swh:1:snp:af87cd67498ef4fe47c76ed3e7caffe5b61facaf
Tip revision: bc0d9b6cc2e699afac8ab08ad31e5cbda1414799 authored by Unknown Author on 05 November 2002, 09:54:28 UTC
This commit was manufactured by cvs2svn to create tag 'v3-03-09b'.
This commit was manufactured by cvs2svn to create tag 'v3-03-09b'.
Tip revision: bc0d9b6
FeldmanCousins.C
void FeldmanCousins()
{
// Example macro of using the TFeldmanCousins class in root.
// Author : Adrian John Bevan <bevan@SLAC.Stanford.EDU>
//
// 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
TFeldmanCousins f;
// calculate either the upper or lower limit for 10 observerd
// events with an estimated background of 3. The calculation of
// either upper or lower limit will return that limit and fill
// data memebers 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;
}