Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:49:57

0001 #ifndef _Clusterizer1DCommons_H_
0002 #define _Clusterizer1DCommons_H_
0003 
0004 #include "CommonTools/Clustering1D/interface/Cluster1D.h"
0005 
0006 namespace Clusterizer1DCommons {
0007   // typedef Clusterizer1DCommons::Cluster1D Cluster1D;
0008   inline double square(const double a) { return a * a; }
0009 
0010   template <class T>
0011   struct ComparePairs {
0012     bool operator()(const Cluster1D<T>& c1, const Cluster1D<T>& c2) {
0013       return (c1.position().value() < c2.position().value());
0014     };
0015   };
0016 
0017   template <class T>
0018   void add(const std::vector<const T*>& source, std::vector<const T*>& dest) {
0019     for (typename std::vector<const T*>::const_iterator i = source.begin(); i != source.end(); ++i) {
0020       dest.push_back(*i);
0021     };
0022   }
0023 
0024 }  // namespace Clusterizer1DCommons
0025 
0026 #endif