00001 #ifndef RecoCandUtils_CandKinematicVertexFitter_h 00002 #define RecoCandUtils_CandKinematicVertexFitter_h 00003 /* \class CandKinematicVertexFitter 00004 * 00005 * \author Luca Lista, INFN 00006 * 00007 */ 00008 00009 #include "FWCore/ParameterSet/interface/ParameterSetfwd.h" 00010 #include "TrackingTools/TransientTrack/interface/TransientTrack.h" 00011 #include "RecoVertex/VertexPrimitives/interface/TransientVertex.h" 00012 #include "DataFormats/RecoCandidate/interface/RecoCandidate.h" 00013 #include "RecoVertex/KinematicFit/interface/KinematicParticleVertexFitter.h" 00014 #include "PhysicsTools/UtilAlgos/interface/ParameterAdapter.h" 00015 #include "RecoVertex/KinematicFitPrimitives/interface/KinematicParticleFactoryFromTransientTrack.h" 00016 #include "SimGeneral/HepPDTRecord/interface/ParticleDataTable.h" 00017 #include <vector> 00018 #include "boost/shared_ptr.hpp" 00019 00020 class MagneticField; 00021 namespace reco { class VertexCompositeCandidate; } 00022 00023 class CandKinematicVertexFitter { 00024 public: 00025 typedef reco::Vertex::CovarianceMatrix CovarianceMatrix; 00026 CandKinematicVertexFitter(const edm::ParameterSet & cfg) : 00027 bField_(0), pdt_(0), fitter_(), fitters_(new std::vector<CandKinematicVertexFitter>) { 00028 } 00029 CandKinematicVertexFitter(const CandKinematicVertexFitter& o) : 00030 bField_(o.bField_), pdt_(o.pdt_), fitter_(), fitters_(new std::vector<CandKinematicVertexFitter>) { 00031 } 00032 void set(const MagneticField * bField) { bField_ = bField; } 00033 void set(const ParticleDataTable * pdt) { pdt_ = pdt; } 00034 void set(reco::VertexCompositeCandidate &) const; 00035 bool fit(const std::vector<RefCountedKinematicParticle> & tracks) const; 00036 RefCountedKinematicParticle currentParticle() const { 00037 tree_->movePointerToTheTop(); 00038 return tree_->currentParticle(); 00039 } 00040 private: 00041 const MagneticField * bField_; 00042 const ParticleDataTable * pdt_; 00043 void fill(std::vector<RefCountedKinematicParticle> &, 00044 std::vector<reco::Candidate *> &, 00045 std::vector<reco::RecoCandidate::TrackType> &, 00046 reco::Candidate &) const; 00048 KinematicParticleVertexFitter fitter_; 00050 mutable RefCountedKinematicTree tree_; 00052 KinematicParticleFactoryFromTransientTrack factory_; 00054 mutable double chi2_; 00056 mutable double ndof_; 00058 mutable CovarianceMatrix cov_; 00060 boost::shared_ptr<std::vector<CandKinematicVertexFitter> > fitters_; 00061 }; 00062 00063 #endif