CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 11 of file TsosGaussianStateConversions.cc.

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

Referenced by MultiTrajectoryStateMerger::merge().

12  {
13  if ( !tsos.isValid() ) return MultiGaussianState<5>();
14 
15  typedef boost::shared_ptr< SingleGaussianState<5> > SingleStatePtr;
16  const std::vector<TrajectoryStateOnSurface>& components = tsos.components();
18  singleStates.reserve(components.size());
19  for ( std::vector<TrajectoryStateOnSurface>::const_iterator ic=components.begin();
20  ic!=components.end(); ic ++ ) {
21  if ( ic->isValid() ) {
22  SingleStatePtr sgs(new SingleGaussianState<5>(ic->localParameters().vector(),
23  ic->localError().matrix(),
24  ic->weight()));
25  singleStates.push_back(sgs);
26  }
27  }
28  return MultiGaussianState<5>(singleStates);
29  }
Mixture of multi-variate gaussian states.
std::vector< SingleStatePtr > SingleStateContainer
std::vector< TrajectoryStateOnSurface > components() const
MultiGaussianState< 3 > GaussianStateConversions::multiGaussianStateFromVertex ( const VertexState  aState)

Definition at line 9 of file VertexGaussianStateConversions.cc.

References makeMuonMisalignmentScenario::components, VertexState::components(), Parameters::parameters, and pos.

Referenced by GsfVertexMerger::merge().

10  {
11  typedef boost::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_new(),
23  ic->weightInMixture()));
24  singleStates.push_back(sgs);
25  }
26  }
27  return MultiGaussianState<3>(singleStates);
28  }
dictionary parameters
Definition: Parameters.py:2
Mixture of multi-variate gaussian states.
std::vector< SingleStatePtr > SingleStateContainer
ROOT::Math::SVector< double, 3 > AlgebraicVector3
std::vector< VertexState > components() const
Definition: VertexState.h:61
TrajectoryStateOnSurface GaussianStateConversions::tsosFromMultiGaussianState ( const MultiGaussianState< 5 > &  multiState,
const TrajectoryStateOnSurface  refTsos 
)

Definition at line 31 of file TsosGaussianStateConversions.cc.

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

Referenced by MultiTrajectoryStateMerger::merge().

33  {
34  if ( multiState.components().empty() ) return TrajectoryStateOnSurface();
35  const Surface& surface = refTsos.surface();
36  SurfaceSide side = refTsos.surfaceSide();
37  const MagneticField* field = refTsos.magneticField();
38  TrajectoryStateOnSurface refTsos1 = refTsos.components().front();
39  double pzSign = refTsos1.localParameters().pzSign();
40  bool charged = refTsos1.charge()!=0;
41 
42  const MultiGaussianState<5>::SingleStateContainer& singleStates =
43  multiState.components();
44  std::vector<TrajectoryStateOnSurface> components;
45  components.reserve(singleStates.size());
47  ic!=singleStates.end(); ic++ ) {
48  components.push_back(TrajectoryStateOnSurface(LocalTrajectoryParameters((**ic).mean(),
49  pzSign,charged),
50  LocalTrajectoryError((**ic).covariance()),
51  surface,field,side,(**ic).weight()));
52  }
53  return TrajectoryStateOnSurface(new BasicMultiTrajectoryState(components));
54  }
double pzSign() const
Sign of the z-component of the momentum in the local frame.
const LocalTrajectoryParameters & localParameters() const
const SingleStateContainer & components() const
access to components (single Gaussian states)
const MagneticField * magneticField() const
Mixture of multi-variate gaussian states.
std::vector< SingleStatePtr > SingleStateContainer
const SurfaceType & surface() const
SurfaceSide surfaceSide() const
Position relative to material, defined relative to momentum vector.
std::vector< TrajectoryStateOnSurface > components() const
VertexState GaussianStateConversions::vertexFromMultiGaussianState ( const MultiGaussianState< 3 > &  multiState)

Definition at line 30 of file VertexGaussianStateConversions.cc.

References makeMuonMisalignmentScenario::components, MultiGaussianState< N >::components(), 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)
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
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