test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PositiveSideGhostTrackFitter.cc
Go to the documentation of this file.
1 #include <cmath>
2 #include <vector>
3 
6 
9 
11 
12 using namespace reco;
13 
17  std::vector<GhostTrackState> &states,
18  double &ndof, double &chi2)
19 {
20  double rho = prior.rho();
21  for(unsigned int i = 0; i < states.size(); i++) {
22  GhostTrackState &state = states[i];
23  state.linearize(prior, true, .5 / rho);
24  }
25 
27  actualFitter_->fit(updater, prior, states, ndof, chi2);
28 
29  double origin = pred.lambda(origin_);
30  bool done = true;
31  for(unsigned int i = 0; i < states.size(); i++) {
32  GhostTrackState &state = states[i];
33  double lambda = state.lambda();
34  if (lambda < origin && (origin - lambda) < 3.5) {
35  GhostTrackState testState = state;
36  testState.linearize(pred, 2. * origin - lambda);
37  double ndof, chi2;
38 
39  updater.contribution(prior, testState, ndof, chi2, true);
40  if (ndof > 0. && chi2 < 10.) {
41  state = testState;
42  if (state.weight() != 1.)
43  state.setWeight(3.);
44  done = false;
45  }
46  }
47  }
48 
49  if (!done) {
50  for(unsigned int i = 0; i < states.size(); i++) {
51  GhostTrackState &state = states[i];
52  double lambda = state.lambda();
53  if (state.weight() != 1. && lambda < origin) {
54  double weight =
55  std::exp(10. * (origin - lambda) - .1);
56  state.setWeight(
57  std::min(state.weight(), weight));
58  }
59  }
60 
61  pred = actualFitter_->fit(updater, prior, states, ndof, chi2);
62  }
63 
64  return pred;
65 }
int i
Definition: DBlmapReader.cc:9
std::auto_ptr< GhostTrackFitter::FitterImpl > actualFitter_
double lambda(const GlobalPoint &point) const
double weight() const
void setWeight(double weight)
virtual void contribution(const GhostTrackPrediction &pred, const GhostTrackState &state, double &ndof, double &chi2, bool withPredError=false) const =0
T min(T a, T b)
Definition: MathUtil.h:58
double lambda() const
bool linearize(const GhostTrackPrediction &pred, bool initial=false, double lambda=0.)
GhostTrackPrediction fit(const GhostTrackFitter::PredictionUpdater &updater, const GhostTrackPrediction &prior, std::vector< GhostTrackState > &states, double &ndof, double &chi2)
dictionary prior