CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
lms_3d.cc
Go to the documentation of this file.
1 #include "CommonTools/Statistics/interface/lms_1d.icc"
4 #include <vector>
5 
8 GlobalPoint lms_3d ( std::vector<GlobalPoint> values )
9 {
10  const int sze = values.size();
11  if ( sze == 0 ) {
12  throw VertexException("lms_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>::iterator i=values.begin();
19  i!=values.end() ; i++ ) {
20  x_vals.push_back( i->x() );
21  y_vals.push_back( i->y() );
22  z_vals.push_back( i->z() );
23  };
24  return GlobalPoint ( lms_1d(x_vals), lms_1d(y_vals), lms_1d(z_vals) );
25 }
int i
Definition: DBlmapReader.cc:9
Common base class.
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
GlobalPoint lms_3d(std::vector< GlobalPoint > values)
Definition: lms_3d.cc:8