CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
AnnealingGhostTrackFitter.cc
Go to the documentation of this file.
1 #include <vector>
2 
4 
7 
9 
10 using namespace reco;
11 
12 namespace {
13  static inline double sqr(double arg) { return arg * arg; }
14 }
15 
17 {
18  annealing.reset(new GeometricAnnealing(3.0, 64.0, 0.25));
19 }
20 
23  const GhostTrackPrediction &pred,
24  std::vector<GhostTrackState> &states)
25 {
26  for(std::vector<GhostTrackState>::iterator state =
27  states.begin(); state != states.end(); ++state) {
28 
29  if (!state->isValid())
30  continue;
31 
32  double ndof, chi2;
33  updater.contribution(pred, *state, ndof, chi2);
34  if (ndof == 0. || firstStep)
35  continue;
36 
37  state->setWeight(annealing->weight(chi2));
38  }
39 
40  if (firstStep)
41  firstStep = false;
42  else
43  annealing->anneal();
44 }
virtual void postFit(const GhostTrackFitter::PredictionUpdater &updater, const GhostTrackPrediction &pred, std::vector< GhostTrackState > &states)
A arg
Definition: Factorize.h:36
virtual void contribution(const GhostTrackPrediction &pred, const GhostTrackState &state, double &ndof, double &chi2, bool withPredError=false) const =0
std::auto_ptr< AnnealingSchedule > annealing
char state
Definition: procUtils.cc:75
Square< F >::type sqr(const F &f)
Definition: Square.h:13