/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
CommonTools/UtilAlgos/interface/StringCutObjectSelector.h
37 строк
1 KB
mmusich
Add fillDescriptions to several plugins used at HLT
03 фев 2025, 13:35
03 фев 2025, 13:35
083eb7b
Код
Авторство
О чём код?
#ifndef UtilAlgos_StringCutObjectSelector_h #define UtilAlgos_StringCutObjectSelector_h #include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "CommonTools/UtilAlgos/interface/ParameterAdapter.h" #include "CommonTools/Utils/interface/StringCutObjectSelector.h" namespace reco { namespace modules { template <typename T, bool Lazy> struct ParameterAdapter<StringCutObjectSelector<T, Lazy> > { static StringCutObjectSelector<T, Lazy> make(const edm::ParameterSet& cfg, edm::ConsumesCollector& iC) { return StringCutObjectSelector<T, Lazy>(cfg.template getParameter<std::string>("cut")); } static void fillPSetDescription(edm::ParameterSetDescription& desc) { desc.add<std::string>("cut", ""); } }; } // namespace modules } // namespace reco // Introducing a simpler way to use a string object selector outside of the // heavily-templated infrastructure above. This simply translates the cfg // into the string that the functor expects. namespace reco { template <typename T, bool Lazy> class StringCutObjectSelectorHandler : public StringCutObjectSelector<T, Lazy> { public: explicit StringCutObjectSelectorHandler(const edm::ParameterSet& cfg) : StringCutObjectSelector<T, Lazy>(cfg.getParameter<std::string>("cut")) {} static void fillPSetDescription(edm::ParameterSetDescription& desc) { desc.add<std::string>("cut", ""); } }; } // namespace reco #endif