CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/RecoVertex/ConfigurableVertexReco/src/ConfigurableVertexReconstructor.cc

Go to the documentation of this file.
00001 #include "RecoVertex/ConfigurableVertexReco/interface/ConfigurableVertexReconstructor.h"
00002 #include "RecoVertex/ConfigurableVertexReco/interface/VertexRecoManager.h"
00003 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00004 
00005 using namespace std;
00006 
00007 namespace {
00008   void errorNoReconstructor( const string & finder )
00009   {
00010     edm::LogError ( "ConfigurableVertexReconstructor") << "got no reconstructor for \""
00011          << finder << "\"";
00012     map < string, AbstractConfReconstructor * > valid = 
00013       VertexRecoManager::Instance().get();
00014     cout << "  Valid reconstructors are:";
00015     for ( map < string, AbstractConfReconstructor * >::const_iterator i=valid.begin(); 
00016           i!=valid.end() ; ++i )
00017     {
00018       if ( i->second ) cout << "  " << i->first;
00019     }
00020     cout << endl;
00021     throw std::string ( finder + " not available!" );
00022   }
00023 }
00024 
00025 ConfigurableVertexReconstructor::ConfigurableVertexReconstructor ( 
00026     const edm::ParameterSet & p ) : theRector ( 0 )
00027 {
00028   string finder=p.getParameter<string>("finder");
00029   theRector = VertexRecoManager::Instance().get ( finder );
00030   if (!theRector)
00031   {
00032     errorNoReconstructor ( finder );
00033   }
00034   theRector->configure ( p );
00035   // theRector = theRector->clone();
00036   // theRector = new ReconstructorFromFitter ( KalmanVertexFitter() );
00037 }
00038 
00039 ConfigurableVertexReconstructor::~ConfigurableVertexReconstructor()
00040 {
00041 //  delete theRector;
00042 }
00043 
00044 ConfigurableVertexReconstructor::ConfigurableVertexReconstructor 
00045     ( const ConfigurableVertexReconstructor & o ) :
00046   theRector ( o.theRector->clone() )
00047 {}
00048 
00049 
00050 ConfigurableVertexReconstructor * ConfigurableVertexReconstructor::clone() const
00051 {
00052   return new ConfigurableVertexReconstructor ( *this );
00053 }
00054 
00055 vector < TransientVertex > ConfigurableVertexReconstructor::vertices ( 
00056     const std::vector < reco::TransientTrack > & prims,
00057     const std::vector < reco::TransientTrack > & secs,
00058     const reco::BeamSpot & s ) const
00059 {
00060   return theRector->vertices ( prims, secs, s );
00061 }
00062 
00063 vector < TransientVertex > ConfigurableVertexReconstructor::vertices ( 
00064     const std::vector < reco::TransientTrack > & t,
00065     const reco::BeamSpot & s ) const
00066 {
00067   return theRector->vertices ( t, s );
00068 }
00069 
00070 vector < TransientVertex > ConfigurableVertexReconstructor::vertices ( 
00071     const std::vector < reco::TransientTrack > & t ) const
00072 {
00073   return theRector->vertices ( t );
00074 }