ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HybridResult.h
Go to the documentation of this file.
1 // @(#)root/roostats:$Id$
2 
3 /*************************************************************************
4  * Project: RooStats *
5  * Package: RooFit/RooStats *
6  * Authors: *
7  * Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke *
8  *************************************************************************
9  * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. *
10  * All rights reserved. *
11  * *
12  * For the licensing terms see $ROOTSYS/LICENSE. *
13  * For the list of contributors see $ROOTSYS/README/CREDITS. *
14  *************************************************************************/
15 
16 #ifndef ROOSTATS_HybridResult
17 #define ROOSTATS_HybridResult
18 
19 #ifndef ROOSTATS_HypoTestResult
21 #endif
22 
23 namespace RooStats {
24 
25  class HybridPlot;
26 
27  /*
28 
29  Class encapsulating the result of the HybridCalculatorOriginal.
30  This class is a fresh rewrite in RooStats of
31  RooStatsCms/LimitResults developped by D. Piparo and G. Schott
32  New contributions to this class have been written by Matthias Wolf (error estimation)
33 
34  The objects of this class store and access with lightweight methods the
35  information calculated by LimitResults through a Lent calculation using
36  MC toy experiments.
37  In some ways can be considered an extended and extensible implementation of the
38  TConfidenceLevel class (http://root.cern.ch/root/html/TConfidenceLevel.html).
39 
40 */
41 
42  class HybridResult : public HypoTestResult {
43 
44  public:
45 
46  /// Default constructor
47  explicit HybridResult(const char *name = 0);
48 
49  /// Constructor for HybridResult
50  HybridResult(const char *name,
51  const std::vector<double>& testStat_sb_vals,
52  const std::vector<double>& testStat_b_vals,
53  bool sumLargerValues=true);
54 
55 
56  /// Destructor of HybridResult
57  virtual ~HybridResult();
58 
59  void SetDataTestStatistics(double testStat_data_val);
60 
61  void Add(HybridResult* other);
62 
63  HybridPlot* GetPlot(const char* name,const char* title, int n_bins);
64 
65  void PrintMore(const char* options);
66 
67  /// Get test statistics values for the sb model
68  std::vector<double> GetTestStat_sb(){return fTestStat_sb;}
69 
70  /// Get test statistics values for the b model
71  std::vector<double> GetTestStat_b(){return fTestStat_b;}
72 
73  /// Get test statistics value for data
74  double GetTestStat_data(){ return fTestStat_data;}
75 
76  // Return p-value for null hypothesis
77  Double_t NullPValue() const;
78 
79  // Return p-value for alternate hypothesis
80  Double_t AlternatePValue() const;
81 
82  /// The error on the "confidence level" of the null hypothesis
83  Double_t CLbError() const;
84 
85  /// The error on the "confidence level" of the alternative hypothesis
86  Double_t CLsplusbError() const;
87 
88  /// The error on the ratio CLs+b/CLb
89  Double_t CLsError() const;
90 
91  private:
92 
93  std::vector<double> fTestStat_b; // vector of results for B-only toy-MC
94  std::vector<double> fTestStat_sb; // vector of results for S+B toy-MC
95  double fTestStat_data; // results (test statistics) evaluated for data
96 
97  mutable bool fComputationsNulDoneFlag; // flag if the fNullPValue computation have been already done or not (ie need to be refreshed)
98  mutable bool fComputationsAltDoneFlag; // flag if the fAlternatePValue computation have been already done or not (ie need to be refreshed)
99  bool fSumLargerValues; // p-value for velues of testStat >= testStat_data (or testStat <= testStat_data)
100 
101  protected:
102 
103  ClassDef(HybridResult,1) // Class containing the results of the HybridCalculator
104  };
105 }
106 
107 #endif
HybridPlot * GetPlot(const char *name, const char *title, int n_bins)
HybridResult(const char *name=0)
Default constructor.
void Add(HybridResult *other)
HypoTestResult is a base class for results from hypothesis tests.
virtual ~HybridResult()
Destructor of HybridResult.
Double_t CLsplusbError() const
The error on the "confidence level" of the alternative hypothesis.
void SetDataTestStatistics(double testStat_data_val)
Double_t CLbError() const
The error on the "confidence level" of the null hypothesis.
#define ClassDef(name, id)
Definition: Rtypes.h:254
Double_t NullPValue() const
Return p-value for null hypothesis.
This class provides the plots for the result of a study performed with the HybridCalculatorOriginal c...
Definition: HybridPlot.h:53
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
double Double_t
Definition: RtypesCore.h:55
double GetTestStat_data()
Get test statistics value for data.
Definition: HybridResult.h:74
std::vector< double > fTestStat_b
Definition: HybridResult.h:93
std::vector< double > GetTestStat_sb()
Get test statistics values for the sb model.
Definition: HybridResult.h:68
void PrintMore(const char *options)
#define name(a, b)
Definition: linkTestLib0.cpp:5
std::vector< double > GetTestStat_b()
Get test statistics values for the b model.
Definition: HybridResult.h:71
Double_t AlternatePValue() const
Return p-value for alternate hypothesis.
Double_t CLsError() const
The error on the ratio CLs+b/CLb.
std::vector< double > fTestStat_sb
Definition: HybridResult.h:94