Logo ROOT  
Reference Guide
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#include "TList.h"
27
28class RooAbsData;
29
30namespace RooStats {
31
32 class ConfInterval;
33
35
36 public:
37
38 // FeldmanCousins();
39
40 /// Common constructor
42
43 virtual ~FeldmanCousins();
44
45 /// Main interface to get a ConfInterval (will be a PointSetInterval)
46 virtual PointSetInterval* GetInterval() const;
47
48 /// Get the size of the test (eg. rate of Type I error)
49 virtual Double_t Size() const {return fSize;}
50 /// Get the Confidence level for the test
51 virtual Double_t ConfidenceLevel() const {return 1.-fSize;}
52 /// Set the DataSet
53 virtual void SetData(RooAbsData& /*data*/) {
54 std::cout << "DEPRECATED, set data in constructor" << std::endl;
55 }
56 /// Set the Pdf
57 virtual void SetPdf(RooAbsPdf& /*pdf*/) {
58 std::cout << "DEPRECATED, use ModelConfig" << std::endl;
59 }
60
61 /// specify the parameters of interest in the interval
62 virtual void SetParameters(const RooArgSet& /*set*/) {
63 std::cout << "DEPRECATED, use ModelConfig" << std::endl;
64 }
65
66 /// specify the nuisance parameters (eg. the rest of the parameters)
67 virtual void SetNuisanceParameters(const RooArgSet& /*set*/) {
68 std::cout << "DEPRECATED, use ModelConfig" << std::endl;
69 }
70
71 /// User-defined set of points to test
73 fPointsToTest = &pointsToTest;
74 }
75
76 /// User-defined set of points to test
77 void SetPOIPointsToTest(RooAbsData& poiToTest) {
78 fPOIToTest = &poiToTest;
79 }
80
81 /// set the size of the test (rate of Type I error) ( Eg. 0.05 for a 95% Confidence Interval)
82 virtual void SetTestSize(Double_t size) {fSize = size;}
83 /// set the confidence level for the interval (eg. 0.95 for a 95% Confidence Interval)
84 virtual void SetConfidenceLevel(Double_t cl) {fSize = 1.-cl;}
85
86 virtual void SetModel(const ModelConfig &);
87
90 return fPointsToTest;
91 }
92
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
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
#define ClassDef(name, id)
Definition: Rtypes.h:326
RooAbsData is the common abstract base class for binned and unbinned datasets.
Definition: RooAbsData.h:39
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:28
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)
FeldmanCousins(RooAbsData &data, ModelConfig &model)
Common constructor.
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()
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.
Definition: ToyMCSampler.h:72
Namespace for the RooStats classes.
Definition: Asimov.h:20