CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
SmsModeFinder3d Class Reference

#include <SmsModeFinder3d.h>

Inheritance diagram for SmsModeFinder3d:
ModeFinder3d

Public Member Functions

virtual SmsModeFinder3dclone () const
 
virtual GlobalPoint operator() (const std::vector< PointAndDistance > &values) const
 
 SmsModeFinder3d (const SMS &algo=SMS())
 
- Public Member Functions inherited from ModeFinder3d
virtual ~ModeFinder3d ()
 

Private Attributes

SMS theAlgo
 

Additional Inherited Members

- Public Types inherited from ModeFinder3d
typedef std::pair< GlobalPoint,
float > 
PointAndDistance
 

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().

3  :
4  theAlgo(algo)
5 {}

Member Function Documentation

SmsModeFinder3d * SmsModeFinder3d::clone ( void  ) const
virtual

Implements ModeFinder3d.

Definition at line 19 of file SmsModeFinder3d.cc.

References SmsModeFinder3d().

20 {
21  return new SmsModeFinder3d ( * this );
22 }
SmsModeFinder3d(const SMS &algo=SMS())
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, puppiForMET_cff::weight, and plotBeamSpotDB::weighted.

8 {
9  std::vector < std::pair < GlobalPoint, float > > weighted;
10  for ( std::vector< PointAndDistance >::const_iterator i=values.begin();
11  i!=values.end() ; ++i )
12  {
13  float weight = pow ( 10 + 10000 * i->second, -2 );
14  weighted.push_back ( std::pair < GlobalPoint, float > ( i->first, weight ) );
15  };
16  return theAlgo.location( weighted );
17 }
int i
Definition: DBlmapReader.cc:9
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
GlobalPoint location(const std::vector< GlobalPoint > &) const
Definition: SMS.cc:76

Member Data Documentation

SMS SmsModeFinder3d::theAlgo
private

Definition at line 15 of file SmsModeFinder3d.h.

Referenced by operator()().