test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
hsm_3d.h File Reference
#include <vector>
#include "DataFormats/GeometryVector/interface/GlobalPoint.h"

Go to the source code of this file.

Functions

GlobalPoint hsm_3d (const std::vector< GlobalPoint > &values)
 cordinate wise half sample mode in 3d More...
 

Function Documentation

GlobalPoint hsm_3d ( const std::vector< GlobalPoint > &  values)

cordinate wise half sample mode in 3d

Definition at line 8 of file hsm_3d.cc.

References i, and runTheMatrix::ret.

Referenced by HsmModeFinder3d::operator()(), and SubsetHsmModeFinder3d::operator()().

9 {
10  const int sze = values.size();
11  if ( sze == 0 ) {
12  throw VertexException("hsm_3d: no values given.");
13  };
14  std::vector <float> x_vals, y_vals, z_vals;
15  x_vals.reserve(sze-1);
16  y_vals.reserve(sze-1);
17  z_vals.reserve(sze-1);
18  for ( std::vector<GlobalPoint>::const_iterator i=values.begin();
19  i!=values.end() ; i++ )
20  {
21  x_vals.push_back( i->x() );
22  y_vals.push_back( i->y() );
23  z_vals.push_back( i->z() );
24  };
25 
26  // FIXME isnt necessary, is it?
27  /*
28  sort ( x_vals.begin(), x_vals.end() );
29  sort ( y_vals.begin(), y_vals.end() );
30  sort ( z_vals.begin(), z_vals.end() );*/
31 
32  GlobalPoint ret ( hsm_1d(x_vals), hsm_1d(y_vals), hsm_1d(z_vals) );
33  return ret;
34 }
int i
Definition: DBlmapReader.cc:9
tuple ret
prodAgent to be discontinued
Common base class.