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

Definition at line 14 of file SequentialGhostTrackFitter.cc.

15  : maxIteration(15), minDeltaR(0.0015), minDistance(0.002), weightThreshold(0.001) {}

Referenced by clone().

◆ ~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

Implements reco::GhostTrackFitter::FitterImpl.

Definition at line 32 of file SequentialGhostTrackFitter.h.

32 { return new SequentialGhostTrackFitter(*this); }

References SequentialGhostTrackFitter().

◆ 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.

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 }

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

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

◆ 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.

29  {}

Referenced by fit().

◆ reset()

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

Reimplemented in reco::AnnealingGhostTrackFitter.

Definition at line 26 of file SequentialGhostTrackFitter.h.

26 {}

Referenced by fit().

◆ stable()

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

Reimplemented in reco::AnnealingGhostTrackFitter.

Definition at line 17 of file SequentialGhostTrackFitter.cc.

17  {
18  return (sqr(after.sz() - before.sz()) + sqr(after.ip() - before.ip()) < sqr(minDistance) &&
19  sqr(after.eta() - before.eta()) + sqr(after.phi() - before.phi()) < sqr(minDeltaR));
20 }

References reco::GhostTrackPrediction::eta(), reco::GhostTrackPrediction::ip(), minDeltaR, minDistance, reco::GhostTrackPrediction::phi(), sqr(), and reco::GhostTrackPrediction::sz().

Referenced by fit(), and reco::AnnealingGhostTrackFitter::stable().

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

mps_fire.i
i
Definition: mps_fire.py:355
reco::SequentialGhostTrackFitter::SequentialGhostTrackFitter
SequentialGhostTrackFitter()
Definition: SequentialGhostTrackFitter.cc:14
sqr
int sqr(const T &t)
Definition: pfalgo_common_ref.h:9
reco::GhostTrackPrediction::phi
double phi() const
Definition: GhostTrackPrediction.h:51
reco::SequentialGhostTrackFitter::minDeltaR
double minDeltaR
Definition: SequentialGhostTrackFitter.h:35
reco::GhostTrackFitter::PredictionUpdater::update
virtual GhostTrackPrediction update(const GhostTrackPrediction &pred, const GhostTrackState &state, double &ndof, double &chi2) const =0
hltPixelTracks_cff.chi2
chi2
Definition: hltPixelTracks_cff.py:25
reco::GhostTrackState
Definition: GhostTrackState.h:21
reco::SequentialGhostTrackFitter::maxIteration
unsigned int maxIteration
Definition: SequentialGhostTrackFitter.h:34
ndof
Definition: HIMultiTrackSelector.h:49
reco::SequentialGhostTrackFitter::reset
virtual void reset()
Definition: SequentialGhostTrackFitter.h:26
reco::GhostTrackPrediction::ip
double ip() const
Definition: GhostTrackPrediction.h:49
reco::SequentialGhostTrackFitter::minDistance
double minDistance
Definition: SequentialGhostTrackFitter.h:36
reco::SequentialGhostTrackFitter::postFit
virtual void postFit(const GhostTrackFitter::PredictionUpdater &updater, const GhostTrackPrediction &pred, std::vector< GhostTrackState > &states)
Definition: SequentialGhostTrackFitter.h:27
reco::SequentialGhostTrackFitter::stable
virtual bool stable(const GhostTrackPrediction &before, const GhostTrackPrediction &after) const
Definition: SequentialGhostTrackFitter.cc:17
reco::GhostTrackState::linearize
bool linearize(const GhostTrackPrediction &pred, bool initial=false, double lambda=0.)
Definition: GhostTrackState.h:47
reco::GhostTrackPrediction::sz
double sz() const
Definition: GhostTrackPrediction.h:55
reco::GhostTrackPrediction::eta
double eta() const
Definition: GhostTrackPrediction.h:57
reco::SequentialGhostTrackFitter::weightThreshold
double weightThreshold
Definition: SequentialGhostTrackFitter.h:37
bookConverter.prior
prior
Definition: bookConverter.py:146
reco::GhostTrackPrediction
Definition: GhostTrackPrediction.h:21
align_cfg.iteration
iteration
Definition: align_cfg.py:5