CMS 3D CMS Logo

SequentialGhostTrackFitter.cc
Go to the documentation of this file.
1 #include <vector>
2 
5 
7 
8 using namespace reco;
9 
10 namespace {
11  inline double sqr(double arg) { return arg * arg; }
12 } // namespace
13 
15  : maxIteration(15), minDeltaR(0.0015), minDistance(0.002), weightThreshold(0.001) {}
16 
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 }
21 
24  std::vector<GhostTrackState> &states,
25  double &ndof,
26  double &chi2) {
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 }
GhostTrackPrediction.h
reco::GhostTrackFitter::PredictionUpdater
Definition: GhostTrackFitter.h:42
mps_fire.i
i
Definition: mps_fire.py:428
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
GhostTrackState.h
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
hltPixelTracks_cff.chi2
chi2
Definition: hltPixelTracks_cff.py:25
reco::SequentialGhostTrackFitter::fit
GhostTrackPrediction fit(const GhostTrackFitter::PredictionUpdater &updater, const GhostTrackPrediction &prior, std::vector< GhostTrackState > &states, double &ndof, double &chi2) override
Definition: SequentialGhostTrackFitter.cc:22
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
SequentialGhostTrackFitter.h
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
HLT_FULL_cff.minDeltaR
minDeltaR
Definition: HLT_FULL_cff.py:26279
reco::SequentialGhostTrackFitter::stable
virtual bool stable(const GhostTrackPrediction &before, const GhostTrackPrediction &after) const
Definition: SequentialGhostTrackFitter.cc:17
anotherprimaryvertexanalyzer_cfi.weightThreshold
weightThreshold
Definition: anotherprimaryvertexanalyzer_cfi.py:9
reco::GhostTrackPrediction::sz
double sz() const
Definition: GhostTrackPrediction.h:55
reco::GhostTrackPrediction::eta
double eta() const
Definition: GhostTrackPrediction.h:57
RunInfoPI::state
state
Definition: RunInfoPayloadInspectoHelper.h:16
reco::SequentialGhostTrackFitter::weightThreshold
double weightThreshold
Definition: SequentialGhostTrackFitter.h:37
bookConverter.prior
prior
Definition: bookConverter.py:146
funct::arg
A arg
Definition: Factorize.h:31
reco::GhostTrackPrediction
Definition: GhostTrackPrediction.h:21
align_cfg.iteration
iteration
Definition: align_cfg.py:5