Logo ROOT  
Reference Guide
TFeldmanCousins.h
Go to the documentation of this file.
1 // @(#)root/physics:$Id$
2 // Author: Adrian Bevan 2001
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. *
6  * Copyright (C) 2001, Liverpool University. *
7  * All rights reserved. *
8  * *
9  * For the licensing terms see $ROOTSYS/LICENSE. *
10  * For the list of contributors see $ROOTSYS/README/CREDITS. *
11  *************************************************************************/
12 
13 #ifndef ROOT_TFeldmanCousins
14 #define ROOT_TFeldmanCousins
15 
16 ////////////////////////////////////////////////////////////////////////////
17 // TFeldmanCousins
18 //
19 // class to calculate the CL upper limit using
20 // the Feldman-Cousins method as described in PRD V57 #7, p3873-3889
21 //
22 // The default confidence interval calvculated using this method is 90%
23 // This is set either by having a default the constructor, or using the
24 // appropriate fraction when instantiating an object of this class (e.g. 0.9)
25 //
26 // The simple extension to a gaussian resolution function bounded at zero
27 // has not been addressed as yet -> `time is of the essence' as they write
28 // on the wall of the maze in that classic game ...
29 //
30 // VARIABLES THAT CAN BE ALTERED
31 // -----------------------------
32 // => depending on your desired precision: The intial values of fMuMin,
33 // fMuMax, fMuStep and fNMax are those used in the PRD:
34 // fMuMin = 0.0
35 // fMuMax = 50.0
36 // fMuStep= 0.005
37 // but there is total flexibility in changing this should you desire.
38 //
39 // Author: Adrian Bevan, Liverpool University
40 //
41 // Copyright Liverpool University 2001 bevan@slac.stanford.edu
42 ///////////////////////////////////////////////////////////////////////////
43 
44 #include "TObject.h"
45 #include "TString.h"
46 
47 class TFeldmanCousins : public TObject {
48 protected:
49  Double_t fCL; // confidence level as a fraction [e.g. 90% = 0.9]
50  Double_t fUpperLimit; // the calculated upper limit
51  Double_t fLowerLimit; // the calculated lower limit
52  Double_t fNobserved; // input number of observed events
53  Double_t fNbackground;// input number of background events
54  Double_t fMuMin; // minimum value of signal to use in calculating the tables
55  Double_t fMuMax; // maximum value of signal to use in calculating the tables
56  Double_t fMuStep; // the step in signal to use when generating tables
57  Int_t fNMuStep; // = (int)(fMuStep)
58  Int_t fNMax; // = (int)(fMuMax)
59  Int_t fQUICK; // take a short cut to speed up the process of generating a
60  // lut. This scans from Nobserved-Nbackground-fMuMin upwards
61  // assuming that UL > Nobserved-Nbackground.
62 
63  ////////////////////////////////////////////////
64  // calculate the poissonian probability for //
65  // a mean of mu+B events with a variance of N //
66  ////////////////////////////////////////////////
68 
69  ////////////////////////////////////////////////
70  // calculate the probability table and see if //
71  // fNObserved is in the 100.0 * fCL % //
72  // interval //
73  ////////////////////////////////////////////////
75 
76 public:
77  TFeldmanCousins(Double_t newCL=0.9, TString options = "");
78  virtual ~TFeldmanCousins();
79 
80  ////////////////////////////////////////////////
81  // calculate the upper limit given Nobserved //
82  // and Nbackground events //
83  // the variables fUpperLimit and fLowerLimit //
84  // are set before returning the upper limit //
85  ////////////////////////////////////////////////
86  Double_t CalculateUpperLimit(Double_t Nobserved, Double_t Nbackground);
87  Double_t CalculateLowerLimit(Double_t Nobserved, Double_t Nbackground);
88 
89  inline Double_t GetUpperLimit(void) const { return fUpperLimit; }
90  inline Double_t GetLowerLimit(void) const { return fLowerLimit; }
91  inline Double_t GetNobserved(void) const { return fNobserved; }
92  inline Double_t GetNbackground(void) const { return fNbackground; }
93  inline Double_t GetCL(void) const { return fCL; }
94 
95  inline Double_t GetMuMin(void) const { return fMuMin; }
96  inline Double_t GetMuMax(void) const { return fMuMax; }
97  inline Double_t GetMuStep(void) const { return fMuStep; }
98  inline Double_t GetNMax(void) const { return fNMax; }
99 
100  inline void SetNobserved(Double_t NObs) { fNobserved = NObs; }
101  inline void SetNbackground(Double_t Nbg) { fNbackground = Nbg; }
102  inline void SetCL(Double_t newCL) { fCL = newCL; }
103 
104  inline void SetMuMin(Double_t newMin = 0.0) { fMuMin = newMin; }
105  void SetMuMax(Double_t newMax = 50.0);
106  void SetMuStep(Double_t newMuStep = 0.005);
107 
108  ClassDef(TFeldmanCousins,1) //calculate the CL upper limit using the Feldman-Cousins method
109 };
110 
111 #endif
112 
113 
114 
115 
116 
117 
TFeldmanCousins::fLowerLimit
Double_t fLowerLimit
Definition: TFeldmanCousins.h:51
TFeldmanCousins::CalculateUpperLimit
Double_t CalculateUpperLimit(Double_t Nobserved, Double_t Nbackground)
given Nobserved and Nbackground, try different values of mu that give upper limits that are consisten...
Definition: TFeldmanCousins.cxx:100
TFeldmanCousins::GetMuMin
Double_t GetMuMin(void) const
Definition: TFeldmanCousins.h:95
TFeldmanCousins::fQUICK
Int_t fQUICK
Definition: TFeldmanCousins.h:59
TFeldmanCousins::Prob
Double_t Prob(Int_t N, Double_t mu, Double_t B)
Calculate the poissonian probability for a mean of mu+B events with a variance of N.
Definition: TFeldmanCousins.cxx:201
N
#define N
TFeldmanCousins::fCL
Double_t fCL
Definition: TFeldmanCousins.h:49
TFeldmanCousins::SetNobserved
void SetNobserved(Double_t NObs)
Definition: TFeldmanCousins.h:100
TFeldmanCousins::fNMax
Int_t fNMax
Definition: TFeldmanCousins.h:58
TString
Basic string class.
Definition: TString.h:136
TString.h
TFeldmanCousins::GetUpperLimit
Double_t GetUpperLimit(void) const
Definition: TFeldmanCousins.h:89
TFeldmanCousins::fNobserved
Double_t fNobserved
Definition: TFeldmanCousins.h:52
TFeldmanCousins::fNbackground
Double_t fNbackground
Definition: TFeldmanCousins.h:53
TFeldmanCousins::SetMuMax
void SetMuMax(Double_t newMax=50.0)
Set maximum value of signal to use in calculating the tables.
Definition: TFeldmanCousins.cxx:209
TFeldmanCousins::fNMuStep
Int_t fNMuStep
Definition: TFeldmanCousins.h:57
TFeldmanCousins::fMuStep
Double_t fMuStep
Definition: TFeldmanCousins.h:56
TFeldmanCousins::fUpperLimit
Double_t fUpperLimit
Definition: TFeldmanCousins.h:50
TFeldmanCousins::GetMuStep
Double_t GetMuStep(void) const
Definition: TFeldmanCousins.h:97
TFeldmanCousins::GetNMax
Double_t GetNMax(void) const
Definition: TFeldmanCousins.h:98
TFeldmanCousins::~TFeldmanCousins
virtual ~TFeldmanCousins()
Definition: TFeldmanCousins.cxx:79
TFeldmanCousins::GetNobserved
Double_t GetNobserved(void) const
Definition: TFeldmanCousins.h:91
TFeldmanCousins::fMuMin
Double_t fMuMin
Definition: TFeldmanCousins.h:54
TFeldmanCousins::GetNbackground
Double_t GetNbackground(void) const
Definition: TFeldmanCousins.h:92
Double_t
double Double_t
Definition: RtypesCore.h:59
TFeldmanCousins::GetLowerLimit
Double_t GetLowerLimit(void) const
Definition: TFeldmanCousins.h:90
TFeldmanCousins::SetCL
void SetCL(Double_t newCL)
Definition: TFeldmanCousins.h:102
TObject.h
TFeldmanCousins::GetCL
Double_t GetCL(void) const
Definition: TFeldmanCousins.h:93
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TFeldmanCousins::fMuMax
Double_t fMuMax
Definition: TFeldmanCousins.h:55
TFeldmanCousins::CalculateLowerLimit
Double_t CalculateLowerLimit(Double_t Nobserved, Double_t Nbackground)
given Nobserved and Nbackground, try different values of mu that give lower limits that are consisten...
Definition: TFeldmanCousins.cxx:88
TFeldmanCousins::FindLimitsFromTable
Int_t FindLimitsFromTable(Double_t mu)
calculate the probability table for a given mu for n = 0, NMAX and return 1 if the number of observed...
Definition: TFeldmanCousins.cxx:155
TFeldmanCousins::TFeldmanCousins
TFeldmanCousins(Double_t newCL=0.9, TString options="")
Constructor.
Definition: TFeldmanCousins.cxx:57
ROOT::Math::Cephes::B
static double B[]
Definition: SpecFuncCephes.cxx:178
TFeldmanCousins
Class to calculate the CL upper limit using the Feldman-Cousins method as described in PRD V57 #7,...
Definition: TFeldmanCousins.h:47
TFeldmanCousins::SetMuMin
void SetMuMin(Double_t newMin=0.0)
Definition: TFeldmanCousins.h:104
TFeldmanCousins::GetMuMax
Double_t GetMuMax(void) const
Definition: TFeldmanCousins.h:96
TFeldmanCousins::SetMuStep
void SetMuStep(Double_t newMuStep=0.005)
Set the step in signal to use when generating tables.
Definition: TFeldmanCousins.cxx:219
TFeldmanCousins::SetNbackground
void SetNbackground(Double_t Nbg)
Definition: TFeldmanCousins.h:101
int