qupid 0.2
Quasi-Signal Generation Model for Pixelized Detector
Loading...
Searching...
No Matches
QPMath::Gaussian Namespace Reference

Normalized Gaussian profiles. More...

Functions

double Simple1D (double x, double integral=1., double mean=0., double sigma=1.)
 1D Gaussian $ \dfrac{I}{\sqrt{2\pi}\,\sigma}\, e^{-(x-\mu)^2/(2\sigma^2)} $.
 
double Simple2D (double x, double y, double integral=1., double meanx=0, double meany=0, double sigma=1.)
 Isotropic 2D Gaussian $ \dfrac{I}{2\pi\sigma^2}
    \exp\!\left(-\dfrac{(x-\mu_x)^2+(y-\mu_y)^2}{2\sigma^2}\right) $.
 
double UniAxis2D (double x, double y, double integral=1., double meanx=0., double meany=0., double sigmax=1., double sigmay=1.)
 Axis-aligned elliptic 2D Gaussian $ \dfrac{I}{2\pi\sigma_x\sigma_y}
    \exp\!\left(-\dfrac12\left[\dfrac{(x-\mu_x)^2}{\sigma_x^2}
    +\dfrac{(y-\mu_y)^2}{\sigma_y^2}\right]\right) $.
 
double RotAxis2D (double x, double y, double integral=1., double meanx=0., double meany=0., double sigmax=1., double sigmay=1., double rotation=0.)
 Elliptic 2D Gaussian with principal axes rotated by rotation: the offsets are first turned into the ellipse frame, $ x' = (x-\mu_x)\cos\theta + (y-\mu_y)\sin\theta,\quad
    y' = (y-\mu_y)\cos\theta - (x-\mu_x)\sin\theta $, then evaluated as in UniAxis2D.
 
double Assymetry2D (double x, double y, double integral=1., double meanx=0., double meany=0., double sigmax=1., double sigmay=1., double rotation=0., double length=0., double tilt=0., double dispersion=1.)
 Gaussian of an inclined track with depth-dependent widening.
 
double MatrixForm2D (QPVector &x, QPVector &x0, QPMatrix &S)
 2D Gaussian in covariance-matrix form,
 

Detailed Description

Normalized Gaussian profiles.

integral is the total integral of the distribution — the deposited charge in electrons when the profile is used as a signal.

Function Documentation

◆ Simple1D()

double QPMath::Gaussian::Simple1D ( double  x,
double  integral = 1.,
double  mean = 0.,
double  sigma = 1. 
)

1D Gaussian $ \dfrac{I}{\sqrt{2\pi}\,\sigma}\, e^{-(x-\mu)^2/(2\sigma^2)} $.

Parameters
xevaluation point
integraltotal integral $ I $
meanmean $ \mu $
sigmawidth $ \sigma $
Returns
density at x; 0 when $ \sigma \le 0 $

Definition at line 10 of file QPMath.cpp.

References QPMath::Gaus().

Referenced by RotAxis2D(), Simple2D(), and UniAxis2D().

◆ Simple2D()

double QPMath::Gaussian::Simple2D ( double  x,
double  y,
double  integral = 1.,
double  meanx = 0,
double  meany = 0,
double  sigma = 1. 
)

Isotropic 2D Gaussian $ \dfrac{I}{2\pi\sigma^2}
    \exp\!\left(-\dfrac{(x-\mu_x)^2+(y-\mu_y)^2}{2\sigma^2}\right) $.

Parameters
xevaluation point x
yevaluation point y
integraltotal integral $ I $
meanxmean $ \mu_x $
meanymean $ \mu_y $
sigmacommon width $ \sigma $
Returns
density at (x, y); 0 when $ \sigma \le 0 $

Definition at line 18 of file QPMath.cpp.

References QPMath::InvSqrt2Pi, QPMath::Power(), Simple1D(), and QPMath::Sqrt().

◆ UniAxis2D()

double QPMath::Gaussian::UniAxis2D ( double  x,
double  y,
double  integral = 1.,
double  meanx = 0.,
double  meany = 0.,
double  sigmax = 1.,
double  sigmay = 1. 
)

Axis-aligned elliptic 2D Gaussian $ \dfrac{I}{2\pi\sigma_x\sigma_y}
    \exp\!\left(-\dfrac12\left[\dfrac{(x-\mu_x)^2}{\sigma_x^2}
    +\dfrac{(y-\mu_y)^2}{\sigma_y^2}\right]\right) $.

Parameters
xevaluation point x
yevaluation point y
integraltotal integral $ I $
meanxmean $ \mu_x $
meanymean $ \mu_y $
sigmaxwidth $ \sigma_x $
sigmaywidth $ \sigma_y $
Returns
density at (x, y); 0 when either width $ \le 0 $

Definition at line 29 of file QPMath.cpp.

References QPMath::InvSqrt2Pi, QPMath::Power(), Simple1D(), and QPMath::Sqrt().

◆ RotAxis2D()

double QPMath::Gaussian::RotAxis2D ( double  x,
double  y,
double  integral = 1.,
double  meanx = 0.,
double  meany = 0.,
double  sigmax = 1.,
double  sigmay = 1.,
double  rotation = 0. 
)

Elliptic 2D Gaussian with principal axes rotated by rotation: the offsets are first turned into the ellipse frame, $ x' = (x-\mu_x)\cos\theta + (y-\mu_y)\sin\theta,\quad
    y' = (y-\mu_y)\cos\theta - (x-\mu_x)\sin\theta $, then evaluated as in UniAxis2D.

Parameters
xevaluation point x
yevaluation point y
integraltotal integral $ I $
meanxmean $ \mu_x $
meanymean $ \mu_y $
sigmaxwidth $ \sigma_x $ along the rotated x axis
sigmaywidth $ \sigma_y $ along the rotated y axis
rotationaxis rotation $ \theta $, radians
Returns
density at (x, y); 0 when either width $ \le 0 $

Definition at line 41 of file QPMath.cpp.

References QPMath::Cos(), QPMath::InvSqrt2Pi, QPMath::Power(), Simple1D(), QPMath::Sin(), and QPMath::Sqrt().

Referenced by Assymetry2D().

◆ Assymetry2D()

double QPMath::Gaussian::Assymetry2D ( double  x,
double  y,
double  integral = 1.,
double  meanx = 0.,
double  meany = 0.,
double  sigmax = 1.,
double  sigmay = 1.,
double  rotation = 0.,
double  length = 0.,
double  tilt = 0.,
double  dispersion = 1. 
)

Gaussian of an inclined track with depth-dependent widening.

With $ x_p = x-\mu_x,\ y_p = y-\mu_y $ the implementation evaluates $ x_3 = x_p\cos t,\quad y_3 = y_p,\quad z_3 = -x_p\sin t - L $ and widens both sigmas linearly with depth, $ \sigma'_{x,y} = \sigma_{x,y} - D\,z_3 $, then returns RotAxis2D $(x_3, y_3, I, 0, 0,
\sigma'_x, \sigma'_y, \theta)$.

Parameters
xevaluation point x
yevaluation point y
integraltotal integral $ I $
meanxmean $ \mu_x $
meanymean $ \mu_y $
sigmaxbase width $ \sigma_x $
sigmaybase width $ \sigma_y $
rotationaxis rotation $ \theta $, radians
lengthdepth offset $ L $
tilttrack tilt $ t $, radians
dispersionwidening rate $ D $ per unit depth
Returns
density at (x, y); 0 when either effective width $ \le 0 $

Definition at line 100 of file QPMath.cpp.

References QPMath::Cos(), RotAxis2D(), and QPMath::Sin().

◆ MatrixForm2D()

double QPMath::Gaussian::MatrixForm2D ( QPVector &  x,
QPVector &  x0,
QPMatrix &  S 
)

2D Gaussian in covariance-matrix form,

\[ p(\vec{x}) = \frac{1}{2\pi\sqrt{\det S}}
    \exp\!\left(-\tfrac12(\vec{x}-\vec{x}_0)^{T} S^{-1}
    (\vec{x}-\vec{x}_0)\right) \]

evaluated with the hand-rolled QPMatrix inverse and determinant.

Parameters
xevaluation point (first two components used)
x0mean $ \vec{x}_0 $
S2×2 matrix $ S $
Returns
density at x

Definition at line 56 of file QPMath.cpp.

References QPMatrix::Det(), QPMath::Exp(), QPMatrix::Inverse(), QPMath::InvPi, QPMath::Sqrt(), and QPMatrix::Transpose().

Referenced by QPSignalGaussian::GetPDF().