1#ifndef __JASTRONOMY__JASPERA__
2#define __JASTRONOMY__JASPERA__
44 void put(
const double s,
60 void put(
const size_t n,
64 for (
size_t i = 0; i != n; ++i) {
135 }
else if (f1 > 0.0) {
138 x2 = (double) this->size() /
ws;
167 const double xm = 0.5 * (x1 + x2);
170 const double s = sqrt(fm*fm - f1*f2);
176 const double xn = xm + (xm - x1) * fm/s;
183 if (signbit(fn) != signbit(fm)) {
205 const double x = 0.5 * (x1 + x2);
220 const fit_type result = (*this)(
true);
222 if (result.signal <= 0.0)
224 else if (result.signal <= ps)
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
double signal
signal strength
double likelihood
likelihood
Auxiliary data structure to fit signal strength using likelihood ratio.
void addSignal(const double wS)
Add signal strength.
double getSignal() const
Get total signal strength.
double getLikelihood(const double p) const
Get likelihood for given signal strength.
void setSignal(const double wS)
Set signal strength.
void put(const double s, const double b)
Put signal and background to list of pre-computed N/S values.
double getTestStatisticForUpperLimit(const double ps) const
Get test statistic for given signal strength.
double ws
total signal strength
static constexpr double EPSILON
precision determination of signal strength
double getDerivative(const double p) const
Get derivative of likelihood for given signal strength.
fit_type operator()(const bool ns=false) const
Fit signal strength.
void put(const size_t n, const double s, const double b)
Put signal and background to list of pre-computed N/S values.