#include <string>
#include <iostream>
#include <iomanip>
#include <cmath>
#include "TROOT.h"
#include "TFile.h"
#include "TH1D.h"
#include "JLang/JManip.hh"
#include "JMath/JMathSupportkit.hh"
#include "Jeep/JParser.hh"
Go to the source code of this file.
|
| int | main (int argc, char *argv[]) |
| | Auxiliary program to determine number of signal events for given background and number of standard deviations.
|
| |
◆ main()
| int main |
( |
int | argc, |
|
|
char * | argv[] ) |
Auxiliary program to determine number of signal events for given background and number of standard deviations.
Definition at line 19 of file JNs.cc.
20{
23
25 double stdev;
26 double precision;
28
29 try {
30
31 JParser<> zap(
"Auxiliary program to determine number of signal events for given background and number of standard deviations.");
32
37
39 }
40 catch(const exception &error) {
42 }
43
44
47
50 }
51
52 const double P =
getP(stdev);
53
55
56
58
61
63
64 const double x =
pow(10.0, h1.GetXaxis()->GetBinCenter(
ix));
65
66 const size_t n =
getNs(x, P);
67 const double f =
getFs(x, P, precision);
68
70 <<
" n = " <<
FIXED(7,3) << n - x
71 <<
" f = " <<
FIXED(7,3) << f - x <<
endl);
72
73 h0.SetBinContent(
ix, n - x);
74 h1.SetBinContent(
ix, f - x);
75 }
76
77 out.Write();
78 out.Close();
79}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Template definition of a multi-dimensional oscillation probability interpolation table.
Utility class to parse command line options.
double getP(const double expval, bool hit)
Get Poisson probability to observe a hit or not for given expectation value for the number of hits.
size_t getNs(const double background, const double P)
Get minimal number of events to exceed Poisson probability given number of background events.
T pow(const T &x, const double y)
Power .
double getFs(const double background, const double P, const double precision)
Get minimal number of events to exceed Poisson probability given number of background events.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for floating point format specification.
Auxiliary data structure for floating point format specification.