ROOT  6.06/09
Reference Guide
HypoTestInverterOriginal.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_HypoTestInverterOriginal
12 #define ROOSTATS_HypoTestInverterOriginal
13 
14 
15 
16 #ifndef ROOSTATS_IntervalCalculator
18 #endif
19 
20 #ifndef ROOSTATS_HypoTestCalculator
22 #endif
23 
24 #ifndef ROOSTATS_HypoTestInverterResult
26 #endif
27 
28 class RooRealVar;
29 
30 
31 namespace RooStats {
32 
33  /**
34 
35  This class is now depratcated and to be replaced by the HypoTestInverter.
36  HypoTestInverterOriginal class for performing an hypothesis test inversion by scanning the hypothesis test results of the
37  HybridCalculator for various values of the parameter of interest. By looking at the confidence level curve of
38  the result an upper limit, where it intersects the desired confidence level, can be derived.
39  The class implements the RooStats::IntervalCalculator interface and returns an RooStats::HypoTestInverterResult class.
40  The result is a SimpleInterval, which via the method UpperLimit returns to the user the upper limit value.
41 
42 The HypoTestInverterOriginal implements various option for performing the scan. HypoTestInverterOriginal::RunFixedScan will scan using a fixed grid the parameter of interest. HypoTestInverterOriginal::RunAutoScan will perform an automatic scan to find optimally the curve and it will stop until the desired precision is obtained.
43 The confidence level value at a given point can be done via HypoTestInverterOriginal::RunOnePoint.
44 The class can scan the CLs+b values or alternativly CLs (if the method HypoTestInverterOriginal::UseCLs has been called).
45 
46 
47  New contributions to this class have been written by Matthias Wolf (advanced AutoRun algorithm)
48 **/
49 
51 
52  public:
53 
54  // default constructor (used only for I/O)
56 
57 
58  // constructor
60  RooRealVar& scannedVariable,
61  double size = 0.05) ;
62 
63 
64 
65  virtual HypoTestInverterResult* GetInterval() const { return fResults; } ;
66 
67  bool RunAutoScan( double xMin, double xMax, double target, double epsilon=0.005, unsigned int numAlgorithm=0 );
68 
69  bool RunFixedScan( int nBins, double xMin, double xMax );
70 
71  bool RunOnePoint( double thisX );
72 
73  void UseCLs( bool on = true) { fUseCLs = on; if (fResults) fResults->UseCLs(on); }
74 
75  virtual void SetData(RooAbsData &) { } // not needed
76 
77  virtual void SetModel(const ModelConfig &) { } // not needed
78 
79  // set the size of the test (rate of Type I error) ( Eg. 0.05 for a 95% Confidence Interval)
80  virtual void SetTestSize(Double_t size) {fSize = size; if (fResults) fResults->SetTestSize(size); }
81  // set the confidence level for the interval (eg. 0.95 for a 95% Confidence Interval)
82  virtual void SetConfidenceLevel(Double_t cl) {fSize = 1.-cl; if (fResults) fResults->SetConfidenceLevel(cl); }
83  // Get the size of the test (eg. rate of Type I error)
84  virtual Double_t Size() const {return fSize;}
85  // Get the Confidence level for the test
86  virtual Double_t ConfidenceLevel() const {return 1.-fSize;}
87 
88  // destructor
89  virtual ~HypoTestInverterOriginal() ;
90 
91  private:
92 
93  void CreateResults();
94 
95  HypoTestCalculator* fCalculator0; // pointer to the calculator passed in the constructor
96  RooRealVar* fScannedVariable; // pointer to the constrained variable
98 
99  bool fUseCLs;
100  double fSize;
101 
102  protected:
103 
104  ClassDef(HypoTestInverterOriginal,1) // HypoTestInverterOriginal class
105 
106  };
107 }
108 
109 #endif
virtual void SetModel(const ModelConfig &)
Set the Model.
virtual HypoTestInverterResult * GetInterval() const
Main interface to get a ConfInterval, pure virtual.
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
Definition: ModelConfig.h:52
IntervalCalculator is an interface class for a tools which produce RooStats ConfIntervals.
bool RunAutoScan(double xMin, double xMax, double target, double epsilon=0.005, unsigned int numAlgorithm=0)
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 SetData(RooAbsData &)
Set the DataSet ( add to the the workspace if not already there ?)
#define ClassDef(name, id)
Definition: Rtypes.h:254
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
void UseCLs(bool on=true)
flag to switch between using CLsb (default) or CLs as confidence level
virtual void SetTestSize(Double_t size)
set the size of the test (rate of Type I error) ( e.g. 0.05 for a 95% Confidence Interval) ...
HypoTestCalculator is an interface class for a tools which produce RooStats HypoTestResults.
virtual Double_t Size() const
Get the size of the test (eg. rate of Type I error)
virtual void SetConfidenceLevel(Double_t cl)
set the confidence level for the interval (e.g. 0.95 for a 95% Confidence Interval) ...
REAL epsilon
Definition: triangle.c:617
virtual Double_t ConfidenceLevel() const
Get the Confidence level for the test.
Namespace for the RooStats classes.
Definition: Asimov.h:20
This class is now depratcated and to be replaced by the HypoTestInverter.
HypoTestInverterResult class: holds the array of hypothesis test results and compute a confidence int...
double Double_t
Definition: RtypesCore.h:55
bool RunFixedScan(int nBins, double xMin, double xMax)
virtual void SetConfidenceLevel(Double_t cl)
set the confidence level for the interval (eg. 0.95 for a 95% Confidence Interval) ...