CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_6/src/RecoVertex/VertexTools/src/SmsModeFinder3d.cc

Go to the documentation of this file.
00001 #include "RecoVertex/VertexTools/interface/SmsModeFinder3d.h"
00002 
00003 SmsModeFinder3d::SmsModeFinder3d ( const SMS & algo ) :
00004     theAlgo(algo)
00005 {}
00006 
00007 GlobalPoint SmsModeFinder3d::operator() ( const std::vector<PointAndDistance> & values ) const
00008 {
00009   std::vector < std::pair < GlobalPoint, float > > weighted;
00010   for ( std::vector< PointAndDistance >::const_iterator i=values.begin(); 
00011         i!=values.end() ; ++i )
00012   {
00013     float weight = pow ( 10 + 10000 * i->second, -2 );
00014     weighted.push_back ( std::pair < GlobalPoint, float > ( i->first, weight ) );
00015   };
00016   return theAlgo.location( weighted );
00017 }
00018 
00019 SmsModeFinder3d * SmsModeFinder3d::clone() const
00020 {
00021   return new SmsModeFinder3d ( * this );
00022 }