FeldmanCousins.C

Go to the documentation of this file.
00001 
00002 void FeldmanCousins()
00003 {
00004  // Example macro of using the TFeldmanCousins class in root.
00005  //
00006  // get a FeldmanCousins calculation object with the default limits
00007  // of calculating a 90% CL with the minimum signal value scanned 
00008  // = 0.0 and the maximum signal value scanned of 50.0
00009  //Author : Adrian John Bevan <bevan@SLAC.Stanford.EDU>
00010   
00011  if (!gROOT->GetClass("TFeldmanCousins")) gSystem->Load("libPhysics");
00012  
00013  TFeldmanCousins f;
00014 
00015   // calculate either the upper or lower limit for 10 observerd
00016   // events with an estimated background of 3.  The calculation of
00017   // either upper or lower limit will return that limit and fill
00018   // data members with both the upper and lower limit for you.
00019   Double_t Nobserved   = 10.0;
00020   Double_t Nbackground = 3.0;
00021 
00022   Double_t ul = f.CalculateUpperLimit(Nobserved, Nbackground);
00023   Double_t ll = f.GetLowerLimit();
00024 
00025   cout << "For " <<  Nobserved << " data observed with and estimated background"<<endl;
00026   cout << "of " << Nbackground << " candidates, the Feldman-Cousins method of "<<endl;
00027   cout << "calculating confidence limits gives:"<<endl;
00028   cout << "\tUpper Limit = " <<  ul << endl;
00029   cout << "\tLower Limit = " <<  ll << endl;
00030   cout << "at the 90% CL"<< endl;
00031 }
00032 

Generated on Tue Jul 5 15:44:49 2011 for ROOT_528-00b_version by  doxygen 1.5.1