CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch2/src/CommonTools/Clustering1D/interface/Cluster1D.h

Go to the documentation of this file.
00001 #ifndef _Cluster1D_H_
00002 #define _Cluster1D_H_
00003 
00004 #include "DataFormats/GeometryCommonDetAlgo/interface/Measurement1D.h"
00005 
00006 #include <vector>
00007 
00012 template < class T >
00013 class Cluster1D
00014 {
00015 public:
00016     Cluster1D (); // needed :-(
00017     Cluster1D ( const Measurement1D & meas,
00018               const std::vector < const T * > & tracks, double weight = 1.0 );
00019 
00020     Measurement1D position() const;
00021     std::vector < const T * > tracks() const;
00022     double weight() const;
00023     // bool operator== ( const Cluster1D<T> & other ) const;
00024 
00025 private:
00026     Measurement1D theMeasurement1D;
00027     std::vector < const T *> theTracks;
00028     double theWeight;
00029 };
00030 
00031 /*
00032  *                                 implementation
00033  */
00034 
00035 template <class T>
00036 Cluster1D<T>::Cluster1D( const Measurement1D & meas,
00037                      const std::vector < const T * > & t,
00038                      double weight ) :
00039         theMeasurement1D(meas), theTracks(t), theWeight(weight)
00040 {}
00041 
00042 template <class T>
00043 Cluster1D<T>::Cluster1D() :
00044         theMeasurement1D(), theTracks(), theWeight(0.)
00045 {}
00046 
00047 
00048 template <class T>
00049 std::vector < const T * > Cluster1D<T>::tracks() const
00050 {
00051     return theTracks;
00052 }
00053 
00054 template <class T>
00055 Measurement1D Cluster1D<T>::position() const
00056 {
00057     return theMeasurement1D;
00058 }
00059 
00060 template <class T>
00061 double Cluster1D<T>::weight() const
00062 {
00063     return theWeight;
00064 }
00065 
00066 #endif