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::SequentialGhostTrackFitter ( )

◆ ~SequentialGhostTrackFitter()

reco::SequentialGhostTrackFitter::~SequentialGhostTrackFitter ( )
inlineoverride

Definition at line 16 of file SequentialGhostTrackFitter.h.

16 {}

Member Function Documentation

◆ clone()

FitterImpl* reco::SequentialGhostTrackFitter::clone ( void  ) const
inlineoverrideprivatevirtual

◆ fit()

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 22 of file SequentialGhostTrackFitter.cc.

References isoTrack_cff::chi2, mps_fire::i, align_cfg::iteration, maxIteration, PixelVertexMonitor_cff::ndof, postFit(), bookConverter::prior, reset(), stable(), reco::GhostTrackFitter::PredictionUpdater::update(), and weightThreshold.

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

26  {
27  GhostTrackPrediction pred, lastPred = prior;
28 
29  reset();
30 
31  ndof = 0.;
32  chi2 = 0.;
33 
34  unsigned int iteration = 0;
35  for (;;) {
36  pred = prior;
37 
38  if (states.begin() == states.end())
39  break;
40 
41  if (iteration > 0) {
42  for (unsigned int i = 0; i < states.size(); i++) {
43  GhostTrackState &state = states[i];
44  state.linearize(lastPred);
45  }
46  }
47 
48  ndof = 0.; // prior gives us an initial ndof
49  chi2 = 0.;
50 
51  for (std::vector<GhostTrackState>::const_iterator state = states.begin(); state != states.end(); ++state) {
52  if (state->isValid() && state->weight() > weightThreshold)
53  pred = updater.update(pred, *state, ndof, chi2);
54  }
55 
56  if (++iteration >= maxIteration || stable(lastPred, pred))
57  break;
58 
59  postFit(updater, pred, states);
60 
61  lastPred = pred;
62  }
63 
64  return pred;
65 }
virtual void postFit(const GhostTrackFitter::PredictionUpdater &updater, const GhostTrackPrediction &pred, std::vector< GhostTrackState > &states)
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

◆ postFit()

virtual void reco::SequentialGhostTrackFitter::postFit ( const GhostTrackFitter::PredictionUpdater updater,
const GhostTrackPrediction pred,
std::vector< GhostTrackState > &  states 
)
inlineprotectedvirtual

Reimplemented in reco::AnnealingGhostTrackFitter.

Definition at line 27 of file SequentialGhostTrackFitter.h.

Referenced by fit().

29  {}

◆ reset()

virtual void reco::SequentialGhostTrackFitter::reset ( void  )
inlineprotectedvirtual

Reimplemented in reco::AnnealingGhostTrackFitter.

Definition at line 26 of file SequentialGhostTrackFitter.h.

Referenced by fit().

26 {}

◆ stable()

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

Member Data Documentation

◆ maxIteration

unsigned int reco::SequentialGhostTrackFitter::maxIteration
private

Definition at line 34 of file SequentialGhostTrackFitter.h.

Referenced by fit().

◆ minDeltaR

double reco::SequentialGhostTrackFitter::minDeltaR
private

Definition at line 35 of file SequentialGhostTrackFitter.h.

Referenced by stable().

◆ minDistance

double reco::SequentialGhostTrackFitter::minDistance
private

Definition at line 36 of file SequentialGhostTrackFitter.h.

Referenced by stable().

◆ weightThreshold

double reco::SequentialGhostTrackFitter::weightThreshold
private

Definition at line 37 of file SequentialGhostTrackFitter.h.

Referenced by fit().