00001 #include "RecoVertex/ConfigurableVertexReco/interface/VertexFitterManager.h" 00002 #include "RecoVertex/ConfigurableVertexReco/interface/VertexRecoManager.h" 00003 #include "RecoVertex/ConfigurableVertexReco/interface/ReconstructorFromFitter.h" 00004 00005 using namespace std; 00006 00007 void VertexFitterManager::registerFitter ( 00008 const string & name, AbstractConfFitter * o, const string & d ) 00009 { 00010 theAbstractConfFitters[name]=o; 00011 theDescription[name]=d; 00012 00013 // every fitter registers as a reconstructor, also 00014 VertexRecoManager::Instance().registerReconstructor ( name, new ReconstructorFromFitter ( *o ), d); 00015 } 00016 00017 VertexFitterManager::~VertexFitterManager() 00018 { 00019 /* 00020 * Let the VertexRecoManager delete them (they all register there, as well!) 00021 for ( map < string, AbstractConfFitter * >::iterator i=theAbstractConfFitters.begin(); 00022 i!=theAbstractConfFitters.end() ; ++i ) 00023 { 00024 delete i->second; 00025 }*/ 00026 } 00027 00028 std::string VertexFitterManager::describe ( const std::string & d ) 00029 { 00030 return theDescription[d]; 00031 } 00032 00033 VertexFitterManager * VertexFitterManager::clone() const 00034 { 00035 return new VertexFitterManager ( * this ); 00036 } 00037 00038 VertexFitterManager::VertexFitterManager ( const VertexFitterManager & o ) 00039 { 00040 std::cout << "[VertexFitterManager] copy constructor! Error!" << std::endl; 00041 exit(0); 00042 /* 00043 for ( map < string, AbstractConfFitter * >::const_iterator i=o.theAbstractConfFitters.begin(); 00044 i!=o.theAbstractConfFitters.end() ; ++i ) 00045 { 00046 theAbstractConfFitters[ i->first ] = i->second->clone(); 00047 } 00048 00049 theIsEnabled=o.theIsEnabled; 00050 */ 00051 } 00052 00053 VertexFitterManager & VertexFitterManager::Instance() 00054 { 00055 static VertexFitterManager singleton; 00056 return singleton; 00057 } 00058 00059 AbstractConfFitter * VertexFitterManager::get ( const string & s ) 00060 { 00061 return theAbstractConfFitters[s]; 00062 } 00063 00064 map < string, AbstractConfFitter * > VertexFitterManager::get() 00065 { 00066 return theAbstractConfFitters; 00067 } 00068 00069 VertexFitterManager::VertexFitterManager() 00070 {}