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 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 10 of file VertexGaussianStateConversions.cc.

References VertexState::components(), ExpressReco_HICollisions_FallBack::parameters, and pos.

Referenced by GsfVertexMerger::merge().

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  }
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(), 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  }
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
SurfaceSide surfaceSide() const
Position relative to material, defined relative to momentum vector.
const Surface & surface() const
std::vector< TrajectoryStateOnSurface > components() const
VertexState GaussianStateConversions::vertexFromMultiGaussianState ( const MultiGaussianState< 3 > &  multiState)

Definition at line 31 of file VertexGaussianStateConversions.cc.

References MultiGaussianState< N >::components(), error, Gflash::par, and position.

Referenced by GsfVertexMerger::merge().

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  }
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
const double par[8 *NPar][4]