CMS 3D CMS Logo

VertexFitterManager.cc
Go to the documentation of this file.
5 
6 using namespace std;
7 
9  theAbstractConfFitters[name] = o;
10  theDescription[name] = d;
11 
12  // every fitter registers as a reconstructor, also
15  //ReconstructorFromFitter clones the object passed
16  std::unique_ptr<AbstractConfFitter> t{o()};
17  return new ReconstructorFromFitter(std::move(t));
18  },
19  d);
20 }
21 
23 
25  auto found = theDescription.find(d);
26  if (found == theDescription.end()) {
27  return std::string{};
28  }
29  return found->first;
30 }
31 
33 
35  std::cout << "[VertexFitterManager] copy constructor! Error!" << std::endl;
36  exit(0);
37  /*
38  for ( map < string, AbstractConfFitter * >::const_iterator i=o.theAbstractConfFitters.begin();
39  i!=o.theAbstractConfFitters.end() ; ++i )
40  {
41  theAbstractConfFitters[ i->first ] = i->second->clone();
42  }
43 
44  theIsEnabled=o.theIsEnabled;
45  */
46 }
47 
49  //The singleton's internal structure only changes while
50  // this library is being loaded. All other methods are const.
51 
53  return singleton;
54 }
55 
56 std::unique_ptr<AbstractConfFitter> VertexFitterManager::get(const string& s) const {
57  auto found = theAbstractConfFitters.find(s);
58  if (found == theAbstractConfFitters.end()) {
59  return std::unique_ptr<AbstractConfFitter>{};
60  }
61  return std::unique_ptr<AbstractConfFitter>{found->second()};
62 }
63 
64 std::vector<std::string> VertexFitterManager::getNames() const {
65  std::vector<std::string> ret;
66  ret.reserve(theAbstractConfFitters.size());
67 
68  for (const auto& i : theAbstractConfFitters) {
69  ret.push_back(i.first);
70  }
71  return ret;
72 }
73 
ret
prodAgent to be discontinued
static VertexRecoManager & Instance()
#define CMS_THREAD_SAFE
d
Definition: ztail.py:151
void registerFitter(const std::string &name, std::function< AbstractConfFitter *()> o, const std::string &description)
VertexFitterManager * clone() const
std::unique_ptr< AbstractConfFitter > get(const std::string &) const
std::vector< std::string > getNames() const
void registerReconstructor(const std::string &name, std::function< AbstractConfReconstructor *()> o, const std::string &description)
static VertexFitterManager & Instance()
std::string describe(const std::string &) const
def move(src, dest)
Definition: eostools.py:511
def exit(msg="")