CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
14  name,
16  //ReconstructorFromFitter clones the object passed
17  std::unique_ptr<AbstractConfFitter> t{o()};
18  return new ReconstructorFromFitter(std::move(t));
19  },
20  d);
21 }
22 
24 
26  auto found = theDescription.find(d);
27  if (found == theDescription.end()) {
28  return std::string{};
29  }
30  return found->first;
31 }
32 
34 
36  std::cout << "[VertexFitterManager] copy constructor! Error!" << std::endl;
37  exit(0);
38  /*
39  for ( map < string, AbstractConfFitter * >::const_iterator i=o.theAbstractConfFitters.begin();
40  i!=o.theAbstractConfFitters.end() ; ++i )
41  {
42  theAbstractConfFitters[ i->first ] = i->second->clone();
43  }
44 
45  theIsEnabled=o.theIsEnabled;
46  */
47 }
48 
50  //The singleton's internal structure only changes while
51  // this library is being loaded. All other methods are const.
52 
53  CMS_THREAD_SAFE static VertexFitterManager singleton;
54  return singleton;
55 }
56 
57 std::unique_ptr<AbstractConfFitter> VertexFitterManager::get(const string& s) const {
58  auto found = theAbstractConfFitters.find(s);
59  if (found == theAbstractConfFitters.end()) {
60  return std::unique_ptr<AbstractConfFitter>{};
61  }
62  return std::unique_ptr<AbstractConfFitter>{found->second()};
63 }
64 
65 std::vector<std::string> VertexFitterManager::getNames() const {
66  std::vector<std::string> ret;
67  ret.reserve(theAbstractConfFitters.size());
68 
69  for (const auto& i : theAbstractConfFitters) {
70  ret.push_back(i.first);
71  }
72  return ret;
73 }
74 
tuple ret
prodAgent to be discontinued
static VertexRecoManager & Instance()
tuple d
Definition: ztail.py:151
string function
Definition: callgraph.py:50
def move
Definition: eostools.py:511
#define CMS_THREAD_SAFE
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
tuple cout
Definition: gather_cfg.py:144
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