CMS 3D CMS Logo

Public Member Functions | Private Types

KFSplittingFitter Class Reference

#include <KFSplittingFitter.h>

Inheritance diagram for KFSplittingFitter:
KFTrajectoryFitter TrajectoryFitter

List of all members.

Public Member Functions

virtual KFSplittingFitterclone () const
virtual std::vector< Trajectoryfit (const TrajectorySeed &aSeed, const RecHitContainer &hits, const TSOS &firstPredTsos) const
virtual std::vector< Trajectoryfit (const Trajectory &aTraj) const
 KFSplittingFitter (const Propagator &aPropagator, const TrajectoryStateUpdator &aUpdator, const MeasurementEstimator &aEstimator)
 KFSplittingFitter (const Propagator *aPropagator, const TrajectoryStateUpdator *aUpdator, const MeasurementEstimator *aEstimator)

Private Types

typedef FreeTrajectoryState FTS
typedef TrajectoryMeasurement TM
typedef TrajectoryStateOnSurface TSOS

Detailed Description

Definition at line 15 of file KFSplittingFitter.h.


Member Typedef Documentation

Reimplemented from KFTrajectoryFitter.

Definition at line 20 of file KFSplittingFitter.h.

Reimplemented from KFTrajectoryFitter.

Definition at line 21 of file KFSplittingFitter.h.

Reimplemented from KFTrajectoryFitter.

Definition at line 19 of file KFSplittingFitter.h.


Constructor & Destructor Documentation

KFSplittingFitter::KFSplittingFitter ( const Propagator aPropagator,
const TrajectoryStateUpdator aUpdator,
const MeasurementEstimator aEstimator 
) [inline]

Definition at line 25 of file KFSplittingFitter.h.

Referenced by clone().

                                                            :
    KFTrajectoryFitter(aPropagator, aUpdator, aEstimator) {}
KFSplittingFitter::KFSplittingFitter ( const Propagator aPropagator,
const TrajectoryStateUpdator aUpdator,
const MeasurementEstimator aEstimator 
) [inline]

Definition at line 31 of file KFSplittingFitter.h.

                                                            : 
    KFTrajectoryFitter(aPropagator, aUpdator, aEstimator) {}

Member Function Documentation

virtual KFSplittingFitter* KFSplittingFitter::clone ( void  ) const [inline, virtual]
std::vector< Trajectory > KFSplittingFitter::fit ( const TrajectorySeed aSeed,
const RecHitContainer hits,
const TSOS firstPredTsos 
) const [virtual]

Reimplemented from KFTrajectoryFitter.

Definition at line 40 of file KFSplittingFitter.cc.

References TrajectorySeed::direction(), fit(), query::result, RecHitSorter::sortHits(), and RecHitSplitter::split().

                                                                                {

  RecHitContainer result;
  result.reserve(hits.size());
  for(RecHitContainer::const_iterator ihit = hits.begin(); ihit != hits.end();
      ihit++) {
    if(!(**ihit).isValid()) result.push_back(*ihit);
    else if((**ihit).transientHits().size() == 1) result.push_back(*ihit);
    else {      
      RecHitContainer splitted = RecHitSplitter().split((**ihit).transientHits());
      RecHitContainer sorted = 
        RecHitSorter().sortHits(splitted, aSeed.direction());
      for (RecHitContainer::iterator srt = sorted.begin(); srt != sorted.end(); srt++) {
        result.push_back(*srt);
        //      result.insert(result.end(), sorted.begin(), sorted.end());
      }
    }
  }
  
  return KFTrajectoryFitter::fit(aSeed, result, firstPredTsos);
  
}
std::vector< Trajectory > KFSplittingFitter::fit ( const Trajectory aTraj) const [virtual]

Reimplemented from KFTrajectoryFitter.

Definition at line 7 of file KFSplittingFitter.cc.

References Trajectory::direction(), Trajectory::empty(), Trajectory::firstMeasurement(), TrajectoryMeasurement::predictedState(), Trajectory::recHits(), query::result, Trajectory::seed(), RecHitSorter::sortHits(), and RecHitSplitter::split().

Referenced by fit().

                                                                          {
  
  typedef RecHitSplitter::RecHitContainer        RecHitContainer;
  
  if(aTraj.empty()) return std::vector<Trajectory>();
  
  TM firstTM = aTraj.firstMeasurement();
  TSOS firstTsos = 
    TrajectoryStateWithArbitraryError()(firstTM.predictedState());
  
  RecHitContainer hits = aTraj.recHits();
  RecHitContainer result; 
  result.reserve(hits.size());
  for(RecHitContainer::iterator ihit = hits.begin(); ihit != hits.end();
      ihit++) {
    if(!(**ihit).isValid()) result.push_back(*ihit);
    else if((**ihit).transientHits().size() == 1) result.push_back(*ihit);
    else {
      RecHitContainer splitted = RecHitSplitter().split((**ihit).transientHits());
      RecHitContainer sorted = 
        RecHitSorter().sortHits(splitted, aTraj.direction());
      for (RecHitContainer::iterator srt = sorted.begin(); srt != sorted.end(); srt++) {
        result.push_back(*srt);
        //      result.insert(result.end(), sorted.begin(), sorted.end());
      }
    }
  }
  

  return KFTrajectoryFitter::fit(aTraj.seed(), result, firstTsos);
  
}