CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ConfigurableAdaptiveFitter.cc
Go to the documentation of this file.
6 // #include "RecoVertex/LinearizationPointFinders/interface/GenericLinearizationPointFinder.h"
7 // #include "RecoVertex/KalmanVertexFit/interface/KalmanVertexFitter.h"
8 // #include "RecoVertex/LinearizationPointFinders/interface/ZeroLinearizationPointFinder.h"
15 
16 using namespace std;
17 
18 namespace {
19  edm::ParameterSet mydefaults()
20  {
22  ret.addParameter<string>("annealing", "geom" );
23  ret.addParameter<bool>("smoothing", true );
24  ret.addParameter<double>("sigmacut",3.0);
25  ret.addParameter<double>("Tini",256.0);
26  ret.addParameter<double>("ratio",0.25);
27 
28  ret.addParameter<double>("maxshift",0.0001);
29  ret.addParameter<double>("maxlpshift",0.1);
30  ret.addParameter<int>("maxstep",30);
31  ret.addParameter<double>("weightthreshold",0.001);
32  return ret;
33  }
34 }
35 
38 {}
39 
41  const edm::ParameterSet & n )
42 {
44  m.augment ( mydefaults() );
45  ConfigurableAnnealing ann ( m );
47  // ZeroLinearizationPointFinder linpt;
48  // KalmanVertexFitter kvf;
49  // GenericLinearizationPointFinder linpt ( kvf );
50  KalmanVertexUpdator<5> updator;
51  bool s=m.getParameter< bool >("smoothing");
52  VertexSmoother<5> * smoother=0;
53  if ( s )
54  {
55  smoother = new KalmanVertexSmoother ();
56  } else {
57  smoother = new DummyVertexSmoother<5> ();
58  }
60 
61  if (theFitter) delete theFitter;
62  AdaptiveVertexFitter * fitter = new AdaptiveVertexFitter ( ann, linpt, updator, estimator, *smoother );
63  delete smoother;
64  fitter->setParameters ( m );
65  theFitter=fitter;
66 }
67 
69 {
70  /*
71  if (theFitter) delete theFitter;
72  theFitter=0;
73  */
74 }
75 
78  AbstractConfFitter ( o )
79 {}
80 
82 {
83  return new ConfigurableAdaptiveFitter ( *this );
84 }
85 
87 {
88  return mydefaults();
89 }
90 
92 
93 namespace {
94  ConfFitterBuilder < ConfigurableAdaptiveFitter > t ( "avf", "AdaptiveVertexFitter" );
95 }
T getParameter(std::string const &) const
void configure(const edm::ParameterSet &)
void augment(ParameterSet const &from)
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:145
edm::ParameterSet defaults() const
void setParameters(double maxshift=0.0001, double maxlpshift=0.1, unsigned maxstep=30, double weightthreshold=.001)
ConfigurableAdaptiveFitter * clone() const
const VertexFitter< 5 > * theFitter