9#include <pxd/reconstruction/ClusterCache.h>
45 throw std::out_of_range(
"u cell id is outside of valid range");
48 const unsigned int u1 = u + 1;
88 if (!cls1 || cls1 == cls2)
return cls2;
89 return cls1->
merge(*cls2);
ClusterCandidate & findCluster(unsigned int u, unsigned int v)
Find a cluster adjacent to the given coordinates.
~ClusterCache()
Delete the cache and free the memory.
const unsigned int m_maxU
number of columns of the cache.
std::deque< ClusterCandidate > m_clusters
list of all the clusters created so far
ClusterCandidate * mergeCluster(ClusterCandidate *cls1, ClusterCandidate *cls2)
Merge two cluster and update the list of cached clusters.
ClusterCandidate ** m_clsCur
cache of the current row
ClusterCandidate ** m_clsTop
cache of the top row
std::deque< ClusterCandidate >::iterator m_currCluster
iterator to the next free cluster to be used if a new cluster is needed.
ClusterCache(unsigned int maxU=c_defaultNumberColumns)
Create a new cache.
void switchRow(unsigned int v)
Switch the internal rows.
void clear()
Clear the cache structure.
unsigned int m_curV
current v coordinate, needed to switch top row
Class representing a possible cluster during clustering of the PXD It supports merging of different c...
ClusterCandidate * merge(ClusterCandidate &cls)
Merge the given cluster with this one.
void clear()
Clear the Cluster information (to reuse the same cluster instance)
Namespace to encapsulate code needed for simulation and reconstrucion of the PXD.
Abstract base class for different kinds of events.