11#ifndef ROOSTATS_HypoTestInverter
12#define ROOSTATS_HypoTestInverter
29 class HybridCalculator;
30 class FrequentistCalculator;
31 class AsymptoticCalculator;
32 class HypoTestCalculatorGeneric;
78 void SetFixedScan(
int nBins,
double xMin = 1,
double xMax = -1,
bool scanLog =
false ) {
87 bool RunFixedScan(
int nBins,
double xMin,
double xMax,
bool scanLog =
false )
const;
89 bool RunOnePoint(
double thisX,
bool adaptive =
false,
double clTarget = -1 )
const;
93 bool RunLimit(
double &limit,
double &limitErr,
double absTol = 0,
double relTol = 0,
const double *hint=0)
const;
123 TList * clsDist = 0,
TList *clsbDist= 0,
TList * clbDist = 0,
const char * outputfile =
"HypoTestInverterRebuiltDist.root");
180 std::unique_ptr<HypoTestCalculatorGeneric>
fHC;
#define ClassDef(name, id)
RooAbsData is the common abstract base class for binned and unbinned datasets.
RooRealVar represents a fundamental (non-derived) real valued object.
Hypothesis Test Calculator based on the asymptotic formulae for the profile likelihood ratio.
Does a frequentist hypothesis test.
Same purpose as HybridCalculatorOriginal, but different implementation.
Common base class for the Hypothesis Test Calculators.
HypoTestInverterResult class holds the array of hypothesis test results and compute a confidence inte...
virtual void SetTestSize(Double_t size)
set the size of the test (rate of Type I error) (eg. 0.05 for a 95% Confidence Interval)
virtual void SetConfidenceLevel(Double_t cl)
set the confidence level for the interval (eg. 0.95 for a 95% Confidence Interval)
void UseCLs(bool on=true)
flag to switch between using CLsb (default) or CLs as confidence level
HypoTestInverter class for performing an hypothesis test inversion by scanning the hypothesis test re...
virtual void SetData(RooAbsData &)
Set the DataSet ( add to the the workspace if not already there ?)
static void CheckInputModels(const HypoTestCalculatorGeneric &hc, const RooRealVar &scanVar)
check the model given the given hypotestcalculator
static void SetCloseProof(Bool_t flag)
set flag to close proof for every new run
void SetVerbose(int level=1)
RooRealVar * fScannedVariable
pointer to the generic hypotest calculator used
virtual ~HypoTestInverter()
destructor (delete the HypoTestInverterResult)
static double fgCLAccuracy
std::unique_ptr< HypoTestCalculatorGeneric > fHC
virtual void SetTestSize(Double_t size)
set the size of the test (rate of Type I error) ( e.g. 0.05 for a 95% Confidence Interval)
SamplingDistribution * RebuildDistributions(bool isUpper=true, int nToys=100, TList *clsDist=0, TList *clsbDist=0, TList *clbDist=0, const char *outputfile="HypoTestInverterRebuiltDist.root")
rebuild the sampling distributions by generating some toys and find for each of them a new upper limi...
HypoTestInverterResult * fResults
virtual Double_t Size() const
Get the size of the test (eg. rate of Type I error)
HypoTestInverter()
default constructor (doesn't do anything)
bool SetTestStatistic(TestStatistic &stat)
set the test statistic to use
virtual Double_t ConfidenceLevel() const
Get the Confidence level for the test.
SamplingDistribution * GetUpperLimitDistribution(bool rebuild=false, int nToys=100)
get the distribution of lower limit if rebuild = false (default) it will re-use the results of the sc...
virtual void SetConfidenceLevel(Double_t cl)
set the confidence level for the interval (e.g. 0.95 for a 95% Confidence Interval)
void SetMaximumToys(int ntoys)
static unsigned int fgNToys
HypoTestCalculatorGeneric * GetHypoTestCalculator() const
void Clear()
delete contained result and graph
virtual void SetModel(const ModelConfig &)
Set the Model.
void SetNumErr(double err)
TestStatistic * GetTestStatistic() const
return the test statistic which is or will be used by the class
virtual HypoTestInverterResult * GetInterval() const
Run a fixed scan or the automatic scan depending on the configuration Return if needed a copy of the ...
static std::string fgAlgo
bool RunLimit(double &limit, double &limitErr, double absTol=0, double relTol=0, const double *hint=0) const
run an automatic scan until the desired accuracy is reached Start by default from the full interval (...
std::unique_ptr< TGraphErrors > fLimitPlot
bool RunFixedScan(int nBins, double xMin, double xMax, bool scanLog=false) const
Run a Fixed scan in npoints between min and max.
bool RunOnePoint(double thisX, bool adaptive=false, double clTarget=-1) const
run only one point at the given POI value
ECalculatorType fCalcType
SamplingDistribution * GetLowerLimitDistribution(bool rebuild=false, int nToys=100)
get the distribution of lower limit if rebuild = false (default) it will re-use the results of the sc...
HypoTestInverter & operator=(const HypoTestInverter &rhs)
assignment operator NOTE: this class does not copy the contained result and the HypoTestCalculator,...
void SetFixedScan(int nBins, double xMin=1, double xMax=-1, bool scanLog=false)
HypoTestCalculatorGeneric * fCalculator0
int fTotalToysRun
plot of limits
static double fgRelAccuracy
void CreateResults() const
create a new HypoTestInverterResult to hold all computed results
static double fgAbsAccuracy
void UseCLs(bool on=true)
static RooRealVar * GetVariableToScan(const HypoTestCalculatorGeneric &hc)
get the variable to scan try first with null model if not go to alternate model
HypoTestResult * Eval(HypoTestCalculatorGeneric &hc, bool adaptive, double clsTarget) const
Run the Hypothesis test at a previous configured point (internal function called by RunOnePoint)
HypoTestResult is a base class for results from hypothesis tests.
IntervalCalculator is an interface class for a tools which produce RooStats ConfIntervals.
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
This class simply holds a sampling distribution of some test statistic.
TestStatistic is an interface class to provide a facility for construction test statistics distributi...
A TGraphErrors is a TGraph with error bars.
Namespace for the RooStats classes.