File indexing completed on 2024-04-06 12:31:30
0001 #include "TrackingTools/GsfTools/interface/MultiGaussianState1D.h"
0002 #include "TrackingTools/GsfTools/interface/MultiGaussianStateCombiner1D.h"
0003
0004
0005 double MultiGaussianState1D::weight() const {
0006 if (theCombinedStateUp2Date)
0007 return theCombinedState.weight();
0008
0009 double result(0.);
0010 for (SingleState1dContainer::const_iterator ic = theComponents.begin(); ic != theComponents.end(); ic++)
0011 result += (*ic).weight();
0012 return result;
0013 }
0014
0015 double MultiGaussianState1D::mean() const {
0016 checkCombinedState();
0017 return theCombinedState.mean();
0018 }
0019
0020 double MultiGaussianState1D::variance() const {
0021 checkCombinedState();
0022 return theCombinedState.variance();
0023 }
0024
0025 void MultiGaussianState1D::checkCombinedState() const {
0026 if (theCombinedStateUp2Date)
0027 return;
0028
0029 MultiGaussianStateCombiner1D combiner;
0030 theCombinedState = combiner.combine(theComponents);
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050 theCombinedStateUp2Date = true;
0051 }