Logo ROOT   6.10/09
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 #include "TList.h"
27 
28 class RooAbsData;
29 
30 namespace 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
72  void SetParameterPointsToTest(RooAbsData& pointsToTest) {
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 
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
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
Definition: ModelConfig.h:30
void AdditionalNToysFactor(double fact)
IntervalCalculator is an interface class for a tools which produce RooStats ConfIntervals.
ConfidenceBelt * GetConfidenceBelt()
void SaveBeltToFile(bool flag=true)
virtual Double_t ConfidenceLevel() const
Get the Confidence level for the test.
TestStatSampler is an interface class for a tools which produce RooStats SamplingDistributions.
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) ...
virtual void SetParameters(const RooArgSet &)
specify the parameters of interest in the interval
virtual Double_t Size() const
Get the size of the test (eg. rate of Type I error)
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
RooAbsData * GetPointsToScan()
virtual PointSetInterval * GetInterval() const
Main interface to get a ConfInterval (will be a PointSetInterval)
virtual void SetConfidenceLevel(Double_t cl)
set the confidence level for the interval (eg. 0.95 for a 95% Confidence Interval) ...
#define ClassDef(name, id)
Definition: Rtypes.h:297
ConfidenceBelt is a concrete implementation of the ConfInterval interface.
virtual void SetData(RooAbsData &)
Set the DataSet.
virtual ~FeldmanCousins()
destructor
void CreateTestStatSampler() const
initializes fTestStatSampler data member (mutable)
void SetNBins(Int_t bins)
void FluctuateNumDataEntries(bool flag=true)
void SetPOIPointsToTest(RooAbsData &poiToTest)
User-defined set of points to test.
ToyMCSampler * fTestStatSampler
RooAbsData is the common abstract base class for binned and unbinned datasets.
Definition: RooAbsData.h:37
ToyMCSampler is an implementation of the TestStatSampler interface.
Definition: ToyMCSampler.h:71
The FeldmanCousins class (like the Feldman-Cousins technique) is essentially a specific configuration...
Namespace for the RooStats classes.
Definition: Asimov.h:20
PointSetInterval is a concrete implementation of the ConfInterval interface.
double Double_t
Definition: RtypesCore.h:55
void CreateParameterPoints() const
initializes fPointsToTest data member (mutable)
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
Definition: RooAbsPdf.h:41
FeldmanCousins(RooAbsData &data, ModelConfig &model)
Common constructor.
TestStatSampler * GetTestStatSampler() const
Returns instance of TestStatSampler.
virtual void SetPdf(RooAbsPdf &)
Set the Pdf.
void SetParameterPointsToTest(RooAbsData &pointsToTest)
User-defined set of points to test.
virtual void SetModel(const ModelConfig &)
set the model
void CreateConfBelt(bool flag=true)
ConfidenceBelt * fConfBelt
virtual void SetNuisanceParameters(const RooArgSet &)
specify the nuisance parameters (eg. the rest of the parameters)
void UseAdaptiveSampling(bool flag=true)