CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
VertexGaussianStateConversions.cc
Go to the documentation of this file.
2 
6 #include "boost/shared_ptr.hpp"
7 
8 namespace GaussianStateConversions {
9 
11  {
12  typedef boost::shared_ptr< SingleGaussianState<3> > SingleStatePtr;
13  const std::vector<VertexState> components = aState.components();
15  singleStates.reserve(components.size());
16  for ( std::vector<VertexState>::const_iterator ic=components.begin();
17  ic!=components.end(); ic ++ ) {
18  if ( ic->isValid() ) {
19  GlobalPoint pos(ic->position());
21  parameters(0) = pos.x(); parameters(1) = pos.y(); parameters(2) = pos.z();
22  SingleStatePtr sgs(new SingleGaussianState<3>(parameters,
23  ic->error().matrix_new(),
24  ic->weightInMixture()));
25  singleStates.push_back(sgs);
26  }
27  }
28  return MultiGaussianState<3>(singleStates);
29  }
30 
32  {
33  if ( multiState.components().empty() ) return VertexState();
34 
35  const MultiGaussianState<3>::SingleStateContainer& singleStates =
36  multiState.components();
37  std::vector<VertexState> components;
38  components.reserve(singleStates.size());
40  ic!=singleStates.end(); ic++ ) {
41  const AlgebraicVector3& par = (**ic).mean();
42  GlobalPoint position(par(0),par(1),par(2));
43  const AlgebraicSymMatrix33& cov = (**ic).covariance();
44  GlobalError error(cov(0,0),cov(1,0),cov(2,0),cov(1,1),cov(2,1),cov(2,2));
45  components.push_back(VertexState(position,error,(**ic).weight()));
46  }
47  return VertexState(new BasicMultiVertexState(components));
48  }
49 }
50 
MultiGaussianState< 3 > multiGaussianStateFromVertex(const VertexState aState)
dictionary parameters
Definition: Parameters.py:2
const SingleStateContainer & components() const
access to components (single Gaussian states)
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
VertexState vertexFromMultiGaussianState(const MultiGaussianState< 3 > &multiState)
Mixture of multi-variate gaussian states.
std::vector< SingleStatePtr > SingleStateContainer
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
ROOT::Math::SVector< double, 3 > AlgebraicVector3
std::vector< VertexState > components() const
Definition: VertexState.h:61
MultiGaussianState< N > multiState(const std::vector< MultiGaussianState< N >::Vector > &, const std::vector< MultiGaussianState< N >::Matrix > &, const std::vector< double > &)
const double par[8 *NPar][4]