CMS 3D CMS Logo

VertexGaussianStateConversions.cc
Go to the documentation of this file.
2 
5 
6 namespace GaussianStateConversions {
7 
9  typedef std::shared_ptr<SingleGaussianState<3> > SingleStatePtr;
10  const std::vector<VertexState> components = aState.components();
12  singleStates.reserve(components.size());
13  for (std::vector<VertexState>::const_iterator ic = components.begin(); ic != components.end(); ic++) {
14  if (ic->isValid()) {
15  GlobalPoint pos(ic->position());
17  parameters(0) = pos.x();
18  parameters(1) = pos.y();
19  parameters(2) = pos.z();
20  SingleStatePtr sgs(new SingleGaussianState<3>(parameters, ic->error().matrix(), ic->weightInMixture()));
21  singleStates.push_back(sgs);
22  }
23  }
24  return MultiGaussianState<3>(singleStates);
25  }
26 
28  if (multiState.components().empty())
29  return VertexState();
30 
31  const MultiGaussianState<3>::SingleStateContainer& singleStates = multiState.components();
32  std::vector<VertexState> components;
33  components.reserve(singleStates.size());
35  ic != singleStates.end();
36  ic++) {
37  const AlgebraicVector3& par = (**ic).mean();
38  GlobalPoint position(par(0), par(1), par(2));
39  const AlgebraicSymMatrix33& cov = (**ic).covariance();
40  GlobalError error(cov(0, 0), cov(1, 0), cov(2, 0), cov(1, 1), cov(2, 1), cov(2, 2));
41  components.push_back(VertexState(position, error, (**ic).weight()));
42  }
43  return VertexState(new BasicMultiVertexState(components));
44  }
45 } // namespace GaussianStateConversions
MultiGaussianState< 3 > multiGaussianStateFromVertex(const VertexState aState)
const SingleStateContainer & components() const
access to components (single Gaussian states)
VertexState vertexFromMultiGaussianState(const MultiGaussianState< 3 > &multiState)
Mixture of multi-variate gaussian states.
std::vector< SingleStatePtr > SingleStateContainer
std::vector< VertexState > components() const
Definition: VertexState.h:90
MultiGaussianState< N > multiState(const std::vector< MultiGaussianState< N >::Vector > &, const std::vector< MultiGaussianState< N >::Matrix > &, const std::vector< double > &)
static int position[264][3]
Definition: ReadPGInfo.cc:289
ROOT::Math::SVector< double, 3 > AlgebraicVector3
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33