CMS 3D CMS Logo

ConfigurableVertexFitter.cc

Go to the documentation of this file.
00001 #include "RecoVertex/ConfigurableVertexReco/interface/ConfigurableVertexFitter.h"
00002 #include "RecoVertex/ConfigurableVertexReco/interface/VertexFitterManager.h"
00003 
00004 using namespace std;
00005 
00006 namespace {
00007   void errorNoFitter( const string & finder )
00008   {
00009     cout << "[ConfigurableVertexFitter] got no fitter for \""
00010          << finder << "\"" << endl;
00011     map < string, AbstractConfFitter * > valid = 
00012       VertexFitterManager::Instance().get();
00013     cout << "  Valid fitters are:";
00014     for ( map < string, AbstractConfFitter * >::const_iterator i=valid.begin(); 
00015           i!=valid.end() ; ++i )
00016     {
00017       if ( i->second ) cout << "  " << i->first;
00018     }
00019     cout << endl;
00020     throw std::string ( finder + " not available!" );
00021   }
00022 }
00023 
00024 ConfigurableVertexFitter::ConfigurableVertexFitter ( 
00025     const edm::ParameterSet & p ) : theFitter ( 0 )
00026 {
00027   string fitter=p.getParameter<string>("fitter");
00028   theFitter = VertexFitterManager::Instance().get ( fitter );
00029   if (!theFitter)
00030   {
00031     errorNoFitter ( fitter );
00032   }
00033   theFitter->configure ( p );
00034 }
00035 
00036 ConfigurableVertexFitter::~ConfigurableVertexFitter()
00037 {
00038 }
00039 
00040 ConfigurableVertexFitter::ConfigurableVertexFitter 
00041     ( const ConfigurableVertexFitter & o ) :
00042   theFitter ( o.theFitter->clone() )
00043 {}
00044 
00045 
00046 ConfigurableVertexFitter * ConfigurableVertexFitter::clone() const
00047 {
00048   return new ConfigurableVertexFitter ( *this );
00049 }
00050 
00051 
00052 CachingVertex<5> ConfigurableVertexFitter::vertex ( 
00053     const std::vector < reco::TransientTrack > & t ) const
00054 {
00055   return theFitter->vertex ( t );
00056 }
00057 
00058 CachingVertex<5> ConfigurableVertexFitter::vertex(
00059   const vector<RefCountedVertexTrack> & tracks) const
00060 {
00061   return theFitter->vertex ( tracks );
00062 }
00063 
00064 CachingVertex<5> ConfigurableVertexFitter::vertex(
00065   const vector<reco::TransientTrack> & tracks, const GlobalPoint& linPoint) const
00066 {
00067   return theFitter->vertex ( tracks, linPoint );
00068 }
00069 
00070 CachingVertex<5> ConfigurableVertexFitter::vertex(
00071   const vector<reco::TransientTrack> & tracks, const GlobalPoint& priorPos,
00072   const GlobalError& priorError) const
00073 {
00074   return theFitter->vertex ( tracks, priorPos, priorError );
00075 }
00076 
00077 CachingVertex<5> ConfigurableVertexFitter::vertex(
00078   const vector<reco::TransientTrack> & tracks, const reco::BeamSpot& beamSpot) const
00079 {
00080   return theFitter->vertex ( tracks, beamSpot );
00081 }
00082 
00083 CachingVertex<5> ConfigurableVertexFitter::vertex(const vector<RefCountedVertexTrack> & tracks, 
00084   const GlobalPoint& priorPos, const GlobalError& priorError) const
00085 {
00086   return theFitter->vertex ( tracks, priorPos, priorError );
00087 }
00088 

Generated on Tue Jun 9 17:46:04 2009 for CMSSW by  doxygen 1.5.4