CMS 3D CMS Logo

Enumerations | Functions

MultiGaussianStateTransform Namespace Reference

Enumerations

enum  { N = reco::GsfTrackExtra::dimension }

Functions

MultiGaussianState< N > innerMultiState (const reco::GsfTrack &tk)
MultiGaussianState1D innerMultiState1D (const reco::GsfTrack &tk, unsigned int index)
MultiGaussianState< N > multiState (const std::vector< MultiGaussianState< N >::Vector > &, const std::vector< MultiGaussianState< N >::Matrix > &, const std::vector< double > &)
MultiGaussianState< 5 > multiState (const TrajectoryStateOnSurface)
MultiGaussianState1D multiState1D (const TrajectoryStateOnSurface, unsigned int)
MultiGaussianState1D multiState1D (const std::vector< MultiGaussianState< N >::Vector > &, const std::vector< MultiGaussianState< N >::Matrix > &, const std::vector< double > &, unsigned int)
MultiGaussianState< N > outerMultiState (const reco::GsfTrack &tk)
MultiGaussianState1D outerMultiState1D (const reco::GsfTrack &tk, unsigned int index)
TrajectoryStateOnSurface tsosFromSingleState (const SingleGaussianState< 5 > &, const TrajectoryStateOnSurface)

Enumeration Type Documentation

anonymous enum
Enumerator:
N 

Definition at line 19 of file MultiGaussianStateTransform.h.


Function Documentation

MultiGaussianState< MultiGaussianStateTransform::N > MultiGaussianStateTransform::innerMultiState ( const reco::GsfTrack tk)

Construct a MultiGaussianState from the reco::GsfTrack innermost state (local parameters)

Definition at line 18 of file MultiGaussianStateTransform.cc.

References reco::GsfTrack::gsfExtra(), and multiState().

{
  const reco::GsfTrackExtraRef& extra(tk.gsfExtra());
  return multiState(extra->innerStateLocalParameters(),
               extra->innerStateCovariances(),
               extra->innerStateWeights());
}
MultiGaussianState1D MultiGaussianStateTransform::innerMultiState1D ( const reco::GsfTrack tk,
unsigned int  index 
)

Construct a MultiGaussianState1D for the local parameter corresponding to "index" (0<=index<5) from the reco::GsfTrack innermost state

Definition at line 41 of file MultiGaussianStateTransform.cc.

References Exception, reco::GsfTrack::gsfExtra(), getHLTprescales::index, multiState1D(), and N.

{
  if ( index>=N )  
    throw cms::Exception("LogicError") << "MultiGaussianStateTransform: index out of range";

  const reco::GsfTrackExtraRef& extra(tk.gsfExtra());
  return multiState1D(extra->innerStateLocalParameters(),
                      extra->innerStateCovariances(),
                      extra->innerStateWeights(),
                      index);
}
MultiGaussianState< MultiGaussianStateTransform::N > MultiGaussianStateTransform::multiState ( const std::vector< MultiGaussianState< N >::Vector > &  parameters,
const std::vector< MultiGaussianState< N >::Matrix > &  covariances,
const std::vector< double > &  weights 
)

Construct a MultiGaussianState from the vectors of parameters, covariances and weights

Definition at line 55 of file MultiGaussianStateTransform.cc.

References makeMuonMisalignmentScenario::components, i, and Parameters::parameters.

Referenced by innerMultiState(), MultiTrajectoryStateMerger::merge(), and outerMultiState().

{
  unsigned int nc = parameters.size();
  MultiGaussianState<N>::SingleStateContainer components;
  components.reserve(nc);
  for ( unsigned int i=0; i<nc; ++i ) {
    MultiGaussianState<N>::SingleStatePtr 
      sgs(new MultiGaussianState<N>::SingleState(parameters[i],covariances[i],weights[i]));
    components.push_back(sgs);
  }
  return MultiGaussianState<N>(components);
}
MultiGaussianState< 5 > MultiGaussianStateTransform::multiState ( const TrajectoryStateOnSurface  tsos)

Construct a MultiGaussianState from a TrajectoryStateOnSurface (local parameters)

Definition at line 87 of file MultiGaussianStateTransform.cc.

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

{
  std::vector<TrajectoryStateOnSurface> tsosComponents(tsos.components());
  MultiGaussianState<5>::SingleStateContainer components;
  components.reserve(tsosComponents.size());
  for ( std::vector<TrajectoryStateOnSurface>::const_iterator i=tsosComponents.begin();
        i!=tsosComponents.end(); ++i ) {
    MultiGaussianState<5>::SingleStatePtr 
      sgs(new MultiGaussianState<5>::SingleState(i->localParameters().vector(),
                                                 i->localError().matrix(),
                                                 i->weight()));
    components.push_back(sgs);
  }
  return MultiGaussianState<5>(components);
}
MultiGaussianState1D MultiGaussianStateTransform::multiState1D ( const TrajectoryStateOnSurface  tsos,
unsigned int  index 
)

Construct a MultiGaussianState1D from a TrajectoryStateOnSurface (local parameters)

Definition at line 104 of file MultiGaussianStateTransform.cc.

References makeMuonMisalignmentScenario::components, TrajectoryStateOnSurface::components(), Exception, i, getHLTprescales::index, and N.

{
  if ( index>=N )  
    throw cms::Exception("LogicError") << "MultiGaussianStateTransform: index out of range";
  std::vector<TrajectoryStateOnSurface> tsosComponents(tsos.components());
  MultiGaussianState1D::SingleState1dContainer components;
  components.reserve(tsosComponents.size());
  for ( std::vector<TrajectoryStateOnSurface>::const_iterator i=tsosComponents.begin();
        i!=tsosComponents.end(); ++i ) {
    components.push_back(SingleGaussianState1D(i->localParameters().vector()(index),
                                               i->localError().matrix()(index,index),
                                               i->weight()));
  }
  return MultiGaussianState1D(components);
}
MultiGaussianState1D MultiGaussianStateTransform::multiState1D ( const std::vector< MultiGaussianState< N >::Vector > &  parameters,
const std::vector< MultiGaussianState< N >::Matrix > &  covariances,
const std::vector< double > &  weights,
unsigned int  index 
)
MultiGaussianState< MultiGaussianStateTransform::N > MultiGaussianStateTransform::outerMultiState ( const reco::GsfTrack tk)

Construct a MultiGaussianState from the reco::GsfTrack innermost state (local parameters)

Definition at line 9 of file MultiGaussianStateTransform.cc.

References reco::GsfTrack::gsfExtra(), and multiState().

{
  const reco::GsfTrackExtraRef& extra(tk.gsfExtra());
  return multiState(extra->outerStateLocalParameters(),
                    extra->outerStateCovariances(),
                    extra->outerStateWeights());
}
MultiGaussianState1D MultiGaussianStateTransform::outerMultiState1D ( const reco::GsfTrack tk,
unsigned int  index 
)

Construct a MultiGaussianState1D for the local parameter corresponding to "index" (0<=index<5) from the reco::GsfTrack outermost state

Definition at line 27 of file MultiGaussianStateTransform.cc.

References Exception, reco::GsfTrack::gsfExtra(), getHLTprescales::index, multiState1D(), and N.

{
  if ( index>=N )  
    throw cms::Exception("LogicError") << "MultiGaussianStateTransform: index out of range";

  const reco::GsfTrackExtraRef& extra(tk.gsfExtra());
  return multiState1D(extra->outerStateLocalParameters(),
                      extra->outerStateCovariances(),
                      extra->outerStateWeights(),
                      index);
}
TrajectoryStateOnSurface MultiGaussianStateTransform::tsosFromSingleState ( const SingleGaussianState< 5 > &  singleState,
const TrajectoryStateOnSurface  refTsos 
)

Construct a TrajectoryStateOnSurface from a 5D SingleGaussianState (local parameters) and a reference TSOS (surface, charge, ..)

Definition at line 122 of file MultiGaussianStateTransform.cc.

References SingleGaussianState< N >::covariance(), TrajectoryStateOnSurface::localParameters(), TrajectoryStateOnSurface::magneticField(), SingleGaussianState< N >::mean(), LocalTrajectoryParameters::pzSign(), and TrajectoryStateOnSurface::surface().

{
  const LocalTrajectoryParameters& refPars(refTsos.localParameters());
  double pzSign = refPars.pzSign();
  bool charged = refPars.charge()!=0;
  LocalTrajectoryParameters pars(singleState.mean(),pzSign,charged);
  LocalTrajectoryError errs(singleState.covariance());
  // return state (doesn't use weight of the single state)
  return TrajectoryStateOnSurface(pars,errs,refTsos.surface(),refTsos.magneticField());
}