CMS 3D CMS Logo

VertexRecoManager.cc
Go to the documentation of this file.
3 
4 using namespace std;
5 
7  const string & name, std::function<AbstractConfReconstructor*()> o, const string & d )
8 {
9  theAbstractConfReconstructors[name]=o;
10  theDescription[name]=d;
11 }
12 
14 {
15 }
16 
18 {
19  auto found = theDescription.find(d);
20  if(found == theDescription.end()) {
21  return std::string();
22  }
23  return found->second;
24 }
25 
27 {
28  return new VertexRecoManager ( * this );
29 }
30 
32 {
33  std::cout << "[VertexRecoManager] copy constructor! Error!" << std::endl;
34  exit(0);
35  /*
36  for ( map < string, AbstractConfReconstructor * >::const_iterator i=o.theAbstractConfReconstructors.begin();
37  i!=o.theAbstractConfReconstructors.end() ; ++i )
38  {
39  theAbstractConfReconstructors[ i->first ] = i->second->clone();
40  }
41 
42  theIsEnabled=o.theIsEnabled;
43  */
44 }
45 
47 {
48  //The singleton's internal structure only changes while
49  // this library is being loaded. All other methods are const.
51  return singleton;
52 }
53 
54 std::unique_ptr<AbstractConfReconstructor> VertexRecoManager::get ( const string & s ) const
55 {
56  auto found = theAbstractConfReconstructors.find(s);
57  if( found == theAbstractConfReconstructors.end()) {
58  return std::unique_ptr<AbstractConfReconstructor>{};
59  }
60  return std::unique_ptr<AbstractConfReconstructor>{found->second()};
61 }
62 
63 std::vector<std::string> VertexRecoManager::getNames() const
64 {
65  std::vector<std::string> ret;
66  ret.reserve(theAbstractConfReconstructors.size());
67  for(const auto& i : theAbstractConfReconstructors ) {
68  ret.push_back(i.first);
69  }
70  return ret;
71 }
72 
74 {}
std::string describe(const std::string &) const
std::unique_ptr< AbstractConfReconstructor > get(const std::string &) const
static VertexRecoManager & Instance()
#define CMS_THREAD_SAFE
std::vector< std::string > getNames() const
VertexRecoManager * clone() const
void registerReconstructor(const std::string &name, std::function< AbstractConfReconstructor *()> o, const std::string &description)