00001 00008 #include "MagneticField/UniformEngine/plugins/UniformMagneticFieldESProducer.h" 00009 #include "MagneticField/UniformEngine/src/UniformMagneticField.h" 00010 00011 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" 00012 00013 #include "FWCore/Framework/interface/ModuleFactory.h" 00014 00015 using namespace magneticfield; 00016 00017 UniformMagneticFieldESProducer::UniformMagneticFieldESProducer(const edm::ParameterSet& pset) : value(pset.getParameter<double>("ZFieldInTesla")) { 00018 setWhatProduced(this, pset.getUntrackedParameter<std::string>("label","")); 00019 } 00020 00021 00022 std::auto_ptr<MagneticField> UniformMagneticFieldESProducer::produce(const IdealMagneticFieldRecord & iRecord) 00023 { 00024 std::auto_ptr<MagneticField> s(new UniformMagneticField(value)); 00025 return s; 00026 } 00027 00028 DEFINE_FWK_EVENTSETUP_MODULE(UniformMagneticFieldESProducer);