CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/CommonTools/Clustering1D/interface/Clusterizer1DCommons.h

Go to the documentation of this file.
00001 #ifndef _Clusterizer1DCommons_H_
00002 #define _Clusterizer1DCommons_H_
00003 
00004 #include "CommonTools/Clustering1D/interface/Cluster1D.h"
00005 
00006 namespace Clusterizer1DCommons
00007 {
00008 // typedef Clusterizer1DCommons::Cluster1D Cluster1D;
00009 inline double square ( const double a )
00010 {
00011     return a*a;
00012 }
00013 
00014 template <class T>
00015 struct ComparePairs
00016 {
00017     bool operator() ( const Cluster1D<T> & c1,
00018                       const Cluster1D<T> & c2 )
00019     {
00020         return ( c1.position().value() < c2.position().value() );
00021     };
00022 };
00023 
00024 template <class T>
00025 void add
00026     ( const std::vector < const T * > & source,
00027             std::vector < const T * > & dest )
00028 {
00029     for ( typename std::vector< const T * >::const_iterator i=source.begin();
00030             i!=source.end() ; ++i )
00031     {
00032         dest.push_back ( *i );
00033     };
00034 }
00035 
00036 } // namespace Clusterizer1DCommons
00037 
00038 #endif