MarlinUtil
1.12.1
|
Utility class to derive properties of a set od weighted points in 3D, such as centre of gravity, eigen-values and eigen-vectors, and their uncertainties. More...
#include <WeightedPoints3D.h>
Public Member Functions | |
WeightedPoints3D (int nhits, double *a, double *x, double *y, double *z) | |
Constructor. More... | |
WeightedPoints3D (const std::vector< double > &cog, const std::vector< double > &cov, const std::vector< double > &mayor_axis_error=std::vector< double >(), int npnt=0, double wgtsum=0.0, double wgt2sum=0.0, double wgt4sum=0.0) | |
~WeightedPoints3D () | |
Destructor. | |
void | setErrors (double *ex, double *ey, double *ez) |
Defining position errors. More... | |
int | getNumberOfPoints () |
returns the number of elements of the set of points | |
double | getTotalWeight () |
returns the summed weight for the whole set of points. | |
double | getTotalSquaredWeight () |
returns the sum of weight^2 for the whole set of points. | |
double | getTotalQuarticWeight () |
returns the sum of weight^4 for the whole set of points. | |
double * | getCentreOfGravity () |
returns an array, which represents a vector from the origin of the coordiante system, i. e. IP, to average (aka the centre of gravity) of the set of points, with the weighs of each point taken into account. | |
double * | getCentreOfGravityErrors () |
returns the covarinace matrix between the three coordinates of the centre of gravity. More... | |
double * | getCenterOfGravity () |
US spelling of getCentreOfGravity. | |
double * | getCenterOfGravityErrors () |
double * | getEigenVal () |
array of the eigen-values of the covariance matrix, sorted in ascending size. | |
double * | getEigenValErrors () |
Retuns a vector containing the variances of the three eigen-values. | |
double * | getEigenVecCartesian () |
array of the three main axes of the covariance matrix, starting with the axis corresponding to the smallest covariance. More... | |
double * | getEigenVecPolar () |
The same in polar. More... | |
double * | getEigenVecCartesianErrors () |
The covariance matrix of the eigen-vectors, one matrix/eigen-vector, so it is a (2/3) x (2/3) x 3 matrix (2 for polar, 3 for cartesian), which is returned as a vector in depth->row major order. | |
double * | getEigenVecPolarErrors () |
double | getWidth () |
'mean' width of the cluster perpendicular to the main principal axis, defined as: width := sqrt( 1/Sum(wgt) * Sum(wgt_i * d^2 )) where d[i] is the distance of the i-th point to the main principal axis. | |
double | radius () |
distance to the centre of gravity measured from IP (absolut value of the vector to the centre of gravity) | |
Utility class to derive properties of a set od weighted points in 3D, such as centre of gravity, eigen-values and eigen-vectors, and their uncertainties.
WeightedPoints3D::WeightedPoints3D | ( | int | nhits, |
double * | a, | ||
double * | x, | ||
double * | y, | ||
double * | z | ||
) |
Constructor.
nhits | : number of hits in the cluster |
a | : amplitudes of elements ('cells') of the cluster. Stored in an array, with one entry for each element ('cell'). Each entry is depending on coordinates x,y,z (Cartesian), which are stored in the arrays x,y,z. |
x,y,z | : array of coordinates corresponding to the array of amplitudes a. |
double * WeightedPoints3D::getCentreOfGravityErrors | ( | ) |
returns the covarinace matrix between the three coordinates of the centre of gravity.
Returned as a vector storing the matrix in row-major order.
double * WeightedPoints3D::getEigenVecCartesian | ( | ) |
array of the three main axes of the covariance matrix, starting with the axis corresponding to the smallest covariance.
The main principal axis is thus the last one. All axes are normalised to a length of 1, and they form a right-handed system (ie. e_3 = e_1 X e_2). the eigen-values are the columns of the matrix, which is returned as a vector storing the matrix in row-major order.
double * WeightedPoints3D::getEigenVecPolar | ( | ) |
The same in polar.
Each eigen-vector is represented by two angles in the order (theta, phi). Also returned as a vector storing the matrix in row-major order.
void WeightedPoints3D::setErrors | ( | double * | ex, |
double * | ey, | ||
double * | ez | ||
) |
Defining position errors.
(Currently not used)