From df5ba007bbf8cb734f149c0d4b162c1f18c3dc9d Mon Sep 17 00:00:00 2001 From: silviodonato Date: Wed, 17 Jan 2024 11:26:15 +0100 Subject: [PATCH 1/2] add fillDescription in CommonTools/UtilAlgos/interface/Merger.h --- 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..ef6d41172e5d1 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.add("simpleMergedTracks", desc); +} + #endif From 366848638b155ed6a23c133df9c16917b3b39803 Mon Sep 17 00:00:00 2001 From: silviodonato Date: Wed, 17 Jan 2024 14:21:02 +0100 Subject: [PATCH 2/2] use addWithDefaultLabel instead of add in fillDescription of Merger.h --- CommonTools/UtilAlgos/interface/Merger.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CommonTools/UtilAlgos/interface/Merger.h b/CommonTools/UtilAlgos/interface/Merger.h index ef6d41172e5d1..054baa5943a7f 100644 --- a/CommonTools/UtilAlgos/interface/Merger.h +++ b/CommonTools/UtilAlgos/interface/Merger.h @@ -80,7 +80,7 @@ void Merger::fillDescriptions(edm::Configu edm::InputTag("collection1"), edm::InputTag("collection2"), }); - descriptions.add("simpleMergedTracks", desc); + descriptions.addWithDefaultLabel(desc); } #endif