Belle II Software  release-05-02-19
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 37 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 112 of file ClusterProjection.h.

116  {
117  m_max = cell;
119  m_maxPos = position;
120  } else if (cell == m_max) {
121  m_maxCharge += charge;
122  }
123  //Add weighted positions for center of gravity
124  m_pos += charge * position;
125  m_charge += charge;
126  }
127 
128  } // PXD namespace
129 
131 } // Belle2 namespace
132 
133 #endif //PXD_ClusterProjection_H

◆ finalize()

void finalize ( )
inline

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

Should only be used once

Definition at line 54 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 61 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 65 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 84 of file ClusterProjection.h.


The documentation for this class was generated from the following file:
Belle2::EvtPDLUtil::charge
double charge(int pdgCode)
Returns electric charge of a particle with given pdg code.
Definition: EvtPDLUtil.cc:46
Belle2::PXD::ClusterProjection::m_max
unsigned int m_max
Maximum row or column of the cluster.
Definition: ClusterProjection.h:95
Belle2::PXD::ClusterProjection::m_maxCharge
double m_maxCharge
Charge collected in the maximum row/column.
Definition: ClusterProjection.h:99
Belle2::PXD::ClusterProjection::m_maxPos
double m_maxPos
Position of the maximum row/column.
Definition: ClusterProjection.h:103
Belle2::PXD::ClusterProjection::m_pos
double m_pos
Center of gravity of the cluster.
Definition: ClusterProjection.h:91
Belle2::PXD::ClusterProjection::m_charge
double m_charge
Charge of the full cluster.
Definition: ClusterProjection.h:107