Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:29:44

0001 // @(#)root/roostats:$Id$
0002 
0003 /*************************************************************************
0004  * Project: RooStats                                                     *
0005  * Package: RooFit/RooStats                                              *
0006  * Authors:                                                              *
0007  *   Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke       *
0008  *************************************************************************
0009  * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers.               *
0010  * All rights reserved.                                                  *
0011  *                                                                       *
0012  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0013  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0014  *************************************************************************/
0015 
0016 #ifndef ROOSTATS_HybridResult
0017 #define ROOSTATS_HybridResult
0018 
0019 #include "RooStats/HypoTestResult.h"
0020 
0021 #include <vector>
0022 
0023 namespace RooStats {
0024 
0025    class HybridPlot;
0026 
0027    class HybridResult : public HypoTestResult {
0028 
0029    public:
0030 
0031       /// Default constructor
0032       explicit HybridResult(const char *name = nullptr);
0033 
0034       /// Constructor for HybridResult
0035       HybridResult(const char *name,
0036          const std::vector<double>& testStat_sb_vals,
0037                    const std::vector<double>& testStat_b_vals,
0038          bool sumLargerValues=true);
0039 
0040 
0041       /// Destructor of HybridResult
0042       ~HybridResult() override;
0043 
0044       void SetDataTestStatistics(double testStat_data_val);
0045 
0046       void Add(HybridResult* other);
0047 
0048       HybridPlot* GetPlot(const char* name,const char* title, int n_bins);
0049 
0050       void PrintMore(const char* options);
0051 
0052       /// Get test statistics values for the sb model
0053       std::vector<double> GetTestStat_sb(){return fTestStat_sb;}
0054 
0055       /// Get test statistics values for the b model
0056       std::vector<double> GetTestStat_b(){return fTestStat_b;}
0057 
0058       /// Get test statistics value for data
0059       double GetTestStat_data(){ return fTestStat_data;}
0060 
0061       // Return p-value for null hypothesis
0062       double NullPValue() const override;
0063 
0064       // Return p-value for alternate hypothesis
0065       double AlternatePValue() const override;
0066 
0067       /// The error on the "confidence level" of the null hypothesis
0068       double CLbError() const;
0069 
0070       /// The error on the "confidence level" of the alternative hypothesis
0071       double CLsplusbError() const;
0072 
0073       /// The error on the ratio \f$CL_{s+b}/CL_{b}\f$
0074       double CLsError() const;
0075 
0076    private:
0077 
0078       std::vector<double> fTestStat_b; // vector of results for B-only toy-MC
0079       std::vector<double> fTestStat_sb; // vector of results for S+B toy-MC
0080       double fTestStat_data; // results (test statistics) evaluated for data
0081 
0082       mutable bool fComputationsNulDoneFlag; // flag if the fNullPValue computation have been already done or not (ie need to be refreshed)
0083       mutable bool fComputationsAltDoneFlag; // flag if the fAlternatePValue computation have been already done or not (ie need to be refreshed)
0084       bool fSumLargerValues; // p-value for velues of testStat >= testStat_data (or testStat <= testStat_data)
0085 
0086    protected:
0087 
0088       ClassDefOverride(HybridResult,1)  // Class containing the results of the HybridCalculator
0089    };
0090 }
0091 
0092 #endif