/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
FWCore/TestModules/plugins/GlobalFloatProducer.cc
39 строк
1 KB
Andrea Bocci
Implement integration tests for standard types
25 фев 2025, 18:06
Не верифицирован
25 фев 2025, 18:06
9920497
Код
Авторство
О чём код?
#include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/global/EDProducer.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "FWCore/Utilities/interface/EDPutToken.h" namespace edmtest { class GlobalFloatProducer : public edm::global::EDProducer<> { public: explicit GlobalFloatProducer(edm::ParameterSet const& ps); void produce(edm::StreamID sid, edm::Event& event, edm::EventSetup const& es) const override; static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); private: edm::EDPutTokenT<float> token_; float value_; }; GlobalFloatProducer::GlobalFloatProducer(edm::ParameterSet const& config) : token_(produces()), value_(static_cast<float>(config.getParameter<double>("value"))) {} void GlobalFloatProducer::produce(edm::StreamID sid, edm::Event& event, edm::EventSetup const& es) const { event.emplace(token_, value_); } void GlobalFloatProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; desc.add<double>("value", 0.); descriptions.addDefault(desc); } } // namespace edmtest #include "FWCore/Framework/interface/MakerMacros.h" DEFINE_FWK_MODULE(edmtest::GlobalFloatProducer);