4 plow = x - TMath::ChisquareQuantile(0.16, 2 * x) / 2;
5 pup = TMath::ChisquareQuantile(0.84, 2 * (x + 1)) / 2 - x;
11 TFeldmanCousins *ff =
new TFeldmanCousins (0.90,
"");
12 Double_t Nobserved = x;
13 Double_t Nbackground = 0.0;
14 Double_t
ul = ff->CalculateUpperLimit(Nobserved, Nbackground);
15 Double_t ll = ff->GetLowerLimit();
23 TMatrixD
jacobian(TVectorD(*f)(TVectorD,
string),
24 TVectorD x, TVectorD dx,
28 int nx = x.GetNoElements();
29 TVectorD y = f(x, stringtype);
30 int ny = y.GetNoElements();
32 TMatrixD jacobi(ny, nx);
38 for (
int ix = 0; ix < nx; ++ix) {
42 TVectorD t1 = f(x + e, stringtype);
43 TVectorD
t2 = f(x, stringtype);
44 TVectorD tmp = (f(x + e, stringtype) - f(x, stringtype));
48 for (
int iy = 0; iy < ny; ++iy) {
49 jacobi[iy][ix] = der[iy] / dx[ix];
61 TVectorD x, TMatrixD xcov,
64 int ncol = x.GetNoElements();
67 for (
int i = 0; i < ncol; ++i)
68 dx[i] = xcov[i][i] ?
sqrt(xcov[i][i]) * 1e-3 : 1;
70 TMatrixD jacobi =
jacobian(f, x, dx, stringtype);
71 TMatrixD jacT(TMatrixD::kTransposed, jacobi);
72 TMatrixD
final = jacobi * (xcov * jacT);
TMatrixD jacobian(TVectorD(*f)(TVectorD, const modeltype), TVectorD x, TVectorD dx, const modeltype mtype)
void poisson_uncertainty(double x, double &plow, double &pup)
TMatrixD propagate_covariance(TVectorD(*f)(TVectorD, const modeltype), TVectorD x, TMatrixD xcov, const modeltype mtype)
void FC_UpperLimits(double x, double &plow, double &pup)