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 // FeldmanCousins();
38
39 /// Common constructor
41
42 virtual ~FeldmanCousins();
43
44 /// Main interface to get a ConfInterval (will be a PointSetInterval)
45 virtual PointSetInterval* GetInterval() const;
46
47 /// Get the size of the test (eg. rate of Type I error)
48 virtual Double_t Size() const {return fSize;}
49 /// Get the Confidence level for the test
50 virtual Double_t ConfidenceLevel() const {return 1.-fSize;}
51 /// Set the DataSet
52 virtual void SetData(RooAbsData& /*data*/) {
53 std::cout << "DEPRECATED, set data in constructor" << std::endl;
54 }
55 /// Set the Pdf
56 virtual void SetPdf(RooAbsPdf& /*pdf*/) {
57 std::cout << "DEPRECATED, use ModelConfig" << std::endl;
58 }
59
60 /// specify the parameters of interest in the interval
61 virtual void SetParameters(const RooArgSet& /*set*/) {
62 std::cout << "DEPRECATED, use ModelConfig" << std::endl;
63 }
64
65 /// specify the nuisance parameters (eg. the rest of the parameters)
66 virtual void SetNuisanceParameters(const RooArgSet& /*set*/) {
67 std::cout << "DEPRECATED, use ModelConfig" << std::endl;
68 }
69
70 /// User-defined set of points to test
72 fPointsToTest = &pointsToTest;
73 }
74
75 /// User-defined set of points to test
76 void SetPOIPointsToTest(RooAbsData& poiToTest) {
77 fPOIToTest = &poiToTest;
78 }
79
80 /// set the size of the test (rate of Type I error) ( Eg. 0.05 for a 95% Confidence Interval)
81 virtual void SetTestSize(Double_t size) {fSize = size;}
82 /// set the confidence level for the interval (eg. 0.95 for a 95% Confidence Interval)
83 virtual void SetConfidenceLevel(Double_t cl) {fSize = 1.-cl;}
84
85 virtual void SetModel(const ModelConfig &);
86
89 return fPointsToTest;
90 }
91
92 /// Get the confidence belt. This requires that CreateConfBelt() has been set.
94
95 void UseAdaptiveSampling(bool flag=true){fAdaptiveSampling=flag;}
96
98
99 void SetNBins(Int_t bins) {fNbins = bins;}
100
101 void FluctuateNumDataEntries(bool flag=true){fFluctuateData = flag;}
102
103 void SaveBeltToFile(bool flag=true){
104 fSaveBeltToFile = flag;
105 if(flag) fCreateBelt = true;
106 }
107 void CreateConfBelt(bool flag=true){fCreateBelt = flag;}
108
109 /// Returns instance of TestStatSampler. Use to change properties of
110 /// TestStatSampler, e.g. GetTestStatSampler.SetTestSize(Double_t size);
112
113
114 private:
115
116 /// initializes fPointsToTest data member (mutable)
117 void CreateParameterPoints() const;
118
119 /// initializes fTestStatSampler data member (mutable)
120 void CreateTestStatSampler() const;
121
122 Double_t fSize; // size of the test (eg. specified rate of Type I error)
124 RooAbsData & fData; // data set
125
126 /*
127 RooAbsPdf * fPdf; // common PDF
128 RooArgSet fPOI; // RooArgSet specifying parameters of interest for interval
129 RooArgSet fNuisParams;// RooArgSet specifying nuisance parameters for interval
130 RooArgSet fObservables;// RooArgSet specifying nuisance parameters for interval
131 */
132
133 mutable ToyMCSampler* fTestStatSampler; // the test statistic sampler
134 mutable RooAbsData* fPointsToTest; // points to perform the construction
135 mutable RooAbsData* fPOIToTest; // value of POI points to perform the construction
137 Bool_t fAdaptiveSampling; // controls use of adaptive sampling algorithm
138 Double_t fAdditionalNToysFactor; // give user ability to ask for more toys
139 Int_t fNbins; // number of samples per variable
140 Bool_t fFluctuateData; // tell ToyMCSampler to fluctuate number of entries in dataset
141 Bool_t fDoProfileConstruction; // instead of full construction over nuisance parameters, do profile
142 Bool_t fSaveBeltToFile; // controls use if ConfidenceBelt should be saved to a TFile
143 Bool_t fCreateBelt; // controls use if ConfidenceBelt should be saved to a TFile
144
145 protected:
146 ClassDef(FeldmanCousins,2) // Interface for tools setting limits (producing confidence intervals)
147 };
148}
149
150
151#endif
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
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:82
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:35
ConfidenceBelt is a concrete implementation of the ConfInterval interface.
The FeldmanCousins class (like the Feldman-Cousins technique) is essentially a specific configuration...
ConfidenceBelt * fConfBelt
virtual PointSetInterval * GetInterval() const
Main interface to get a ConfInterval (will be a PointSetInterval)
void CreateParameterPoints() const
initializes fPointsToTest data member (mutable)
void AdditionalNToysFactor(double fact)
void SetPOIPointsToTest(RooAbsData &poiToTest)
User-defined set of points to test.
void UseAdaptiveSampling(bool flag=true)
virtual void SetData(RooAbsData &)
Set the DataSet.
TestStatSampler * GetTestStatSampler() const
Returns instance of TestStatSampler.
RooAbsData * GetPointsToScan()
void CreateTestStatSampler() const
initializes fTestStatSampler data member (mutable)
void SaveBeltToFile(bool flag=true)
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)
void CreateConfBelt(bool flag=true)
virtual Double_t ConfidenceLevel() const
Get the Confidence level for the test.
virtual ~FeldmanCousins()
destructor
ToyMCSampler * fTestStatSampler
virtual void SetPdf(RooAbsPdf &)
Set the Pdf.
void FluctuateNumDataEntries(bool flag=true)
virtual void SetModel(const ModelConfig &)
set the model
virtual Double_t Size() const
Get the size of the test (eg. rate of Type I error)
void SetNBins(Int_t bins)
void SetParameterPointsToTest(RooAbsData &pointsToTest)
User-defined set of points to test.
virtual void SetConfidenceLevel(Double_t cl)
set the confidence level for the interval (eg. 0.95 for a 95% Confidence Interval)
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
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
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