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

◆ multiGaussianStateFromTSOS()

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

Definition at line 10 of file TsosGaussianStateConversions.cc.

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  }

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

Referenced by MultiTrajectoryStateMerger::merge().

◆ multiGaussianStateFromVertex()

MultiGaussianState< 3 > GaussianStateConversions::multiGaussianStateFromVertex ( const VertexState  aState)

Definition at line 8 of file VertexGaussianStateConversions.cc.

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  }

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

Referenced by GsfVertexMerger::merge().

◆ tsosFromMultiGaussianState()

TrajectoryStateOnSurface GaussianStateConversions::tsosFromMultiGaussianState ( const MultiGaussianState< 5 > &  multiState,
const TrajectoryStateOnSurface refTsos 
)

Definition at line 28 of file TsosGaussianStateConversions.cc.

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  }

References makeMuonMisalignmentScenario::components, TrajectoryStateOnSurface::components(), TrajectoryStateOnSurface::magneticField(), MultiGaussianStateTransform::multiState(), TrajectoryStateOnSurface::surface(), and TrajectoryStateOnSurface::surfaceSide().

Referenced by MultiTrajectoryStateMerger::merge().

◆ vertexFromMultiGaussianState()

VertexState GaussianStateConversions::vertexFromMultiGaussianState ( const MultiGaussianState< 3 > &  multiState)

Definition at line 27 of file VertexGaussianStateConversions.cc.

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  }
44  }

References makeMuonMisalignmentScenario::components, relativeConstraints::error, MultiGaussianStateTransform::multiState(), and position.

Referenced by GsfVertexMerger::merge().

AlgebraicVector3
ROOT::Math::SVector< double, 3 > AlgebraicVector3
Definition: AlgebraicROOTObjects.h:12
AlgebraicSymMatrix33
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
Definition: AlgebraicROOTObjects.h:21
BasicMultiTrajectoryState
Definition: BasicMultiTrajectoryState.h:17
pos
Definition: PixelAliasList.h:18
MultiGaussianState
Mixture of multi-variate gaussian states.
Definition: MultiGaussianState.h:18
Surface
Definition: Surface.h:36
SurfaceSideDefinition::SurfaceSide
SurfaceSide
Definition: SurfaceSideDefinition.h:8
relativeConstraints.error
error
Definition: relativeConstraints.py:53
parameters
parameters
Definition: BeamSpot_PayloadInspector.cc:14
LocalTrajectoryParameters
Definition: LocalTrajectoryParameters.h:25
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
Point3DBase< float, GlobalTag >
BasicMultiVertexState
Definition: BasicMultiVertexState.h:12
LocalTrajectoryError
Definition: LocalTrajectoryError.h:20
MultiGaussianStateTransform::multiState
MultiGaussianState< N > multiState(const std::vector< MultiGaussianState< N >::Vector > &, const std::vector< MultiGaussianState< N >::Matrix > &, const std::vector< double > &)
Definition: MultiGaussianStateTransform.cc:39
SingleGaussianState
Definition: SingleGaussianState.h:14
TrajectoryStateOnSurface::components
Components const & components() const
Definition: TrajectoryStateOnSurface.h:85
VertexState::components
std::vector< VertexState > components() const
Definition: VertexState.h:90
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
GlobalErrorBase< double, ErrorMatrixTag >
BasicTrajectoryState
Definition: BasicTrajectoryState.h:66
VertexState
Definition: VertexState.h:13
makeMuonMisalignmentScenario.components
string components
Definition: makeMuonMisalignmentScenario.py:58
TrajectoryStateOnSurface::surface
const SurfaceType & surface() const
Definition: TrajectoryStateOnSurface.h:78
MultiGaussianState::SingleStateContainer
std::vector< SingleStatePtr > SingleStateContainer
Definition: MultiGaussianState.h:25
MagneticField
Definition: MagneticField.h:19
TrajectoryStateOnSurface::surfaceSide
SurfaceSide surfaceSide() const
Position relative to material, defined relative to momentum vector.
Definition: TrajectoryStateOnSurface.h:89
TrajectoryStateOnSurface::magneticField
const MagneticField * magneticField() const
Definition: TrajectoryStateOnSurface.h:62
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54