19int main(
int argc,
char* argv[])
31 JParser<> zap(
"Auxiliary program to determine number of signal events for given background and number of standard deviations.");
40 catch(
const exception &error) {
41 FATAL(error.what() << endl);
45 const double STDEV_MIN = 1.0;
46 const double STDEV_MAX = 7.0;
48 if (stdev < STDEV_MIN || stdev > STDEV_MAX) {
49 FATAL(
"Number of standard deviations out of range [" << STDEV_MIN <<
"," << STDEV_MAX <<
"]" << endl);
52 const double P = getP(stdev);
54 cout <<
"probability (single-sided Gauss): " <<
SCIENTIFIC(12,3) << P << endl;
59 TH1D h0(
"h0", NULL, 500, -2.0, 2.0);
60 TH1D h1(
"h1", NULL, 500, -2.0, 2.0);
62 for (Int_t ix = 1; ix <= h1.GetXaxis()->GetNbins(); ++ix) {
64 const double x = pow(10.0, h1.GetXaxis()->GetBinCenter(ix));
66 const size_t n = getNs(x, P);
67 const double f = getFs(x, P, precision);
70 <<
" n = " <<
FIXED(7,3) << n - x
71 <<
" f = " <<
FIXED(7,3) << f - x << endl);
73 h0.SetBinContent(ix, n - x);
74 h1.SetBinContent(ix, f - x);