40 HybridResult::HybridResult( const
char *name) :
42 fTestStat_data(-999.),
43 fComputationsNulDoneFlag(
false),
44 fComputationsAltDoneFlag(false),
45 fSumLargerValues(false)
52 HybridResult::HybridResult(
const char *name,
53 const std::vector<double>& testStat_sb_vals,
54 const std::vector<double>& testStat_b_vals,
55 bool sumLargerValues ) :
56 HypoTestResult(name,0,0),
57 fTestStat_data(-999.),
58 fComputationsNulDoneFlag(
false),
59 fComputationsAltDoneFlag(
false),
60 fSumLargerValues(sumLargerValues)
64 int vector_size_sb = testStat_sb_vals.size();
67 int vector_size_b = testStat_b_vals.size();
71 for (
int i=0;i<vector_size_sb;++i)
75 for (
int i=0;i<vector_size_b;++i)
111 std::cout <<
"Error: no toy data present. Returning -1.\n";
115 double larger_than_measured=0;
117 for (
int iToy=0;iToy<nToys;++iToy)
120 for (
int iToy=0;iToy<nToys;++iToy)
124 if (larger_than_measured==0) std::cout <<
"Warning: CLb = 0 ... maybe more toys are needed!\n";
142 std::cout <<
"Error: no toy data present. Returning -1.\n";
146 double larger_than_measured=0;
148 for (
int iToy=0;iToy<nToys;++iToy)
151 for (
int iToy=0;iToy<nToys;++iToy)
155 if (larger_than_measured==0) std::cout <<
"Warning: CLsb = 0 ... maybe more toys are needed!\n";
205 double cl_b_err = (1. -
CLb()) / (n_b *
CLb());
219 for (
int i=0;i<other_size_sb;++i)
223 for (
int i=0;i<other_size_b;++i)
247 plot_name +=
"_plot";
248 }
else plot_name =
name;
254 plot_title +=
"_plot (";
256 plot_title +=
" toys)";
257 }
else plot_title = title;
275 std::cout <<
"\nResults " <<
GetName() <<
":\n"
276 <<
" - Number of S+B toys: " <<
fTestStat_b.size() << std::endl
277 <<
" - Number of B toys: " <<
fTestStat_sb.size() << std::endl
278 <<
" - test statistics evaluated on data: " <<
fTestStat_data << std::endl
279 <<
" - CL_b " <<
CLb() << std::endl
280 <<
" - CL_s+b " <<
CLsplusb() << std::endl
281 <<
" - CL_s " <<
CLs() << std::endl;
virtual const char * GetTitle() const
Returns title of object.
HybridPlot * GetPlot(const char *name, const char *title, int n_bins)
virtual Double_t CLs() const
CLs is simply CLs+b/CLb (not a method, but a quantity)
void Add(HybridResult *other)
virtual ~HybridResult()
Destructor of HybridResult.
virtual Double_t CLsplusb() const
Convert AlternatePValue into a "confidence level".
ClassImp(TIterator) Bool_t TIterator return false
Compare two iterator objects.
Double_t CLsplusbError() const
The error on the "confidence level" of the alternative hypothesis.
void SetDataTestStatistics(double testStat_data_val)
const char * Data() const
bool fComputationsAltDoneFlag
Double_t CLbError() const
The error on the "confidence level" of the null hypothesis.
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...
bool fComputationsNulDoneFlag
Double_t fAlternatePValue
virtual Double_t CLb() const
Convert NullPValue into a "confidence level".
virtual const char * GetName() const
Returns name of object.
ClassImp(RooStats::HybridResult) using namespace RooStats
Namespace for the RooStats classes.
double GetTestStat_data()
Get test statistics value for data.
std::vector< double > fTestStat_b
std::vector< double > GetTestStat_sb()
Get test statistics values for the sb model.
void PrintMore(const char *options)
std::vector< double > GetTestStat_b()
Get test statistics values for the b model.
Double_t AlternatePValue() const
Return p-value for alternate hypothesis.
Double_t Sqrt(Double_t x)
Double_t CLsError() const
The error on the ratio CLs+b/CLb.
std::vector< double > fTestStat_sb