CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_8_patch3/src/RecoVertex/ConfigurableVertexReco/src/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<RefCountedVertexTrack> & tracks,
00066   const reco::BeamSpot & spot ) const
00067 {
00068   return theFitter->vertex ( tracks, spot );
00069 }
00070 
00071 
00072 CachingVertex<5> ConfigurableVertexFitter::vertex(
00073   const vector<reco::TransientTrack> & tracks, const GlobalPoint& linPoint) const
00074 {
00075   return theFitter->vertex ( tracks, linPoint );
00076 }
00077 
00078 CachingVertex<5> ConfigurableVertexFitter::vertex(
00079   const vector<reco::TransientTrack> & tracks, const GlobalPoint& priorPos,
00080   const GlobalError& priorError) const
00081 {
00082   return theFitter->vertex ( tracks, priorPos, priorError );
00083 }
00084 
00085 CachingVertex<5> ConfigurableVertexFitter::vertex(
00086   const vector<reco::TransientTrack> & tracks, const reco::BeamSpot& beamSpot) const
00087 {
00088   return theFitter->vertex ( tracks, beamSpot );
00089 }
00090 
00091 CachingVertex<5> ConfigurableVertexFitter::vertex(const vector<RefCountedVertexTrack> & tracks, 
00092   const GlobalPoint& priorPos, const GlobalError& priorError) const
00093 {
00094   return theFitter->vertex ( tracks, priorPos, priorError );
00095 }
00096