CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/PhysicsTools/RecoAlgos/plugins/CandKinematicVertexFitter.h

Go to the documentation of this file.
00001 #ifndef RecoAlgos_CandKalmanVertexFitter_h
00002 #define RecoAlgos_CandKalmanVertexFitter_h
00003 #include "CommonTools/UtilAlgos/interface/EventSetupInitTrait.h"
00004 #include "PhysicsTools/RecoUtils/interface/CandKinematicVertexFitter.h"
00005 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
00006 #include "SimGeneral/HepPDTRecord/interface/ParticleDataTable.h"
00007 #include "FWCore/Framework/interface/ESHandle.h"
00008 #include "FWCore/Framework/interface/EventSetup.h"
00009 
00010 namespace reco {
00011   namespace modules {
00012     struct CandKinematicVertexFitterEventSetupInit {
00013       static void init(CandKinematicVertexFitter & fitter, 
00014                        const edm::Event & evt,
00015                        const edm::EventSetup& es) { 
00016         edm::ESHandle<MagneticField> h;
00017         es.get<IdealMagneticFieldRecord>().get(h);
00018         fitter.set(h.product());
00019         edm::ESHandle<ParticleDataTable> pdt;
00020         es.getData(pdt); 
00021         fitter.set(pdt.product());
00022       }
00023     };
00024 
00025     template<>
00026     struct EventSetupInit<CandKinematicVertexFitter> {
00027       typedef CandKinematicVertexFitterEventSetupInit type;
00028     };
00029   }
00030 }
00031 
00032 #endif