CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MultiGaussianState1D.cc
Go to the documentation of this file.
3 // #include "TrackingTools/GsfTools/interface/MultiGaussianState.h"
4 
6 {
8 
9  double result(0.);
10  for ( SingleState1dContainer::const_iterator ic=theComponents.begin();
11  ic!=theComponents.end(); ic++ ) result += (*ic).weight();
12  return result;
13 }
14 
16 {
18  return theCombinedState.mean();
19 }
20 
22 {
24  return theCombinedState.variance();
25 }
26 
28 {
29  if (theCombinedStateUp2Date) return;
30 
33 
34 // typedef SingleGaussianState<1> SingleState;
35 // typedef boost::shared_ptr< SingleGaussianState<1> > SingleStatePtr;
36 // typedef std::vector< SingleStatePtr > SingleStateContainer;
37 
38 // SingleStateContainer components;
39 // for ( SingleState1dContainer::const_iterator ic=theComponents.begin();
40 // ic!=theComponents.end(); ic++ ) {
41 // SingleStatePtr ssp(new SingleState(SingleState::Vector((*ic).mean()),
42 // SingleState::Matrix((*ic).variance()),
43 // (*ic).weight()));
44 // components.push_back(ssp);
45 // }
46 // MultiGaussianState<1> multiState(components);
47 
48 // theCombinedState = SingleGaussianState1D(multiState.mean()(0),
49 // multiState.covariance()(0,0),
50 // multiState.weight());
51 
53 
54 }
SingleGaussianState1D theCombinedState
double mean() const
combined mean
double weight() const
combined weight
const SingleState1dContainer theComponents
double mean() const
parameter vector
tuple result
Definition: query.py:137
double variance() const
variance
double variance() const
combined variance
double weight() const
weight
SingleGaussianState1D combine(const MultiGaussianState1D &theState) const
void checkCombinedState() const
calculation of the combined state (on demand)