CMS 3D CMS Logo

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 );
51  bool s=m.getParameter< bool >("smoothing");
52  VertexSmoother<5> * smoother=nullptr;
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  const ConfFitterBuilder < ConfigurableAdaptiveFitter > t ( "avf", "AdaptiveVertexFitter" );
95 }
T getParameter(std::string const &) const
ConfigurableAdaptiveFitter * clone() const override
void augment(ParameterSet const &from)
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:143
void configure(const edm::ParameterSet &) override
void setParameters(double maxshift=0.0001, double maxlpshift=0.1, unsigned maxstep=30, double weightthreshold=.001)
const VertexFitter< 5 > * theFitter
edm::ParameterSet defaults() const override