\section{Weighted\-Points3\-D Class Reference}
\label{classWeightedPoints3D}\index{Weighted\-Points3\-D@{Weighted\-Points3\-D}}


Utility class to derive properties of a set od weighted points in 3\-D, such as centre of gravity, eigen-\/values and eigen-\/vectors, and their uncertainties.  




{\ttfamily \#include $<$Weighted\-Points3\-D.\-h$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
{\bf Weighted\-Points3\-D} (int nhits, double $\ast$a, double $\ast$x, double $\ast$y, double $\ast$z)
\begin{DoxyCompactList}\small\item\em Constructor. \end{DoxyCompactList}\item 
{\bfseries Weighted\-Points3\-D} (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)\label{classWeightedPoints3D_a829c00d3934dd1d3c8b4affcccb4d3bb}

\item 
{\bf $\sim$\-Weighted\-Points3\-D} ()\label{classWeightedPoints3D_a2729ae002f01eba088f332f42a08ef6c}

\begin{DoxyCompactList}\small\item\em Destructor. \end{DoxyCompactList}\item 
void {\bf set\-Errors} (double $\ast$ex, double $\ast$ey, double $\ast$ez)
\begin{DoxyCompactList}\small\item\em Defining position errors. \end{DoxyCompactList}\item 
int {\bf get\-Number\-Of\-Points} ()\label{classWeightedPoints3D_a4cc639869eb187e0bad87ccb3ffbfc17}

\begin{DoxyCompactList}\small\item\em returns the number of elements of the set of points \end{DoxyCompactList}\item 
double {\bf get\-Total\-Weight} ()\label{classWeightedPoints3D_a09264b2288f7487032c5a9199cad55d2}

\begin{DoxyCompactList}\small\item\em returns the summed weight for the whole set of points. \end{DoxyCompactList}\item 
double {\bf get\-Total\-Squared\-Weight} ()\label{classWeightedPoints3D_a4531ac9a2cd5e7b996304976d804b99b}

\begin{DoxyCompactList}\small\item\em returns the sum of weight$^\wedge$2 for the whole set of points. \end{DoxyCompactList}\item 
double {\bf get\-Total\-Quartic\-Weight} ()\label{classWeightedPoints3D_a999a55ea37a56d27b40d7c79516ea965}

\begin{DoxyCompactList}\small\item\em returns the sum of weight$^\wedge$4 for the whole set of points. \end{DoxyCompactList}\item 
double $\ast$ {\bf get\-Centre\-Of\-Gravity} ()\label{classWeightedPoints3D_a88f35dc2f3717d87220154c0dd66da1d}

\begin{DoxyCompactList}\small\item\em returns an array, which represents a vector from the origin of the coordiante system, i. e. I\-P, to average (aka the centre of gravity) of the set of points, with the weighs of each point taken into account. \end{DoxyCompactList}\item 
double $\ast$ {\bf get\-Centre\-Of\-Gravity\-Errors} ()
\begin{DoxyCompactList}\small\item\em returns the covarinace matrix between the three coordinates of the centre of gravity. \end{DoxyCompactList}\item 
double $\ast$ {\bf get\-Center\-Of\-Gravity} ()\label{classWeightedPoints3D_a0985644bdecbdbcfc7a499bea27287ec}

\begin{DoxyCompactList}\small\item\em U\-S spelling of get\-Centre\-Of\-Gravity. \end{DoxyCompactList}\item 
double $\ast$ {\bfseries get\-Center\-Of\-Gravity\-Errors} ()\label{classWeightedPoints3D_a3957458bb2461247faa5461bbbbfd990}

\item 
double $\ast$ {\bf get\-Eigen\-Val} ()\label{classWeightedPoints3D_aa0ec9cdcb055dfb8ec276fb80b9388fd}

\begin{DoxyCompactList}\small\item\em array of the eigen-\/values of the covariance matrix, sorted in ascending size. \end{DoxyCompactList}\item 
double $\ast$ {\bf get\-Eigen\-Val\-Errors} ()\label{classWeightedPoints3D_a326cc51396b067b63a33f00366ef2fb5}

\begin{DoxyCompactList}\small\item\em Retuns a vector containing the variances of the three eigen-\/values. \end{DoxyCompactList}\item 
double $\ast$ {\bf get\-Eigen\-Vec\-Cartesian} ()
\begin{DoxyCompactList}\small\item\em array of the three main axes of the covariance matrix, starting with the axis corresponding to the smallest covariance. \end{DoxyCompactList}\item 
double $\ast$ {\bf get\-Eigen\-Vec\-Polar} ()
\begin{DoxyCompactList}\small\item\em The same in polar. \end{DoxyCompactList}\item 
double $\ast$ {\bf get\-Eigen\-Vec\-Cartesian\-Errors} ()\label{classWeightedPoints3D_a418980f7d01cdaaf48d5fe5e3c5133ee}

\begin{DoxyCompactList}\small\item\em 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. \end{DoxyCompactList}\item 
double $\ast$ {\bfseries get\-Eigen\-Vec\-Polar\-Errors} ()\label{classWeightedPoints3D_a7aad47c4fd15e699f78e45b7959fdbbe}

\item 
double {\bf get\-Width} ()\label{classWeightedPoints3D_acc01638278d7169f48a078e14b059b41}

\begin{DoxyCompactList}\small\item\em 'mean' width of the cluster perpendicular to the main principal axis, defined as\-: width \-:= sqrt( 1/\-Sum(wgt) $\ast$ Sum(wgt\-\_\-i $\ast$ d$^\wedge$2 )) where d[i] is the distance of the i-\/th point to the main principal axis. \end{DoxyCompactList}\item 
double {\bf radius} ()\label{classWeightedPoints3D_a7da54890dbe459e98396a57c53067b17}

\begin{DoxyCompactList}\small\item\em distance to the centre of gravity measured from I\-P (absolut value of the vector to the centre of gravity) \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Utility class to derive properties of a set od weighted points in 3\-D, such as centre of gravity, eigen-\/values and eigen-\/vectors, and their uncertainties. 

\begin{DoxyAuthor}{Authors}
M. Berggren (D\-E\-S\-Y) 
\end{DoxyAuthor}
\begin{DoxyVersion}{Version}
\$\-Id\-: \doxyref{Weighted\-Points3\-D.\-h}{p.}{WeightedPoints3D_8h_source},v 1.\-0 
\end{DoxyVersion}


\subsection{Constructor \& Destructor Documentation}
\index{Weighted\-Points3\-D@{Weighted\-Points3\-D}!Weighted\-Points3\-D@{Weighted\-Points3\-D}}
\index{Weighted\-Points3\-D@{Weighted\-Points3\-D}!WeightedPoints3D@{Weighted\-Points3\-D}}
\subsubsection[{Weighted\-Points3\-D}]{\setlength{\rightskip}{0pt plus 5cm}Weighted\-Points3\-D\-::\-Weighted\-Points3\-D (
\begin{DoxyParamCaption}
\item[{int}]{nhits, }
\item[{double $\ast$}]{a, }
\item[{double $\ast$}]{x, }
\item[{double $\ast$}]{y, }
\item[{double $\ast$}]{z}
\end{DoxyParamCaption}
)}\label{classWeightedPoints3D_a4bb8d4ee82111a07c3f371a56857f7c5}


Constructor. 


\begin{DoxyParams}{Parameters}
{\em nhits} & \-: number of hits in the cluster \\
\hline
{\em 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. \\
\hline
{\em x,y,z} & \-: array of coordinates corresponding to the array of amplitudes a. \\
\hline
\end{DoxyParams}


\subsection{Member Function Documentation}
\index{Weighted\-Points3\-D@{Weighted\-Points3\-D}!get\-Centre\-Of\-Gravity\-Errors@{get\-Centre\-Of\-Gravity\-Errors}}
\index{get\-Centre\-Of\-Gravity\-Errors@{get\-Centre\-Of\-Gravity\-Errors}!WeightedPoints3D@{Weighted\-Points3\-D}}
\subsubsection[{get\-Centre\-Of\-Gravity\-Errors}]{\setlength{\rightskip}{0pt plus 5cm}double $\ast$ Weighted\-Points3\-D\-::get\-Centre\-Of\-Gravity\-Errors (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}\label{classWeightedPoints3D_af56eed617e267837f0added77aa755b6}


returns the covarinace matrix between the three coordinates of the centre of gravity. 

Returned as a vector storing the matrix in row-\/major order. \index{Weighted\-Points3\-D@{Weighted\-Points3\-D}!get\-Eigen\-Vec\-Cartesian@{get\-Eigen\-Vec\-Cartesian}}
\index{get\-Eigen\-Vec\-Cartesian@{get\-Eigen\-Vec\-Cartesian}!WeightedPoints3D@{Weighted\-Points3\-D}}
\subsubsection[{get\-Eigen\-Vec\-Cartesian}]{\setlength{\rightskip}{0pt plus 5cm}double $\ast$ Weighted\-Points3\-D\-::get\-Eigen\-Vec\-Cartesian (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}\label{classWeightedPoints3D_a8cbf4a175e3a5ac42d3164bd2046ff31}


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. \index{Weighted\-Points3\-D@{Weighted\-Points3\-D}!get\-Eigen\-Vec\-Polar@{get\-Eigen\-Vec\-Polar}}
\index{get\-Eigen\-Vec\-Polar@{get\-Eigen\-Vec\-Polar}!WeightedPoints3D@{Weighted\-Points3\-D}}
\subsubsection[{get\-Eigen\-Vec\-Polar}]{\setlength{\rightskip}{0pt plus 5cm}double $\ast$ Weighted\-Points3\-D\-::get\-Eigen\-Vec\-Polar (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}\label{classWeightedPoints3D_ade4ddb49251ced0cb260325a9f6c9ccc}


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. \index{Weighted\-Points3\-D@{Weighted\-Points3\-D}!set\-Errors@{set\-Errors}}
\index{set\-Errors@{set\-Errors}!WeightedPoints3D@{Weighted\-Points3\-D}}
\subsubsection[{set\-Errors}]{\setlength{\rightskip}{0pt plus 5cm}void Weighted\-Points3\-D\-::set\-Errors (
\begin{DoxyParamCaption}
\item[{double $\ast$}]{ex, }
\item[{double $\ast$}]{ey, }
\item[{double $\ast$}]{ez}
\end{DoxyParamCaption}
)}\label{classWeightedPoints3D_acb6357c0fa230a1046daa9add4f38f27}


Defining position errors. 

(Currently not used) 

The documentation for this class was generated from the following files\-:\begin{DoxyCompactItemize}
\item 
Weighted\-Points3\-D.\-h\item 
Weighted\-Points3\-D.\-cc\end{DoxyCompactItemize}
