Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files 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 
20 
21 namespace RooStats {
22 
23  class HybridPlot;
24 
25  class HybridResult : public HypoTestResult {
26 
27  public:
28 
29  /// Default constructor
30  explicit HybridResult(const char *name = 0);
31 
32  /// Constructor for HybridResult
33  HybridResult(const char *name,
34  const std::vector<double>& testStat_sb_vals,
35  const std::vector<double>& testStat_b_vals,
36  bool sumLargerValues=true);
37 
38 
39  /// Destructor of HybridResult
40  virtual ~HybridResult();
41 
42  void SetDataTestStatistics(double testStat_data_val);
43 
44  void Add(HybridResult* other);
45 
46  HybridPlot* GetPlot(const char* name,const char* title, int n_bins);
47 
48  void PrintMore(const char* options);
49 
50  /// Get test statistics values for the sb model
51  std::vector<double> GetTestStat_sb(){return fTestStat_sb;}
52 
53  /// Get test statistics values for the b model
54  std::vector<double> GetTestStat_b(){return fTestStat_b;}
55 
56  /// Get test statistics value for data
57  double GetTestStat_data(){ return fTestStat_data;}
58 
59  // Return p-value for null hypothesis
60  Double_t NullPValue() const;
61 
62  // Return p-value for alternate hypothesis
63  Double_t AlternatePValue() const;
64 
65  /// The error on the "confidence level" of the null hypothesis
66  Double_t CLbError() const;
67 
68  /// The error on the "confidence level" of the alternative hypothesis
69  Double_t CLsplusbError() const;
70 
71  /// The error on the ratio \f$CL_{s+b}/CL_{b}\f$
72  Double_t CLsError() const;
73 
74  private:
75 
76  std::vector<double> fTestStat_b; // vector of results for B-only toy-MC
77  std::vector<double> fTestStat_sb; // vector of results for S+B toy-MC
78  double fTestStat_data; // results (test statistics) evaluated for data
79 
80  mutable bool fComputationsNulDoneFlag; // flag if the fNullPValue computation have been already done or not (ie need to be refreshed)
81  mutable bool fComputationsAltDoneFlag; // flag if the fAlternatePValue computation have been already done or not (ie need to be refreshed)
82  bool fSumLargerValues; // p-value for velues of testStat >= testStat_data (or testStat <= testStat_data)
83 
84  protected:
85 
86  ClassDef(HybridResult,1) // Class containing the results of the HybridCalculator
87  };
88 }
89 
90 #endif