CMS 3D CMS Logo

Public Member Functions | Private Attributes

SmsModeFinder3d Class Reference

#include <SmsModeFinder3d.h>

Inheritance diagram for SmsModeFinder3d:
ModeFinder3d

List of all members.

Public Member Functions

virtual SmsModeFinder3dclone () const
virtual GlobalPoint operator() (const std::vector< PointAndDistance > &values) const
 SmsModeFinder3d (const SMS &algo=SMS())

Private Attributes

SMS theAlgo

Detailed Description

Least Median sum of squares mode finder. Works coordinate wise.

Definition at line 9 of file SmsModeFinder3d.h.


Constructor & Destructor Documentation

SmsModeFinder3d::SmsModeFinder3d ( const SMS algo = SMS())

Definition at line 3 of file SmsModeFinder3d.cc.

Referenced by clone().

                                                    :
    theAlgo(algo)
{}

Member Function Documentation

SmsModeFinder3d * SmsModeFinder3d::clone ( void  ) const [virtual]

Implements ModeFinder3d.

Definition at line 19 of file SmsModeFinder3d.cc.

References SmsModeFinder3d().

{
  return new SmsModeFinder3d ( * this );
}
GlobalPoint SmsModeFinder3d::operator() ( const std::vector< PointAndDistance > &  values) const [virtual]

Implements ModeFinder3d.

Definition at line 7 of file SmsModeFinder3d.cc.

References i, SMS::location(), funct::pow(), theAlgo, CommonMethods::weight(), and plotBeamSpotDB::weighted.

{
  std::vector < std::pair < GlobalPoint, float > > weighted;
  for ( std::vector< PointAndDistance >::const_iterator i=values.begin(); 
        i!=values.end() ; ++i )
  {
    float weight = pow ( 10 + 10000 * i->second, -2 );
    weighted.push_back ( std::pair < GlobalPoint, float > ( i->first, weight ) );
  };
  return theAlgo.location( weighted );
}

Member Data Documentation

Definition at line 15 of file SmsModeFinder3d.h.

Referenced by operator()().