00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef ROOT_TRolke
00027 #define ROOT_TRolke
00028
00029 #include "TObject.h"
00030 #include "TMath.h"
00031
00032
00033 class TRolke : public TObject
00034 {
00035
00036 private:
00037 Double_t fCL;
00038 Double_t fUpperLimit;
00039 Double_t fLowerLimit;
00040 bool fBounding;
00041
00042 Int_t fNumWarningsDeprecated1;
00043 Int_t fNumWarningsDeprecated2;
00044
00045
00046
00047 Int_t f_x;
00048 Int_t f_y;
00049 Int_t f_z;
00050 Double_t f_bm;
00051 Double_t f_em;
00052 Double_t f_e;
00053 Int_t f_mid;
00054 Double_t f_sde;
00055 Double_t f_sdb;
00056 Double_t f_tau;
00057 Double_t f_b;
00058 Int_t f_m;
00059
00060
00061
00062
00063 Double_t Interval(Int_t x, Int_t y, Int_t z, Double_t bm, Double_t em, Double_t e, Int_t mid, Double_t sde, Double_t sdb, Double_t tau, Double_t b, Int_t m);
00064
00065
00066 Double_t Likelihood(Double_t mu, Int_t x, Int_t y, Int_t z, Double_t bm, Double_t em, Int_t mid, Double_t sde, Double_t sdb, Double_t tau, Double_t b, Int_t m, Int_t what);
00067
00068
00069 Double_t EvalLikeMod1(Double_t mu, Int_t x, Int_t y, Int_t z, Double_t tau, Int_t m, Int_t what);
00070 Double_t LikeMod1(Double_t mu, Double_t b, Double_t e, Int_t x, Int_t y, Int_t z, Double_t tau, Int_t m);
00071 void ProfLikeMod1(Double_t mu, Double_t &b, Double_t &e, Int_t x, Int_t y, Int_t z, Double_t tau, Int_t m);
00072 Double_t LikeGradMod1(Double_t e, Double_t mu, Int_t x, Int_t y, Int_t z, Double_t tau, Int_t m);
00073
00074
00075 Double_t EvalLikeMod2(Double_t mu, Int_t x, Int_t y, Double_t em, Double_t sde, Double_t tau, Int_t what);
00076
00077 Double_t LikeMod2(Double_t mu, Double_t b, Double_t e, Int_t x, Int_t y, Double_t em, Double_t tau, Double_t v);
00078
00079
00080 Double_t EvalLikeMod3(Double_t mu, Int_t x, Double_t bm, Double_t em, Double_t sde, Double_t sdb, Int_t what);
00081 Double_t LikeMod3(Double_t mu, Double_t b, Double_t e, Int_t x, Double_t bm, Double_t em, Double_t u, Double_t v);
00082
00083
00084 Double_t EvalLikeMod4(Double_t mu, Int_t x, Int_t y, Double_t tau, Int_t what);
00085 Double_t LikeMod4(Double_t mu, Double_t b, Int_t x, Int_t y, Double_t tau);
00086
00087
00088 Double_t EvalLikeMod5(Double_t mu, Int_t x, Double_t bm, Double_t sdb, Int_t what);
00089 Double_t LikeMod5(Double_t mu, Double_t b, Int_t x, Double_t bm, Double_t u);
00090
00091
00092 Double_t EvalLikeMod6(Double_t mu, Int_t x, Int_t z, Double_t b, Int_t m, Int_t what);
00093 Double_t LikeMod6(Double_t mu, Double_t b, Double_t e, Int_t x, Int_t z, Int_t m);
00094
00095
00096 Double_t EvalLikeMod7(Double_t mu, Int_t x, Double_t em, Double_t sde, Double_t b, Int_t what);
00097 Double_t LikeMod7(Double_t mu, Double_t b, Double_t e, Int_t x, Double_t em, Double_t v);
00098
00099
00100 static Double_t EvalPolynomial(Double_t x, const Int_t coef[], Int_t N);
00101 static Double_t EvalMonomial(Double_t x, const Int_t coef[], Int_t N);
00102 Double_t LogFactorial(Int_t n);
00103
00104 Double_t ComputeInterval(Int_t x, Int_t y, Int_t z, Double_t bm, Double_t em, Double_t e, Int_t mid, Double_t sde, Double_t sdb, Double_t tau, Double_t b, Int_t m);
00105
00106 void SetModelParameters(Int_t x, Int_t y, Int_t z, Double_t bm, Double_t em, Double_t e, Int_t mid, Double_t sde, Double_t sdb, Double_t tau, Double_t b, Int_t m);
00107
00108 void SetModelParameters();
00109
00110 Double_t GetBackground();
00111
00112 public:
00113
00114
00115 TRolke(Double_t CL = 0.9, Option_t *option = "");
00116
00117
00118 virtual ~TRolke();
00119
00120
00121 Double_t GetCL() const {
00122 return fCL;
00123 }
00124 void SetCL(Double_t CL) {
00125 fCL = CL;
00126 }
00127
00128
00129 void SetCLSigmas(Double_t CLsigmas) {
00130 fCL = TMath::Erf(CLsigmas / TMath::Sqrt(2.0)) ;
00131 }
00132
00133
00134
00135 void SetPoissonBkgBinomEff(Int_t x, Int_t y, Int_t z, Double_t tau, Int_t m);
00136
00137
00138 void SetPoissonBkgGaussEff(Int_t x, Int_t y, Double_t em, Double_t tau, Double_t sde);
00139
00140
00141 void SetGaussBkgGaussEff(Int_t x, Double_t bm, Double_t em, Double_t sde, Double_t sdb);
00142
00143
00144 void SetPoissonBkgKnownEff(Int_t x, Int_t y, Double_t tau, Double_t e);
00145
00146
00147 void SetGaussBkgKnownEff(Int_t x, Double_t bm, Double_t sdb, Double_t e);
00148
00149
00150 void SetKnownBkgBinomEff(Int_t x, Int_t z, Int_t m, Double_t b);
00151
00152
00153 void SetKnownBkgGaussEff(Int_t x, Double_t em, Double_t sde, Double_t b);
00154
00155
00156 Double_t CalculateInterval(Int_t x, Int_t y, Int_t z, Double_t bm, Double_t em, Double_t e, Int_t mid, Double_t sde, Double_t sdb, Double_t tau, Double_t b, Int_t m);
00157
00158
00159 bool GetLimits(Double_t& low, Double_t& high);
00160 Double_t GetUpperLimit();
00161 Double_t GetLowerLimit();
00162
00163
00164 bool GetSensitivity(Double_t& low, Double_t& high, Double_t pPrecision = 0.00001);
00165
00166
00167
00168 bool GetLimitsQuantile(Double_t& low, Double_t& high, Int_t& out_x, Double_t integral = 0.5);
00169
00170
00171 bool GetLimitsML(Double_t& low, Double_t& high, Int_t& out_x);
00172
00173
00174 bool GetCriticalNumber(Int_t& ncrit,Int_t maxtry=-1);
00175
00176
00177
00178 bool GetBounding() const {
00179 return fBounding;
00180 }
00181
00182
00183
00184 void SetBounding(const bool bnd) {
00185 fBounding = bnd;
00186 }
00187
00188
00189 void SetSwitch(bool bnd) ;
00190
00191
00192 void Print(Option_t*) const;
00193
00194 ClassDef(TRolke, 2)
00195 };
00196
00197
00198 #endif
00199