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().

11  {
12  if ( !tsos.isValid() ) 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>>(ic.localParameters().vector(),
21  ic.localError().matrix(),
22  ic.weight());
23  singleStates.push_back(sgs);
24  }
25  }
26  return MultiGaussianState<5>(singleStates);
27  }
Mixture of multi-variate gaussian states.
std::vector< SingleStatePtr > SingleStateContainer
Components const & components() const
MultiGaussianState< 3 > GaussianStateConversions::multiGaussianStateFromVertex ( const VertexState  aState)

Definition at line 9 of file VertexGaussianStateConversions.cc.

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

Referenced by GsfVertexMerger::merge().

10  {
11  typedef std::shared_ptr< SingleGaussianState<3> > SingleStatePtr;
12  const std::vector<VertexState> components = aState.components();
14  singleStates.reserve(components.size());
15  for ( std::vector<VertexState>::const_iterator ic=components.begin();
16  ic!=components.end(); ic ++ ) {
17  if ( ic->isValid() ) {
18  GlobalPoint pos(ic->position());
20  parameters(0) = pos.x(); parameters(1) = pos.y(); parameters(2) = pos.z();
21  SingleStatePtr sgs(new SingleGaussianState<3>(parameters,
22  ic->error().matrix(),
23  ic->weightInMixture()));
24  singleStates.push_back(sgs);
25  }
26  }
27  return MultiGaussianState<3>(singleStates);
28  }
Mixture of multi-variate gaussian states.
std::vector< SingleStatePtr > SingleStateContainer
ROOT::Math::SVector< double, 3 > AlgebraicVector3
std::vector< VertexState > components() const
Definition: VertexState.h:125
TrajectoryStateOnSurface GaussianStateConversions::tsosFromMultiGaussianState ( const MultiGaussianState< 5 > &  multiState,
const TrajectoryStateOnSurface refTsos 
)

Definition at line 29 of file TsosGaussianStateConversions.cc.

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

Referenced by MultiTrajectoryStateMerger::merge().

31  {
32  if ( multiState.components().empty() ) return TrajectoryStateOnSurface();
33  const Surface & surface = refTsos.surface();
34  SurfaceSide side = refTsos.surfaceSide();
35  const MagneticField* field = refTsos.magneticField();
36  auto const & refTsos1 = refTsos.components().front();
37  auto pzSign = refTsos1.localParameters().pzSign();
38  bool charged = refTsos1.charge()!=0;
39 
40  auto const & singleStates = multiState.components();
41  std::vector<TrajectoryStateOnSurface> components;
42  components.reserve(singleStates.size());
43  for ( auto const & ic : singleStates ) {
44  components.emplace_back((*ic).weight(),
45  LocalTrajectoryParameters((*ic).mean(), pzSign,charged),
46  LocalTrajectoryError((*ic).covariance()),
47  surface,field,side);
48  }
50  }
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 30 of file VertexGaussianStateConversions.cc.

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

Referenced by GsfVertexMerger::merge().

31  {
32  if ( multiState.components().empty() ) return VertexState();
33 
34  const MultiGaussianState<3>::SingleStateContainer& singleStates =
35  multiState.components();
36  std::vector<VertexState> components;
37  components.reserve(singleStates.size());
39  ic!=singleStates.end(); ic++ ) {
40  const AlgebraicVector3& par = (**ic).mean();
41  GlobalPoint position(par(0),par(1),par(2));
42  const AlgebraicSymMatrix33& cov = (**ic).covariance();
43  GlobalError error(cov(0,0),cov(1,0),cov(2,0),cov(1,1),cov(2,1),cov(2,2));
44  components.push_back(VertexState(position,error,(**ic).weight()));
45  }
46  return VertexState(new BasicMultiVertexState(components));
47  }
const SingleStateContainer & components() const
access to components (single Gaussian states)
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
static int position[264][3]
Definition: ReadPGInfo.cc:509