CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ConfigurableMultiVertexFitter.cc
Go to the documentation of this file.
4 // #include "RecoVertex/ConfigurableVertexReco/interface/ConfigurableTrimmedKalmanFinder.h"
6 
7 namespace {
8  edm::ParameterSet mydefaults()
9  {
11  ret.addParameter<double>("sigmacut",9.0);
12  ret.addParameter<double>("Tini",8.0);
13  ret.addParameter<double>("ratio",0.25);
14  ret.addParameter<int>("cheat",0);
15  edm::ParameterSet nest;
16  nest.addParameter<std::string>("finder","mbs");
17  ret.addParameter<edm::ParameterSet>("ini",nest);
18  return ret;
19  }
20 
21  const AnnealingSchedule * schedule ( const edm::ParameterSet & m )
22  {
23  return new GeometricAnnealing(
24  m.getParameter<double>("sigmacut"),
25  m.getParameter<double>("Tini"),
26  m.getParameter<double>("ratio") );
27  }
28 
29  const VertexReconstructor * initialiser ( const edm::ParameterSet & p )
30  {
31  // std::cout << "[ConfigurableMultiVertexFitter] ini: " << p << std::endl;
32  return new ConfigurableVertexReconstructor ( p );
33  }
34 }
35 
37  theRector ( new MultiVertexReconstructor( MultiVertexBSeeder() ) ),
38  theCheater(0)
39 {}
40 
42  const edm::ParameterSet & n )
43 {
45  m.augment ( mydefaults() );
46  // print ( m );
47  const AnnealingSchedule * ann = schedule ( m );
48  const VertexReconstructor * ini = initialiser ( m.getParameter<edm::ParameterSet>("ini") );
49  if ( theRector ) delete theRector;
50  theRector = new MultiVertexReconstructor( *ini, *ann );
51  theCheater=m.getParameter<int>("cheat");
52  delete ann;
53  delete ini;
54 }
55 
57 {
58  if ( theRector ) delete theRector;
59 }
60 
63  theRector ( o.theRector->clone() ),
64  theCheater(o.theCheater)
65 {}
66 
67 
69 {
70  return new ConfigurableMultiVertexFitter ( *this );
71 }
72 
73 std::vector < TransientVertex > ConfigurableMultiVertexFitter::vertices (
74  const std::vector < reco::TransientTrack > & t,
75  const reco::BeamSpot & s ) const
76 {
77  return theRector->vertices ( t, s );
78 }
79 
80 std::vector < TransientVertex > ConfigurableMultiVertexFitter::vertices (
81  const std::vector < reco::TransientTrack > & prims,
82  const std::vector < reco::TransientTrack > & secs,
83  const reco::BeamSpot & s ) const
84 {
85  return theRector->vertices ( prims, secs, s );
86 }
87 
88 std::vector < TransientVertex > ConfigurableMultiVertexFitter::vertices (
89  const std::vector < reco::TransientTrack > & t ) const
90 {
91  return theRector->vertices ( t );
92 }
93 
95 {
96  return mydefaults();
97 }
98 
100 
101 namespace {
102  ConfRecoBuilder < ConfigurableMultiVertexFitter > t ( "mvf", "Multi Vertex Fitter" );
103 }
T getParameter(std::string const &) const
tuple t
Definition: tree.py:139
void configure(const edm::ParameterSet &)
void augment(ParameterSet const &from)
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:144
MultiVertexReconstructor * clone() const
std::vector< TransientVertex > vertices(const std::vector< reco::TransientTrack > &, const reco::BeamSpot &) const
std::vector< TransientVertex > vertices(const std::vector< reco::TransientTrack > &t) const
ConfigurableMultiVertexFitter * clone() const
const MultiVertexReconstructor * theRector