CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_4/src/RecoVertex/ConfigurableVertexReco/src/ReconstructorFromFitter.cc

Go to the documentation of this file.
00001 #include "RecoVertex/ConfigurableVertexReco/interface/ReconstructorFromFitter.h"
00002 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00003 
00004 using namespace std;
00005 
00006 ReconstructorFromFitter::ReconstructorFromFitter ( const AbstractConfFitter & f ) :
00007   theFitter ( f.clone() )
00008 {}
00009 
00010 vector < TransientVertex > ReconstructorFromFitter::vertices
00011   ( const vector < reco::TransientTrack > & t )  const
00012 {
00013   vector < TransientVertex > ret;
00014   // cout << "[ReconstructorFromFitter] debug: fitting without bs!" << endl; 
00015   try {
00016     CachingVertex<5> tmp = theFitter->vertex ( t );
00017     if ( tmp.isValid() ) ret.push_back ( tmp );
00018   } catch ( VertexException & e ) {
00019     edm::LogWarning("ReconstructorFromFitter") << "exception caught: " << e.what();
00020   }
00021   return ret;
00022 }
00023 
00024 vector < TransientVertex > ReconstructorFromFitter::vertices
00025   ( const vector < reco::TransientTrack > & t, const reco::BeamSpot & s )  const
00026 {
00027   vector < TransientVertex > ret;
00028   try {
00029     /*
00030     cout << "[ReconstructorFromFitter] debug: fitting with s: " << s.BeamWidth() 
00031          << " sz=" << s.sigmaZ() << endl;
00032          */
00033     CachingVertex<5> tmp = theFitter->vertex ( t, s );
00034     if ( tmp.isValid() ) ret.push_back ( tmp );
00035   } catch ( VertexException & e ) {
00036     edm::LogWarning("ReconstructorFromFitter") << "exception caught: " << e.what();
00037   }
00038   return ret;
00039 }
00040 
00041 ReconstructorFromFitter::~ReconstructorFromFitter()
00042 {
00043   delete theFitter;
00044 }
00045 
00046 ReconstructorFromFitter::ReconstructorFromFitter ( const ReconstructorFromFitter & o ) :
00047   theFitter ( o.theFitter->clone() )
00048 {}
00049 
00050 edm::ParameterSet ReconstructorFromFitter::defaults() const
00051 {
00052   return theFitter->defaults();
00053 }
00054 
00055 void ReconstructorFromFitter::configure ( const edm::ParameterSet & s )
00056 {
00057   const_cast < AbstractConfFitter *> (theFitter)->configure (s );
00058 }
00059 
00060 ReconstructorFromFitter * ReconstructorFromFitter::clone () const
00061 {
00062   return new ReconstructorFromFitter ( *this );
00063 }