test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ConfigurableVertexFitter.cc
Go to the documentation of this file.
3 
4 using namespace std;
5 
6 namespace {
7  void errorNoFitter( const string & finder )
8  {
9  cout << "[ConfigurableVertexFitter] got no fitter for \""
10  << finder << "\"" << endl;
11  std::vector<std::string> valid =
13  cout << " Valid fitters are:";
14  for (const auto& i: valid)
15  {
16  cout << " " << i;
17  }
18  cout << endl;
19  throw std::string ( finder + " not available!" );
20  }
21 }
22 
24  const edm::ParameterSet & p ) : theFitter ( 0 )
25 {
26  string fitter=p.getParameter<string>("fitter");
27  theFitter = VertexFitterManager::Instance().get ( fitter ).release();
28  if (!theFitter)
29  {
30  errorNoFitter ( fitter );
31  }
32  theFitter->configure ( p );
33 }
34 
36 {
37  delete theFitter;
38 }
39 
42  theFitter ( o.theFitter->clone() )
43 {}
44 
45 
47 {
48  return new ConfigurableVertexFitter ( *this );
49 }
50 
51 
53  const std::vector < reco::TransientTrack > & t ) const
54 {
55  return theFitter->vertex ( t );
56 }
57 
59  const vector<RefCountedVertexTrack> & tracks) const
60 {
61  return theFitter->vertex ( tracks );
62 }
63 
65  const vector<RefCountedVertexTrack> & tracks,
66  const reco::BeamSpot & spot ) const
67 {
68  return theFitter->vertex ( tracks, spot );
69 }
70 
71 
73  const vector<reco::TransientTrack> & tracks, const GlobalPoint& linPoint) const
74 {
75  return theFitter->vertex ( tracks, linPoint );
76 }
77 
79  const vector<reco::TransientTrack> & tracks, const GlobalPoint& priorPos,
80  const GlobalError& priorError) const
81 {
82  return theFitter->vertex ( tracks, priorPos, priorError );
83 }
84 
86  const vector<reco::TransientTrack> & tracks, const reco::BeamSpot& beamSpot) const
87 {
88  return theFitter->vertex ( tracks, beamSpot );
89 }
90 
91 CachingVertex<5> ConfigurableVertexFitter::vertex(const vector<RefCountedVertexTrack> & tracks,
92  const GlobalPoint& priorPos, const GlobalError& priorError) const
93 {
94  return theFitter->vertex ( tracks, priorPos, priorError );
95 }
96 
ConfigurableVertexFitter(const edm::ParameterSet &)
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &t) const
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &t) const
AbstractConfFitter * clone() const =0
ConfigurableVertexFitter * clone() const
tuple tracks
Definition: testEve_cfg.py:39
std::unique_ptr< AbstractConfFitter > get(const std::string &) const
tuple cout
Definition: gather_cfg.py:121
std::vector< std::string > getNames() const
static VertexFitterManager & Instance()