CMS 3D CMS Logo

Functions
GaussianStateConversions Namespace Reference

Functions

MultiGaussianState< 5 > multiGaussianStateFromTSOS (const TrajectoryStateOnSurface &tsos)
 
MultiGaussianState< 3 > multiGaussianStateFromVertex (const VertexState aState)
 
TrajectoryStateOnSurface tsosFromMultiGaussianState (const MultiGaussianState< 5 > &multiState, const TrajectoryStateOnSurface &refTsos)
 
VertexState vertexFromMultiGaussianState (const MultiGaussianState< 3 > &multiState)
 

Function Documentation

MultiGaussianState< 5 > GaussianStateConversions::multiGaussianStateFromTSOS ( const TrajectoryStateOnSurface tsos)

Definition at line 10 of file TsosGaussianStateConversions.cc.

References makeMuonMisalignmentScenario::components, TrajectoryStateOnSurface::components(), and TrajectoryStateOnSurface::isValid().

Referenced by MultiTrajectoryStateMerger::merge().

10  {
11  if (!tsos.isValid())
12  return MultiGaussianState<5>();
13 
14  using SingleStatePtr = std::shared_ptr<SingleGaussianState<5>>;
15  auto const& components = tsos.components();
17  singleStates.reserve(components.size());
18  for (auto const& ic : components) {
19  if (ic.isValid()) {
20  auto sgs = std::make_shared<SingleGaussianState<5>>(
21  ic.localParameters().vector(), ic.localError().matrix(), ic.weight());
22  singleStates.push_back(sgs);
23  }
24  }
25  return MultiGaussianState<5>(singleStates);
26  }
Mixture of multi-variate gaussian states.
std::vector< SingleStatePtr > SingleStateContainer
Components const & components() const
MultiGaussianState< 3 > GaussianStateConversions::multiGaussianStateFromVertex ( const VertexState  aState)

Definition at line 8 of file VertexGaussianStateConversions.cc.

References makeMuonMisalignmentScenario::components, and VertexState::components().

Referenced by GsfVertexMerger::merge().

8  {
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  }
Mixture of multi-variate gaussian states.
std::vector< SingleStatePtr > SingleStateContainer
std::vector< VertexState > components() const
Definition: VertexState.h:90
ROOT::Math::SVector< double, 3 > AlgebraicVector3
TrajectoryStateOnSurface GaussianStateConversions::tsosFromMultiGaussianState ( const MultiGaussianState< 5 > &  multiState,
const TrajectoryStateOnSurface refTsos 
)

Definition at line 28 of file TsosGaussianStateConversions.cc.

References makeMuonMisalignmentScenario::components, MultiGaussianState< N >::components(), TrajectoryStateOnSurface::components(), TrajectoryStateOnSurface::magneticField(), TrajectoryStateOnSurface::surface(), and TrajectoryStateOnSurface::surfaceSide().

Referenced by MultiTrajectoryStateMerger::merge().

29  {
30  if (multiState.components().empty())
31  return TrajectoryStateOnSurface();
32  const Surface& surface = refTsos.surface();
33  SurfaceSide side = refTsos.surfaceSide();
34  const MagneticField* field = refTsos.magneticField();
35  auto const& refTsos1 = refTsos.components().front();
36  auto pzSign = refTsos1.localParameters().pzSign();
37  bool charged = refTsos1.charge() != 0;
38 
39  auto const& singleStates = multiState.components();
40  std::vector<TrajectoryStateOnSurface> components;
41  components.reserve(singleStates.size());
42  for (auto const& ic : singleStates) {
43  components.emplace_back((*ic).weight(),
44  LocalTrajectoryParameters((*ic).mean(), pzSign, charged),
45  LocalTrajectoryError((*ic).covariance()),
46  surface,
47  field,
48  side);
49  }
51  }
const SingleStateContainer & components() const
access to components (single Gaussian states)
const MagneticField * magneticField() const
const SurfaceType & surface() const
SurfaceSide surfaceSide() const
Position relative to material, defined relative to momentum vector.
Components const & components() const
VertexState GaussianStateConversions::vertexFromMultiGaussianState ( const MultiGaussianState< 3 > &  multiState)

Definition at line 27 of file VertexGaussianStateConversions.cc.

References makeMuonMisalignmentScenario::components, MultiGaussianState< N >::components(), relativeConstraints::error, and position.

Referenced by GsfVertexMerger::merge().

27  {
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  }
const SingleStateContainer & components() const
access to components (single Gaussian states)
Mixture of multi-variate gaussian states.
std::vector< SingleStatePtr > SingleStateContainer
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