CMS 3D CMS Logo

ConfigurableVertexReconstructor.cc
Go to the documentation of this file.
4 
5 using namespace std;
6 
7 namespace {
8  void errorNoReconstructor( const string & finder )
9  {
10  edm::LogError ( "ConfigurableVertexReconstructor") << "got no reconstructor for \""
11  << finder << "\"";
12  vector <string> valid =
14  cout << " Valid reconstructors are:";
15  for (const auto& i : valid)
16  {
17  cout <<" "<<i;
18  }
19  cout << endl;
20  throw std::string ( finder + " not available!" );
21  }
22 }
23 
25  const edm::ParameterSet & p ) : theRector ( 0 )
26 {
27  string finder=p.getParameter<string>("finder");
28  theRector = VertexRecoManager::Instance().get ( finder ).release();
29  if (!theRector)
30  {
31  errorNoReconstructor ( finder );
32  }
33  theRector->configure ( p );
34  // theRector = theRector->clone();
35  // theRector = new ReconstructorFromFitter ( KalmanVertexFitter() );
36 }
37 
39 {
40  delete theRector;
41 }
42 
45  theRector ( o.theRector->clone() )
46 {}
47 
48 
50 {
51  return new ConfigurableVertexReconstructor ( *this );
52 }
53 
54 vector < TransientVertex > ConfigurableVertexReconstructor::vertices (
55  const std::vector < reco::TransientTrack > & prims,
56  const std::vector < reco::TransientTrack > & secs,
57  const reco::BeamSpot & s ) const
58 {
59  return theRector->vertices ( prims, secs, s );
60 }
61 
62 vector < TransientVertex > ConfigurableVertexReconstructor::vertices (
63  const std::vector < reco::TransientTrack > & t,
64  const reco::BeamSpot & s ) const
65 {
66  return theRector->vertices ( t, s );
67 }
68 
69 vector < TransientVertex > ConfigurableVertexReconstructor::vertices (
70  const std::vector < reco::TransientTrack > & t ) const
71 {
72  return theRector->vertices ( t );
73 }
T getParameter(std::string const &) const
std::unique_ptr< AbstractConfReconstructor > get(const std::string &) const
static VertexRecoManager & Instance()
std::vector< TransientVertex > vertices(const std::vector< reco::TransientTrack > &) const
std::vector< std::string > getNames() const
virtual std::vector< TransientVertex > vertices(const std::vector< reco::TransientTrack > &) const =0
ConfigurableVertexReconstructor(const edm::ParameterSet &)
AbstractConfReconstructor * clone() const =0
ConfigurableVertexReconstructor * clone() const