Belle II Software development
|
Class representing a possible cluster during clustering of the PXD It supports merging of different clusters and keeps track of the highest charge inside the cluster. More...
#include <ClusterCandidate.h>
Public Types | |
enum | { c_defaultCapacity = 10 , c_maxCapacity = 4 * c_defaultCapacity } |
Public Member Functions | |
ClusterCandidate () | |
Constructor to create an empty Cluster. | |
void | clear () |
Clear the Cluster information (to reuse the same cluster instance) | |
ClusterCandidate * | merge (ClusterCandidate &cls) |
Merge the given cluster with this one. | |
void | add (const Pixel &pixel) |
Add a Pixel to the current cluster. | |
float | getCharge () const |
get the charge of the cluster | |
float | getSeedCharge () const |
get the seed charge of the cluster | |
const Pixel & | getSeed () const |
get the seed pixel of the cluster, i.e. | |
size_t | size () const |
get the cluster size | |
const std::vector< Pixel > & | pixels () const |
get a reference to all pixels in the cluster | |
Protected Attributes | |
ClusterCandidate * | m_merged |
Pointer to the cluster this cluster was merged into. | |
float | m_charge |
Charge of the cluster. | |
Pixel | m_seed |
Seed pixel of the cluster, i.e. | |
std::vector< Pixel > | m_pixels |
List of all pixels in the cluster. | |
Class representing a possible cluster during clustering of the PXD It supports merging of different clusters and keeps track of the highest charge inside the cluster.
To save relocation time, each Instance is created with a default capacity of 10 pixels before relocation will occur.
Definition at line 30 of file ClusterCandidate.h.
anonymous enum |
Enumerator | |
---|---|
c_defaultCapacity | Reserve space for this number of pixels on construction. |
c_maxCapacity | If the capacity exceeds this value, shrink the vector back to c_defaultCapacity after clearing. |
Definition at line 32 of file ClusterCandidate.h.
|
inline |
Constructor to create an empty Cluster.
Definition at line 39 of file ClusterCandidate.h.
void add | ( | const Pixel & | pixel | ) |
Add a Pixel to the current cluster.
Increases the charge of the cluster and checks if the seed pixel changes. If this method is called on a cluster which has been merged with another cluster, the add method of the merged cluster will be called,
pixel | Pixel to add to the cluster |
Definition at line 57 of file ClusterCandidate.cc.
|
inline |
|
inline |
|
inline |
get the seed pixel of the cluster, i.e.
the pixel with the highes charge
Definition at line 79 of file ClusterCandidate.h.
|
inline |
get the seed charge of the cluster
Definition at line 77 of file ClusterCandidate.h.
ClusterCandidate * merge | ( | ClusterCandidate & | cls | ) |
Merge the given cluster with this one.
This method will remove all pixels from a given cluster and add it to this one. In addition we set a pointer to this instance in the other cluster so that new pixels will be directly added to the correct cluster when add is called on an already merged cluster
cls | Cluster to merge into this one |
Definition at line 21 of file ClusterCandidate.cc.
|
inline |
|
inline |
|
protected |
Charge of the cluster.
Definition at line 89 of file ClusterCandidate.h.
|
protected |
Pointer to the cluster this cluster was merged into.
Definition at line 87 of file ClusterCandidate.h.
|
protected |
List of all pixels in the cluster.
Definition at line 93 of file ClusterCandidate.h.
|
protected |
Seed pixel of the cluster, i.e.
the pixel with the highest charge
Definition at line 91 of file ClusterCandidate.h.