#include <ClusteringAlgorithm_neighbor.h>
Public Member Functions | |
void | addNeighbors (std::vector< T > &cluster, const std::vector< T > &input, unsigned int start, std::vector< bool > &masked) const |
Add neighbours to the cluster. | |
void | Cluster (std::vector< std::vector< T > > &output, const std::vector< T > &input) const |
Clustering operations. | |
ClusteringAlgorithm_neighbor (const StackedTrackerGeometry *aStackedTracker) | |
Constructor. | |
bool | isANeighbor (const T ¢er, const T &mayNeigh) const |
Needed for neighbours. | |
~ClusteringAlgorithm_neighbor () | |
Destructor. |
//////////////////////////////////////// Stacked Tracker Simulations /// / Kristofer Henriksson /// ////////////////////////////////////// //////////////////////////////////////// This is a greedy clustering to be /// used for diagnostic purposes, which /// will make clusters as large as /// possible by including all contiguous /// hits in a single cluster. /// ////////////////////////////////////// ************************ DECLARATION OF CLASS ************************
Definition at line 38 of file ClusteringAlgorithm_neighbor.h.
ClusteringAlgorithm_neighbor< T >::ClusteringAlgorithm_neighbor | ( | const StackedTrackerGeometry * | aStackedTracker | ) | [inline] |
Constructor.
Data members Other stuff
Definition at line 46 of file ClusteringAlgorithm_neighbor.h.
: ClusteringAlgorithm< T >( aStackedTracker,__func__ ) {}
ClusteringAlgorithm_neighbor< T >::~ClusteringAlgorithm_neighbor | ( | ) | [inline] |
void ClusteringAlgorithm_neighbor< T >::addNeighbors | ( | std::vector< T > & | cluster, |
const std::vector< T > & | input, | ||
unsigned int | start, | ||
std::vector< bool > & | masked | ||
) | const |
Add neighbours to the cluster.
This following line is necessary to ensure the iterators afterward remain valid.
Loop over hits
Loop over candidate neighbours
Is it really a neighbour?
End of loop over candidate neighbours
End of loop over hits
Definition at line 102 of file ClusteringAlgorithm_neighbor.h.
References i.
{ cluster.reserve(input.size()); typename std::vector< T >::iterator clusIter; typename std::vector< T >::iterator inIter; for ( clusIter = cluster.begin(); clusIter < cluster.end(); clusIter++ ) { for ( unsigned int i=startVal; i<input.size(); i++) { if ( isANeighbor(*clusIter, input[i]) ) { cluster.push_back(input[i]); used[i]=true; } } } }
void ClusteringAlgorithm_neighbor< T >::Cluster | ( | std::vector< std::vector< T > > & | output, |
const std::vector< T > & | input | ||
) | const [virtual] |
Clustering operations.
Close class.
***************************** IMPLEMENTATION OF METHODS ***************************** Clustering operations
Prepare output
Loop over all input hits and delete them once clustered
End of iteration
Reimplemented from ClusteringAlgorithm< T >.
Definition at line 70 of file ClusteringAlgorithm_neighbor.h.
References i, and convertSQLitetoXML_cfg::output.
bool ClusteringAlgorithm_neighbor< T >::isANeighbor | ( | const T & | center, |
const T & | mayNeigh | ||
) | const |
Needed for neighbours.
Check if the hit is a neighbour.
Definition at line 92 of file ClusteringAlgorithm_neighbor.h.
References abs.