MarlinUtil  1.12.1
Public Member Functions | List of all members
ClusterShapes Class Reference

Utility class to derive properties of clusters, such as centre of gravity, axes of inertia, fits of the cluster shape and so on. More...

#include <ClusterShapes.h>

Public Member Functions

 ClusterShapes (int nhits, float *a, float *x, float *y, float *z)
 Constructor. More...
 
 ~ClusterShapes ()
 Destructor.
 
void setErrors (float *ex, float *ey, float *ez)
 Defining errors for Helix Fit.
 
void setHitTypes (int *ityp)
 Defining hit types for Helix Fit : type 1 - cyllindrical detector type 2 - Z disk detector.
 
int getNumberOfHits ()
 returns the number of elements of the cluster
 
float getTotalAmplitude ()
 returns the accumulated amplitude for the whole cluster (just the sum of the energy in all the entries of the cluster)
 
float * getCentreOfGravity ()
 returns an array, which represents a vector from the origin of the coordiante system, i. e. IP, to the centre of gravity of the cluster. More...
 
float * getCentreOfGravityErrors ()
 
float * getCenterOfGravity ()
 US spelling of getCentreOfGravity.
 
float * getCenterOfGravityErrors ()
 
float * getEigenValInertia ()
 array of the inertias of mass (i. e. energy) corresponding to the three main axes of inertia. More...
 
float * getEigenValInertiaErrors ()
 
float * getEigenVecInertia ()
 array of the three main axes of inertia (9 entries) starting with the axis corresponding to the smallest inertia of mass (main principal axis). More...
 
float * getEigenVecInertiaErrors ()
 
float getWidth ()
 'mean' width of the cluster perpendicular to the main principal axis, defined as: width := sqrt( 1/TotalAmplitude * Sum(a[i]*d[i]*d[i]) ), where d[i] is the distance of the i-th point to the main principal axis.
 
int getEigenSytemCoordinates (float *xlong, float *xtrans)
 returns the coordinates of the cluster transformed into the CoG-System. More...
 
int getEigenSytemCoordinates (float *xlong, float *xtrans, float *a)
 returns the coordinates and the amplitudes of the cluster transformed into the CoG-System. More...
 
int fit3DProfile (float &chi2, float &a, float &b, float &c, float &d, float &xl0, float *xStart, int &index_xStart, float *X0, float *Rm)
 performs a least square fit on the shape of an electro- magnetic-shower, which is defined as: A[i] = a * (xl[i]-xl0)^b * exp(-c*(xl[i]-xl0)) * exp(-d*xt[i]), where A[i] is the array of amplitudes, xl[i] is the coordinate of the actual point along the main principal axis and xt[i] the coordinate perpendicular to it. More...
 
float getChi2Fit3DProfileSimple (float a, float b, float c, float d, float *X0, float *Rm)
 returns the chi2 of the fit in the method Fit3DProfile (if simple parametrisation is used)for a given set of parameters a,b,c,d More...
 
float getChi2Fit3DProfileAdvanced (float E0, float a, float b, float d, float t0, float *X0, float *Rm)
 returns the chi2 of the fit in the method Fit3DProfile (if advanced parametrisation is used) for a given set of parameters E0,a,b,d,t0 More...
 
int FitHelix (int max_iter, int status_out, int parametrisation, double *parameter, double *dparameter, double &chi2, double &distmax, int direction=1)
 performs a least square fit on a helix path in space, which which is defined as (Cartesian coordiantes): More...
 
int FitHelix (int max_iter, int status_out, int parametrisation, float *parameter, float *dparameter, float &chi2, float &distmax, int direction=1)
 
float getEmax (float *xStart, int &index_xStart, float *X0, float *Rm)
 
float getsmax (float *xStart, int &index_xStart, float *X0, float *Rm)
 
float getxt90 (float *xStart, int &index_xStart, float *X0, float *Rm)
 
float getxl20 (float *xStart, int &index_xStart, float *X0, float *Rm)
 
void gethits (float *xStart, int &index_xStart, float *X0, float *Rm, float *okxl, float *okxt, float *oke)
 
float radius ()
 distance to the centre of gravity measured from IP (absolut value of the vector to the centre of gravity)
 
float getElipsoid_r1 ()
 largest spatial axis length of the ellipsoid derived by the inertia tensor (by their eigenvalues and eigen- vectors)
 
float getElipsoid_r2 ()
 medium spatial axis length of the ellipsoid derived by the inertia tensor (by their eigenvalues and eigen- vectors)
 
float getElipsoid_r3 ()
 smallest spatial axis length of the ellipsoid derived by the inertia tensor (by their eigenvalues and eigen- vectors)
 
float getElipsoid_vol ()
 volume of the ellipsoid
 
float getElipsoid_r_ave ()
 average radius of the ellipsoid (qubic root of volume)
 
float getElipsoid_density ()
 density of the ellipsoid defined by: totAmpl/vol
 
float getElipsoid_eccentricity ()
 eccentricity of the ellipsoid defined by: Width/r1
 
float getElipsoid_r_forw ()
 distance from centre of gravity to the point most far away from IP projected on the main principal axis
 
float getElipsoid_r_back ()
 distance from centre of gravity to the point nearest to IP projected on the main principal axis
 
float getRhitMean (float *xStart, int &index_xStart, float *X0, float *Rm)
 
float getRhitRMS (float *xStart, int &index_xStart, float *X0, float *Rm)
 

Detailed Description

Utility class to derive properties of clusters, such as centre of gravity, axes of inertia, fits of the cluster shape and so on.

All the details are explained in the documentation of the methods. Several classes of the GSL (GNU Scientific Library) are needed in this class.

Authors
V. Morgunov (ITEP/DESY), A. Raspereza (DESY), O. Wendt (DESY)
Version
Id:
ClusterShapes.h,v 1.14 2007-04-27 13:56:53 owendt Exp

Constructor & Destructor Documentation

ClusterShapes::ClusterShapes ( int  nhits,
float *  a,
float *  x,
float *  y,
float *  z 
)

Constructor.

Parameters
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.

Member Function Documentation

int ClusterShapes::fit3DProfile ( float &  chi2,
float &  a,
float &  b,
float &  c,
float &  d,
float &  xl0,
float *  xStart,
int &  index_xStart,
float *  X0,
float *  Rm 
)

performs a least square fit on the shape of an electro- magnetic-shower, which is defined as: A[i] = a * (xl[i]-xl0)^b * exp(-c*(xl[i]-xl0)) * exp(-d*xt[i]), where A[i] is the array of amplitudes, xl[i] is the coordinate of the actual point along the main principal axis and xt[i] the coordinate perpendicular to it.

The return value of the method itself is not used at the moment (always returns 0).

Parameters
a,b,c,d,xl0: references to the parameters, which are fitted.
chi2: reference to the chi2 of the fit
xStart: pointer to the 'initial hit' of the cluster. It is defined as the point with the largest distance to the CoG measured in the direction towards the IP.
index_xStart: index of the point in the cluster corresponding to xStart
X0: radiation length of the detector material. For a composite detector this is meant to be the 'mean' radiation length.
Rm: Moliere radius of the the detector material. For a composite detector this is meant to be the 'mean' Moliere radius.
int ClusterShapes::FitHelix ( int  max_iter,
int  status_out,
int  parametrisation,
double *  parameter,
double *  dparameter,
double &  chi2,
double &  distmax,
int  direction = 1 
)

performs a least square fit on a helix path in space, which which is defined as (Cartesian coordiantes):

  1. parametrisation: x[i] = x0 + R*cos(b*z[i] + phi0) y[i] = y0 + R*sin(b*z[i] + phi0) z[i] = z[i], where x0,y0,R,b and phi0 are the parameters to be fitted and x[i],y[i],z[i] are the (Cartesian) coordiantes of the space points.
  2. parametrisation: x[i] = x0 + R*cos(phi) y[i] = y0 + R*sin(phi) z[i] = z0 + b*phi and phi = atan2( y[i]-y0 , x[i]-x0 ), where x0,y0,z0,R and b are the parameters to be fitted and x[i],y[i],z[i] are the (Cartesian) coordiantes of the space points.

The method returns 1 if an error occured and 0 if not.

The following output/input parameters are returned/needed:

OUTPUTS:

Parameters
parameter: array of parameters to be fitted. For parametrisation 1: parameter[5] = {x0,y0,R,b,phi0} For parametrisation 2: parameter[5] = {x0,y0,z0,R,b}
dparameter: error on the parameters, that means: dparameter[i] = sqrt( CovarMatrix[i][i] )
chi2: chi2 of the fit
distmax: maximal distance between the points x[i],y[i] z[i] and the fitted function

INPUTS:

Parameters
parametrisation: 1 for first and 2 for second parametrisation (see above)
max_iter: maximal number of iterations, before fit cancels
status_out: if set to 1, only the initial parameters of the fit are calculated and are stored in parameter. The entries of dparameter are set to 0.0
float * ClusterShapes::getCentreOfGravity ( )

returns an array, which represents a vector from the origin of the coordiante system, i. e. IP, to the centre of gravity of the cluster.

The centre of gravity is calculated with the energy of the entries of the cluster.

Referenced by getCenterOfGravity().

float ClusterShapes::getChi2Fit3DProfileAdvanced ( float  E0,
float  a,
float  b,
float  d,
float  t0,
float *  X0,
float *  Rm 
)

returns the chi2 of the fit in the method Fit3DProfile (if advanced parametrisation is used) for a given set of parameters E0,a,b,d,t0

Parameters
E0,a,b,d,t0: fitted parameters, which have been calculated before
X0: radiation length of the detector material. For a composite detector this is meant to be the 'mean' radiation length.
Rm: Moliere radius of the the detector material. For a composite detector this is meant to be the 'mean' Moliere radius.
float ClusterShapes::getChi2Fit3DProfileSimple ( float  a,
float  b,
float  c,
float  d,
float *  X0,
float *  Rm 
)

returns the chi2 of the fit in the method Fit3DProfile (if simple parametrisation is used)for a given set of parameters a,b,c,d

Parameters
a,b,c,d,xl0: fitted parameters, which have been calculated before
X0: radiation length of the detector material. For a composite detector this is meant to be the 'mean' radiation length.
Rm: Moliere radius of the the detector material. For a composite detector this is meant to be the 'mean' Moliere radius.
int ClusterShapes::getEigenSytemCoordinates ( float *  xlong,
float *  xtrans 
)

returns the coordinates of the cluster transformed into the CoG-System.

Parameters
xlong: pointer to an array, where the calculated longitudinal coordiantes are stored in.
xtrans: pointer to an array, where the calculated transversal coordiantes are stored in.
int ClusterShapes::getEigenSytemCoordinates ( float *  xlong,
float *  xtrans,
float *  a 
)

returns the coordinates and the amplitudes of the cluster transformed into the CoG-System.

Parameters
xlong: pointer to an array, where the calculated longitudinal coordiantes are stored in.
xtrans: pointer to an array, where the calculated transversal coordiantes are stored in.
a: pointer to an array, where the amplitudes corresponding to the longitudinal and transversal coordiantes are stored in.
float * ClusterShapes::getEigenValInertia ( )

array of the inertias of mass (i. e. energy) corresponding to the three main axes of inertia.

The array is sorted in ascending order.

float * ClusterShapes::getEigenVecInertia ( )

array of the three main axes of inertia (9 entries) starting with the axis corresponding to the smallest inertia of mass (main principal axis).

All axes are normalised to a length of 1.


The documentation for this class was generated from the following files: