CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/RecoVertex/TrimmedVertexFit/src/TrimmedVertexFitter.cc

Go to the documentation of this file.
00001 #include "RecoVertex/TrimmedVertexFit/interface/TrimmedVertexFitter.h"
00002 #include "RecoVertex/VertexTools/interface/VertexTrackFactory.h"
00003 #include "RecoVertex/VertexTools/interface/LinearizedTrackStateFactory.h"
00004 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00005 
00006 
00007 
00008 TrimmedVertexFitter::TrimmedVertexFitter()
00009 {
00010   theRector.setMaxNbOfVertices(1);
00011   setPtCut(0.);
00012 }
00013 
00014 TrimmedVertexFitter::TrimmedVertexFitter(const edm::ParameterSet & pSet)
00015 {
00016   theRector.setMaxNbOfVertices(1);
00017   setPtCut(pSet.getParameter<double>("minPt"));
00018   setTrackCompatibilityCut ( pSet.getParameter<double>("trackCompatibilityCut") );
00019   setVertexFitProbabilityCut ( pSet.getParameter<double>("vtxFitProbCut") );
00020 }
00021 
00022 CachingVertex<5> 
00023 TrimmedVertexFitter::vertex(const std::vector<reco::TransientTrack> & tracks) const
00024 {
00025   std::vector<TransientVertex> vtces = theRector.vertices ( tracks );
00026   if (vtces.size() )
00027   {
00028     const TransientVertex & rv = *(vtces.begin());
00029     LinearizedTrackStateFactory lfac;
00030     VertexTrackFactory<5> vfac; 
00031        VertexState state ( rv.position(), rv.positionError() );
00032      std::vector < RefCountedVertexTrack > vtrks;
00033     std::vector<reco::TransientTrack> mytrks = rv.originalTracks();
00034     for ( std::vector<reco::TransientTrack>::const_iterator rt=mytrks.begin(); 
00035           rt!=mytrks.end() ; ++rt )
00036     {
00037       RefCountedLinearizedTrackState lstate =lfac.linearizedTrackState
00038        ( rv.position(), *rt );
00039        
00040       RefCountedVertexTrack vtrk = vfac.vertexTrack ( lstate, state, 1.0 );
00041       vtrks.push_back ( vtrk );
00042     };
00043     return CachingVertex<5> ( rv.position(), rv.positionError(), vtrks, rv.totalChiSquared() );
00044   };
00045   return CachingVertex<5>();
00046 }
00047 
00048 CachingVertex<5> TrimmedVertexFitter::vertex(
00049     const std::vector<RefCountedVertexTrack> & tracks) const
00050 {
00051   std::cout << "[TrimmedVertexFitter] method not implemented" << std::endl;
00052   throw VertexException("not implemented");
00053 }
00054 
00055 CachingVertex<5> TrimmedVertexFitter::vertex(
00056     const std::vector<RefCountedVertexTrack> & tracks,
00057     const reco::BeamSpot & spot ) const
00058 {
00059   std::cout << "[TrimmedVertexFitter] method not implemented" << std::endl;
00060   throw VertexException("not implemented");
00061 }
00062 
00063 
00064 CachingVertex<5> TrimmedVertexFitter::vertex(
00065     const std::vector<reco::TransientTrack> & tracks, const GlobalPoint& linPoint) const
00066 {
00067   std::cout << "[TrimmedVertexFitter] method not implemented" << std::endl;
00068   throw VertexException("not implemented");
00069 }
00070 
00071 CachingVertex<5> TrimmedVertexFitter::vertex(
00072     const std::vector<reco::TransientTrack> & tracks, const GlobalPoint& priorPos,
00073     const GlobalError& priorError) const
00074 {
00075   std::cout << "[TrimmedVertexFitter] method not implemented" << std::endl;
00076   throw VertexException("not implemented");
00077 }
00078 
00079 CachingVertex<5> TrimmedVertexFitter::vertex(
00080     const std::vector<RefCountedVertexTrack> & tracks, 
00081          const GlobalPoint& priorPos,
00082          const GlobalError& priorError) const
00083 {
00084  std::cout << "[TrimmedVertexFitter] method not implemented" << std::endl;
00085   throw VertexException("not implemented");
00086 }
00087 
00088 CachingVertex<5> 
00089 TrimmedVertexFitter::vertex(const std::vector<reco::TransientTrack> & tracks,
00090                                const reco::BeamSpot& beamSpot) const
00091 {
00092  std::cout << "[TrimmedVertexFitter] method not implemented" << std::endl;
00093   throw VertexException("not implemented");
00094 }
00095 
00096 
00097 TrimmedVertexFitter * TrimmedVertexFitter::clone() const
00098 {
00099   return new TrimmedVertexFitter( * this );
00100 }
00101  
00102 void TrimmedVertexFitter::setPtCut ( float cut )
00103 {
00104   ptcut           = cut;
00105   theRector.setPtCut ( cut );
00106 }
00107 
00108 void TrimmedVertexFitter::setTrackCompatibilityCut ( float cut )
00109 {
00110   theRector.setTrackCompatibilityCut ( cut );
00111 }
00112 
00113 void TrimmedVertexFitter::setVertexFitProbabilityCut ( float cut )
00114 {
00115   theRector.setVertexFitProbabilityCut ( cut );
00116 }
00117