Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Loading...
Searching...
No Matches
NeymanConstruction.h
Go to the documentation of this file.
1// @(#)root/roostats:$Id$
2// Author: Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke
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_NeymanConstruction
12#define ROOSTATS_NeymanConstruction
13
14
15#include "Rtypes.h"
16
18
23
24#include "RooAbsData.h"
25#include "RooAbsPdf.h"
26#include "RooArgSet.h"
27
28#include <map>
29
30class RooAbsData;
31
32namespace RooStats {
33
34 class ConfInterval;
35
37
38 public:
39
41
42 ~NeymanConstruction() override;
43
44 /// Main interface to get a ConfInterval (will be a PointSetInterval)
45 PointSetInterval* GetInterval() const override;
46
47 /// in addition to interface we also need:
48 /// Set the TestStatSampler (eg. ToyMC or FFT, includes choice of TestStatistic)
50 /// fLeftSideTailFraction*fSize defines lower edge of acceptance region.
51 /// Unified limits use 0, central limits use 0.5,
52 /// for upper/lower limits it is 0/1 depends on sign of test statistic w.r.t. parameter
54
55 /// User-defined set of points to test
60 /// This class can make regularly spaced scans based on range stored in RooRealVars.
61 /// Choose number of steps for a rastor scan (common for each dimension)
62 /// void SetNumSteps(Int_t);
63 /// This class can make regularly spaced scans based on range stored in RooRealVars.
64 /// Choose number of steps for a rastor scan (specific for each dimension)
65 /// void SetNumSteps(std::map<RooAbsArg, Int_t>)
66
67 /// Get the size of the test (eg. rate of Type I error)
68 double Size() const override {return fSize;}
69
70 /// Get the Confidence level for the test
71 double ConfidenceLevel() const override {return 1.-fSize;}
72
73 /// Set ModelConfig
74 void SetModel(const ModelConfig &model) override {fModel = model;}
75
76 /// Set the DataSet
77 void SetData(RooAbsData& data) override { fData = data; }
78
79 /// set the size of the test (rate of Type I error) ( Eg. 0.05 for a 95% Confidence Interval)
80 void SetTestSize(double size) override {fSize = size;}
81 /// set the confidence level for the interval (eg. 0.95 for a 95% Confidence Interval)
82 void SetConfidenceLevel(double cl) override {fSize = 1.-cl;}
83
84 /// Get confidence belt. This requires that CreateConfBelt() has been called.
86
87 /// adaptive sampling algorithm to speed up interval calculation
89
90 /// give user ability to ask for more toys
92
93 /// save the confidence belt to a file
94 void SaveBeltToFile(bool flag=true){
96 if(flag) fCreateBelt = true;
97 }
98 /// should create confidence belt
99 void CreateConfBelt(bool flag=true){fCreateBelt = flag;}
100
101 /// Returns instance of TestStatSampler. Use to change properties of
102 /// TestStatSampler, e.g. GetTestStatSampler.SetTestSize(double size);
104
105
106 private:
107
108 double fSize; ///< size of the test (eg. specified rate of Type I error)
109 RooAbsData& fData; ///< data set
111
116 bool fAdaptiveSampling; ///< controls use of adaptive sampling algorithm
117 double fAdditionalNToysFactor; ///< give user ability to ask for more toys
118 bool fSaveBeltToFile; ///< controls use if ConfidenceBelt should be saved to a TFile
119 bool fCreateBelt; ///< controls use if ConfidenceBelt should be saved to a TFile
120
121 protected:
122 ClassDefOverride(NeymanConstruction,0) ///< Interface for tools setting limits (producing confidence intervals)
123 };
124}
125
126
127#endif
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
#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
ConfidenceBelt is a concrete implementation of the ConfInterval interface.
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...
Definition ModelConfig.h:35
NeymanConstruction is a concrete implementation of the NeymanConstruction interface that,...
bool fAdaptiveSampling
controls use of adaptive sampling algorithm
double fSize
size of the test (eg. specified rate of Type I error)
TestStatSampler * GetTestStatSampler(void)
Returns instance of TestStatSampler.
PointSetInterval * GetInterval() const override
Main interface to get a ConfInterval (will be a PointSetInterval)
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 SaveBeltToFile(bool flag=true)
save the confidence belt to a file
void SetConfidenceLevel(double cl) override
set the confidence level for the interval (eg. 0.95 for a 95% Confidence Interval)
ConfidenceBelt * GetConfidenceBelt()
Get confidence belt. This requires that CreateConfBelt() has been called.
~NeymanConstruction() override
default constructor if(fOwnsWorkspace && fWS) delete fWS; if(fConfBelt) delete fConfBelt;
void SetTestStatSampler(TestStatSampler &sampler)
in addition to interface we also need: Set the TestStatSampler (eg.
void SetLeftSideTailFraction(double leftSideFraction=0.)
fLeftSideTailFraction*fSize defines lower edge of acceptance region.
double ConfidenceLevel() const override
Get the Confidence level for the test.
void UseAdaptiveSampling(bool flag=true)
adaptive sampling algorithm to speed up interval calculation
void AdditionalNToysFactor(double fact)
give user ability to ask for more toys
bool fSaveBeltToFile
controls use if ConfidenceBelt should be saved to a TFile
double Size() const override
This class can make regularly spaced scans based on range stored in RooRealVars.
void CreateConfBelt(bool flag=true)
should create confidence belt
void SetParameterPointsToTest(RooAbsData &pointsToTest)
User-defined set of points to test.
NeymanConstruction(RooAbsData &data, ModelConfig &model)
default constructor
void SetData(RooAbsData &data) override
Set the DataSet.
double fAdditionalNToysFactor
give user ability to ask for more toys
void SetModel(const ModelConfig &model) override
Set ModelConfig.
bool fCreateBelt
controls use if ConfidenceBelt should be saved to a TFile
PointSetInterval is a concrete implementation of the ConfInterval interface.
TestStatSampler is an interface class for a tools which produce RooStats SamplingDistributions.
Namespace for the RooStats classes.
Definition CodegenImpl.h:58