MUSIC unknown
Analysis for the MUSIC active-target ionization chamber
Loading...
Searching...
No Matches
BeamFit2D.hpp
Go to the documentation of this file.
1#ifndef BEAM_FIT_2D_HPP
2#define BEAM_FIT_2D_HPP
3
4#include <Rtypes.h>
5#include <TH2F.h>
6#include <TString.h>
7#include <algorithm>
8#include <cmath>
9
16struct BeamFit2D {
17 Double_t amp = 0;
18 Double_t mu_x = 0, mu_y = 0;
19 Double_t sigma_x = 0, sigma_y = 0;
20 Double_t rho = 0;
21 Bool_t ok = kFALSE;
22};
23
30struct Moments2D {
31 Double_t mu_x = 0, mu_y = 0;
32 Double_t sigma_x = 0, sigma_y = 0;
33 Double_t rho = 0;
34 Double_t weight = 0;
36};
37
40public:
50 static Bool_t InEllipseXY(const BeamFit2D &b, Double_t x, Double_t y,
51 Double_t nx, Double_t ny);
52
66 static Moments2D ComputeMoments(TH2F *h, Int_t lo_bx, Int_t hi_bx,
67 Int_t lo_by, Int_t hi_by, Double_t thresh,
68 Double_t bw_x, Double_t bw_y);
69};
70
71#endif
Helpers for the 2-D beam-spot description.
Definition BeamFit2D.hpp:39
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.
Definition BeamFit2D.cpp:20
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.
Definition BeamFit2D.cpp:3
A fitted 2-D Gaussian beam spot.
Definition BeamFit2D.hpp:16
Double_t rho
Correlation coefficient, in [-1, 1].
Definition BeamFit2D.hpp:20
Double_t sigma_y
Widths along each axis.
Definition BeamFit2D.hpp:19
Double_t mu_x
Definition BeamFit2D.hpp:18
Double_t amp
Peak amplitude.
Definition BeamFit2D.hpp:17
Double_t mu_y
Centroid.
Definition BeamFit2D.hpp:18
Bool_t ok
Whether the fit converged.
Definition BeamFit2D.hpp:21
Double_t sigma_x
Definition BeamFit2D.hpp:19
Second moments of a 2-D distribution over a bin range.
Definition BeamFit2D.hpp:30
Double_t rho
Correlation coefficient, in [-1, 1].
Definition BeamFit2D.hpp:33
Double_t sigma_y
Weighted RMS widths.
Definition BeamFit2D.hpp:32
Double_t sigma_x
Definition BeamFit2D.hpp:32
Double_t mu_x
Definition BeamFit2D.hpp:31
Double_t mu_y
Weighted centroid.
Definition BeamFit2D.hpp:31
Double_t weight
Total weight included; zero means the range held nothing above threshold.
Definition BeamFit2D.hpp:34