Belle II Software  release-08-01-10
ClusterProjection Class Reference

Helper struct to collect information about the 1D projection of a Pixel cluster. More...

#include <ClusterProjection.h>

Public Member Functions

 ClusterProjection ()
 Constructor.
 
void add (unsigned int cell, float position, float charge)
 Add Pixel information to the projection. More...
 
void finalize ()
 Finish calculation of center of gravity and set correct cluster size. More...
 
double getPos () const
 Return the projected position of the cluster. More...
 
double getError () const
 Return the error of the cluster.
 
unsigned int getSize () const
 Return the projected size of the cluster. More...
 
unsigned int getMinCell () const
 Return the minimum cell part of the cluster.
 
unsigned int getMaxCell () const
 Return the maximum cell part of the cluster.
 
double getCharge () const
 Return the total charge of the cluster.
 
double getMinCharge () const
 Return the charge in the minimum cell of the cluster.
 
double getMaxCharge () const
 Return the charge in the maximum cell of the cluster.
 
double getCenterCharge () const
 Return the center charge of the cluster, that is total charge minus minimum and maximum cell charge.
 
double getMinPos () const
 Return the position of the minimum cell of the cluster.
 
double getMaxPos () const
 Return the position of the maximum cell of the cluster.
 
void setPos (double pos)
 Set the position of the cluster. More...
 
void setError (double error)
 Set the error of the cluster.
 

Private Attributes

double m_pos
 Center of gravity of the cluster.
 
unsigned int m_min
 Minimum row or column of the cluster.
 
unsigned int m_max
 Maximum row or column of the cluster.
 
double m_minCharge
 Charge collected in the minimum row/column.
 
double m_maxCharge
 Charge collected in the maximum row/column.
 
double m_minPos
 Position of the minimum row/column.
 
double m_maxPos
 Position of the maximum row/column.
 
double m_error
 Position error of the cluster.
 
double m_charge
 Charge of the full cluster.
 
unsigned int m_size
 Projected size of the cluster.
 

Detailed Description

Helper struct to collect information about the 1D projection of a Pixel cluster.

This class just collects some information necessary to calculate the cluster position and errors: the minimum and maximum pixel row or column as well as the corresponding sensor position and charge in that row or column and the weighted (by charge) sum of positions for center of gravity determination

Definition at line 26 of file ClusterProjection.h.

Member Function Documentation

◆ add()

void add ( unsigned int  cell,
float  position,
float  charge 
)
inline

Add Pixel information to the projection.

This will adjust the minimal and maximal coordinates and the charge collected at these coordinates as well as increment the weighted position to calculate the center of gravity

Parameters
cellpixel coordinate
positionpixel center position on the sensor
chargecharge in that pixel

Definition at line 101 of file ClusterProjection.h.

102  {
103  //If the new cell is smaller than the last minimum cell than change that
104  if (cell < m_min) {
105  m_min = cell;
107  m_minPos = position;
108  } else if (cell == m_min) {
109  //But if it is equal to the last known minimum cell sum up the charge
110  m_minCharge += charge;
111  }
112  //Same as above for maximum cell.
113  if (cell > m_max || m_max == 0) {
114  m_max = cell;
116  m_maxPos = position;
117  } else if (cell == m_max) {
118  m_maxCharge += charge;
119  }
120  //Add weighted positions for center of gravity
121  m_pos += charge * position;
122  m_charge += charge;
123  }
double m_maxCharge
Charge collected in the maximum row/column.
double m_pos
Center of gravity of the cluster.
unsigned int m_min
Minimum row or column of the cluster.
double m_minPos
Position of the minimum row/column.
unsigned int m_max
Maximum row or column of the cluster.
double m_minCharge
Charge collected in the minimum row/column.
double m_charge
Charge of the full cluster.
double m_maxPos
Position of the maximum row/column.
double charge(int pdgCode)
Returns electric charge of a particle with given pdg code.
Definition: EvtPDLUtil.cc:44

◆ finalize()

void finalize ( )
inline

Finish calculation of center of gravity and set correct cluster size.

Should only be used once

Definition at line 43 of file ClusterProjection.h.

◆ getPos()

double getPos ( ) const
inline

Return the projected position of the cluster.

Should only be used after a call to finalize

Definition at line 50 of file ClusterProjection.h.

◆ getSize()

unsigned int getSize ( ) const
inline

Return the projected size of the cluster.

Should only be used after a call to finalize

Definition at line 54 of file ClusterProjection.h.

◆ setPos()

void setPos ( double  pos)
inline

Set the position of the cluster.

Should only be used after a call to finalize

Definition at line 73 of file ClusterProjection.h.


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