TFeldmanCousins.h

Go to the documentation of this file.
00001 // @(#)root/physics:$Id: TFeldmanCousins.h 20882 2007-11-19 11:31:26Z rdm $
00002 // Author: Adrian Bevan  2001
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers.               *
00006  * Copyright (C) 2001, Liverpool University.                             *
00007  * All rights reserved.                                                  *
00008  *                                                                       *
00009  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00010  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00011  *************************************************************************/
00012 
00013 #ifndef ROOT_TFeldmanCousins
00014 #define ROOT_TFeldmanCousins
00015 
00016 ////////////////////////////////////////////////////////////////////////////
00017 // TFeldmanCousins
00018 //
00019 // class to calculate the CL upper limit using
00020 // the Feldman-Cousins method as described in PRD V57 #7, p3873-3889
00021 //
00022 // The default confidence interval calvculated using this method is 90%
00023 // This is set either by having a default the constructor, or using the
00024 // appropriate fraction when instantiating an object of this class (e.g. 0.9)
00025 //
00026 // The simple extension to a gaussian resolution function bounded at zero
00027 // has not been addressed as yet -> `time is of the essence' as they write
00028 // on the wall of the maze in that classic game ...
00029 //
00030 //    VARIABLES THAT CAN BE ALTERED
00031 //    -----------------------------
00032 // => depending on your desired precision: The intial values of fMuMin,
00033 // fMuMax, fMuStep and fNMax are those used in the PRD:
00034 //   fMuMin = 0.0
00035 //   fMuMax = 50.0
00036 //   fMuStep= 0.005
00037 // but there is total flexibility in changing this should you desire.
00038 //
00039 // Author: Adrian Bevan, Liverpool University
00040 //
00041 // Copyright Liverpool University 2001       bevan@slac.stanford.edu
00042 ///////////////////////////////////////////////////////////////////////////
00043 
00044 #include "TObject.h"
00045 #include "TString.h"
00046 
00047 class TFeldmanCousins : public TObject {
00048 protected:
00049    Double_t fCL;         // confidence level as a fraction [e.g. 90% = 0.9]
00050    Double_t fUpperLimit; // the calculated upper limit
00051    Double_t fLowerLimit; // the calculated lower limit
00052    Double_t fNobserved;  // input number of observed events
00053    Double_t fNbackground;// input number of background events
00054    Double_t fMuMin;      // minimum value of signal to use in calculating the tables
00055    Double_t fMuMax;      // maximum value of signal to use in calculating the tables
00056    Double_t fMuStep;     // the step in signal to use when generating tables
00057    Int_t    fNMuStep;    // = (int)(fMuStep)
00058    Int_t    fNMax;       // = (int)(fMuMax)
00059    Int_t    fQUICK;      // take a short cut to speed up the process of generating a
00060                         // lut.  This scans from Nobserved-Nbackground-fMuMin upwards
00061                         // assuming that UL > Nobserved-Nbackground.
00062 
00063    ////////////////////////////////////////////////
00064    // calculate the poissonian probability for   //
00065    // a mean of mu+B events with a variance of N //
00066    ////////////////////////////////////////////////
00067    Double_t Prob(Int_t N, Double_t mu, Double_t B);
00068 
00069    ////////////////////////////////////////////////
00070    // calculate the probability table and see if //
00071    // fNObserved is in the 100.0 * fCL %         //
00072    // interval                                   //
00073    ////////////////////////////////////////////////
00074    Int_t FindLimitsFromTable(Double_t mu);
00075 
00076 public:
00077    TFeldmanCousins(Double_t newCL=0.9, TString options = "");
00078    virtual ~TFeldmanCousins();
00079 
00080    ////////////////////////////////////////////////
00081    // calculate the upper limit given Nobserved  //
00082    // and Nbackground events                     //
00083    // the variables fUpperLimit and fLowerLimit  //
00084    // are set before returning the upper limit   //
00085    ////////////////////////////////////////////////
00086    Double_t CalculateUpperLimit(Double_t Nobserved, Double_t Nbackground);
00087    Double_t CalculateLowerLimit(Double_t Nobserved, Double_t Nbackground);
00088 
00089    inline Double_t GetUpperLimit(void)  const { return fUpperLimit;  }
00090    inline Double_t GetLowerLimit(void)  const { return fLowerLimit;  }
00091    inline Double_t GetNobserved(void)   const { return fNobserved;   }
00092    inline Double_t GetNbackground(void) const { return fNbackground; }
00093    inline Double_t GetCL(void)          const { return fCL;          }
00094 
00095    inline Double_t GetMuMin(void)       const { return fMuMin;  }
00096    inline Double_t GetMuMax(void)       const { return fMuMax;  }
00097    inline Double_t GetMuStep(void)      const { return fMuStep; }
00098    inline Double_t GetNMax(void)        const { return fNMax;   }
00099 
00100    inline void     SetNobserved(Double_t NObs)         { fNobserved   = NObs;  }
00101    inline void     SetNbackground(Double_t Nbg)        { fNbackground = Nbg;   }
00102    inline void     SetCL(Double_t newCL)               { fCL          = newCL; }
00103 
00104    inline void     SetMuMin(Double_t  newMin    = 0.0)   { fMuMin = newMin;  }
00105    void            SetMuMax(Double_t  newMax    = 50.0);
00106    void            SetMuStep(Double_t newMuStep = 0.005);
00107 
00108    ClassDef(TFeldmanCousins,1) //calculate the CL upper limit using the Feldman-Cousins method
00109 };
00110 
00111 #endif
00112 
00113 
00114 
00115 
00116 
00117 

Generated on Tue Jul 5 14:26:47 2011 for ROOT_528-00b_version by  doxygen 1.5.1