00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef RooStats_LikelihoodInterval
00012 #define RooStats_LikelihoodInterval
00013
00014 #ifndef RooStats_ConfInterval
00015 #include "RooStats/ConfInterval.h"
00016 #endif
00017
00018 #ifndef ROO_ARG_SET
00019 #include "RooArgSet.h"
00020 #endif
00021
00022 #ifndef ROO_ABS_REAL
00023 #include "RooAbsReal.h"
00024 #endif
00025
00026 #ifndef ROOT_Math_IFunctionfwd
00027 #include "Math/IFunctionfwd.h"
00028 #endif
00029
00030 #include <map>
00031 #include <memory>
00032
00033 namespace ROOT {
00034 namespace Math {
00035 class Minimizer;
00036 }
00037 }
00038
00039 namespace RooStats {
00040
00041 class LikelihoodInterval : public ConfInterval {
00042
00043 public:
00044
00045
00046 explicit LikelihoodInterval(const char* name = 0);
00047
00048
00049
00050 LikelihoodInterval(const char* name, RooAbsReal*, const RooArgSet*, RooArgSet * = 0);
00051
00052
00053 virtual ~LikelihoodInterval();
00054
00055
00056 virtual Bool_t IsInInterval(const RooArgSet&) const;
00057
00058
00059 virtual void SetConfidenceLevel(Double_t cl) {fConfidenceLevel = cl; ResetLimits(); }
00060
00061
00062 virtual Double_t ConfidenceLevel() const {return fConfidenceLevel;}
00063
00064
00065 virtual RooArgSet* GetParameters() const;
00066
00067
00068 Bool_t CheckParameters(const RooArgSet&) const ;
00069
00070
00071
00072 Double_t LowerLimit(const RooRealVar& param) { bool ok; return LowerLimit(param,ok); }
00073 Double_t LowerLimit(const RooRealVar& param, bool & status) ;
00074
00075
00076 Double_t UpperLimit(const RooRealVar& param) { bool ok; return UpperLimit(param,ok); }
00077 Double_t UpperLimit(const RooRealVar& param, bool & status) ;
00078
00079
00080
00081 Bool_t FindLimits(const RooRealVar & param, double & lower, double &upper);
00082
00083
00084
00085
00086
00087
00088
00089
00090 Int_t GetContourPoints(const RooRealVar & paramX, const RooRealVar & paramY, Double_t * x, Double_t *y, Int_t npoints = 30);
00091
00092
00093 RooAbsReal* GetLikelihoodRatio() {return fLikelihoodRatio;}
00094
00095
00096 const RooArgSet * GetBestFitParameters() const { return fBestFitParams; }
00097
00098 protected:
00099
00100
00101 void ResetLimits();
00102
00103
00104 bool CreateMinimizer();
00105
00106 private:
00107
00108 RooArgSet fParameters;
00109 RooArgSet * fBestFitParams;
00110 RooAbsReal* fLikelihoodRatio;
00111 Double_t fConfidenceLevel;
00112 std::map<std::string, double> fLowerLimits;
00113 std::map<std::string, double> fUpperLimits;
00114 std::auto_ptr<ROOT::Math::Minimizer > fMinimizer;
00115 std::auto_ptr<RooFunctor> fFunctor;
00116 std::auto_ptr<ROOT::Math::IMultiGenFunction> fMinFunc;
00117
00118 ClassDef(LikelihoodInterval,1)
00119
00120 };
00121 }
00122
00123 #endif