CMS 3D CMS Logo

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

#include <SmsModeFinder3d.h>

Inheritance diagram for SmsModeFinder3d:
ModeFinder3d

Public Member Functions

SmsModeFinder3dclone () const override
 
GlobalPoint operator() (const std::vector< PointAndDistance > &values) const override
 
 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 : theAlgo(algo) {}

Member Function Documentation

SmsModeFinder3d * SmsModeFinder3d::clone ( void  ) const
overridevirtual

Implements ModeFinder3d.

Definition at line 14 of file SmsModeFinder3d.cc.

References SmsModeFinder3d().

14 { return new SmsModeFinder3d(*this); }
SmsModeFinder3d(const SMS &algo=SMS())
GlobalPoint SmsModeFinder3d::operator() ( const std::vector< PointAndDistance > &  values) const
overridevirtual

Implements ModeFinder3d.

Definition at line 5 of file SmsModeFinder3d.cc.

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

5  {
6  std::vector<std::pair<GlobalPoint, float> > weighted;
7  for (std::vector<PointAndDistance>::const_iterator i = values.begin(); i != values.end(); ++i) {
8  float weight = pow(10 + 10000 * i->second, -2);
9  weighted.push_back(std::pair<GlobalPoint, float>(i->first, weight));
10  };
11  return theAlgo.location(weighted);
12 }
int weight
Definition: histoStyle.py:51
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
GlobalPoint location(const std::vector< GlobalPoint > &) const
Definition: SMS.cc:57

Member Data Documentation

SMS SmsModeFinder3d::theAlgo
private

Definition at line 16 of file SmsModeFinder3d.h.

Referenced by operator()().