File indexing completed on 2025-12-16 10:29:45
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef RooStats_LikelihoodInterval
0012 #define RooStats_LikelihoodInterval
0013
0014 #include "RooStats/ConfInterval.h"
0015
0016 #include "RooArgSet.h"
0017
0018 #include "RooAbsReal.h"
0019
0020 #include "Math/IFunctionfwd.h"
0021
0022 #include <map>
0023 #include <memory>
0024 #include <string>
0025
0026 namespace ROOT {
0027 namespace Math {
0028 class Minimizer;
0029 }
0030 }
0031
0032 namespace RooStats {
0033
0034 class LikelihoodInterval : public ConfInterval {
0035
0036 public:
0037
0038
0039 explicit LikelihoodInterval(const char *name = nullptr);
0040
0041
0042
0043 LikelihoodInterval(const char* name, RooAbsReal*, const RooArgSet*, RooArgSet * = nullptr);
0044
0045
0046 ~LikelihoodInterval() override;
0047
0048
0049 bool IsInInterval(const RooArgSet&) const override;
0050
0051
0052 void SetConfidenceLevel(double cl) override {fConfidenceLevel = cl; ResetLimits(); }
0053
0054
0055 double ConfidenceLevel() const override {return fConfidenceLevel;}
0056
0057
0058 RooArgSet* GetParameters() const override;
0059
0060
0061 bool CheckParameters(const RooArgSet&) const override ;
0062
0063
0064
0065 double LowerLimit(const RooRealVar& param) { bool ok; return LowerLimit(param,ok); }
0066 double LowerLimit(const RooRealVar& param, bool & status) ;
0067
0068
0069 double UpperLimit(const RooRealVar& param) { bool ok; return UpperLimit(param,ok); }
0070 double UpperLimit(const RooRealVar& param, bool & status) ;
0071
0072
0073
0074 bool FindLimits(const RooRealVar & param, double & lower, double &upper);
0075
0076
0077
0078
0079
0080
0081 Int_t GetContourPoints(const RooRealVar & paramX, const RooRealVar & paramY, double * x, double *y, Int_t npoints = 30);
0082
0083
0084 RooAbsReal* GetLikelihoodRatio() {return fLikelihoodRatio;}
0085
0086
0087 const RooArgSet * GetBestFitParameters() const { return fBestFitParams; }
0088
0089 protected:
0090
0091
0092 void ResetLimits();
0093
0094
0095 bool CreateMinimizer();
0096
0097 private:
0098
0099 RooArgSet fParameters;
0100 RooArgSet * fBestFitParams;
0101 RooAbsReal* fLikelihoodRatio;
0102 double fConfidenceLevel;
0103 std::map<std::string, double> fLowerLimits;
0104 std::map<std::string, double> fUpperLimits;
0105 std::shared_ptr<ROOT::Math::Minimizer > fMinimizer;
0106 std::shared_ptr<RooFunctor> fFunctor;
0107 std::shared_ptr<ROOT::Math::IMultiGenFunction> fMinFunc;
0108
0109 ClassDefOverride(LikelihoodInterval,1)
0110
0111 };
0112 }
0113
0114 #endif