test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
 SequentialGhostTrackFitter ()
 
 ~SequentialGhostTrackFitter ()
 
- 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

virtual FitterImpl * clone () const
 

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

Definition at line 16 of file SequentialGhostTrackFitter.h.

16 {}

Member Function Documentation

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

Implements reco::GhostTrackFitter::FitterImpl.

Definition at line 32 of file SequentialGhostTrackFitter.cc.

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

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

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 }
int i
Definition: DBlmapReader.cc:9
virtual bool stable(const GhostTrackPrediction &before, const GhostTrackPrediction &after) const
tuple iteration
Definition: align_cfg.py:5
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
bool linearize(const GhostTrackPrediction &pred, bool initial=false, double lambda=0.)
dictionary prior
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

Reimplemented in reco::AnnealingGhostTrackFitter.

Definition at line 22 of file SequentialGhostTrackFitter.cc.

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

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

25 {
26  return (sqr(after.sz() - before.sz()) +
27  sqr(after.ip() - before.ip()) < sqr(minDistance) &&
28  sqr(after.eta() - before.eta()) +
29  sqr(after.phi() - before.phi()) < sqr(minDeltaR));
30 }
Square< F >::type sqr(const F &f)
Definition: Square.h:13

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