CMS 3D CMS Logo

Public Member Functions

GsfMultiStateUpdator Class Reference

#include <GsfMultiStateUpdator.h>

Inheritance diagram for GsfMultiStateUpdator:
TrajectoryStateUpdator

List of all members.

Public Member Functions

virtual GsfMultiStateUpdatorclone () const
 GsfMultiStateUpdator ()
TrajectoryStateOnSurface update (const TrajectoryStateOnSurface &, const TransientTrackingRecHit &) const

Detailed Description

Class which updates a Gaussian mixture trajectory state with the information from a reconstructed hit according to the Gaussian-sum filter (GSF) strategy. The relevant formulas can be derived from those described in R. Fruhwirth, Computer Physics Communications 100 (1997), 1.

Definition at line 16 of file GsfMultiStateUpdator.h.


Constructor & Destructor Documentation

GsfMultiStateUpdator::GsfMultiStateUpdator ( ) [inline]

Definition at line 20 of file GsfMultiStateUpdator.h.

Referenced by clone().

{}

Member Function Documentation

virtual GsfMultiStateUpdator* GsfMultiStateUpdator::clone ( void  ) const [inline, virtual]

Implements TrajectoryStateUpdator.

Definition at line 25 of file GsfMultiStateUpdator.h.

References GsfMultiStateUpdator().

                                               {
    return new GsfMultiStateUpdator(*this);
  }
TrajectoryStateOnSurface GsfMultiStateUpdator::update ( const TrajectoryStateOnSurface tsos,
const TransientTrackingRecHit aRecHit 
) const [virtual]

Implements TrajectoryStateUpdator.

Definition at line 13 of file GsfMultiStateUpdator.cc.

References MultiTrajectoryStateAssembler::addState(), MultiTrajectoryStateAssembler::combinedState(), TrajectoryStateOnSurface::components(), TrajectoryStateOnSurface::globalParameters(), i, TrajectoryStateOnSurface::isValid(), TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localParameters(), GlobalTrajectoryParameters::magneticField(), query::result, TrajectoryStateOnSurface::surface(), KFUpdator::update(), and PosteriorWeightsCalculator::weights().

Referenced by GsfConstraintAtVertex::constrainAtPoint().

                                                                                                    {
  
  std::vector<TrajectoryStateOnSurface> predictedComponents = tsos.components();
  if (predictedComponents.empty()) {
    edm::LogError("GsfMultiStateUpdator") << "Trying to update trajectory state with zero components! " ;
    return TrajectoryStateOnSurface();
  }

  std::vector<double> weights = PosteriorWeightsCalculator(predictedComponents).weights(aRecHit);
  if ( weights.empty() ) {
    edm::LogError("GsfMultiStateUpdator") << " no weights could be retreived. invalid updated state !.";
    return TrajectoryStateOnSurface();
  }

  MultiTrajectoryStateAssembler result;

  int i = 0;
  for (std::vector<TrajectoryStateOnSurface>::const_iterator iter = predictedComponents.begin();
       iter != predictedComponents.end(); iter++) {
    TrajectoryStateOnSurface updatedTSOS = KFUpdator().update(*iter, aRecHit);
    if (updatedTSOS.isValid()){
      result.addState(TrajectoryStateOnSurface(updatedTSOS.localParameters(),
                                               updatedTSOS.localError(), updatedTSOS.surface(), 
                                               &(tsos.globalParameters().magneticField()),
                                               (*iter).surfaceSide(), weights[i]));
    i++;
    }
    else{
      edm::LogError("GsfMultiStateUpdator") << "one of the KF updated state is invalid. skipping.";
    }

  }

  return result.combinedState();
}