62 const std::vector<double>& testStat_sb_vals,
63 const std::vector<double>& testStat_b_vals,
64 bool sumLargerValues ) :
73 int vector_size_sb = testStat_sb_vals.size();
74 assert(vector_size_sb>0);
76 int vector_size_b = testStat_b_vals.size();
77 assert(vector_size_b>0);
80 for (
int i=0;i<vector_size_sb;++i)
84 for (
int i=0;i<vector_size_b;++i)
118 coutE(Eval) <<
"Error: no toy data present. Returning -1.\n";
122 double larger_than_measured=0;
124 for (
int iToy=0;iToy<nToys;++iToy)
127 for (
int iToy=0;iToy<nToys;++iToy)
131 if (larger_than_measured==0)
coutW(Eval) <<
"Warning: CLb = 0 ... maybe more toys are needed!\n";
148 coutE(Eval) <<
"Error: no toy data present. Returning -1.\n";
152 double larger_than_measured=0;
154 for (
int iToy=0;iToy<nToys;++iToy)
157 for (
int iToy=0;iToy<nToys;++iToy)
161 if (larger_than_measured==0)
coutW(Eval) <<
"Warning: CLsb = 0 ... maybe more toys are needed!\n";
180 return std::sqrt(
CLb() * (1. -
CLb()) /
n);
211 double cl_b_err = (1. -
CLb()) / (n_b *
CLb());
214 return CLs() * std::sqrt(cl_b_err + cl_sb_err);
226 for (
int i=0;i<other_size_sb;++i)
230 for (
int i=0;i<other_size_b;++i)
248 std::cout <<
"\nResults " <<
GetName() <<
":\n"
249 <<
" - Number of S+B toys: " <<
fTestStat_b.size() << std::endl
250 <<
" - Number of B toys: " <<
fTestStat_sb.size() << std::endl
251 <<
" - test statistics evaluated on data: " <<
fTestStat_data << std::endl
252 <<
" - CL_b " <<
CLb() << std::endl
253 <<
" - CL_s+b " <<
CLsplusb() << std::endl
254 <<
" - CL_s " <<
CLs() << std::endl;
std::vector< double > GetTestStat_sb()
Get test statistics values for the sb model.
std::vector< double > fTestStat_b
~HybridResult() override
Destructor of HybridResult.
double AlternatePValue() const override
Returns : the S+B p-value.
double GetTestStat_data()
Get test statistics value for data.
std::vector< double > GetTestStat_b()
Get test statistics values for the b model.
void PrintMore(const char *options)
Print out some information about the results.
void Add(HybridResult *other)
add additional toy-MC experiments to the current results use the data test statistics of the added ob...
std::vector< double > fTestStat_sb
bool fComputationsAltDoneFlag
double CLsplusbError() const
The error on the "confidence level" of the alternative hypothesis.
double CLbError() const
The error on the "confidence level" of the null hypothesis.
void SetDataTestStatistics(double testStat_data_val)
set the value of the test statistics on data
HybridResult(const char *name=nullptr)
Default constructor.
double CLsError() const
The error on the ratio .
bool fComputationsNulDoneFlag
double NullPValue() const override
Returns : the B p-value.
double fNullPValue
p-value for the null hypothesis (small number means disfavoured)
virtual double CLsplusb() const
Convert AlternatePValue into a "confidence level".
HypoTestResult(const char *name=nullptr)
default constructor
virtual double CLs() const
is simply (not a method, but a quantity)
double fAlternatePValue
p-value for the alternate hypothesis (small number means disfavoured)
virtual double CLb() const
Convert NullPValue into a "confidence level".
const char * GetName() const override
Returns name of object.
Namespace for the RooStats classes.