Logo ROOT   6.08/07
Reference Guide
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Private Attributes | Static Private Attributes | List of all members
RooStats::HypoTestInverter Class Reference

HypoTestInverter class for performing an hypothesis test inversion by scanning the hypothesis test results of an HypoTestCalculator for various values of the parameter of interest.

By looking at the confidence level curve of the result an upper limit, where it intersects the desired confidence level, can be derived. The class implements the RooStats::IntervalCalculator interface and returns an RooStats::HypoTestInverterResult class. The result is a SimpleInterval, which via the method UpperLimit returns to the user the upper limit value.

The HypoTestInverter implements various option for performing the scan. HypoTestInverter::RunFixedScan will scan using a fixed grid the parameter of interest. HypoTestInverter::RunAutoScan will perform an automatic scan to find optimally the curve and it will stop until the desired precision is obtained. The confidence level value at a given point can be done via HypoTestInverter::RunOnePoint. The class can scan the CLs+b values or alternativly CLs (if the method HypoTestInverter::UseCLs has been called).

Contributions to this class have been written by Giovanni Petrucciani and Annapaola Decosa

Definition at line 61 of file HypoTestInverter.h.

Public Types

enum  ECalculatorType { kUndefined = 0, kHybrid = 1, kFrequentist = 2, kAsymptotic = 3 }
 

Public Member Functions

 HypoTestInverter ()
 
 HypoTestInverter (HypoTestCalculatorGeneric &hc, RooRealVar *scannedVariable=0, double size=0.05)
 
 HypoTestInverter (HybridCalculator &hc, RooRealVar *scannedVariable=0, double size=0.05)
 
 HypoTestInverter (FrequentistCalculator &hc, RooRealVar *scannedVariable, double size=0.05)
 
 HypoTestInverter (AsymptoticCalculator &hc, RooRealVar *scannedVariable, double size=0.05)
 
 HypoTestInverter (RooAbsData &data, ModelConfig &sb, ModelConfig &b, RooRealVar *scannedVariable=0, ECalculatorType type=kFrequentist, double size=0.05)
 Constructor from a model for B model and a model for S+B. More...
 
virtual ~HypoTestInverter ()
 
void Clear ()
 
virtual Double_t ConfidenceLevel () const
 Get the Confidence level for the test. More...
 
HypoTestCalculatorGenericGetHypoTestCalculator () const
 
virtual HypoTestInverterResultGetInterval () const
 Main interface to get a ConfInterval, pure virtual. More...
 
SamplingDistributionGetLowerLimitDistribution (bool rebuild=false, int nToys=100)
 
TestStatisticGetTestStatistic () const
 
SamplingDistributionGetUpperLimitDistribution (bool rebuild=false, int nToys=100)
 
SamplingDistributionRebuildDistributions (bool isUpper=true, int nToys=100, TList *clsDist=0, TList *clsbDist=0, TList *clbDist=0, const char *outputfile="HypoTestInverterRebuiltDist.root")
 
bool RunFixedScan (int nBins, double xMin, double xMax, bool scanLog=false) const
 
bool RunLimit (double &limit, double &limitErr, double absTol=0, double relTol=0, const double *hint=0) const
 
bool RunOnePoint (double thisX, bool adaptive=false, double clTarget=-1) const
 
void SetAutoScan ()
 
virtual void SetConfidenceLevel (Double_t cl)
 set the confidence level for the interval (e.g. 0.95 for a 95% Confidence Interval) More...
 
virtual void SetData (RooAbsData &)
 Set the DataSet ( add to the the workspace if not already there ?) More...
 
void SetFixedScan (int nBins, double xMin=1, double xMax=-1, bool scanLog=false)
 
void SetMaximumToys (int ntoys)
 
virtual void SetModel (const ModelConfig &)
 Set the Model. More...
 
void SetNumErr (double err)
 
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) More...
 
bool SetTestStatistic (TestStatistic &stat)
 
void SetVerbose (int level=1)
 
virtual Double_t Size () const
 Get the size of the test (eg. rate of Type I error) More...
 
void UseCLs (bool on=true)
 
- Public Member Functions inherited from RooStats::IntervalCalculator
virtual ~IntervalCalculator ()
 

Static Public Member Functions

static void SetCloseProof (Bool_t flag)
 

Protected Member Functions

 HypoTestInverter (const HypoTestInverter &rhs)
 
void CreateResults () const
 
HypoTestResultEval (HypoTestCalculatorGeneric &hc, bool adaptive, double clsTarget) const
 
HypoTestInverteroperator= (const HypoTestInverter &rhs)
 

Static Protected Member Functions

static void CheckInputModels (const HypoTestCalculatorGeneric &hc, const RooRealVar &scanVar)
 
static RooRealVarGetVariableToScan (const HypoTestCalculatorGeneric &hc)
 

Private Attributes

ECalculatorType fCalcType
 
HypoTestCalculatorGenericfCalculator0
 
std::unique_ptr< HypoTestCalculatorGenericfHC
 
std::unique_ptr< TGraphErrorsfLimitPlot
 
int fMaxToys
 
int fNBins
 
double fNumErr
 
HypoTestInverterResultfResults
 
bool fScanLog
 
RooRealVarfScannedVariable
 pointer to the generic hypotest calculator used More...
 
double fSize
 
int fTotalToysRun
 plot of limits More...
 
bool fUseCLs
 
int fVerbose
 
double fXmax
 
double fXmin
 

Static Private Attributes

static double fgAbsAccuracy = 0.05
 
static std::string fgAlgo = "logSecant"
 
static double fgCLAccuracy = 0.005
 
static bool fgCloseProof = false
 
static unsigned int fgNToys = 500
 
static double fgRelAccuracy = 0.05
 

#include <RooStats/HypoTestInverter.h>

Inheritance diagram for RooStats::HypoTestInverter:
[legend]

Member Enumeration Documentation

◆ ECalculatorType

Enumerator
kUndefined 
kHybrid 
kFrequentist 
kAsymptotic 

Definition at line 65 of file HypoTestInverter.h.

Constructor & Destructor Documentation

◆ HypoTestInverter() [1/7]

HypoTestInverter::HypoTestInverter ( )

Definition at line 140 of file HypoTestInverter.cxx.

◆ HypoTestInverter() [2/7]

HypoTestInverter::HypoTestInverter ( HypoTestCalculatorGeneric hc,
RooRealVar scannedVariable = 0,
double  size = 0.05 
)

Definition at line 157 of file HypoTestInverter.cxx.

◆ HypoTestInverter() [3/7]

HypoTestInverter::HypoTestInverter ( HybridCalculator hc,
RooRealVar scannedVariable = 0,
double  size = 0.05 
)

Definition at line 211 of file HypoTestInverter.cxx.

◆ HypoTestInverter() [4/7]

HypoTestInverter::HypoTestInverter ( FrequentistCalculator hc,
RooRealVar scannedVariable,
double  size = 0.05 
)

Definition at line 245 of file HypoTestInverter.cxx.

◆ HypoTestInverter() [5/7]

HypoTestInverter::HypoTestInverter ( AsymptoticCalculator hc,
RooRealVar scannedVariable,
double  size = 0.05 
)

Definition at line 275 of file HypoTestInverter.cxx.

◆ HypoTestInverter() [6/7]

HypoTestInverter::HypoTestInverter ( RooAbsData data,
ModelConfig sbModel,
ModelConfig bModel,
RooRealVar scannedVariable = 0,
ECalculatorType  type = kFrequentist,
double  size = 0.05 
)

Constructor from a model for B model and a model for S+B.

An HypoTestCalculator (Hybrid of Frequentis) will be created using the S+B model as the null and the B model as the alternate If no variable to scan are given they are assumed to be the first variable from the parameter of interests of the null model

Definition at line 314 of file HypoTestInverter.cxx.

◆ ~HypoTestInverter()

HypoTestInverter::~HypoTestInverter ( )
virtual

Definition at line 381 of file HypoTestInverter.cxx.

◆ HypoTestInverter() [7/7]

HypoTestInverter::HypoTestInverter ( const HypoTestInverter rhs)
protected

Definition at line 345 of file HypoTestInverter.cxx.

Member Function Documentation

◆ CheckInputModels()

void HypoTestInverter::CheckInputModels ( const HypoTestCalculatorGeneric hc,
const RooRealVar scanVar 
)
staticprotected

Definition at line 102 of file HypoTestInverter.cxx.

◆ Clear()

void HypoTestInverter::Clear ( )

Definition at line 410 of file HypoTestInverter.cxx.

◆ ConfidenceLevel()

virtual Double_t RooStats::HypoTestInverter::ConfidenceLevel ( ) const
inlinevirtual

Get the Confidence level for the test.

Implements RooStats::IntervalCalculator.

Definition at line 133 of file HypoTestInverter.h.

◆ CreateResults()

void HypoTestInverter::CreateResults ( ) const
protected

Definition at line 417 of file HypoTestInverter.cxx.

◆ Eval()

HypoTestResult * HypoTestInverter::Eval ( HypoTestCalculatorGeneric hc,
bool  adaptive,
double  clsTarget 
) const
protected

Definition at line 477 of file HypoTestInverter.cxx.

◆ GetHypoTestCalculator()

HypoTestCalculatorGeneric* RooStats::HypoTestInverter::GetHypoTestCalculator ( ) const
inline

Definition at line 140 of file HypoTestInverter.h.

◆ GetInterval()

HypoTestInverterResult * HypoTestInverter::GetInterval ( ) const
virtual

Main interface to get a ConfInterval, pure virtual.

Implements RooStats::IntervalCalculator.

Definition at line 446 of file HypoTestInverter.cxx.

◆ GetLowerLimitDistribution()

SamplingDistribution * HypoTestInverter::GetLowerLimitDistribution ( bool  rebuild = false,
int  nToys = 100 
)

Definition at line 983 of file HypoTestInverter.cxx.

◆ GetTestStatistic()

TestStatistic * HypoTestInverter::GetTestStatistic ( void  ) const

Definition at line 390 of file HypoTestInverter.cxx.

◆ GetUpperLimitDistribution()

SamplingDistribution * HypoTestInverter::GetUpperLimitDistribution ( bool  rebuild = false,
int  nToys = 100 
)

Definition at line 1006 of file HypoTestInverter.cxx.

◆ GetVariableToScan()

RooRealVar * HypoTestInverter::GetVariableToScan ( const HypoTestCalculatorGeneric hc)
staticprotected

Definition at line 82 of file HypoTestInverter.cxx.

◆ operator=()

HypoTestInverter & HypoTestInverter::operator= ( const HypoTestInverter rhs)
protected

Definition at line 358 of file HypoTestInverter.cxx.

◆ RebuildDistributions()

SamplingDistribution * HypoTestInverter::RebuildDistributions ( bool  isUpper = true,
int  nToys = 100,
TList clsDist = 0,
TList clsbDist = 0,
TList clbDist = 0,
const char *  outputfile = "HypoTestInverterRebuiltDist.root" 
)

Definition at line 1034 of file HypoTestInverter.cxx.

◆ RunFixedScan()

bool HypoTestInverter::RunFixedScan ( int  nBins,
double  xMin,
double  xMax,
bool  scanLog = false 
) const

Definition at line 565 of file HypoTestInverter.cxx.

◆ RunLimit()

bool HypoTestInverter::RunLimit ( double &  limit,
double &  limitErr,
double  absTol = 0,
double  relTol = 0,
const double *  hint = 0 
) const

Definition at line 719 of file HypoTestInverter.cxx.

◆ RunOnePoint()

bool HypoTestInverter::RunOnePoint ( double  thisX,
bool  adaptive = false,
double  clTarget = -1 
) const

Definition at line 628 of file HypoTestInverter.cxx.

◆ SetAutoScan()

void RooStats::HypoTestInverter::SetAutoScan ( )
inline

Definition at line 110 of file HypoTestInverter.h.

◆ SetCloseProof()

void HypoTestInverter::SetCloseProof ( Bool_t  flag)
static

Definition at line 76 of file HypoTestInverter.cxx.

◆ SetConfidenceLevel()

virtual void RooStats::HypoTestInverter::SetConfidenceLevel ( Double_t  cl)
inlinevirtual

set the confidence level for the interval (e.g. 0.95 for a 95% Confidence Interval)

Implements RooStats::IntervalCalculator.

Definition at line 129 of file HypoTestInverter.h.

◆ SetData()

void HypoTestInverter::SetData ( RooAbsData )
virtual

Set the DataSet ( add to the the workspace if not already there ?)

Implements RooStats::IntervalCalculator.

Definition at line 1030 of file HypoTestInverter.cxx.

◆ SetFixedScan()

void RooStats::HypoTestInverter::SetFixedScan ( int  nBins,
double  xMin = 1,
double  xMax = -1,
bool  scanLog = false 
)
inline

Definition at line 103 of file HypoTestInverter.h.

◆ SetMaximumToys()

void RooStats::HypoTestInverter::SetMaximumToys ( int  ntoys)
inline

Definition at line 160 of file HypoTestInverter.h.

◆ SetModel()

virtual void RooStats::HypoTestInverter::SetModel ( const ModelConfig )
inlinevirtual

Set the Model.

Implements RooStats::IntervalCalculator.

Definition at line 124 of file HypoTestInverter.h.

◆ SetNumErr()

void RooStats::HypoTestInverter::SetNumErr ( double  err)
inline

Definition at line 163 of file HypoTestInverter.h.

◆ SetTestSize()

virtual void RooStats::HypoTestInverter::SetTestSize ( Double_t  size)
inlinevirtual

set the size of the test (rate of Type I error) ( e.g. 0.05 for a 95% Confidence Interval)

Implements RooStats::IntervalCalculator.

Definition at line 127 of file HypoTestInverter.h.

◆ SetTestStatistic()

bool HypoTestInverter::SetTestStatistic ( TestStatistic stat)

Definition at line 400 of file HypoTestInverter.cxx.

◆ SetVerbose()

void RooStats::HypoTestInverter::SetVerbose ( int  level = 1)
inline

Definition at line 157 of file HypoTestInverter.h.

◆ Size()

virtual Double_t RooStats::HypoTestInverter::Size ( ) const
inlinevirtual

Get the size of the test (eg. rate of Type I error)

Implements RooStats::IntervalCalculator.

Definition at line 131 of file HypoTestInverter.h.

◆ UseCLs()

void RooStats::HypoTestInverter::UseCLs ( bool  on = true)
inline

Definition at line 120 of file HypoTestInverter.h.

Member Data Documentation

◆ fCalcType

ECalculatorType RooStats::HypoTestInverter::fCalcType
private

Definition at line 213 of file HypoTestInverter.h.

◆ fCalculator0

HypoTestCalculatorGeneric* RooStats::HypoTestInverter::fCalculator0
private

Definition at line 204 of file HypoTestInverter.h.

◆ fgAbsAccuracy

double HypoTestInverter::fgAbsAccuracy = 0.05
staticprivate

Definition at line 191 of file HypoTestInverter.h.

◆ fgAlgo

std::string HypoTestInverter::fgAlgo = "logSecant"
staticprivate

Definition at line 194 of file HypoTestInverter.h.

◆ fgCLAccuracy

double HypoTestInverter::fgCLAccuracy = 0.005
staticprivate

Definition at line 190 of file HypoTestInverter.h.

◆ fgCloseProof

bool HypoTestInverter::fgCloseProof = false
staticprivate

Definition at line 193 of file HypoTestInverter.h.

◆ fgNToys

unsigned int HypoTestInverter::fgNToys = 500
staticprivate

Definition at line 189 of file HypoTestInverter.h.

◆ fgRelAccuracy

double HypoTestInverter::fgRelAccuracy = 0.05
staticprivate

Definition at line 192 of file HypoTestInverter.h.

◆ fHC

std::unique_ptr<HypoTestCalculatorGeneric> RooStats::HypoTestInverter::fHC
private

Definition at line 205 of file HypoTestInverter.h.

◆ fLimitPlot

std::unique_ptr<TGraphErrors> RooStats::HypoTestInverter::fLimitPlot
mutableprivate

Definition at line 197 of file HypoTestInverter.h.

◆ fMaxToys

int RooStats::HypoTestInverter::fMaxToys
private

Definition at line 202 of file HypoTestInverter.h.

◆ fNBins

int RooStats::HypoTestInverter::fNBins
private

Definition at line 214 of file HypoTestInverter.h.

◆ fNumErr

double RooStats::HypoTestInverter::fNumErr
private

Definition at line 217 of file HypoTestInverter.h.

◆ fResults

HypoTestInverterResult* RooStats::HypoTestInverter::fResults
mutableprivate

Definition at line 207 of file HypoTestInverter.h.

◆ fScanLog

bool RooStats::HypoTestInverter::fScanLog
private

Definition at line 210 of file HypoTestInverter.h.

◆ fScannedVariable

RooRealVar* RooStats::HypoTestInverter::fScannedVariable
private

pointer to the generic hypotest calculator used

Definition at line 206 of file HypoTestInverter.h.

◆ fSize

double RooStats::HypoTestInverter::fSize
private

Definition at line 211 of file HypoTestInverter.h.

◆ fTotalToysRun

int RooStats::HypoTestInverter::fTotalToysRun
mutableprivate

plot of limits

Definition at line 201 of file HypoTestInverter.h.

◆ fUseCLs

bool RooStats::HypoTestInverter::fUseCLs
private

Definition at line 209 of file HypoTestInverter.h.

◆ fVerbose

int RooStats::HypoTestInverter::fVerbose
private

Definition at line 212 of file HypoTestInverter.h.

◆ fXmax

double RooStats::HypoTestInverter::fXmax
private

Definition at line 216 of file HypoTestInverter.h.

◆ fXmin

double RooStats::HypoTestInverter::fXmin
private

Definition at line 215 of file HypoTestInverter.h.


The documentation for this class was generated from the following files: