File indexing completed on 2024-04-06 12:24:08
0001 #ifndef RecoAlgos_CandKalmanVertexFitter_h
0002 #define RecoAlgos_CandKalmanVertexFitter_h
0003 #include "CommonTools/UtilAlgos/interface/EventSetupInitTrait.h"
0004 #include "PhysicsTools/RecoUtils/interface/CandKinematicVertexFitter.h"
0005 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
0006 #include "SimGeneral/HepPDTRecord/interface/ParticleDataTable.h"
0007 #include "FWCore/Framework/interface/ESHandle.h"
0008 #include "FWCore/Framework/interface/EventSetup.h"
0009
0010 namespace reco {
0011 namespace modules {
0012 struct CandKinematicVertexFitterEventSetupInit {
0013 explicit CandKinematicVertexFitterEventSetupInit(edm::ConsumesCollector iC)
0014 : magToken_(iC.esConsumes()), pdtToken_(iC.esConsumes()) {}
0015
0016 void init(CandKinematicVertexFitter& fitter, const edm::Event& evt, const edm::EventSetup& es) {
0017 fitter.set(&es.getData(magToken_));
0018 fitter.set(&es.getData(pdtToken_));
0019 }
0020
0021 edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> magToken_;
0022 edm::ESGetToken<ParticleDataTable, edm::DefaultRecord> pdtToken_;
0023 };
0024
0025 template <>
0026 struct EventSetupInit<CandKinematicVertexFitter> {
0027 typedef CandKinematicVertexFitterEventSetupInit type;
0028 };
0029 }
0030 }
0031
0032 #endif