Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
FeldmanCousins.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_FeldmanCousins
12#define ROOSTATS_FeldmanCousins
13
14
15#include "Rtypes.h"
16
18
22
23#include "RooAbsData.h"
24#include "RooAbsPdf.h"
25#include "RooArgSet.h"
26
27class RooAbsData;
28
29namespace RooStats {
30
31 class ConfInterval;
32
34
35 public:
36
37 /// Common constructor
39
40 ~FeldmanCousins() override;
41
42 /// Main interface to get a ConfInterval (will be a PointSetInterval)
43 PointSetInterval* GetInterval() const override;
44
45 /// Get the size of the test (eg. rate of Type I error)
46 double Size() const override {return fSize;}
47 /// Get the Confidence level for the test
48 double ConfidenceLevel() const override {return 1.-fSize;}
49 /// Set the DataSet
50 void SetData(RooAbsData& /*data*/) override {
51 std::cout << "DEPRECATED, set data in constructor" << std::endl;
52 }
53 /// Set the Pdf
54 virtual void SetPdf(RooAbsPdf& /*pdf*/) {
55 std::cout << "DEPRECATED, use ModelConfig" << std::endl;
56 }
57
58 /// specify the parameters of interest in the interval
59 virtual void SetParameters(const RooArgSet& /*set*/) {
60 std::cout << "DEPRECATED, use ModelConfig" << std::endl;
61 }
62
63 /// specify the nuisance parameters (eg. the rest of the parameters)
64 virtual void SetNuisanceParameters(const RooArgSet& /*set*/) {
65 std::cout << "DEPRECATED, use ModelConfig" << std::endl;
66 }
67
68 /// User-defined set of points to test
70 fPointsToTest = &pointsToTest;
71 }
72
73 /// User-defined set of points to test
74 void SetPOIPointsToTest(RooAbsData& poiToTest) {
75 fPOIToTest = &poiToTest;
76 }
77
78 /// set the size of the test (rate of Type I error) ( Eg. 0.05 for a 95% Confidence Interval)
79 void SetTestSize(double size) override {fSize = size;}
80 /// set the confidence level for the interval (eg. 0.95 for a 95% Confidence Interval)
81 void SetConfidenceLevel(double cl) override {fSize = 1.-cl;}
82
83 void SetModel(const ModelConfig &) override;
84
87 return fPointsToTest;
88 }
89
90 /// Get the confidence belt. This requires that CreateConfBelt() has been set.
92
93 void UseAdaptiveSampling(bool flag=true){fAdaptiveSampling=flag;}
94
96
97 void SetNBins(Int_t bins) {fNbins = bins;}
98
99 void FluctuateNumDataEntries(bool flag=true){fFluctuateData = flag;}
100
101 void SaveBeltToFile(bool flag=true){
102 fSaveBeltToFile = flag;
103 if(flag) fCreateBelt = true;
104 }
105 void CreateConfBelt(bool flag=true){fCreateBelt = flag;}
106
107 /// Returns instance of TestStatSampler. Use to change properties of
108 /// TestStatSampler, e.g. GetTestStatSampler.SetTestSize(double size);
110
111
112 private:
113
114 /// initializes fPointsToTest data member (mutable)
115 void CreateParameterPoints() const;
116
117 /// initializes fTestStatSampler data member (mutable)
118 void CreateTestStatSampler() const;
119
120 double fSize; ///< size of the test (eg. specified rate of Type I error)
122 RooAbsData & fData; ///< data set
123
124 mutable ToyMCSampler* fTestStatSampler; ///< the test statistic sampler
125 mutable RooAbsData* fPointsToTest; ///< points to perform the construction
126 mutable RooAbsData* fPOIToTest; ///< value of POI points to perform the construction
128 bool fAdaptiveSampling; ///< controls use of adaptive sampling algorithm
129 double fAdditionalNToysFactor; ///< give user ability to ask for more toys
130 Int_t fNbins; ///< number of samples per variable
131 bool fFluctuateData; ///< tell ToyMCSampler to fluctuate number of entries in dataset
132 bool fDoProfileConstruction; ///< instead of full construction over nuisance parameters, do profile
133 bool fSaveBeltToFile; ///< controls use if ConfidenceBelt should be saved to a TFile
134 bool fCreateBelt; ///< controls use if ConfidenceBelt should be saved to a TFile
135
136 protected:
137 ClassDefOverride(FeldmanCousins,2) // Interface for tools setting limits (producing confidence intervals)
138 };
139}
140
141
142#endif
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
RooAbsData is the common abstract base class for binned and unbinned datasets.
Definition RooAbsData.h:59
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:55
ConfidenceBelt is a concrete implementation of the ConfInterval interface.
The FeldmanCousins class (like the Feldman-Cousins technique) is essentially a specific configuration...
bool fSaveBeltToFile
controls use if ConfidenceBelt should be saved to a TFile
ConfidenceBelt * fConfBelt
RooAbsData & fData
data set
void CreateParameterPoints() const
initializes fPointsToTest data member (mutable)
void SetModel(const ModelConfig &) override
set the model
void AdditionalNToysFactor(double fact)
bool fFluctuateData
tell ToyMCSampler to fluctuate number of entries in dataset
void SetPOIPointsToTest(RooAbsData &poiToTest)
User-defined set of points to test.
double fSize
size of the test (eg. specified rate of Type I error)
Int_t fNbins
number of samples per variable
double Size() const override
Get the size of the test (eg. rate of Type I error)
PointSetInterval * GetInterval() const override
Main interface to get a ConfInterval (will be a PointSetInterval)
double ConfidenceLevel() const override
Get the Confidence level for the test.
void UseAdaptiveSampling(bool flag=true)
TestStatSampler * GetTestStatSampler() const
Returns instance of TestStatSampler.
RooAbsData * GetPointsToScan()
void CreateTestStatSampler() const
initializes fTestStatSampler data member (mutable)
double fAdditionalNToysFactor
give user ability to ask for more toys
void SaveBeltToFile(bool flag=true)
RooAbsData * fPOIToTest
value of POI points to perform the construction
bool fCreateBelt
controls use if ConfidenceBelt should be saved to a TFile
void CreateConfBelt(bool flag=true)
bool fDoProfileConstruction
instead of full construction over nuisance parameters, do profile
RooAbsData * fPointsToTest
points to perform the construction
void SetTestSize(double size) override
set the size of the test (rate of Type I error) ( Eg. 0.05 for a 95% Confidence Interval)
ToyMCSampler * fTestStatSampler
the test statistic sampler
virtual void SetPdf(RooAbsPdf &)
Set the Pdf.
void SetConfidenceLevel(double cl) override
set the confidence level for the interval (eg. 0.95 for a 95% Confidence Interval)
void FluctuateNumDataEntries(bool flag=true)
void SetNBins(Int_t bins)
~FeldmanCousins() override
destructor
void SetParameterPointsToTest(RooAbsData &pointsToTest)
User-defined set of points to test.
void SetData(RooAbsData &) override
Set the DataSet.
virtual void SetNuisanceParameters(const RooArgSet &)
specify the nuisance parameters (eg. the rest of the parameters)
ConfidenceBelt * GetConfidenceBelt()
Get the confidence belt. This requires that CreateConfBelt() has been set.
virtual void SetParameters(const RooArgSet &)
specify the parameters of interest in the interval
bool fAdaptiveSampling
controls use of adaptive sampling algorithm
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
PointSetInterval is a concrete implementation of the ConfInterval interface.
TestStatSampler is an interface class for a tools which produce RooStats SamplingDistributions.
ToyMCSampler is an implementation of the TestStatSampler interface.
Namespace for the RooStats classes.
Definition Asimov.h:19