CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
reco::SequentialGhostTrackFitter Class Reference

#include <SequentialGhostTrackFitter.h>

Inheritance diagram for reco::SequentialGhostTrackFitter:
reco::GhostTrackFitter::FitterImpl reco::AnnealingGhostTrackFitter

Public Member Functions

GhostTrackPrediction fit (const GhostTrackFitter::PredictionUpdater &updater, const GhostTrackPrediction &prior, std::vector< GhostTrackState > &states, double &ndof, double &chi2) override
 
 SequentialGhostTrackFitter ()
 
 ~SequentialGhostTrackFitter () override
 
- Public Member Functions inherited from reco::GhostTrackFitter::FitterImpl
virtual ~FitterImpl ()
 

Protected Member Functions

virtual void postFit (const GhostTrackFitter::PredictionUpdater &updater, const GhostTrackPrediction &pred, std::vector< GhostTrackState > &states)
 
virtual void reset ()
 
virtual bool stable (const GhostTrackPrediction &before, const GhostTrackPrediction &after) const
 

Private Member Functions

FitterImpl * clone () const override
 

Private Attributes

unsigned int maxIteration
 
double minDeltaR
 
double minDistance
 
double weightThreshold
 

Detailed Description

Definition at line 13 of file SequentialGhostTrackFitter.h.

Constructor & Destructor Documentation

SequentialGhostTrackFitter::SequentialGhostTrackFitter ( )
reco::SequentialGhostTrackFitter::~SequentialGhostTrackFitter ( )
inlineoverride

Definition at line 16 of file SequentialGhostTrackFitter.h.

References vertices_cff::chi2, fit(), ndof, fftjetcommon_cfi::prior, and stable().

16 {}

Member Function Documentation

FitterImpl* reco::SequentialGhostTrackFitter::clone ( void  ) const
inlineoverrideprivatevirtual
GhostTrackPrediction SequentialGhostTrackFitter::fit ( const GhostTrackFitter::PredictionUpdater updater,
const GhostTrackPrediction prior,
std::vector< GhostTrackState > &  states,
double &  ndof,
double &  chi2 
)
overridevirtual

Implements reco::GhostTrackFitter::FitterImpl.

Definition at line 32 of file SequentialGhostTrackFitter.cc.

References mps_fire::i, align_cfg::iteration, reco::GhostTrackState::linearize(), maxIteration, postFit(), fftjetcommon_cfi::prior, reset(), stable(), reco::GhostTrackFitter::PredictionUpdater::update(), and weightThreshold.

Referenced by trackingPlots.Iteration::modules(), reco::GhostTrackVertexFinder::refitGhostTrack(), and ~SequentialGhostTrackFitter().

37 {
38  GhostTrackPrediction pred, lastPred = prior;
39 
40  reset();
41 
42  ndof = 0.;
43  chi2 = 0.;
44 
45  unsigned int iteration = 0;
46  for(;;) {
47  pred = prior;
48 
49  if (states.begin() == states.end())
50  break;
51 
52  if (iteration > 0) {
53  for(unsigned int i = 0; i < states.size(); i++) {
54  GhostTrackState &state = states[i];
55  state.linearize(lastPred);
56  }
57  }
58 
59  ndof = 0.; // prior gives us an initial ndof
60  chi2 = 0.;
61 
62  for(std::vector<GhostTrackState>::const_iterator state =
63  states.begin(); state != states.end(); ++state) {
64 
65  if (state->isValid() &&
66  state->weight() > weightThreshold)
67  pred = updater.update(pred, *state,
68  ndof, chi2);
69  }
70 
71  if (++iteration >= maxIteration || stable(lastPred, pred))
72  break;
73 
74  postFit(updater, pred, states);
75 
76  lastPred = pred;
77  }
78 
79  return pred;
80 }
virtual GhostTrackPrediction update(const GhostTrackPrediction &pred, const GhostTrackState &state, double &ndof, double &chi2) const =0
virtual bool stable(const GhostTrackPrediction &before, const GhostTrackPrediction &after) const
virtual void postFit(const GhostTrackFitter::PredictionUpdater &updater, const GhostTrackPrediction &pred, std::vector< GhostTrackState > &states)
bool linearize(const GhostTrackPrediction &pred, bool initial=false, double lambda=0.)
virtual void reco::SequentialGhostTrackFitter::postFit ( const GhostTrackFitter::PredictionUpdater updater,
const GhostTrackPrediction pred,
std::vector< GhostTrackState > &  states 
)
inlineprotectedvirtual

Reimplemented in reco::AnnealingGhostTrackFitter.

Definition at line 28 of file SequentialGhostTrackFitter.h.

Referenced by fit().

31  {}
virtual void reco::SequentialGhostTrackFitter::reset ( void  )
inlineprotectedvirtual

Reimplemented in reco::AnnealingGhostTrackFitter.

Definition at line 27 of file SequentialGhostTrackFitter.h.

Referenced by fit().

27 {}
bool SequentialGhostTrackFitter::stable ( const GhostTrackPrediction before,
const GhostTrackPrediction after 
) const
protectedvirtual

Member Data Documentation

unsigned int reco::SequentialGhostTrackFitter::maxIteration
private

Definition at line 37 of file SequentialGhostTrackFitter.h.

Referenced by fit().

double reco::SequentialGhostTrackFitter::minDeltaR
private

Definition at line 38 of file SequentialGhostTrackFitter.h.

Referenced by stable().

double reco::SequentialGhostTrackFitter::minDistance
private

Definition at line 39 of file SequentialGhostTrackFitter.h.

Referenced by stable().

double reco::SequentialGhostTrackFitter::weightThreshold
private

Definition at line 40 of file SequentialGhostTrackFitter.h.

Referenced by fit().