#ifndef ROOSTATS_HybridCalculator
#define ROOSTATS_HybridCalculator
#ifndef ROOSTATS_HypoTestCalculator
#include "RooStats/HypoTestCalculator.h"
#endif
#include <vector>
#ifndef ROOSTATS_HybridResult
#include "RooStats/HybridResult.h"
#endif
#ifndef ROOSTATS_ModelConfig
#include "RooStats/ModelConfig.h"
#endif
class TH1;
namespace RooStats {
class HybridResult;
class HybridCalculator : public HypoTestCalculator , public TNamed {
public:
explicit HybridCalculator(const char *name = 0);
HybridCalculator(RooAbsPdf& sb_model,
RooAbsPdf& b_model,
RooArgList& observables,
const RooArgSet* nuisance_parameters = 0,
RooAbsPdf* prior_pdf = 0,
bool GenerateBinned = false, int testStatistics = 1, int ntoys = 1000 );
HybridCalculator(RooAbsData& data,
RooAbsPdf& sb_model,
RooAbsPdf& b_model,
const RooArgSet* nuisance_parameters = 0,
RooAbsPdf* prior_pdf = 0,
bool GenerateBinned = false, int testStatistics = 1, int ntoys = 1000 );
HybridCalculator(RooAbsData& data,
const ModelConfig& sb_model,
const ModelConfig& b_model,
bool GenerateBinned = false, int testStatistics = 1, int ntoys = 1000 );
public:
virtual ~HybridCalculator();
virtual HybridResult* GetHypoTest() const;
virtual void SetNullModel(const ModelConfig & );
virtual void SetAlternateModel(const ModelConfig & );
virtual void SetCommonPdf(RooAbsPdf & pdf) { fSbModel = &pdf; }
virtual void SetNullPdf(RooAbsPdf& pdf) { fBModel = &pdf; }
virtual void SetAlternatePdf(RooAbsPdf& pdf) { fSbModel = &pdf; }
virtual void SetData(RooAbsData& data) { fData = &data; }
virtual void SetNullParameters(const RooArgSet& ) { }
virtual void SetAlternateParameters(const RooArgSet&) {}
void SetNuisancePdf(RooAbsPdf & prior_pdf) {
fPriorPdf = &prior_pdf;
fUsePriorPdf = true;
}
void SetNuisanceParameters(const RooArgSet & params) { fNuisanceParameters = ¶ms; }
void SetNumberOfToys(unsigned int ntoys) { fNToys = ntoys; }
unsigned int GetNumberOfToys() { return fNToys; }
unsigned int GetNumberOfToys() const { return fNToys; }
void UseNuisance(bool on = true) { fUsePriorPdf = on; }
void SetGenerateBinned(bool on = true) { fGenerateBinned = on; }
void SetTestStatistic(int index);
HybridResult* Calculate(TH1& data, unsigned int nToys, bool usePriors) const;
HybridResult* Calculate(RooAbsData& data, unsigned int nToys, bool usePriors) const;
HybridResult* Calculate(unsigned int nToys, bool usePriors) const;
void PrintMore(const char* options) const;
private:
void RunToys(std::vector<double>& bVals, std::vector<double>& sbVals, unsigned int nToys, bool usePriors) const;
bool DoCheckInputs() const;
unsigned int fTestStatisticsIdx;
unsigned int fNToys;
RooAbsPdf* fSbModel;
RooAbsPdf* fBModel;
mutable RooArgList* fObservables;
const RooArgSet* fNuisanceParameters;
RooAbsPdf* fPriorPdf;
RooAbsData * fData;
bool fGenerateBinned;
bool fUsePriorPdf;
protected:
ClassDef(HybridCalculator,1)
};
}
#endif