CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
VertexRecoManager.cc
Go to the documentation of this file.
3 
4 using namespace std;
5 
8  const string& d) {
9  theAbstractConfReconstructors[name] = o;
10  theDescription[name] = d;
11 }
12 
14 
16  auto found = theDescription.find(d);
17  if (found == theDescription.end()) {
18  return std::string();
19  }
20  return found->second;
21 }
22 
24 
26  std::cout << "[VertexRecoManager] copy constructor! Error!" << std::endl;
27  exit(0);
28  /*
29  for ( map < string, AbstractConfReconstructor * >::const_iterator i=o.theAbstractConfReconstructors.begin();
30  i!=o.theAbstractConfReconstructors.end() ; ++i )
31  {
32  theAbstractConfReconstructors[ i->first ] = i->second->clone();
33  }
34 
35  theIsEnabled=o.theIsEnabled;
36  */
37 }
38 
40  //The singleton's internal structure only changes while
41  // this library is being loaded. All other methods are const.
42  CMS_THREAD_SAFE static VertexRecoManager singleton;
43  return singleton;
44 }
45 
46 std::unique_ptr<AbstractConfReconstructor> VertexRecoManager::get(const string& s) const {
47  auto found = theAbstractConfReconstructors.find(s);
48  if (found == theAbstractConfReconstructors.end()) {
49  return std::unique_ptr<AbstractConfReconstructor>{};
50  }
51  return std::unique_ptr<AbstractConfReconstructor>{found->second()};
52 }
53 
54 std::vector<std::string> VertexRecoManager::getNames() const {
55  std::vector<std::string> ret;
56  ret.reserve(theAbstractConfReconstructors.size());
57  for (const auto& i : theAbstractConfReconstructors) {
58  ret.push_back(i.first);
59  }
60  return ret;
61 }
62 
tuple ret
prodAgent to be discontinued
std::string describe(const std::string &) const
std::unique_ptr< AbstractConfReconstructor > get(const std::string &) const
static VertexRecoManager & Instance()
tuple d
Definition: ztail.py:151
string function
Definition: callgraph.py:50
#define CMS_THREAD_SAFE
std::vector< std::string > getNames() const
VertexRecoManager * clone() const
tuple cout
Definition: gather_cfg.py:144
void registerReconstructor(const std::string &name, std::function< AbstractConfReconstructor *()> o, const std::string &description)