From 3433882be0e52c315b910d53f5785d7e2bea7dab Mon Sep 17 00:00:00 2001 From: silviodonato Date: Wed, 17 Jan 2024 18:10:15 +0100 Subject: [PATCH] add fillDescription to CommonTools/UtilAlgos/interface/Merger.h - 133X --- CommonTools/UtilAlgos/interface/Merger.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/CommonTools/UtilAlgos/interface/Merger.h b/CommonTools/UtilAlgos/interface/Merger.h index 63c72cc1fe6fd..054baa5943a7f 100644 --- a/CommonTools/UtilAlgos/interface/Merger.h +++ b/CommonTools/UtilAlgos/interface/Merger.h @@ -19,6 +19,8 @@ */ #include "FWCore/Framework/interface/global/EDProducer.h" #include "FWCore/Framework/interface/Event.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Utilities/interface/transform.h" #include "FWCore/Utilities/interface/InputTag.h" @@ -34,19 +36,20 @@ class Merger : public edm::global::EDProducer<> { explicit Merger(const edm::ParameterSet&); /// destructor ~Merger() override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); private: /// process an event void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; /// vector of strings - typedef std::vector > vtoken; + typedef std::vector> vtoken; /// labels of the collections to be merged vtoken srcToken_; }; template Merger::Merger(const edm::ParameterSet& par) - : srcToken_(edm::vector_transform(par.template getParameter >("src"), + : srcToken_(edm::vector_transform(par.template getParameter>("src"), [this](edm::InputTag const& tag) { return consumes(tag); })) { produces(); } @@ -69,4 +72,15 @@ void Merger::produce(edm::StreamID, evt.put(std::move(coll)); } +template +void Merger::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add>("src", + { + edm::InputTag("collection1"), + edm::InputTag("collection2"), + }); + descriptions.addWithDefaultLabel(desc); +} + #endif