CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Types
KFSplittingFitter Class Reference

#include <KFSplittingFitter.h>

Inheritance diagram for KFSplittingFitter:
KFTrajectoryFitter TrajectoryFitter

Public Member Functions

virtual KFSplittingFitterclone () const
 
virtual std::vector< Trajectoryfit (const Trajectory &aTraj) const
 
virtual std::vector< Trajectoryfit (const TrajectorySeed &aSeed, const RecHitContainer &hits, const TSOS &firstPredTsos) const
 
 KFSplittingFitter (const Propagator &aPropagator, const TrajectoryStateUpdator &aUpdator, const MeasurementEstimator &aEstimator)
 
 KFSplittingFitter (const Propagator *aPropagator, const TrajectoryStateUpdator *aUpdator, const MeasurementEstimator *aEstimator)
 
- Public Member Functions inherited from KFTrajectoryFitter
const MeasurementEstimatorestimator () const
 
virtual std::vector< Trajectoryfit (const TrajectorySeed &aSeed, const RecHitContainer &hits) const
 
 KFTrajectoryFitter (const Propagator &aPropagator, const TrajectoryStateUpdator &aUpdator, const MeasurementEstimator &aEstimator, int minHits=3, const DetLayerGeometry *detLayerGeometry=0)
 
 KFTrajectoryFitter (const Propagator *aPropagator, const TrajectoryStateUpdator *aUpdator, const MeasurementEstimator *aEstimator, int minHits=3, const DetLayerGeometry *detLayerGeometry=0)
 
const Propagatorpropagator () const
 
const TrajectoryStateUpdatorupdator () const
 
 ~KFTrajectoryFitter ()
 
- Public Member Functions inherited from TrajectoryFitter
virtual std::vector< Trajectoryfit (const Trajectory &traj, fitType type) const
 
virtual std::vector< Trajectoryfit (const TrajectorySeed &seed, const RecHitContainer &hits, fitType type) const
 
virtual std::vector< Trajectoryfit (const TrajectorySeed &seed, const RecHitContainer &hits, const TrajectoryStateOnSurface &tsos, fitType type) const
 
virtual ~TrajectoryFitter ()
 

Private Types

typedef FreeTrajectoryState FTS
 
typedef TrajectoryMeasurement TM
 
typedef TrajectoryStateOnSurface TSOS
 

Additional Inherited Members

- Public Types inherited from TrajectoryFitter
enum  fitType { standard =0, looper =1 }
 
typedef Trajectory::RecHitContainer RecHitContainer
 
typedef TrajectoryFitterRecord Record
 

Detailed Description

Definition at line 15 of file KFSplittingFitter.h.

Member Typedef Documentation

Definition at line 20 of file KFSplittingFitter.h.

Definition at line 21 of file KFSplittingFitter.h.

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().

27  :
28  KFTrajectoryFitter(aPropagator, aUpdator, aEstimator) {}
KFTrajectoryFitter(const Propagator &aPropagator, const TrajectoryStateUpdator &aUpdator, const MeasurementEstimator &aEstimator, int minHits=3, const DetLayerGeometry *detLayerGeometry=0)
KFSplittingFitter::KFSplittingFitter ( const Propagator aPropagator,
const TrajectoryStateUpdator aUpdator,
const MeasurementEstimator aEstimator 
)
inline

Definition at line 31 of file KFSplittingFitter.h.

33  :
34  KFTrajectoryFitter(aPropagator, aUpdator, aEstimator) {}
KFTrajectoryFitter(const Propagator &aPropagator, const TrajectoryStateUpdator &aUpdator, const MeasurementEstimator &aEstimator, int minHits=3, const DetLayerGeometry *detLayerGeometry=0)

Member Function Documentation

virtual KFSplittingFitter* KFSplittingFitter::clone ( void  ) const
inlinevirtual

Reimplemented from KFTrajectoryFitter.

Definition at line 36 of file KFSplittingFitter.h.

References KFTrajectoryFitter::estimator(), KFSplittingFitter(), KFTrajectoryFitter::propagator(), and KFTrajectoryFitter::updator().

36  {
38  }
const TrajectoryStateUpdator * updator() const
const MeasurementEstimator * estimator() const
KFSplittingFitter(const Propagator &aPropagator, const TrajectoryStateUpdator &aUpdator, const MeasurementEstimator &aEstimator)
const Propagator * propagator() const
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(), KFTrajectoryFitter::fit(), TrajectoryMeasurement::predictedState(), Trajectory::recHits(), query::result, Trajectory::seed(), RecHitSorter::sortHits(), and RecHitSplitter::split().

7  {
8 
10 
11  if(aTraj.empty()) return std::vector<Trajectory>();
12 
13  TM firstTM = aTraj.firstMeasurement();
14  TSOS firstTsos =
15  TrajectoryStateWithArbitraryError()(firstTM.predictedState());
16 
17  RecHitContainer hits = aTraj.recHits();
18  RecHitContainer result;
19  result.reserve(hits.size());
20  for(RecHitContainer::iterator ihit = hits.begin(); ihit != hits.end();
21  ihit++) {
22  if(!(**ihit).isValid()) result.push_back(*ihit);
23  else if((**ihit).transientHits().size() == 1) result.push_back(*ihit);
24  else {
25  RecHitContainer splitted = RecHitSplitter().split((**ihit).transientHits());
26  RecHitContainer sorted =
27  RecHitSorter().sortHits(splitted, aTraj.direction());
28  for (RecHitContainer::iterator srt = sorted.begin(); srt != sorted.end(); srt++) {
29  result.push_back(*srt);
30  // result.insert(result.end(), sorted.begin(), sorted.end());
31  }
32  }
33  }
34 
35 
36  return KFTrajectoryFitter::fit(aTraj.seed(), result, firstTsos);
37 
38 }
bool empty() const
True if trajectory has no measurements.
Definition: Trajectory.h:234
TransientTrackingRecHit::ConstRecHitContainer RecHitContainer
TrajectorySeed const & seed() const
Access to the seed used to reconstruct the Trajectory.
Definition: Trajectory.h:265
RecHitContainer sortHits(const RecHitContainer &hits, const PropagationDirection &dir) const
Definition: RecHitSorter.cc:6
ConstRecHitContainer recHits(bool splitting=false) const
Definition: Trajectory.cc:67
PropagationDirection const & direction() const
Definition: Trajectory.cc:195
virtual std::vector< Trajectory > fit(const Trajectory &aTraj) const
tuple result
Definition: query.py:137
RecHitContainer split(const RecHitContainer &hits) const
TrajectoryMeasurement const & firstMeasurement() const
Definition: Trajectory.h:194
TrajectoryMeasurement TM
Trajectory::RecHitContainer RecHitContainer
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(), KFTrajectoryFitter::fit(), query::result, RecHitSorter::sortHits(), and RecHitSplitter::split().

42  {
43 
45  result.reserve(hits.size());
46  for(RecHitContainer::const_iterator ihit = hits.begin(); ihit != hits.end();
47  ihit++) {
48  if(!(**ihit).isValid()) result.push_back(*ihit);
49  else if((**ihit).transientHits().size() == 1) result.push_back(*ihit);
50  else {
51  RecHitContainer splitted = RecHitSplitter().split((**ihit).transientHits());
52  RecHitContainer sorted =
53  RecHitSorter().sortHits(splitted, aSeed.direction());
54  for (RecHitContainer::iterator srt = sorted.begin(); srt != sorted.end(); srt++) {
55  result.push_back(*srt);
56  // result.insert(result.end(), sorted.begin(), sorted.end());
57  }
58  }
59  }
60 
61  return KFTrajectoryFitter::fit(aSeed, result, firstPredTsos);
62 
63 }
PropagationDirection direction() const
RecHitContainer sortHits(const RecHitContainer &hits, const PropagationDirection &dir) const
Definition: RecHitSorter.cc:6
virtual std::vector< Trajectory > fit(const Trajectory &aTraj) const
tuple result
Definition: query.py:137
RecHitContainer split(const RecHitContainer &hits) const
Trajectory::RecHitContainer RecHitContainer