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 
19 #include "RooStats/ToyMCSampler.h"
22 
23 #include "RooAbsData.h"
24 #include "RooAbsPdf.h"
25 #include "RooArgSet.h"
26 
27 class RooAbsData;
28 
29 namespace 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
71  void SetParameterPointsToTest(RooAbsData& pointsToTest) {
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 
97  void AdditionalNToysFactor(double fact){fAdditionalNToysFactor = fact;}
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
RooStats::FeldmanCousins::fPointsToTest
RooAbsData * fPointsToTest
Definition: FeldmanCousins.h:134
RooStats::FeldmanCousins::fDoProfileConstruction
Bool_t fDoProfileConstruction
Definition: FeldmanCousins.h:141
RooStats::FeldmanCousins::fData
RooAbsData & fData
Definition: FeldmanCousins.h:124
RooStats::FeldmanCousins::fAdditionalNToysFactor
Double_t fAdditionalNToysFactor
Definition: FeldmanCousins.h:138
PointSetInterval.h
RooStats::FeldmanCousins::SetPdf
virtual void SetPdf(RooAbsPdf &)
Set the Pdf.
Definition: FeldmanCousins.h:56
RooStats::TestStatSampler
TestStatSampler is an interface class for a tools which produce RooStats SamplingDistributions.
Definition: TestStatSampler.h:39
RooAbsData
RooAbsData is the common abstract base class for binned and unbinned datasets.
Definition: RooAbsData.h:49
RooArgSet.h
RooStats::FeldmanCousins::SetTestSize
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)
Definition: FeldmanCousins.h:81
ConfidenceBelt.h
RooStats::FeldmanCousins::GetConfidenceBelt
ConfidenceBelt * GetConfidenceBelt()
Get the confidence belt. This requires that CreateConfBelt() has been set.
Definition: FeldmanCousins.h:93
RooStats::IntervalCalculator
IntervalCalculator is an interface class for a tools which produce RooStats ConfIntervals.
Definition: IntervalCalculator.h:55
RooStats::FeldmanCousins::SaveBeltToFile
void SaveBeltToFile(bool flag=true)
Definition: FeldmanCousins.h:103
RooStats::FeldmanCousins
The FeldmanCousins class (like the Feldman-Cousins technique) is essentially a specific configuration...
Definition: FeldmanCousins.h:33
RooStats::FeldmanCousins::GetInterval
virtual PointSetInterval * GetInterval() const
Main interface to get a ConfInterval (will be a PointSetInterval)
Definition: FeldmanCousins.cxx:222
ToyMCSampler.h
IntervalCalculator.h
RooStats::FeldmanCousins::fConfBelt
ConfidenceBelt * fConfBelt
Definition: FeldmanCousins.h:136
RooStats::FeldmanCousins::SetNBins
void SetNBins(Int_t bins)
Definition: FeldmanCousins.h:99
RooStats::FeldmanCousins::fSize
Double_t fSize
Definition: FeldmanCousins.h:122
bool
RooStats::FeldmanCousins::ConfidenceLevel
virtual Double_t ConfidenceLevel() const
Get the Confidence level for the test.
Definition: FeldmanCousins.h:50
RooStats::FeldmanCousins::AdditionalNToysFactor
void AdditionalNToysFactor(double fact)
Definition: FeldmanCousins.h:97
RooStats::FeldmanCousins::fPOIToTest
RooAbsData * fPOIToTest
Definition: FeldmanCousins.h:135
RooStats::FeldmanCousins::UseAdaptiveSampling
void UseAdaptiveSampling(bool flag=true)
Definition: FeldmanCousins.h:95
RooStats::FeldmanCousins::fTestStatSampler
ToyMCSampler * fTestStatSampler
Definition: FeldmanCousins.h:133
RooAbsPdf.h
RooStats::FeldmanCousins::SetModel
virtual void SetModel(const ModelConfig &)
set the model
Definition: FeldmanCousins.cxx:95
RooStats::FeldmanCousins::fNbins
Int_t fNbins
Definition: FeldmanCousins.h:139
RooStats::FeldmanCousins::fModel
ModelConfig & fModel
Definition: FeldmanCousins.h:123
RooStats::ConfidenceBelt
ConfidenceBelt is a concrete implementation of the ConfInterval interface.
Definition: ConfidenceBelt.h:156
RooStats::FeldmanCousins::GetTestStatSampler
TestStatSampler * GetTestStatSampler() const
Returns instance of TestStatSampler.
Definition: FeldmanCousins.cxx:101
RooStats::FeldmanCousins::fSaveBeltToFile
Bool_t fSaveBeltToFile
Definition: FeldmanCousins.h:142
RooStats::FeldmanCousins::SetPOIPointsToTest
void SetPOIPointsToTest(RooAbsData &poiToTest)
User-defined set of points to test.
Definition: FeldmanCousins.h:76
RooStats::FeldmanCousins::fAdaptiveSampling
Bool_t fAdaptiveSampling
Definition: FeldmanCousins.h:137
RooStats::FeldmanCousins::fCreateBelt
Bool_t fCreateBelt
Definition: FeldmanCousins.h:143
RooAbsData.h
Double_t
double Double_t
Definition: RtypesCore.h:59
RooStats
Namespace for the RooStats classes.
Definition: Asimov.h:19
RooStats::FeldmanCousins::SetParameters
virtual void SetParameters(const RooArgSet &)
specify the parameters of interest in the interval
Definition: FeldmanCousins.h:61
RooStats::ToyMCSampler
ToyMCSampler is an implementation of the TestStatSampler interface.
Definition: ToyMCSampler.h:73
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
RooStats::FeldmanCousins::GetPointsToScan
RooAbsData * GetPointsToScan()
Definition: FeldmanCousins.h:87
RooStats::FeldmanCousins::SetConfidenceLevel
virtual void SetConfidenceLevel(Double_t cl)
set the confidence level for the interval (eg. 0.95 for a 95% Confidence Interval)
Definition: FeldmanCousins.h:83
RooStats::FeldmanCousins::SetData
virtual void SetData(RooAbsData &)
Set the DataSet.
Definition: FeldmanCousins.h:52
RooStats::FeldmanCousins::CreateTestStatSampler
void CreateTestStatSampler() const
initializes fTestStatSampler data member (mutable)
Definition: FeldmanCousins.cxx:110
make_cnn_model.model
model
Definition: make_cnn_model.py:6
RooStats::FeldmanCousins::FluctuateNumDataEntries
void FluctuateNumDataEntries(bool flag=true)
Definition: FeldmanCousins.h:101
RooAbsPdf
Definition: RooAbsPdf.h:43
RooStats::FeldmanCousins::CreateParameterPoints
void CreateParameterPoints() const
initializes fPointsToTest data member (mutable)
Definition: FeldmanCousins.cxx:138
RooStats::PointSetInterval
PointSetInterval is a concrete implementation of the ConfInterval interface.
Definition: PointSetInterval.h:21
RooStats::FeldmanCousins::Size
virtual Double_t Size() const
Get the size of the test (eg. rate of Type I error)
Definition: FeldmanCousins.h:48
RooStats::ModelConfig
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
Definition: ModelConfig.h:30
RooStats::FeldmanCousins::SetParameterPointsToTest
void SetParameterPointsToTest(RooAbsData &pointsToTest)
User-defined set of points to test.
Definition: FeldmanCousins.h:71
Rtypes.h
RooStats::FeldmanCousins::CreateConfBelt
void CreateConfBelt(bool flag=true)
Definition: FeldmanCousins.h:107
RooStats::FeldmanCousins::~FeldmanCousins
virtual ~FeldmanCousins()
destructor
Definition: FeldmanCousins.cxx:86
RooArgSet
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:29
RooStats::FeldmanCousins::SetNuisanceParameters
virtual void SetNuisanceParameters(const RooArgSet &)
specify the nuisance parameters (eg. the rest of the parameters)
Definition: FeldmanCousins.h:66
RooStats::FeldmanCousins::fFluctuateData
Bool_t fFluctuateData
Definition: FeldmanCousins.h:140
RooStats::FeldmanCousins::FeldmanCousins
FeldmanCousins(RooAbsData &data, ModelConfig &model)
Common constructor.
Definition: FeldmanCousins.cxx:65
int