Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
FeldmanCousins.C
Go to the documentation of this file.
1/// \file
2/// \ingroup tutorial_math_legacy
3/// Example macro of using the TFeldmanCousins class in root.
4///
5/// get a FeldmanCousins calculation object with the default limits
6/// of calculating a 90% CL with the minimum signal value scanned
7/// = 0.0 and the maximum signal value scanned of 50.0
8///
9/// \macro_output
10/// \macro_code
11///
12/// \author Adrian John Bevan <bevan@SLAC.Stanford.EDU>
13
14void FeldmanCousins()
15{
17
18 // calculate either the upper or lower limit for 10 observed
19 // events with an estimated background of 3. The calculation of
20 // either upper or lower limit will return that limit and fill
21 // data members with both the upper and lower limit for you.
22 Double_t Nobserved = 10.0;
24
25 Double_t ul = f.CalculateUpperLimit(Nobserved, Nbackground);
26 Double_t ll = f.GetLowerLimit();
27
28 cout << "For " << Nobserved << " data observed with and estimated background"<<endl;
29 cout << "of " << Nbackground << " candidates, the Feldman-Cousins method of "<<endl;
30 cout << "calculating confidence limits gives:"<<endl;
31 cout << "\tUpper Limit = " << ul << endl;
32 cout << "\tLower Limit = " << ll << endl;
33 cout << "at the 90% CL"<< endl;
34}
#define f(i)
Definition RSha256.hxx:104
double Double_t
Definition RtypesCore.h:59
<div class="legacybox"><h2>Legacy Code</h2> TFeldmanCousins is a legacy interface: there will be no b...