TrackingTools
GsfTools
src
MultiGaussianState1D.cc
Go to the documentation of this file.
1
#include "
TrackingTools/GsfTools/interface/MultiGaussianState1D.h
"
2
#include "
TrackingTools/GsfTools/interface/MultiGaussianStateCombiner1D.h
"
3
// #include "TrackingTools/GsfTools/interface/MultiGaussianState.h"
4
5
double
MultiGaussianState1D::weight
()
const
{
6
if
(
theCombinedStateUp2Date
)
7
return
theCombinedState
.
weight
();
8
9
double
result
(0.);
10
for
(SingleState1dContainer::const_iterator ic =
theComponents
.begin(); ic !=
theComponents
.end(); ic++)
11
result
+= (*ic).weight();
12
return
result
;
13
}
14
15
double
MultiGaussianState1D::mean
()
const
{
16
checkCombinedState
();
17
return
theCombinedState
.
mean
();
18
}
19
20
double
MultiGaussianState1D::variance
()
const
{
21
checkCombinedState
();
22
return
theCombinedState
.
variance
();
23
}
24
25
void
MultiGaussianState1D::checkCombinedState
()
const
{
26
if
(
theCombinedStateUp2Date
)
27
return
;
28
29
MultiGaussianStateCombiner1D
combiner
;
30
theCombinedState
=
combiner
.combine(
theComponents
);
31
32
// typedef SingleGaussianState<1> SingleState;
33
// typedef std::shared_ptr< SingleGaussianState<1> > SingleStatePtr;
34
// typedef std::vector< SingleStatePtr > SingleStateContainer;
35
36
// SingleStateContainer components;
37
// for ( SingleState1dContainer::const_iterator ic=theComponents.begin();
38
// ic!=theComponents.end(); ic++ ) {
39
// SingleStatePtr ssp(new SingleState(SingleState::Vector((*ic).mean()),
40
// SingleState::Matrix((*ic).variance()),
41
// (*ic).weight()));
42
// components.push_back(ssp);
43
// }
44
// MultiGaussianState<1> multiState(components);
45
46
// theCombinedState = SingleGaussianState1D(multiState.mean()(0),
47
// multiState.covariance()(0,0),
48
// multiState.weight());
49
50
theCombinedStateUp2Date
=
true
;
51
}
MultiGaussianState1D::weight
double weight() const
combined weight
Definition:
MultiGaussianState1D.cc:5
MultiGaussianState1D::theCombinedStateUp2Date
bool theCombinedStateUp2Date
Definition:
MultiGaussianState1D.h:40
MultiGaussianState1D::theCombinedState
SingleGaussianState1D theCombinedState
Definition:
MultiGaussianState1D.h:39
mps_fire.result
result
Definition:
mps_fire.py:311
MultiGaussianState1D::mean
double mean() const
combined mean
Definition:
MultiGaussianState1D.cc:15
MultiGaussianState1D.h
MultiGaussianState1D::theComponents
const SingleState1dContainer theComponents
Definition:
MultiGaussianState1D.h:38
MultiGaussianState1D::variance
double variance() const
combined variance
Definition:
MultiGaussianState1D.cc:20
SingleGaussianState1D::mean
double mean() const
parameter vector
Definition:
SingleGaussianState1D.h:25
SingleGaussianState1D::weight
double weight() const
weight
Definition:
SingleGaussianState1D.h:23
MultiGaussianStateCombiner1D.h
heavyFlavorValidationHarvestingSequence_cff.combiner
combiner
Definition:
heavyFlavorValidationHarvestingSequence_cff.py:83
MultiGaussianStateCombiner1D
Definition:
MultiGaussianStateCombiner1D.h:13
SingleGaussianState1D::variance
double variance() const
variance
Definition:
SingleGaussianState1D.h:27
MultiGaussianState1D::checkCombinedState
void checkCombinedState() const
calculation of the combined state (on demand)
Definition:
MultiGaussianState1D.cc:25
combiner
Definition:
CandCombiner.h:17
Generated for CMSSW Reference Manual by
1.8.14