Logo ROOT  
Reference Guide
 
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
40 /// NeymanConstruction();
42
43 virtual ~NeymanConstruction();
44
45 /// Main interface to get a ConfInterval (will be a PointSetInterval)
46 virtual PointSetInterval* GetInterval() const;
47
48 /// in addition to interface we also need:
49 /// Set the TestStatSampler (eg. ToyMC or FFT, includes choice of TestStatistic)
51 /// fLeftSideTailFraction*fSize defines lower edge of acceptance region.
52 /// Unified limits use 0, central limits use 0.5,
53 /// for upper/lower limits it is 0/1 depends on sign of test statistic w.r.t. parameter
54 void SetLeftSideTailFraction(Double_t leftSideFraction = 0.) {fLeftSideFraction = leftSideFraction;}
55
56 /// User-defined set of points to test
58 fPointsToTest = &pointsToTest;
59 fConfBelt = new ConfidenceBelt("ConfBelt",pointsToTest);
60 }
61 /// This class can make regularly spaced scans based on range stored in RooRealVars.
62 /// Choose number of steps for a rastor scan (common for each dimension)
63 /// void SetNumSteps(Int_t);
64 /// This class can make regularly spaced scans based on range stored in RooRealVars.
65 /// Choose number of steps for a rastor scan (specific for each dimension)
66 /// void SetNumSteps(std::map<RooAbsArg, Int_t>)
67
68 /// Get the size of the test (eg. rate of Type I error)
69 virtual Double_t Size() const {return fSize;}
70
71 /// Get the Confidence level for the test
72 virtual Double_t ConfidenceLevel() const {return 1.-fSize;}
73
74 /// Set ModelConfig
75 virtual void SetModel(const ModelConfig &model) {fModel = model;}
76
77 /// Set the DataSet
78 virtual void SetData(RooAbsData& data) { fData = data; }
79
80 /// Set the Pdf, add to the the workspace if not already there
81 virtual void SetPdf(RooAbsPdf& /*pdf*/) {
82 std::cout << "DEPRECATED, use ModelConfig"<<std::endl;
83 }
84
85 /// specify the parameters of interest in the interval
86 virtual void SetParameters(const RooArgSet& /*set*/) {
87 std::cout << "DEPRECATED, use ModelConfig"<<std::endl;
88 }
89
90 /// specify the nuisance parameters (eg. the rest of the parameters)
91 virtual void SetNuisanceParameters(const RooArgSet& /*set*/) {
92 std::cout << "DEPRECATED, use ModelConfig"<<std::endl;
93 }
94
95 /// set the size of the test (rate of Type I error) ( Eg. 0.05 for a 95% Confidence Interval)
96 virtual void SetTestSize(Double_t size) {fSize = size;}
97 /// set the confidence level for the interval (eg. 0.95 for a 95% Confidence Interval)
98 virtual void SetConfidenceLevel(Double_t cl) {fSize = 1.-cl;}
99
100 /// Get confidence belt. This requires that CreateConfBelt() has been called.
102
103 /// adaptive sampling algorithm to speed up interval calculation
104 void UseAdaptiveSampling(bool flag=true){fAdaptiveSampling=flag;}
105
106 /// give user ability to ask for more toys
108
109 /// save the confidence belt to a file
110 void SaveBeltToFile(bool flag=true){
111 fSaveBeltToFile = flag;
112 if(flag) fCreateBelt = true;
113 }
114 /// should create confidence belt
115 void CreateConfBelt(bool flag=true){fCreateBelt = flag;}
116
117 /// Returns instance of TestStatSampler. Use to change properties of
118 /// TestStatSampler, e.g. GetTestStatSampler.SetTestSize(Double_t size);
120
121
122 private:
123
124 Double_t fSize; /// size of the test (eg. specified rate of Type I error)
125 RooAbsData& fData; /// data set
127 /*
128 RooAbsPdf * fPdf; // common PDF
129 mutable RooArgSet fPOI; // RooArgSet specifying parameters of interest for interval
130 RooArgSet fNuisParams;// RooArgSet specifying nuisance parameters for interval
131 */
132
137 bool fAdaptiveSampling; // controls use of adaptive sampling algorithm
138 Double_t fAdditionalNToysFactor; // give user ability to ask for more toys
139 bool fSaveBeltToFile; // controls use if ConfidenceBelt should be saved to a TFile
140 bool fCreateBelt; // controls use if ConfidenceBelt should be saved to a TFile
141
142 protected:
143 ClassDef(NeymanConstruction,1) // Interface for tools setting limits (producing confidence intervals)
144 };
145}
146
147
148#endif
double Double_t
Definition RtypesCore.h:59
#define ClassDef(name, id)
Definition Rtypes.h:325
RooAbsData is the common abstract base class for binned and unbinned datasets.
Definition RooAbsData.h:49
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:29
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:30
NeymanConstruction is a concrete implementation of the NeymanConstruction interface that,...
virtual void SetTestSize(Double_t size)
set the size of the test (rate of Type I error) ( Eg. 0.05 for a 95% Confidence Interval)
virtual void SetParameters(const RooArgSet &)
specify the parameters of interest in the interval
TestStatSampler * GetTestStatSampler(void)
Returns instance of TestStatSampler.
virtual void SetNuisanceParameters(const RooArgSet &)
specify the nuisance parameters (eg. the rest of the parameters)
void SaveBeltToFile(bool flag=true)
save the confidence belt to a file
ConfidenceBelt * GetConfidenceBelt()
Get confidence belt. This requires that CreateConfBelt() has been called.
virtual void SetModel(const ModelConfig &model)
Set ModelConfig.
virtual PointSetInterval * GetInterval() const
Main interface to get a ConfInterval (will be a PointSetInterval)
void SetTestStatSampler(TestStatSampler &sampler)
in addition to interface we also need: Set the TestStatSampler (eg.
virtual void SetPdf(RooAbsPdf &)
Set the Pdf, add to the the workspace if not already there.
void SetLeftSideTailFraction(Double_t leftSideFraction=0.)
fLeftSideTailFraction*fSize defines lower edge of acceptance region.
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
virtual ~NeymanConstruction()
default constructor if(fOwnsWorkspace && fWS) delete fWS; if(fConfBelt) delete fConfBelt;
virtual Double_t ConfidenceLevel() const
Get the Confidence level for the test.
void CreateConfBelt(bool flag=true)
should create confidence belt
RooAbsData & fData
size of the test (eg. specified rate of Type I error)
void SetParameterPointsToTest(RooAbsData &pointsToTest)
User-defined set of points to test.
virtual Double_t Size() const
This class can make regularly spaced scans based on range stored in RooRealVars.
virtual void SetConfidenceLevel(Double_t cl)
set the confidence level for the interval (eg. 0.95 for a 95% Confidence Interval)
virtual void SetData(RooAbsData &data)
Set the DataSet.
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 Asimov.h:19