11 #ifndef ROOSTATS_RatioOfProfiledLikelihoodsTestStat
12 #define ROOSTATS_RatioOfProfiledLikelihoodsTestStat
26 class RatioOfProfiledLikelihoodsTestStat:
public TestStatistic {
30 RatioOfProfiledLikelihoodsTestStat() :
35 fDetailedOutputEnabled(false),
41 RatioOfProfiledLikelihoodsTestStat(RooAbsPdf& nullPdf, RooAbsPdf& altPdf,
42 const RooArgSet* altPOI=0) :
43 fNullProfile(nullPdf),
46 fDetailedOutputEnabled(false),
52 fAltPOI = (RooArgSet*) altPOI->snapshot();
54 fAltPOI =
new RooArgSet();
59 ~RatioOfProfiledLikelihoodsTestStat(
void) {
60 if(fAltPOI)
delete fAltPOI;
61 if(fDetailedOutput)
delete fDetailedOutput;
69 Double_t ProfiledLikelihood(RooAbsData& data, RooArgSet& poi, RooAbsPdf& pdf);
72 virtual Double_t Evaluate(RooAbsData& data, RooArgSet& nullParamsOfInterest);
74 virtual void EnableDetailedOutput(
bool e=
true ) {
75 fDetailedOutputEnabled = e;
76 fNullProfile.EnableDetailedOutput(fDetailedOutputEnabled);
77 fAltProfile.EnableDetailedOutput(fDetailedOutputEnabled);
80 static void SetAlwaysReuseNLL(Bool_t flag);
82 void SetReuseNLL(Bool_t flag) {
83 fNullProfile.SetReuseNLL(flag);
84 fAltProfile.SetReuseNLL(flag);
87 void SetMinimizer(
const char* minimizer){
88 fNullProfile.SetMinimizer(minimizer);
89 fAltProfile.SetMinimizer(minimizer);
91 void SetStrategy(Int_t strategy){
92 fNullProfile.SetStrategy(strategy);
93 fAltProfile.SetStrategy(strategy);
95 void SetTolerance(Double_t tol){
96 fNullProfile.SetTolerance(tol);
97 fAltProfile.SetTolerance(tol);
99 void SetPrintLevel(Int_t printLevel){
100 fNullProfile.SetPrintLevel(printLevel);
101 fAltProfile.SetPrintLevel(printLevel);
106 virtual void SetConditionalObservables(
const RooArgSet& set) {
107 fNullProfile.SetConditionalObservables(set);
108 fAltProfile.SetConditionalObservables(set);
113 virtual void SetGlobalObservables(
const RooArgSet& set) {
114 fNullProfile.SetGlobalObservables(set);
115 fAltProfile.SetGlobalObservables(set);
118 virtual const RooArgSet* GetDetailedOutput(
void)
const {
123 return fDetailedOutput;
129 virtual const TString GetVarName()
const {
return "log(L(#mu_{1},#hat{#nu}_{1}) / L(#mu_{0},#hat{#nu}_{0}))"; }
133 void SetSubtractMLE(
bool subtract){fSubtractMLE = subtract;}
137 ProfileLikelihoodTestStat fNullProfile;
138 ProfileLikelihoodTestStat fAltProfile;
142 static Bool_t fgAlwaysReuseNll ;
144 bool fDetailedOutputEnabled;
145 RooArgSet* fDetailedOutput;
149 ClassDef(RatioOfProfiledLikelihoodsTestStat,3)