CMS 3D CMS Logo

Public Member Functions | Private Attributes

ClusteringAlgorithm_broadside< T > Class Template Reference

#include <ClusteringAlgorithm_broadside.h>

Inheritance diagram for ClusteringAlgorithm_broadside< T >:
ClusteringAlgorithm< T >

List of all members.

Public Member Functions

void Cluster (std::vector< std::vector< T > > &output, const std::vector< T > &input) const
 Clustering operations.
 ClusteringAlgorithm_broadside (const StackedTrackerGeometry *aStackedTracker, int aWidthCut)
 Cluster max width.
 ~ClusteringAlgorithm_broadside ()
 Destructor.

Private Attributes

int mWidthCut
 Data members.

Detailed Description

template<typename T>
class ClusteringAlgorithm_broadside< T >

//////////////////////////////////////// Stacked Tracker Simulations /// / Andrew W. Rose, IC /// / 2008 /// ////////////////////////////////////// ************************ DECLARATION OF CLASS ************************

Definition at line 33 of file ClusteringAlgorithm_broadside.h.


Constructor & Destructor Documentation

template<typename T>
ClusteringAlgorithm_broadside< T >::ClusteringAlgorithm_broadside ( const StackedTrackerGeometry aStackedTracker,
int  aWidthCut 
) [inline]

Cluster max width.

Constructor

Definition at line 41 of file ClusteringAlgorithm_broadside.h.

References ClusteringAlgorithm_broadside< T >::mWidthCut.

        : ClusteringAlgorithm< T >( aStackedTracker, __func__ )
      {
        mWidthCut = aWidthCut;
      }
template<typename T>
ClusteringAlgorithm_broadside< T >::~ClusteringAlgorithm_broadside ( ) [inline]

Destructor.

Definition at line 48 of file ClusteringAlgorithm_broadside.h.

{}

Member Function Documentation

template<typename T >
void ClusteringAlgorithm_broadside< 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 the output

Prepare a proper hit container

Map all the hits by column index

Loop over the mapped hits

Collect hits sharing column index and differing by 1 in row index

Loop over single column

Nested loop

Check col/row and add to the cluster

End of nested loop

Reject all clusters large than the allowed size

End of loop over single column

End of loop over mapped hits

Reimplemented from ClusteringAlgorithm< T >.

Definition at line 63 of file ClusteringAlgorithm_broadside.h.

References convertSQLitetoXML_cfg::output, and groupFilesInBlocks::temp.

  {
    output.clear();

    std::map< unsigned int, std::vector< T > >                            local;

    typename std::vector< T >::const_iterator inputIterator;
    inputIterator = input.begin();
    while ( inputIterator != input.end() )
     {
      local[(**inputIterator).column()].push_back(*inputIterator);
      ++inputIterator;
    }

    typename std::map< unsigned int, std::vector< T > >::iterator mapIterator;
    mapIterator = local.begin();
    while ( mapIterator != local.end() )
    {
      typename std::vector< T >::iterator inputIterator;
      inputIterator = mapIterator->second.begin();

      while( inputIterator != mapIterator->second.end() )
      {
        std::vector< T > temp;
        temp.push_back(*inputIterator);
        inputIterator = mapIterator->second.erase(inputIterator);
        typename std::vector< T >::iterator inputIterator2;
        inputIterator2 = inputIterator;

        while( inputIterator2 != mapIterator->second.end() )
        {
          if( (temp.back()->column() == (**inputIterator2).column()) &&
              ((**inputIterator2).row() - temp.back()->row() == 1) )
          {
            temp.push_back(*inputIterator2);
            inputIterator2 = mapIterator->second.erase(inputIterator2);
          }
          else
            break;

        } 

        if ( (mWidthCut < 1) || (int(temp.size()) <= mWidthCut) ) output.push_back(temp);
        inputIterator = inputIterator2;

      } 
      ++mapIterator;

    } 
  } 

Member Data Documentation

template<typename T>
int ClusteringAlgorithm_broadside< T >::mWidthCut [private]