ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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)
 
virtual HypoTestInverterResultGetInterval () const
 Main interface to get a ConfInterval, pure virtual. More...
 
void Clear ()
 
void SetFixedScan (int nBins, double xMin=1, double xMax=-1, bool scanLog=false)
 
void SetAutoScan ()
 
bool RunFixedScan (int nBins, double xMin, double xMax, bool scanLog=false) const
 
bool RunOnePoint (double thisX, bool adaptive=false, double clTarget=-1) const
 
bool RunLimit (double &limit, double &limitErr, double absTol=0, double relTol=0, const double *hint=0) const
 
void UseCLs (bool on=true)
 
virtual void SetData (RooAbsData &)
 Set the DataSet ( add to the the workspace if not already there ?) More...
 
virtual void SetModel (const ModelConfig &)
 Set the Model. More...
 
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...
 
virtual void SetConfidenceLevel (Double_t cl)
 set the confidence level for the interval (e.g. 0.95 for a 95% Confidence Interval) More...
 
virtual Double_t Size () const
 Get the size of the test (eg. rate of Type I error) More...
 
virtual Double_t ConfidenceLevel () const
 Get the Confidence level for the test. More...
 
virtual ~HypoTestInverter ()
 
HypoTestCalculatorGenericGetHypoTestCalculator () const
 
SamplingDistributionGetLowerLimitDistribution (bool rebuild=false, int nToys=100)
 
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")
 
TestStatisticGetTestStatistic () const
 
bool SetTestStatistic (TestStatistic &stat)
 
void SetVerbose (int level=1)
 
void SetMaximumToys (int ntoys)
 
void SetNumErr (double err)
 
- 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)
 
HypoTestInverteroperator= (const HypoTestInverter &rhs)
 
void CreateResults () const
 
HypoTestResultEval (HypoTestCalculatorGeneric &hc, bool adaptive, double clsTarget) const
 

Static Protected Member Functions

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

Private Attributes

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

Static Private Attributes

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

#include <RooStats/HypoTestInverter.h>

Inheritance diagram for RooStats::HypoTestInverter:
[legend]

Member Enumeration Documentation

Enumerator
kUndefined 
kHybrid 
kFrequentist 
kAsymptotic 

Definition at line 65 of file HypoTestInverter.h.

Constructor & Destructor Documentation

HypoTestInverter::HypoTestInverter ( )

Definition at line 140 of file HypoTestInverter.cxx.

RooStats::HypoTestInverter::HypoTestInverter ( HypoTestCalculatorGeneric hc,
RooRealVar scannedVariable = 0,
double  size = 0.05 
)
RooStats::HypoTestInverter::HypoTestInverter ( HybridCalculator hc,
RooRealVar scannedVariable = 0,
double  size = 0.05 
)
RooStats::HypoTestInverter::HypoTestInverter ( FrequentistCalculator hc,
RooRealVar scannedVariable,
double  size = 0.05 
)
RooStats::HypoTestInverter::HypoTestInverter ( AsymptoticCalculator hc,
RooRealVar scannedVariable,
double  size = 0.05 
)
RooStats::HypoTestInverter::HypoTestInverter ( RooAbsData data,
ModelConfig sb,
ModelConfig b,
RooRealVar scannedVariable = 0,
ECalculatorType  type = kFrequentist,
double  size = 0.05 
)
HypoTestInverter::~HypoTestInverter ( )
virtual

Definition at line 381 of file HypoTestInverter.cxx.

HypoTestInverter::HypoTestInverter ( const HypoTestInverter rhs)
protected

Definition at line 345 of file HypoTestInverter.cxx.

Member Function Documentation

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

Definition at line 102 of file HypoTestInverter.cxx.

void HypoTestInverter::Clear ( )

Definition at line 410 of file HypoTestInverter.cxx.

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.

Referenced by CreateResults().

void HypoTestInverter::CreateResults ( ) const
protected

Definition at line 417 of file HypoTestInverter.cxx.

Referenced by RunFixedScan(), and RunOnePoint().

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

Definition at line 477 of file HypoTestInverter.cxx.

Referenced by GetInterval(), RebuildDistributions(), RunLimit(), and RunOnePoint().

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

Definition at line 140 of file HypoTestInverter.h.

HypoTestInverterResult * HypoTestInverter::GetInterval ( ) const
virtual

Main interface to get a ConfInterval, pure virtual.

Implements RooStats::IntervalCalculator.

Definition at line 446 of file HypoTestInverter.cxx.

Referenced by RebuildDistributions().

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

Definition at line 983 of file HypoTestInverter.cxx.

TestStatistic * HypoTestInverter::GetTestStatistic ( void  ) const

Definition at line 390 of file HypoTestInverter.cxx.

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

Definition at line 1006 of file HypoTestInverter.cxx.

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

Definition at line 82 of file HypoTestInverter.cxx.

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

Definition at line 358 of file HypoTestInverter.cxx.

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.

Referenced by GetLowerLimitDistribution(), and GetUpperLimitDistribution().

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

Definition at line 565 of file HypoTestInverter.cxx.

Referenced by GetInterval().

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.

Referenced by GetInterval().

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

Definition at line 628 of file HypoTestInverter.cxx.

Referenced by RunFixedScan(), and RunLimit().

void RooStats::HypoTestInverter::SetAutoScan ( )
inline

Definition at line 110 of file HypoTestInverter.h.

void HypoTestInverter::SetCloseProof ( Bool_t  flag)
static

Definition at line 76 of file HypoTestInverter.cxx.

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.

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.

Referenced by RebuildDistributions().

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

Definition at line 103 of file HypoTestInverter.h.

Referenced by SetAutoScan().

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

Definition at line 160 of file HypoTestInverter.h.

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

Set the Model.

Implements RooStats::IntervalCalculator.

Definition at line 124 of file HypoTestInverter.h.

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

Definition at line 163 of file HypoTestInverter.h.

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.

bool HypoTestInverter::SetTestStatistic ( TestStatistic stat)

Definition at line 400 of file HypoTestInverter.cxx.

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

Definition at line 157 of file HypoTestInverter.h.

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.

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

Definition at line 120 of file HypoTestInverter.h.

Member Data Documentation

ECalculatorType RooStats::HypoTestInverter::fCalcType
private

Definition at line 213 of file HypoTestInverter.h.

Referenced by Eval(), and operator=().

HypoTestCalculatorGeneric* RooStats::HypoTestInverter::fCalculator0
private
double HypoTestInverter::fgAbsAccuracy = 0.05
staticprivate

Definition at line 191 of file HypoTestInverter.h.

Referenced by RunLimit().

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

Definition at line 194 of file HypoTestInverter.h.

Referenced by RunLimit().

double HypoTestInverter::fgCLAccuracy = 0.005
staticprivate

Definition at line 190 of file HypoTestInverter.h.

bool HypoTestInverter::fgCloseProof = false
staticprivate

Definition at line 193 of file HypoTestInverter.h.

Referenced by GetInterval().

unsigned int HypoTestInverter::fgNToys = 500
staticprivate

Definition at line 189 of file HypoTestInverter.h.

double HypoTestInverter::fgRelAccuracy = 0.05
staticprivate

Definition at line 192 of file HypoTestInverter.h.

Referenced by RunLimit().

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

Definition at line 205 of file HypoTestInverter.h.

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

Definition at line 197 of file HypoTestInverter.h.

Referenced by Clear(), and RunLimit().

int RooStats::HypoTestInverter::fMaxToys
private

Definition at line 202 of file HypoTestInverter.h.

Referenced by operator=(), RunLimit(), and SetMaximumToys().

int RooStats::HypoTestInverter::fNBins
private

Definition at line 214 of file HypoTestInverter.h.

Referenced by GetInterval(), operator=(), RebuildDistributions(), and SetFixedScan().

double RooStats::HypoTestInverter::fNumErr
private

Definition at line 217 of file HypoTestInverter.h.

Referenced by Eval(), operator=(), and SetNumErr().

HypoTestInverterResult* RooStats::HypoTestInverter::fResults
mutableprivate
bool RooStats::HypoTestInverter::fScanLog
private

Definition at line 210 of file HypoTestInverter.h.

Referenced by GetInterval(), operator=(), and SetFixedScan().

RooRealVar* RooStats::HypoTestInverter::fScannedVariable
private

pointer to the generic hypotest calculator used

Definition at line 206 of file HypoTestInverter.h.

Referenced by CreateResults(), Eval(), operator=(), RebuildDistributions(), RunFixedScan(), RunLimit(), and RunOnePoint().

double RooStats::HypoTestInverter::fSize
private
int RooStats::HypoTestInverter::fTotalToysRun
mutableprivate

plot of limits

Definition at line 201 of file HypoTestInverter.h.

Referenced by Eval(), operator=(), and RunLimit().

bool RooStats::HypoTestInverter::fUseCLs
private
int RooStats::HypoTestInverter::fVerbose
private

Definition at line 212 of file HypoTestInverter.h.

Referenced by Eval(), operator=(), RunLimit(), RunOnePoint(), and SetVerbose().

double RooStats::HypoTestInverter::fXmax
private

Definition at line 216 of file HypoTestInverter.h.

Referenced by GetInterval(), operator=(), and SetFixedScan().

double RooStats::HypoTestInverter::fXmin
private

Definition at line 215 of file HypoTestInverter.h.

Referenced by GetInterval(), operator=(), and SetFixedScan().

Collaboration diagram for RooStats::HypoTestInverter:
[legend]

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