CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
VertexRecoManager.cc
Go to the documentation of this file.
2 
3 using namespace std;
4 
6  const string & name, std::function<AbstractConfReconstructor*()> o, const string & d )
7 {
8  theAbstractConfReconstructors[name]=o;
9  theDescription[name]=d;
10 }
11 
13 {
14 }
15 
17 {
18  auto found = theDescription.find(d);
19  if(found == theDescription.end()) {
20  return std::string();
21  }
22  return found->second;
23 }
24 
26 {
27  return new VertexRecoManager ( * this );
28 }
29 
31 {
32  std::cout << "[VertexRecoManager] copy constructor! Error!" << std::endl;
33  exit(0);
34  /*
35  for ( map < string, AbstractConfReconstructor * >::const_iterator i=o.theAbstractConfReconstructors.begin();
36  i!=o.theAbstractConfReconstructors.end() ; ++i )
37  {
38  theAbstractConfReconstructors[ i->first ] = i->second->clone();
39  }
40 
41  theIsEnabled=o.theIsEnabled;
42  */
43 }
44 
46 {
47  static VertexRecoManager singleton;
48  return singleton;
49 }
50 
51 std::unique_ptr<AbstractConfReconstructor> VertexRecoManager::get ( const string & s ) const
52 {
53  auto found = theAbstractConfReconstructors.find(s);
54  if( found == theAbstractConfReconstructors.end()) {
55  return std::unique_ptr<AbstractConfReconstructor>{};
56  }
57  return std::unique_ptr<AbstractConfReconstructor>{found->second()};
58 }
59 
60 std::vector<std::string> VertexRecoManager::getNames() const
61 {
62  std::vector<std::string> ret;
63  ret.reserve(theAbstractConfReconstructors.size());
64  for(const auto& i : theAbstractConfReconstructors ) {
65  ret.push_back(i.first);
66  }
67  return ret;
68 }
69 
71 {}
int i
Definition: DBlmapReader.cc:9
std::string describe(const std::string &) const
std::unique_ptr< AbstractConfReconstructor > get(const std::string &) const
static VertexRecoManager & Instance()
helper::RootFunctionHelper< F, args >::root_function function(F &f)
Definition: rootFunction.h:14
std::vector< std::string > getNames() const
VertexRecoManager * clone() const
tuple cout
Definition: gather_cfg.py:121
void registerReconstructor(const std::string &name, std::function< AbstractConfReconstructor *()> o, const std::string &description)