#ifndef ROOT_TRolke
#define ROOT_TRolke
#include "TObject.h"
#include "TMath.h"
class TRolke : public TObject
{
private:
Double_t fCL;
Double_t fUpperLimit;
Double_t fLowerLimit;
bool fBounding;
Int_t fNumWarningsDeprecated1;
Int_t fNumWarningsDeprecated2;
Int_t f_x;
Int_t f_y;
Int_t f_z;
Double_t f_bm;
Double_t f_em;
Double_t f_e;
Int_t f_mid;
Double_t f_sde;
Double_t f_sdb;
Double_t f_tau;
Double_t f_b;
Int_t f_m;
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);
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);
Double_t EvalLikeMod1(Double_t mu, Int_t x, Int_t y, Int_t z, Double_t tau, Int_t m, Int_t what);
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);
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);
Double_t LikeGradMod1(Double_t e, Double_t mu, Int_t x, Int_t y, Int_t z, Double_t tau, Int_t m);
Double_t EvalLikeMod2(Double_t mu, Int_t x, Int_t y, Double_t em, Double_t sde, Double_t tau, Int_t what);
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);
Double_t EvalLikeMod3(Double_t mu, Int_t x, Double_t bm, Double_t em, Double_t sde, Double_t sdb, Int_t what);
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);
Double_t EvalLikeMod4(Double_t mu, Int_t x, Int_t y, Double_t tau, Int_t what);
Double_t LikeMod4(Double_t mu, Double_t b, Int_t x, Int_t y, Double_t tau);
Double_t EvalLikeMod5(Double_t mu, Int_t x, Double_t bm, Double_t sdb, Int_t what);
Double_t LikeMod5(Double_t mu, Double_t b, Int_t x, Double_t bm, Double_t u);
Double_t EvalLikeMod6(Double_t mu, Int_t x, Int_t z, Double_t b, Int_t m, Int_t what);
Double_t LikeMod6(Double_t mu, Double_t b, Double_t e, Int_t x, Int_t z, Int_t m);
Double_t EvalLikeMod7(Double_t mu, Int_t x, Double_t em, Double_t sde, Double_t b, Int_t what);
Double_t LikeMod7(Double_t mu, Double_t b, Double_t e, Int_t x, Double_t em, Double_t v);
static Double_t EvalPolynomial(Double_t x, const Int_t coef[], Int_t N);
static Double_t EvalMonomial(Double_t x, const Int_t coef[], Int_t N);
Double_t LogFactorial(Int_t n);
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);
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);
void SetModelParameters();
Double_t GetBackground();
public:
TRolke(Double_t CL = 0.9, Option_t *option = "");
virtual ~TRolke();
Double_t GetCL() const {
return fCL;
}
void SetCL(Double_t CL) {
fCL = CL;
}
void SetCLSigmas(Double_t CLsigmas) {
fCL = TMath::Erf(CLsigmas / TMath::Sqrt(2.0)) ;
}
void SetPoissonBkgBinomEff(Int_t x, Int_t y, Int_t z, Double_t tau, Int_t m);
void SetPoissonBkgGaussEff(Int_t x, Int_t y, Double_t em, Double_t tau, Double_t sde);
void SetGaussBkgGaussEff(Int_t x, Double_t bm, Double_t em, Double_t sde, Double_t sdb);
void SetPoissonBkgKnownEff(Int_t x, Int_t y, Double_t tau, Double_t e);
void SetGaussBkgKnownEff(Int_t x, Double_t bm, Double_t sdb, Double_t e);
void SetKnownBkgBinomEff(Int_t x, Int_t z, Int_t m, Double_t b);
void SetKnownBkgGaussEff(Int_t x, Double_t em, Double_t sde, Double_t b);
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);
bool GetLimits(Double_t& low, Double_t& high);
Double_t GetUpperLimit();
Double_t GetLowerLimit();
bool GetSensitivity(Double_t& low, Double_t& high, Double_t pPrecision = 0.00001);
bool GetLimitsQuantile(Double_t& low, Double_t& high, Int_t& out_x, Double_t integral = 0.5);
bool GetLimitsML(Double_t& low, Double_t& high, Int_t& out_x);
bool GetCriticalNumber(Int_t& ncrit,Int_t maxtry=-1);
bool GetBounding() const {
return fBounding;
}
void SetBounding(const bool bnd) {
fBounding = bnd;
}
void SetSwitch(bool bnd) ;
void Print(Option_t*) const;
ClassDef(TRolke, 2)
};
#endif