Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
HypoTestCalculatorGeneric.h
Go to the documentation of this file.
1// @(#)root/roostats:$Id$
2// Author: Kyle Cranmer, Sven Kreiss 23/05/10
3/*************************************************************************
4 * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. *
5 * All rights reserved. *
6 * *
7 * For the licensing terms see $ROOTSYS/LICENSE. *
8 * For the list of contributors see $ROOTSYS/README/CREDITS. *
9 *************************************************************************/
10
11#ifndef ROOSTATS_HypoTestCalculatorGeneric
12#define ROOSTATS_HypoTestCalculatorGeneric
13
14
15#ifndef ROOT_Rtypes
16#include "Rtypes.h" // necessary for TNamed
17#endif
18
20
22
24
26
28
30
31
32namespace RooStats {
33
35
36 public:
38 const RooAbsData &data,
39 const ModelConfig &altModel,
42 );
43
44
46
47 /// inherited methods from HypoTestCalculator interface
48 HypoTestResult* GetHypoTest() const override;
49
50 /// set the model for the null hypothesis (only B)
52 const RooAbsData * GetData(void) const { return fData; }
53 const ModelConfig* GetNullModel(void) const { return fNullModel; }
54 virtual const RooArgSet* GetFitInfo() const { return nullptr; }
55 /// Set the model for the alternate hypothesis (S+B)
57 const ModelConfig* GetAlternateModel(void) const { return fAltModel; }
58 /// Set the DataSet
59 void SetData(RooAbsData &data) override { fData = &data; }
60
61 /// Returns instance of TestStatSampler. Use to change properties of
62 /// TestStatSampler, e.g. GetTestStatSampler.SetTestSize(double size);
64
65 /// Set this for re-using always the same toys for alternate hypothesis in
66 /// case of calls at different null parameter points
67 /// This is useful to get more stable bands when running the HypoTest inversion
68 void UseSameAltToys();
69
70
71 protected:
72 // should return zero (to be used later for conditional flow)
73 virtual int CheckHook(void) const { return 0; }
74 virtual int PreNullHook(RooArgSet* /*parameterPoint*/, double /*obsTestStat*/) const { return 0; }
75 virtual int PreAltHook(RooArgSet* /*parameterPoint*/, double /*obsTestStat*/) const { return 0; }
76 virtual void PreHook() const { }
77 virtual void PostHook() const { }
78
79 protected:
86
87 unsigned int fAltToysSeed; // to have same toys for alternate
88
89 private:
90 void SetupSampler(const ModelConfig& model) const;
91 void SetAdaptiveLimits(double obsTestStat, bool forNull) const;
94 double obsTestStat,
95 RooAbsPdf *impDens=nullptr,
96 const RooArgSet *impSnapshot=nullptr
97 ) const;
98
99
100 protected:
102};
103}
104
105#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Abstract base class for binned and unbinned datasets.
Definition RooAbsData.h:57
Abstract interface for all probability density functions.
Definition RooAbsPdf.h:42
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:24
Common base class for the Hypothesis Test Calculators.
void SetAdaptiveLimits(double obsTestStat, bool forNull) const
const ModelConfig * GetNullModel(void) const
void SetNullModel(const ModelConfig &nullModel) override
set the model for the null hypothesis (only B)
void SetData(RooAbsData &data) override
Set the DataSet.
HypoTestResult * GetHypoTest() const override
inherited methods from HypoTestCalculator interface
virtual int PreNullHook(RooArgSet *, double) const
void SetupSampler(const ModelConfig &model) const
common setup for both models
const ModelConfig * GetAlternateModel(void) const
virtual int PreAltHook(RooArgSet *, double) const
TestStatSampler * GetTestStatSampler(void) const
Returns instance of TestStatSampler.
virtual const RooArgSet * GetFitInfo() const
SamplingDistribution * GenerateSamplingDistribution(ModelConfig *thisModel, double obsTestStat, RooAbsPdf *impDens=nullptr, const RooArgSet *impSnapshot=nullptr) const
void SetAlternateModel(const ModelConfig &altModel) override
Set the model for the alternate hypothesis (S+B)
void UseSameAltToys()
Set this for re-using always the same toys for alternate hypothesis in case of calls at different nul...
HypoTestCalculatorGeneric(const RooAbsData &data, const ModelConfig &altModel, const ModelConfig &nullModel, TestStatSampler *sampler=nullptr)
Constructor.
HypoTestCalculator is an interface class for a tools which produce RooStats HypoTestResults.
HypoTestResult is a base class for results from hypothesis tests.
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
Definition ModelConfig.h:35
This class simply holds a sampling distribution of some test statistic.
TestStatSampler is an interface class for a tools which produce RooStats SamplingDistributions.
TestStatistic is an interface class to provide a facility for construction test statistics distributi...
Namespace for the RooStats classes.
Definition CodegenImpl.h:58