40 HybridResult::HybridResult(
const char *
name) :
42 fTestStat_data(-999.),
43 fComputationsNulDoneFlag(false),
44 fComputationsAltDoneFlag(false),
45 fSumLargerValues(false)
53 const std::vector<double>& testStat_sb_vals,
54 const std::vector<double>& testStat_b_vals,
55 bool sumLargerValues ) :
64 int vector_size_sb = testStat_sb_vals.size();
65 assert(vector_size_sb>0);
67 int vector_size_b = testStat_b_vals.size();
68 assert(vector_size_b>0);
71 for (
int i=0;i<vector_size_sb;++i)
75 for (
int i=0;i<vector_size_b;++i)
109 std::cout <<
"Error: no toy data present. Returning -1.\n";
113 double larger_than_measured=0;
115 for (
int iToy=0;iToy<nToys;++iToy)
118 for (
int iToy=0;iToy<nToys;++iToy)
122 if (larger_than_measured==0) std::cout <<
"Warning: CLb = 0 ... maybe more toys are needed!\n";
139 std::cout <<
"Error: no toy data present. Returning -1.\n";
143 double larger_than_measured=0;
145 for (
int iToy=0;iToy<nToys;++iToy)
148 for (
int iToy=0;iToy<nToys;++iToy)
152 if (larger_than_measured==0) std::cout <<
"Warning: CLsb = 0 ... maybe more toys are needed!\n";
202 double cl_b_err = (1. -
CLb()) / (n_b *
CLb());
217 for (
int i=0;i<other_size_sb;++i)
221 for (
int i=0;i<other_size_b;++i)
242 if ( TString(name)==
"" ) {
244 plot_name +=
"_plot";
245 }
else plot_name =
name;
249 if ( TString(title)==
"" ) {
251 plot_title +=
"_plot (";
253 plot_title +=
" toys)";
254 }
else plot_title = title;
271 std::cout <<
"\nResults " <<
GetName() <<
":\n" 272 <<
" - Number of S+B toys: " <<
fTestStat_b.size() << std::endl
273 <<
" - Number of B toys: " <<
fTestStat_sb.size() << std::endl
274 <<
" - test statistics evaluated on data: " <<
fTestStat_data << std::endl
275 <<
" - CL_b " <<
CLb() << std::endl
276 <<
" - CL_s+b " <<
CLsplusb() << std::endl
277 <<
" - CL_s " <<
CLs() << std::endl;
virtual const char * GetName() const
Returns name of object.
HybridPlot * GetPlot(const char *name, const char *title, int n_bins)
prepare a plot showing a result and return a pointer to a HybridPlot object the needed arguments are:...
virtual Double_t CLb() const
Convert NullPValue into a "confidence level".
Double_t CLbError() const
The error on the "confidence level" of the null hypothesis.
void Add(HybridResult *other)
add additional toy-MC experiments to the current results use the data test statistics of the added ob...
HypoTestResult is a base class for results from hypothesis tests.
Double_t CLsError() const
The error on the ratio .
virtual ~HybridResult()
Destructor of HybridResult.
void SetDataTestStatistics(double testStat_data_val)
set the value of the test statistics on data
bool fComputationsAltDoneFlag
This class provides the plots for the result of a study performed with the HybridCalculatorOriginal c...
HybridResult(const char *name=0)
Default constructor.
Double_t NullPValue() const
Returns : the B p-value.
bool fComputationsNulDoneFlag
Double_t fAlternatePValue
Double_t CLsplusbError() const
The error on the "confidence level" of the alternative hypothesis.
virtual Double_t CLs() const
is simply (not a method, but a quantity)
virtual Double_t CLsplusb() const
Convert AlternatePValue into a "confidence level".
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)
Print out some information about the results.
std::vector< double > GetTestStat_b()
Get test statistics values for the b model.
Double_t Sqrt(Double_t x)
Double_t AlternatePValue() const
Returns : the S+B p-value.
virtual const char * GetTitle() const
Returns title of object.
std::vector< double > fTestStat_sb