Go to the documentation of this file.00001 #ifndef PhysicsTools_RooStatsCms_BinomialInterval_h
00002 #define PhysicsTools_RooStatsCms_BinomialInterval_h
00003
00004
00005
00006
00007
00008
00009
00010
00011 #if (defined (STANDALONE) or defined (__CINT__) )
00012 #include "TNamed.h"
00013 #endif
00014
00015
00016
00017
00018 class BinomialInterval
00019 #if (defined (STANDALONE) or defined (__CINT__) )
00020 : public TNamed
00021 #endif
00022 {
00023 public:
00024
00025
00026
00027 enum tail_type { equal_tailed, lower_tailed, upper_tailed };
00028
00029
00030
00031 void init(const double alpha, const tail_type t=equal_tailed);
00032
00033
00034
00035
00036
00037
00038 virtual void calculate(const double successes, const double trials) = 0;
00039
00040
00041 virtual const char* name() const = 0;
00042
00043
00044
00045 bool contains(double rho);
00046
00047
00048
00049 double coverage_prob(const double rho, const int trials);
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059 void scan_rho(const int ntot, const int nrho, double* rho, double* prob);
00060
00061
00062
00063
00064 void scan_ntot(const double rho, const int ntot_min, const int ntot_max, double* ntot, double* prob);
00065
00066
00067
00068
00069 virtual bool neyman(const int ntot, const int nrho, double* rho, double* x_l, double* x_r) { return false; }
00070
00071
00072
00073
00074 void dump(const int trials_min, const int trials_max);
00075
00076
00077 double alpha() const { return alpha_; }
00078 double lower() const { return lower_; }
00079 double upper() const { return upper_; }
00080 double length() const { return upper_ - lower_; }
00081
00082 protected:
00083 double alpha_;
00084 tail_type type_;
00085 double alpha_min_;
00086 double kappa_;
00087 double kappa2_;
00088
00089 double lower_;
00090 double upper_;
00091
00092 void set(double l, double u) { lower_ = l; upper_ = u; }
00093
00094 #if (defined (STANDALONE) or defined (__CINT__) )
00095 ClassDef(BinomialInterval,1)
00096 #endif
00097 };
00098
00099 #endif
00100