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
54 /// User-defined set of points to test
56 fPointsToTest = &pointsToTest;
57 }
58
59 /// User-defined set of points to test
60 void SetPOIPointsToTest(RooAbsData& poiToTest) {
61 fPOIToTest = &poiToTest;
62 }
63
64 /// set the size of the test (rate of Type I error) ( Eg. 0.05 for a 95% Confidence Interval)
65 void SetTestSize(double size) override {fSize = size;}
66 /// set the confidence level for the interval (eg. 0.95 for a 95% Confidence Interval)
67 void SetConfidenceLevel(double cl) override {fSize = 1.-cl;}
68
69 void SetModel(const ModelConfig &) override;
70
73 return fPointsToTest;
74 }
75
76 /// Get the confidence belt. This requires that CreateConfBelt() has been set.
78
79 void UseAdaptiveSampling(bool flag=true){fAdaptiveSampling=flag;}
80
82
83 void SetNBins(Int_t bins) {fNbins = bins;}
84
85 void FluctuateNumDataEntries(bool flag=true){fFluctuateData = flag;}
86
87 void SaveBeltToFile(bool flag=true){
88 fSaveBeltToFile = flag;
89 if(flag) fCreateBelt = true;
90 }
91 void CreateConfBelt(bool flag=true){fCreateBelt = flag;}
92
93 /// Returns instance of TestStatSampler. Use to change properties of
94 /// TestStatSampler, e.g. GetTestStatSampler.SetTestSize(double size);
96
97
98 private:
99
100 /// initializes fPointsToTest data member (mutable)
101 void CreateParameterPoints() const;
102
103 /// initializes fTestStatSampler data member (mutable)
104 void CreateTestStatSampler() const;
105
106 double fSize; ///< size of the test (eg. specified rate of Type I error)
108 RooAbsData & fData; ///< data set
109
110 mutable ToyMCSampler* fTestStatSampler; ///< the test statistic sampler
111 mutable RooAbsData* fPointsToTest; ///< points to perform the construction
112 mutable RooAbsData* fPOIToTest; ///< value of POI points to perform the construction
114 bool fAdaptiveSampling; ///< controls use of adaptive sampling algorithm
115 double fAdditionalNToysFactor; ///< give user ability to ask for more toys
116 Int_t fNbins; ///< number of samples per variable
117 bool fFluctuateData; ///< tell ToyMCSampler to fluctuate number of entries in dataset
118 bool fDoProfileConstruction; ///< instead of full construction over nuisance parameters, do profile
119 bool fSaveBeltToFile; ///< controls use if ConfidenceBelt should be saved to a TFile
120 bool fCreateBelt; ///< controls use if ConfidenceBelt should be saved to a TFile
121
122 protected:
123 ClassDefOverride(FeldmanCousins,2) // Interface for tools setting limits (producing confidence intervals)
124 };
125}
126
127
128#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
Abstract base class for binned and unbinned datasets.
Definition RooAbsData.h:57
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
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.
ConfidenceBelt * GetConfidenceBelt()
Get the confidence belt. This requires that CreateConfBelt() has been set.
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