CMS 3D CMS Logo

Clusterizer1DCommons.h
Go to the documentation of this file.
1 #ifndef _Clusterizer1DCommons_H_
2 #define _Clusterizer1DCommons_H_
3 
5 
7  // typedef Clusterizer1DCommons::Cluster1D Cluster1D;
8  inline double square(const double a) { return a * a; }
9 
10  template <class T>
11  struct ComparePairs {
12  bool operator()(const Cluster1D<T>& c1, const Cluster1D<T>& c2) {
13  return (c1.position().value() < c2.position().value());
14  };
15  };
16 
17  template <class T>
18  void add(const std::vector<const T*>& source, std::vector<const T*>& dest) {
19  for (typename std::vector<const T*>::const_iterator i = source.begin(); i != source.end(); ++i) {
20  dest.push_back(*i);
21  };
22  }
23 
24 } // namespace Clusterizer1DCommons
25 
26 #endif
void add(const std::vector< const T *> &source, std::vector< const T *> &dest)
bool operator()(const Cluster1D< T > &c1, const Cluster1D< T > &c2)
double value() const
Definition: Measurement1D.h:25
Measurement1D position() const
Definition: Cluster1D.h:46
double a
Definition: hdecay.h:119
double square(const double a)
static std::string const source
Definition: EdmProvDump.cc:46