9 if (theMixture.empty()) {
11 (
"MultiVertexStateCombiner:: VertexState container to collapse is empty");
14 if (theMixture.size()==1) {
16 return VertexState(theMixture.front().position(), theMixture.front().error(), 1.0);
25 double weightSum = 0.;
28 for (VSC::const_iterator mixtureIter1 = theMixture.begin();
29 mixtureIter1 != theMixture.end(); mixtureIter1++ ) {
30 vtxWeight = mixtureIter1->weightInMixture();
32 GlobalPoint vertexPosition = mixtureIter1->position();
34 vertexCoord1[0] = vertexPosition.
x();
35 vertexCoord1[1] = vertexPosition.
y();
36 vertexCoord1[2] = vertexPosition.
z();
39 weightSum += vtxWeight;
40 meanPosition += vtxWeight * vertexCoord1;
42 measCovar1 += vtxWeight * mixtureIter1->error().matrix();
43 for (VSC::const_iterator mixtureIter2 = mixtureIter1+1;
44 mixtureIter2 != theMixture.end(); mixtureIter2++ ) {
45 GlobalPoint vertexPosition2 = mixtureIter2->position();
47 vertexCoord2[0] = vertexPosition2.
x();
48 vertexCoord2[1] = vertexPosition2.
y();
49 vertexCoord2[2] = vertexPosition2.
z();
52 measCovar2 +=vtxWeight * mixtureIter2->weightInMixture() *
53 s.similarity(posDiff.T().T());
56 meanPosition /= weightSum;
59 GlobalPoint newPos(meanPosition[0], meanPosition[1], meanPosition[2]);
VertexState combine(const VSC &theMixture) const
GlobalErrorBase< double, ErrorMatrixTag > GlobalError
std::vector< VertexState > VSC
CLHEP::HepVector AlgebraicVector
CLHEP::HepSymMatrix AlgebraicSymMatrix