4 Double_t nx, Double_t ny) {
5 Double_t dx = x - b.
mu_x;
6 Double_t dy = y - b.
mu_y;
8 if (sx <= 0 || sy <= 0)
13 Double_t dx_s = dx / sx, dy_s = dy / sy;
14 Double_t r2 = rho * rho;
16 (dx_s * dx_s + dy_s * dy_s - 2.0 * rho * dx_s * dy_s) / (1.0 - r2);
17 return chi2 < nx * nx;
21 Int_t lo_by, Int_t hi_by,
22 Double_t thresh, Double_t bw_x,
25 Double_t W = 0, Mx = 0, My = 0, Cxx = 0, Cyy = 0, Cxy = 0;
26 for (Int_t ix = lo_bx; ix <= hi_bx; ix++) {
27 Double_t x = h->GetXaxis()->GetBinCenter(ix);
28 for (Int_t iy = lo_by; iy <= hi_by; iy++) {
29 Double_t w = h->GetBinContent(ix, iy);
32 Double_t y = h->GetYaxis()->GetBinCenter(iy);
42 for (Int_t ix = lo_bx; ix <= hi_bx; ix++) {
43 Double_t x = h->GetXaxis()->GetBinCenter(ix);
44 for (Int_t iy = lo_by; iy <= hi_by; iy++) {
45 Double_t w = h->GetBinContent(ix, iy);
48 Double_t y = h->GetYaxis()->GetBinCenter(iy);
49 Double_t dx = x - Mx, dy = y - My;
60 m.
sigma_x = std::max(std::sqrt(std::max(Cxx, 0.0)), 2.0 * bw_x);
61 m.
sigma_y = std::max(std::sqrt(std::max(Cyy, 0.0)), 2.0 * bw_y);
static Moments2D ComputeMoments(TH2F *h, Int_t lo_bx, Int_t hi_bx, Int_t lo_by, Int_t hi_by, Double_t thresh, Double_t bw_x, Double_t bw_y)
Second moments of a histogram region above a threshold.
static Bool_t InEllipseXY(const BeamFit2D &b, Double_t x, Double_t y, Double_t nx, Double_t ny)
Whether a point lies inside the fitted beam ellipse.