11#ifndef ROOSTATS_HypoTestInverter
12#define ROOSTATS_HypoTestInverter
82 void SetFixedScan(
int nBins,
double xMin = 1,
double xMax = -1,
bool scanLog =
false ) {
96 bool RunFixedScan(
int nBins,
double xMin,
double xMax,
bool scanLog =
false )
const;
98 bool RunOnePoint(
double thisX,
bool adaptive =
false,
double clTarget = -1 )
const;
102 bool RunLimit(
double &limit,
double &limitErr,
double absTol = 0,
double relTol = 0,
const double *hint=
nullptr)
const;
132 TList *clsDist =
nullptr,
TList *clsbDist =
nullptr,
TList *clbDist =
nullptr,
const char *outputfile =
"HypoTestInverterRebuiltDist.root");
184 std::unique_ptr<HypoTestCalculatorGeneric>
fHC;
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
#define ClassDefOverride(name, id)
Abstract base class for binned and unbinned datasets.
Variable that can be changed from the outside.
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...
A class for performing a hypothesis test inversion by scanning the hypothesis test results of a HypoT...
static void CheckInputModels(const HypoTestCalculatorGeneric &hc, const RooRealVar &scanVar)
check the model given the given hypotestcalculator
void SetTestSize(double size) override
set the size of the test (rate of Type I error) ( Eg. 0.05 for a 95% Confidence Interval)
void SetVerbose(int level=1)
set verbose level (0,1,2)
RooRealVar * fScannedVariable
pointer to the constrained variable
static double fgCLAccuracy
std::unique_ptr< HypoTestCalculatorGeneric > fHC
! pointer to the generic hypotest calculator used
bool RunLimit(double &limit, double &limitErr, double absTol=0, double relTol=0, const double *hint=nullptr) const
Run an automatic scan until the desired accuracy is reached.
void SetData(RooAbsData &) override
Set the DataSet ( add to the workspace if not already there ?).
HypoTestInverterResult * fResults
pointer to the result
SamplingDistribution * RebuildDistributions(bool isUpper=true, int nToys=100, TList *clsDist=nullptr, TList *clsbDist=nullptr, TList *clbDist=nullptr, const char *outputfile="HypoTestInverterRebuiltDist.root")
function to rebuild the distributions
int fMaxToys
maximum number of toys to run
HypoTestInverter()
default constructor (used only for I/O)
~HypoTestInverter() override
destructor
double Size() const override
Get the size of the test (eg. rate of Type I error).
double ConfidenceLevel() const override
Get the Confidence level for the test.
bool SetTestStatistic(TestStatistic &stat)
set the test statistic
HypoTestInverterResult * GetInterval() const override
Run a fixed scan or the automatic scan depending on the configuration.
void SetConfidenceLevel(double cl) override
set the confidence level for the interval (eg. 0.95 for a 95% Confidence Interval)
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...
void SetMaximumToys(int ntoys)
set maximum number of toys
static unsigned int fgNToys
HypoTestCalculatorGeneric * GetHypoTestCalculator() const
retrieved a reference to the internally used HypoTestCalculator it might be invalid when the class is...
void Clear()
delete contained result and graph
void SetModel(const ModelConfig &) override
Set the Model.
void SetNumErr(double err)
set numerical error in test statistic evaluation (default is zero)
void SetAutoScan()
Use automatic scanning, i.e. adaptive.
TestStatistic * GetTestStatistic() const
get the test statistic
static std::string fgAlgo
std::unique_ptr< TGraphErrors > fLimitPlot
! plot of limits
bool RunFixedScan(int nBins, double xMin, double xMax, bool scanLog=false) const
Run a fixed scan.
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 upper/lower limit distribution
HypoTestInverter & operator=(const HypoTestInverter &rhs)
assignment
void SetFixedScan(int nBins, double xMin=1, double xMax=-1, bool scanLog=false)
Set up to perform a fixed scan.
HypoTestCalculatorGeneric * fCalculator0
pointer to the calculator passed in the constructor
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)
helper functions
HypoTestResult * Eval(HypoTestCalculatorGeneric &hc, bool adaptive, double clsTarget) const
run the hybrid at a single point
HypoTestResult is a base class for results from hypothesis tests.
IntervalCalculator is an interface class for a tools which produce RooStats ConfIntervals.
< A class that holds configuration information for a model using a workspace as a store
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...
Namespace for the RooStats classes.