83 Int_t lo_by, Int_t hi_by, Double_t thresh,
84 Double_t bw_x, Double_t bw_y);
102 ClippedMoments(
const std::vector<std::pair<Float_t, Float_t>> &pts,
103 const Moments2D &seed, Double_t clip = 3.0);
155 Double_t window_nsigma = 2.0,
156 Double_t *chi2_ndf =
nullptr);
176 static Bool_t
FitPeak(TH1F *h, Double_t seed_mu, Double_t seed_sigma,
177 Double_t window_nsigma, Bool_t fix_mu, Double_t &mu,
178 Double_t &sigma, Double_t *chi2_ndf =
nullptr);
Helpers for the 2-D beam-spot description.
static BeamFit2D FitSpot(TH2F *h, const Moments2D &seed, Double_t window_nsigma=2.0, Double_t *chi2_ndf=nullptr)
Fit a correlated 2-D Gaussian on a flat pedestal to h: ROOT's bigaus written out, Poisson likelihood,...
static SpotFit FitSpotFromPoints(TH2F *h, std::vector< std::pair< Float_t, Float_t > > &pts, const Moments2D &seed)
A beam spot from a coarse histogram and the same events unbinned: the sample's sigma-clipped moments ...
static Bool_t FitPeak(TH1F *h, Double_t seed_mu, Double_t seed_sigma, Double_t window_nsigma, Bool_t fix_mu, Double_t &mu, Double_t &sigma, Double_t *chi2_ndf=nullptr)
The 1-D counterpart: a Gaussian on a flat pedestal, fitted over window_nsigma of the seed and judged ...
static void DrawEllipse(const BeamFit2D &b, Double_t n, Color_t color)
Draw the n-sigma contour of a fitted spot on the current pad.
static Bool_t InEllipseXY(const BeamFit2D &b, Double_t x, Double_t y, Double_t n)
Whether a point lies inside the fitted ellipse at n sigma: the correlation-aware Mahalanobis chi2 bel...
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 Moments2D SeedSpotMoments(TH2F *h, Int_t seed_half_bins)
Second moments of a coarse spot histogram's seed window: the maximum bin, ± seed_half_bins around it,...
static Moments2D ClippedMoments(const std::vector< std::pair< Float_t, Float_t > > &pts, const Moments2D &seed, Double_t clip=3.0)
Sigma-clipped centroid and covariance of a point sample, the 2-D counterpart of the strip-width clip:...
A fitted 2-D Gaussian beam spot.
Double_t rho
Correlation coefficient, in [-1, 1].
Double_t sigma_y
Widths along each axis.
Double_t amp
Peak amplitude.
Bool_t ok
Whether the fit converged.
Result of a beam spot fit: the spot to use, and whether the Gaussian fit (rather than the clipped-mom...
Double_t chi2_ndf
The fit's reduced chi2; -1 when it did not run.
Bool_t fit_used
kTRUE when fit is the fit, not the fallback.
BeamFit2D fit
The spot to use; ok when usable.
Second moments of a 2-D distribution over a bin range.
Double_t rho
Correlation coefficient, in [-1, 1].
Double_t sigma_y
Weighted RMS widths.
Double_t mu_y
Weighted centroid.
Double_t weight
Total weight included; zero means the range held nothing above threshold.