From ea9139b53e86bb8872a04ebb5559a4e1a498bcec Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Mon, 4 Oct 2021 11:32:41 -0500 Subject: [PATCH] Remove use of legacy module classes from framework tests --- .../test/stubs/DeleteEarlyModules.cc | 18 +++++---- .../Framework/test/stubs/HistoryAnalyzer.cc | 4 +- .../test/stubs/RunLumiEventAnalyzer.h | 4 +- .../Framework/test/stubs/TestMergeResults.cc | 4 +- FWCore/Framework/test/stubs/TestMod.cc | 8 ++-- .../test/stubs/TestSchedulerModule1.cc | 8 ++-- .../test/stubs/TestSchedulerModule2.cc | 8 ++-- FWCore/Framework/test/stubs/ToyAnalyzers.cc | 29 +++++++------- .../test/stubs/ToyDoubleProducers.cc | 9 ++--- .../Framework/test/stubs/ToySTLProducers.cc | 40 ++++++++----------- FWCore/Integration/test/ESTestAnalyzers.cc | 1 - FWCore/Integration/test/HistProducer.cc | 5 +-- FWCore/Integration/test/HistProducer.h | 8 ++-- .../Integration/test/ManyProductProducer.cc | 24 ++++------- FWCore/Integration/test/PathAnalyzer.cc | 14 ++++--- .../Integration/test/ProducerWithPSetDesc.cc | 4 +- .../Integration/test/ProducerWithPSetDesc.h | 8 ++-- .../Integration/test/TestGetterOfProducts.cc | 15 ++++--- FWCore/Integration/test/TestHistoryKeeping.cc | 13 +++--- FWCore/Integration/test/TestPSetAnalyzer.cc | 23 ++--------- FWCore/Integration/test/TestParentage.cc | 11 ++--- .../test/UseValueExampleAnalyzer.cc | 16 +++----- .../test/WhatsItWatcherAnalyzer.cc | 12 ++---- .../MessageService/test/MLexampleModule_1.cc | 5 ++- .../MessageService/test/MLexampleModule_1.h | 8 ++-- .../MessageService/test/MemoryTestClient_A.cc | 1 + .../MessageService/test/MemoryTestClient_A.h | 4 +- .../test/MessageLoggerClient.cc | 5 ++- .../MessageService/test/MessageLoggerClient.h | 8 ++-- .../MessageService/test/PSetTestClient_A.cc | 5 ++- FWCore/MessageService/test/PSetTestClient_A.h | 7 ++-- .../test/ProblemTestClient_t1.cc | 5 ++- .../test/ProblemTestClient_t1.h | 8 ++-- .../test/UnitTestClient_SLumi.h | 23 +++++------ FWCore/MessageService/test/makeSignals.cc | 4 +- FWCore/MessageService/test/makeSignals.h | 8 ++-- FWCore/Modules/src/AbortOnEventIDAnalyzer.cc | 10 ++--- FWCore/Modules/src/EventContentAnalyzer.cc | 4 +- .../src/EventSetupCacheIdentifierChecker.cc | 9 +++-- .../test/SiteLocalConfigServiceTester.cc | 8 ++-- .../SecondaryInput/test/SecondaryProducer.h | 10 ++--- IOPool/Streamer/test/StreamThingAnalyzer.h | 4 +- IOPool/Streamer/test/StreamThingProducer.cc | 2 +- IOPool/Streamer/test/StreamThingProducer.h | 6 +-- 44 files changed, 186 insertions(+), 244 deletions(-) diff --git a/FWCore/Framework/test/stubs/DeleteEarlyModules.cc b/FWCore/Framework/test/stubs/DeleteEarlyModules.cc index 64a4ead54be6e..b5f8c0a25373f 100644 --- a/FWCore/Framework/test/stubs/DeleteEarlyModules.cc +++ b/FWCore/Framework/test/stubs/DeleteEarlyModules.cc @@ -16,8 +16,8 @@ // user include files #include "DataFormats/TestObjects/interface/DeleteEarly.h" -#include "FWCore/Framework/interface/EDProducer.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/global/EDProducer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/global/EDAnalyzer.h" #include "FWCore/Utilities/interface/InputTag.h" #include "FWCore/Utilities/interface/Exception.h" @@ -26,16 +26,18 @@ #include "FWCore/Framework/interface/Event.h" namespace edmtest { - class DeleteEarlyProducer : public edm::EDProducer { + class DeleteEarlyProducer : public edm::global::EDProducer<> { public: - DeleteEarlyProducer(edm::ParameterSet const& pset) { produces(); } + explicit DeleteEarlyProducer(edm::ParameterSet const& pset) { produces(); } - virtual void beginJob() { + void beginJob() override { // Needed because DeleteEarly objects may be allocated and deleted in initialization edmtest::DeleteEarly::resetDeleteCount(); } - virtual void produce(edm::Event& e, edm::EventSetup const&) { e.put(std::make_unique()); } + void produce(edm::StreamID, edm::Event& e, edm::EventSetup const&) const override { + e.put(std::make_unique()); + } }; class DeleteEarlyReader : public edm::global::EDAnalyzer<> { @@ -60,12 +62,12 @@ namespace edmtest { private: }; - class DeleteEarlyCheckDeleteAnalyzer : public edm::EDAnalyzer { + class DeleteEarlyCheckDeleteAnalyzer : public edm::one::EDAnalyzer<> { public: DeleteEarlyCheckDeleteAnalyzer(edm::ParameterSet const& pset) : m_expectedValues(pset.getUntrackedParameter>("expectedValues")), m_index(0) {} - virtual void analyze(edm::Event const&, edm::EventSetup const&) { + void analyze(edm::Event const&, edm::EventSetup const&) override { if (DeleteEarly::nDeletes() != m_expectedValues.at(m_index)) { throw cms::Exception("DeleteEarlyError") << "On index " << m_index << " we expected " << m_expectedValues[m_index] << " deletes but we see " diff --git a/FWCore/Framework/test/stubs/HistoryAnalyzer.cc b/FWCore/Framework/test/stubs/HistoryAnalyzer.cc index 8a49cef06ae21..ce799a9f97f6c 100644 --- a/FWCore/Framework/test/stubs/HistoryAnalyzer.cc +++ b/FWCore/Framework/test/stubs/HistoryAnalyzer.cc @@ -5,7 +5,7 @@ ----------------------------------------------------------------------*/ -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "DataFormats/Provenance/interface/EventSelectionID.h" #include "FWCore/Framework/interface/Event.h" @@ -27,7 +27,7 @@ namespace edm { namespace edmtest { - class HistoryAnalyzer : public edm::EDAnalyzer { + class HistoryAnalyzer : public edm::one::EDAnalyzer<> { public: explicit HistoryAnalyzer(edm::ParameterSet const& params); void analyze(edm::Event const& event, edm::EventSetup const&); diff --git a/FWCore/Framework/test/stubs/RunLumiEventAnalyzer.h b/FWCore/Framework/test/stubs/RunLumiEventAnalyzer.h index 481e003144946..ab02420502755 100644 --- a/FWCore/Framework/test/stubs/RunLumiEventAnalyzer.h +++ b/FWCore/Framework/test/stubs/RunLumiEventAnalyzer.h @@ -2,7 +2,7 @@ #define Integration_RunLumiEventAnalyzer_h #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Utilities/interface/EDGetToken.h" #include "FWCore/Utilities/interface/propagate_const.h" @@ -14,7 +14,7 @@ namespace edm { namespace edmtest { - class RunLumiEventAnalyzer : public edm::EDAnalyzer { + class RunLumiEventAnalyzer : public edm::one::EDAnalyzer { public: explicit RunLumiEventAnalyzer(edm::ParameterSet const& pset); diff --git a/FWCore/Framework/test/stubs/TestMergeResults.cc b/FWCore/Framework/test/stubs/TestMergeResults.cc index d9b8a52516e89..c5c0a836b0317 100644 --- a/FWCore/Framework/test/stubs/TestMergeResults.cc +++ b/FWCore/Framework/test/stubs/TestMergeResults.cc @@ -18,7 +18,7 @@ #include "DataFormats/TestObjects/interface/ThingWithIsEqual.h" #include "DataFormats/TestObjects/interface/ThingWithMerge.h" #include "FWCore/Framework/interface/ConstProductRegistry.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/FileBlock.h" #include "FWCore/Framework/interface/LuminosityBlock.h" @@ -41,7 +41,7 @@ namespace edm { namespace edmtest { - class TestMergeResults : public edm::EDAnalyzer { + class TestMergeResults : public edm::one::EDAnalyzer { public: explicit TestMergeResults(edm::ParameterSet const&); virtual ~TestMergeResults(); diff --git a/FWCore/Framework/test/stubs/TestMod.cc b/FWCore/Framework/test/stubs/TestMod.cc index b4cb26a426149..9a8295d900910 100644 --- a/FWCore/Framework/test/stubs/TestMod.cc +++ b/FWCore/Framework/test/stubs/TestMod.cc @@ -1,18 +1,18 @@ #include -#include "FWCore/Framework/interface/EDProducer.h" +#include "FWCore/Framework/interface/global/EDProducer.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" using namespace edm; -class TestMod : public EDProducer { +class TestMod : public global::EDProducer<> { public: explicit TestMod(ParameterSet const& p); - void produce(Event& e, EventSetup const&); + void produce(StreamID, Event& e, EventSetup const&) const final; }; TestMod::TestMod(ParameterSet const& p) { @@ -21,7 +21,7 @@ TestMod::TestMod(ParameterSet const& p) { // << std::endl; } -void TestMod::produce(Event&, EventSetup const&) { +void TestMod::produce(StreamID, Event&, EventSetup const&) const { //std::cerr << "Hi" << std::endl; } diff --git a/FWCore/Framework/test/stubs/TestSchedulerModule1.cc b/FWCore/Framework/test/stubs/TestSchedulerModule1.cc index d2f83e4abae08..2dbccd3c83ec0 100644 --- a/FWCore/Framework/test/stubs/TestSchedulerModule1.cc +++ b/FWCore/Framework/test/stubs/TestSchedulerModule1.cc @@ -6,7 +6,7 @@ \date 19 May 2005 */ -#include "FWCore/Framework/interface/EDProducer.h" +#include "FWCore/Framework/interface/global/EDProducer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -17,17 +17,17 @@ using namespace edm; -class TestSchedulerModule1 : public EDProducer { +class TestSchedulerModule1 : public global::EDProducer<> { public: explicit TestSchedulerModule1(ParameterSet const& p) : pset_(p) { produces(); } - void produce(Event& e, EventSetup const&); + void produce(StreamID, Event& e, EventSetup const&) const final; private: ParameterSet pset_; }; -void TestSchedulerModule1::produce(Event& e, EventSetup const&) { +void TestSchedulerModule1::produce(StreamID, Event& e, EventSetup const&) const { std::string myname = pset_.getParameter("module_name"); e.put(std::make_unique(myname)); } diff --git a/FWCore/Framework/test/stubs/TestSchedulerModule2.cc b/FWCore/Framework/test/stubs/TestSchedulerModule2.cc index fe4eed9b29f23..20837e290243b 100644 --- a/FWCore/Framework/test/stubs/TestSchedulerModule2.cc +++ b/FWCore/Framework/test/stubs/TestSchedulerModule2.cc @@ -6,7 +6,7 @@ \date 19 May 2005 */ -#include "FWCore/Framework/interface/EDProducer.h" +#include "FWCore/Framework/interface/global/EDProducer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -17,17 +17,17 @@ namespace edm { - class TestSchedulerModule2 : public EDProducer { + class TestSchedulerModule2 : public global::EDProducer<> { public: explicit TestSchedulerModule2(ParameterSet const& p) : pset_(p) { produces(); } - void produce(Event& e, EventSetup const&); + void produce(StreamID, Event& e, EventSetup const&) const final; private: ParameterSet pset_; }; - void TestSchedulerModule2::produce(Event& e, EventSetup const&) { + void TestSchedulerModule2::produce(StreamID, Event& e, EventSetup const&) const { std::string myname = pset_.getParameter("module_name"); e.put(std::make_unique(myname)); } diff --git a/FWCore/Framework/test/stubs/ToyAnalyzers.cc b/FWCore/Framework/test/stubs/ToyAnalyzers.cc index a82e0c4b0ac56..3eb4624b6abdb 100644 --- a/FWCore/Framework/test/stubs/ToyAnalyzers.cc +++ b/FWCore/Framework/test/stubs/ToyAnalyzers.cc @@ -9,7 +9,6 @@ Toy EDAnalyzers for testing purposes only. #include "DataFormats/Common/interface/Handle.h" #include "DataFormats/TestObjects/interface/ToyProducts.h" // -#include "FWCore/Framework/interface/EDAnalyzer.h" #include "FWCore/Framework/interface/stream/EDAnalyzer.h" #include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/global/EDAnalyzer.h" @@ -36,14 +35,14 @@ namespace edmtest { // // every call to NonAnalyzer::analyze does nothing. // - class NonAnalyzer : public edm::EDAnalyzer { + class NonAnalyzer : public edm::global::EDAnalyzer<> { public: explicit NonAnalyzer(edm::ParameterSet const& /*p*/) {} - virtual ~NonAnalyzer() {} - virtual void analyze(edm::Event const& e, edm::EventSetup const& c); + ~NonAnalyzer() override {} + void analyze(edm::StreamID, edm::Event const& e, edm::EventSetup const& c) const final; }; - void NonAnalyzer::analyze(edm::Event const&, edm::EventSetup const&) {} + void NonAnalyzer::analyze(edm::StreamID, edm::Event const&, edm::EventSetup const&) const {} //-------------------------------------------------------------------- // @@ -265,14 +264,14 @@ namespace edmtest { //-------------------------------------------------------------------- // - class SCSimpleAnalyzer : public edm::EDAnalyzer { + class SCSimpleAnalyzer : public edm::global::EDAnalyzer<> { public: SCSimpleAnalyzer(edm::ParameterSet const&) {} - virtual void analyze(edm::Event const& e, edm::EventSetup const&); + void analyze(edm::StreamID, edm::Event const& e, edm::EventSetup const&) const final; }; - void SCSimpleAnalyzer::analyze(edm::Event const& e, edm::EventSetup const&) { + void SCSimpleAnalyzer::analyze(edm::StreamID, edm::Event const& e, edm::EventSetup const&) const { // Get the product back out; it should be sorted. edm::Handle h; e.getByLabel("scs", h); @@ -330,23 +329,23 @@ namespace edmtest { //-------------------------------------------------------------------- // - class DSVAnalyzer : public edm::EDAnalyzer { + class DSVAnalyzer : public edm::global::EDAnalyzer<> { public: DSVAnalyzer(edm::ParameterSet const&) {} - virtual void analyze(edm::Event const& e, edm::EventSetup const&); + void analyze(edm::StreamID, edm::Event const& e, edm::EventSetup const&) const final; private: - void do_sorted_stuff(edm::Event const& e); - void do_unsorted_stuff(edm::Event const& e); + void do_sorted_stuff(edm::Event const& e) const; + void do_unsorted_stuff(edm::Event const& e) const; }; - void DSVAnalyzer::analyze(edm::Event const& e, edm::EventSetup const&) { + void DSVAnalyzer::analyze(edm::StreamID, edm::Event const& e, edm::EventSetup const&) const { do_sorted_stuff(e); do_unsorted_stuff(e); } - void DSVAnalyzer::do_sorted_stuff(edm::Event const& e) { + void DSVAnalyzer::do_sorted_stuff(edm::Event const& e) const { typedef DSVSimpleProduct product_type; typedef product_type::value_type detset; typedef detset::value_type value_type; @@ -370,7 +369,7 @@ namespace edmtest { } } - void DSVAnalyzer::do_unsorted_stuff(edm::Event const& e) { + void DSVAnalyzer::do_unsorted_stuff(edm::Event const& e) const { typedef DSVWeirdProduct product_type; typedef product_type::value_type detset; typedef detset::value_type value_type; diff --git a/FWCore/Framework/test/stubs/ToyDoubleProducers.cc b/FWCore/Framework/test/stubs/ToyDoubleProducers.cc index 233e5248085ef..d194cabf65bc2 100644 --- a/FWCore/Framework/test/stubs/ToyDoubleProducers.cc +++ b/FWCore/Framework/test/stubs/ToyDoubleProducers.cc @@ -8,7 +8,7 @@ Toy EDProducers of doubles for testing purposes only. #include "DataFormats/Common/interface/Handle.h" #include "DataFormats/TestObjects/interface/ToyProducts.h" -#include "FWCore/Framework/interface/EDProducer.h" +#include "FWCore/Framework/interface/global/EDProducer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -29,20 +29,19 @@ namespace edmtest { // Produces an DoubleProduct instance. // - class ToyDoubleProducer : public edm::EDProducer { + class ToyDoubleProducer : public edm::global::EDProducer<> { public: explicit ToyDoubleProducer(edm::ParameterSet const& p) : value_(p.getParameter("dvalue")) { produces(); } explicit ToyDoubleProducer(double d) : value_(d) { produces(); } - virtual ~ToyDoubleProducer() {} - virtual void produce(edm::Event& e, edm::EventSetup const& c); + void produce(edm::StreamID, edm::Event& e, edm::EventSetup const& c) const final; private: double value_; }; - void ToyDoubleProducer::produce(edm::Event& e, edm::EventSetup const&) { + void ToyDoubleProducer::produce(edm::StreamID, edm::Event& e, edm::EventSetup const&) const { // Make output e.put(std::make_unique(value_)); } diff --git a/FWCore/Framework/test/stubs/ToySTLProducers.cc b/FWCore/Framework/test/stubs/ToySTLProducers.cc index 323c000c933ea..083a9b583fb8f 100644 --- a/FWCore/Framework/test/stubs/ToySTLProducers.cc +++ b/FWCore/Framework/test/stubs/ToySTLProducers.cc @@ -8,7 +8,6 @@ Toy EDProducers of STL containers for testing purposes only. #include "DataFormats/Common/interface/Handle.h" #include "DataFormats/TestObjects/interface/ToyProducts.h" -#include "FWCore/Framework/interface/EDProducer.h" #include "FWCore/Framework/interface/global/EDProducer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -30,7 +29,7 @@ namespace edmtest { // // Produces an std::vector instance. // - class IntVectorProducer : public edm::EDProducer { + class IntVectorProducer : public edm::global::EDProducer<> { public: explicit IntVectorProducer(edm::ParameterSet const& p) : value_(p.getParameter("ivalue")), @@ -38,8 +37,7 @@ namespace edmtest { delta_(p.getParameter("delta")) { produces>(); } - virtual ~IntVectorProducer() {} - virtual void produce(edm::Event& e, edm::EventSetup const& c); + void produce(edm::StreamID, edm::Event& e, edm::EventSetup const& c) const override; static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; @@ -55,7 +53,7 @@ namespace edmtest { int delta_; }; - void IntVectorProducer::produce(edm::Event& e, edm::EventSetup const&) { + void IntVectorProducer::produce(edm::StreamID, edm::Event& e, edm::EventSetup const&) const { // EventSetup is not used. auto p = std::make_unique>(count_, value_); if (delta_ != 0) { @@ -71,17 +69,16 @@ namespace edmtest { // Produces an std::vector and set instance. // Used to test ambiguous getByToken calls with View // arguments. - class IntVectorSetProducer : public edm::EDProducer { + class IntVectorSetProducer : public edm::global::EDProducer<> { public: explicit IntVectorSetProducer(edm::ParameterSet const& p) { produces>(); produces>(); } - virtual ~IntVectorSetProducer() {} - virtual void produce(edm::Event& e, edm::EventSetup const& c); + void produce(edm::StreamID, edm::Event& e, edm::EventSetup const& c) const override; }; - void IntVectorSetProducer::produce(edm::Event& e, edm::EventSetup const&) { + void IntVectorSetProducer::produce(edm::StreamID, edm::Event& e, edm::EventSetup const&) const { // EventSetup is not used. e.put(std::make_unique>(1, 11)); @@ -92,21 +89,20 @@ namespace edmtest { // // Produces an std::list instance. // - class IntListProducer : public edm::EDProducer { + class IntListProducer : public edm::global::EDProducer<> { public: explicit IntListProducer(edm::ParameterSet const& p) : value_(p.getParameter("ivalue")), count_(p.getParameter("count")) { produces>(); } - virtual ~IntListProducer() {} - virtual void produce(edm::Event& e, edm::EventSetup const& c); + void produce(edm::StreamID, edm::Event& e, edm::EventSetup const& c) const override; private: int value_; size_t count_; }; - void IntListProducer::produce(edm::Event& e, edm::EventSetup const&) { + void IntListProducer::produce(edm::StreamID, edm::Event& e, edm::EventSetup const&) const { // EventSetup is not used. e.put(std::make_unique>(count_, value_)); } @@ -115,21 +111,20 @@ namespace edmtest { // // Produces an std::deque instance. // - class IntDequeProducer : public edm::EDProducer { + class IntDequeProducer : public edm::global::EDProducer<> { public: explicit IntDequeProducer(edm::ParameterSet const& p) : value_(p.getParameter("ivalue")), count_(p.getParameter("count")) { produces>(); } - virtual ~IntDequeProducer() {} - virtual void produce(edm::Event& e, edm::EventSetup const& c); + void produce(edm::StreamID, edm::Event& e, edm::EventSetup const& c) const override; private: int value_; size_t count_; }; - void IntDequeProducer::produce(edm::Event& e, edm::EventSetup const&) { + void IntDequeProducer::produce(edm::StreamID, edm::Event& e, edm::EventSetup const&) const { // EventSetup is not used. e.put(std::make_unique>(count_, value_)); } @@ -138,21 +133,20 @@ namespace edmtest { // // Produces an std::set instance. // - class IntSetProducer : public edm::EDProducer { + class IntSetProducer : public edm::global::EDProducer<> { public: explicit IntSetProducer(edm::ParameterSet const& p) : start_(p.getParameter("start")), stop_(p.getParameter("stop")) { produces>(); } - virtual ~IntSetProducer() {} - virtual void produce(edm::Event& e, edm::EventSetup const& c); + void produce(edm::StreamID, edm::Event& e, edm::EventSetup const& c) const override; private: int start_; int stop_; }; - void IntSetProducer::produce(edm::Event& e, edm::EventSetup const&) { + void IntSetProducer::produce(edm::StreamID, edm::Event& e, edm::EventSetup const&) const { // EventSetup is not used. auto p = std::make_unique>(); for (int i = start_; i < stop_; ++i) @@ -164,7 +158,7 @@ namespace edmtest { // // Produces std::vector> and std::vector> instances. // - class UniqPtrIntVectorProducer : public edm::EDProducer { + class UniqPtrIntVectorProducer : public edm::global::EDProducer<> { public: explicit UniqPtrIntVectorProducer(edm::ParameterSet const& p) : value_(p.getParameter("ivalue")), @@ -173,7 +167,7 @@ namespace edmtest { intToken_(produces>>()), intProductToken_(produces>>()) {} - void produce(edm::Event& e, edm::EventSetup const& c) override { + void produce(edm::StreamID, edm::Event& e, edm::EventSetup const& c) const override { std::vector> p1(count_); std::vector> p2(count_); for (unsigned int i = 0; i < count_; ++i) { diff --git a/FWCore/Integration/test/ESTestAnalyzers.cc b/FWCore/Integration/test/ESTestAnalyzers.cc index 1a14fb4fb867d..068ade2c012ee 100644 --- a/FWCore/Integration/test/ESTestAnalyzers.cc +++ b/FWCore/Integration/test/ESTestAnalyzers.cc @@ -1,4 +1,3 @@ -#include "FWCore/Framework/interface/EDAnalyzer.h" #include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/global/EDAnalyzer.h" #include "FWCore/Framework/interface/stream/EDAnalyzer.h" diff --git a/FWCore/Integration/test/HistProducer.cc b/FWCore/Integration/test/HistProducer.cc index db6829ef22810..72fc81370422b 100644 --- a/FWCore/Integration/test/HistProducer.cc +++ b/FWCore/Integration/test/HistProducer.cc @@ -10,11 +10,8 @@ namespace edmtest { //produces(); } - // Virtual destructor needed. - HistProducer::~HistProducer() {} - // Functions that gets called by framework every event - void HistProducer::produce(edm::Event& e, edm::EventSetup const&) { + void HistProducer::produce(edm::StreamID, edm::Event& e, edm::EventSetup const&) const { //Empty Histograms e.put(std::make_unique()); //e.put(std::make_unique()); diff --git a/FWCore/Integration/test/HistProducer.h b/FWCore/Integration/test/HistProducer.h index 2cfed9fca00b9..e008d1ea07034 100644 --- a/FWCore/Integration/test/HistProducer.h +++ b/FWCore/Integration/test/HistProducer.h @@ -2,20 +2,18 @@ #define FWCore_Integration_HistProducer_h #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDProducer.h" +#include "FWCore/Framework/interface/global/EDProducer.h" namespace edmtest { //struct ThingWithHist { // TH1F hist_; // }; - class HistProducer : public edm::EDProducer { + class HistProducer : public edm::global::EDProducer<> { public: explicit HistProducer(edm::ParameterSet const& ps); - virtual ~HistProducer(); - - virtual void produce(edm::Event& e, edm::EventSetup const& c); + void produce(edm::StreamID, edm::Event& e, edm::EventSetup const& c) const override; private: }; diff --git a/FWCore/Integration/test/ManyProductProducer.cc b/FWCore/Integration/test/ManyProductProducer.cc index a0fef677c1972..8ef2c9504de03 100644 --- a/FWCore/Integration/test/ManyProductProducer.cc +++ b/FWCore/Integration/test/ManyProductProducer.cc @@ -3,8 +3,8 @@ the getByLabel function and supporting code. It makes a lot of getByLabel calls although it is not particularly realistic ... */ -#include "FWCore/Framework/interface/EDProducer.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/global/EDProducer.h" +#include "FWCore/Framework/interface/global/EDAnalyzer.h" #include "DataFormats/Common/interface/Handle.h" #include "DataFormats/TestObjects/interface/ToyProducts.h" #include "FWCore/Framework/interface/Event.h" @@ -16,13 +16,11 @@ realistic ... */ namespace edmtest { - class ManyProductProducer : public edm::EDProducer { + class ManyProductProducer : public edm::global::EDProducer<> { public: explicit ManyProductProducer(edm::ParameterSet const& iConfig); - virtual ~ManyProductProducer(); - - virtual void produce(edm::Event& e, edm::EventSetup const& c); + void produce(edm::StreamID, edm::Event& e, edm::EventSetup const& c) const final; private: unsigned int nProducts_; @@ -39,22 +37,18 @@ namespace edmtest { } } - ManyProductProducer::~ManyProductProducer() {} - // Functions that gets called by framework every event - void ManyProductProducer::produce(edm::Event& e, edm::EventSetup const&) { + void ManyProductProducer::produce(edm::StreamID, edm::Event& e, edm::EventSetup const&) const { for (unsigned int i = 0; i < nProducts_; ++i) { e.put(std::make_unique(1), instanceNames_[i]); } } - class ManyProductAnalyzer : public edm::EDAnalyzer { + class ManyProductAnalyzer : public edm::global::EDAnalyzer<> { public: explicit ManyProductAnalyzer(edm::ParameterSet const& iConfig); - virtual ~ManyProductAnalyzer(); - - void analyze(edm::Event const&, edm::EventSetup const&); + void analyze(edm::StreamID, edm::Event const&, edm::EventSetup const&) const final; private: unsigned int nProducts_; @@ -71,9 +65,7 @@ namespace edmtest { } } - ManyProductAnalyzer::~ManyProductAnalyzer() {} - - void ManyProductAnalyzer::analyze(edm::Event const& e, edm::EventSetup const&) { + void ManyProductAnalyzer::analyze(edm::StreamID, edm::Event const& e, edm::EventSetup const&) const { edm::Handle h; for (auto const& tag : tags_) { e.getByLabel(tag, h); diff --git a/FWCore/Integration/test/PathAnalyzer.cc b/FWCore/Integration/test/PathAnalyzer.cc index 99557a6e2bdca..738fa31ff5f1f 100644 --- a/FWCore/Integration/test/PathAnalyzer.cc +++ b/FWCore/Integration/test/PathAnalyzer.cc @@ -2,7 +2,7 @@ #include #include -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/global/EDAnalyzer.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/Framework/interface/TriggerNamesService.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" @@ -12,17 +12,17 @@ #include "FWCore/ParameterSet/interface/Registry.h" namespace edmtest { - class PathAnalyzer : public edm::EDAnalyzer { + class PathAnalyzer : public edm::global::EDAnalyzer<> { public: explicit PathAnalyzer(edm::ParameterSet const&); virtual ~PathAnalyzer(); - virtual void analyze(edm::Event const&, edm::EventSetup const&); + virtual void analyze(edm::StreamID, edm::Event const&, edm::EventSetup const&) const; virtual void beginJob(); virtual void endJob(); private: - void dumpTriggerNamesServiceInfo(char const* where); + void dumpTriggerNamesServiceInfo(char const* where) const; }; // class PathAnalyzer //-------------------------------------------------------------------- @@ -33,13 +33,15 @@ namespace edmtest { PathAnalyzer::~PathAnalyzer() {} - void PathAnalyzer::analyze(edm::Event const&, edm::EventSetup const&) { dumpTriggerNamesServiceInfo("analyze"); } + void PathAnalyzer::analyze(edm::StreamID, edm::Event const&, edm::EventSetup const&) const { + dumpTriggerNamesServiceInfo("analyze"); + } void PathAnalyzer::beginJob() { dumpTriggerNamesServiceInfo("beginJob"); } void PathAnalyzer::endJob() { dumpTriggerNamesServiceInfo("endJob"); } - void PathAnalyzer::dumpTriggerNamesServiceInfo(char const* where) { + void PathAnalyzer::dumpTriggerNamesServiceInfo(char const* where) const { edm::LogInfo("PathAnalyzer").log([&](auto& message) { edm::Service tns; message << "TNS size: " << tns->size() << "\n"; diff --git a/FWCore/Integration/test/ProducerWithPSetDesc.cc b/FWCore/Integration/test/ProducerWithPSetDesc.cc index b69f7b9ded9fe..2e9d277267989 100644 --- a/FWCore/Integration/test/ProducerWithPSetDesc.cc +++ b/FWCore/Integration/test/ProducerWithPSetDesc.cc @@ -471,9 +471,7 @@ namespace edmtest { produces(); } - ProducerWithPSetDesc::~ProducerWithPSetDesc() {} - - void ProducerWithPSetDesc::produce(edm::Event& e, edm::EventSetup const&) { + void ProducerWithPSetDesc::produce(edm::StreamID, edm::Event& e, edm::EventSetup const&) const { // This serves no purpose, I just put it here so the module does something // Probably could just make this method do nothing and it would not // affect the test. diff --git a/FWCore/Integration/test/ProducerWithPSetDesc.h b/FWCore/Integration/test/ProducerWithPSetDesc.h index 2f3943083f240..dcd95bc628937 100644 --- a/FWCore/Integration/test/ProducerWithPSetDesc.h +++ b/FWCore/Integration/test/ProducerWithPSetDesc.h @@ -8,20 +8,18 @@ // of them. #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDProducer.h" +#include "FWCore/Framework/interface/global/EDProducer.h" namespace edm { class ConfigurationDescriptions; } namespace edmtest { - class ProducerWithPSetDesc : public edm::EDProducer { + class ProducerWithPSetDesc : public edm::global::EDProducer<> { public: explicit ProducerWithPSetDesc(edm::ParameterSet const& ps); - virtual ~ProducerWithPSetDesc(); - - virtual void produce(edm::Event& e, edm::EventSetup const& c); + void produce(edm::StreamID, edm::Event& e, edm::EventSetup const& c) const override; static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); diff --git a/FWCore/Integration/test/TestGetterOfProducts.cc b/FWCore/Integration/test/TestGetterOfProducts.cc index a880af40be2a5..6e605802666bf 100644 --- a/FWCore/Integration/test/TestGetterOfProducts.cc +++ b/FWCore/Integration/test/TestGetterOfProducts.cc @@ -1,6 +1,6 @@ #include "FWCore/Framework/interface/stream/EDFilter.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "DataFormats/TestObjects/interface/Thing.h" #include "DataFormats/TestObjects/interface/ToyProducts.h" #include "FWCore/Framework/interface/GetterOfProducts.h" @@ -109,13 +109,16 @@ namespace edmtest { // constructor. // 4. It can be configured to get things from the Run, LuminosityBlock, // or Event. - class TestGetterOfProductsA : public edm::EDAnalyzer { + class TestGetterOfProductsA : public edm::one::EDAnalyzer { public: explicit TestGetterOfProductsA(edm::ParameterSet const&); - ~TestGetterOfProductsA(); - virtual void analyze(edm::Event const&, edm::EventSetup const&); - virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&); - virtual void endRun(edm::Run const&, edm::EventSetup const&); + ~TestGetterOfProductsA() override; + void analyze(edm::Event const&, edm::EventSetup const&) override; + void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; + void endRun(edm::Run const&, edm::EventSetup const&) override; + + void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override {} + void beginRun(edm::Run const&, edm::EventSetup const&) override {} private: std::string processName_; diff --git a/FWCore/Integration/test/TestHistoryKeeping.cc b/FWCore/Integration/test/TestHistoryKeeping.cc index b194da04bd614..39b95bb02ac7f 100644 --- a/FWCore/Integration/test/TestHistoryKeeping.cc +++ b/FWCore/Integration/test/TestHistoryKeeping.cc @@ -3,21 +3,20 @@ #include #include -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" namespace edmtest { - class TestHistoryKeeping : public edm::EDAnalyzer { + class TestHistoryKeeping : public edm::one::EDAnalyzer { public: explicit TestHistoryKeeping(edm::ParameterSet const& pset); - virtual ~TestHistoryKeeping(); - virtual void analyze(edm::Event const& e, edm::EventSetup const&); + void analyze(edm::Event const& e, edm::EventSetup const&) final; - virtual void beginRun(edm::Run const& r, edm::EventSetup const&); - virtual void endRun(edm::Run const& r, edm::EventSetup const&); + void beginRun(edm::Run const& r, edm::EventSetup const&) final; + void endRun(edm::Run const& r, edm::EventSetup const&) final; private: std::vector expectedProcesses_; @@ -36,8 +35,6 @@ namespace edmtest { // Nothing to do. } - TestHistoryKeeping::~TestHistoryKeeping() {} - void TestHistoryKeeping::beginRun(edm::Run const&, edm::EventSetup const&) { // At begin run, we're looking at, make sure we can get at the // parameter sets for any HLT processing. diff --git a/FWCore/Integration/test/TestPSetAnalyzer.cc b/FWCore/Integration/test/TestPSetAnalyzer.cc index 01d390d77c1cb..5d768efe5284d 100644 --- a/FWCore/Integration/test/TestPSetAnalyzer.cc +++ b/FWCore/Integration/test/TestPSetAnalyzer.cc @@ -11,7 +11,7 @@ // user include files #include "DataFormats/Provenance/interface/EventRange.h" #include "DataFormats/Provenance/interface/LuminosityBlockRange.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/global/EDAnalyzer.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -23,13 +23,12 @@ // class decleration // -class TestPSetAnalyzer : public edm::EDAnalyzer { +class TestPSetAnalyzer : public edm::global::EDAnalyzer<> { public: explicit TestPSetAnalyzer(edm::ParameterSet const&); - ~TestPSetAnalyzer(); private: - virtual void analyze(edm::Event const&, edm::EventSetup const&); + void analyze(edm::StreamID, edm::Event const&, edm::EventSetup const&) const final; edm::LuminosityBlockID testLumi_; edm::LuminosityBlockRange testLRange_; @@ -120,26 +119,12 @@ TestPSetAnalyzer::TestPSetAnalyzer(edm::ParameterSet const& iConfig) { } } -TestPSetAnalyzer::~TestPSetAnalyzer() {} - // // member functions // // ------------ method called to for each event ------------ -void TestPSetAnalyzer::analyze(edm::Event const&, edm::EventSetup const&) { - using namespace edm; - -#ifdef THIS_IS_AN_EVENT_EXAMPLE - Handle pIn; - iEvent.getByLabel("example", pIn); -#endif - -#ifdef THIS_IS_AN_EVENTSETUP_EXAMPLE - ESHandle pSetup; - iSetup.get().get(pSetup); -#endif -} +void TestPSetAnalyzer::analyze(edm::StreamID, edm::Event const&, edm::EventSetup const&) const {} //define this as a plug-in DEFINE_FWK_MODULE(TestPSetAnalyzer); diff --git a/FWCore/Integration/test/TestParentage.cc b/FWCore/Integration/test/TestParentage.cc index cdde44a14f800..d3030af037b5e 100644 --- a/FWCore/Integration/test/TestParentage.cc +++ b/FWCore/Integration/test/TestParentage.cc @@ -7,7 +7,7 @@ #include "DataFormats/Provenance/interface/Provenance.h" #include "DataFormats/TestObjects/interface/ToyProducts.h" #include "FWCore/Framework/interface/ConstProductRegistry.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/global/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -52,12 +52,11 @@ namespace { namespace edmtest { - class TestParentage : public edm::EDAnalyzer { + class TestParentage : public edm::global::EDAnalyzer<> { public: explicit TestParentage(edm::ParameterSet const& pset); - virtual ~TestParentage(); - virtual void analyze(edm::Event const& e, edm::EventSetup const& es) override; + void analyze(edm::StreamID, edm::Event const& e, edm::EventSetup const& es) const override; private: edm::InputTag inputTag_; @@ -73,9 +72,7 @@ namespace edmtest { token_ = consumes(inputTag_); } - TestParentage::~TestParentage() {} - - void TestParentage::analyze(edm::Event const& e, edm::EventSetup const&) { + void TestParentage::analyze(edm::StreamID, edm::Event const& e, edm::EventSetup const&) const { edm::Handle h = e.getHandle(token_); edm::Provenance const* prov = h.provenance(); diff --git a/FWCore/Integration/test/UseValueExampleAnalyzer.cc b/FWCore/Integration/test/UseValueExampleAnalyzer.cc index 71a3fd85cec1c..d3efa3c6af506 100644 --- a/FWCore/Integration/test/UseValueExampleAnalyzer.cc +++ b/FWCore/Integration/test/UseValueExampleAnalyzer.cc @@ -21,7 +21,7 @@ Description: #include // user include files -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/global/EDAnalyzer.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -32,12 +32,11 @@ Description: // class decleration // -class UseValueExampleAnalyzer : public edm::EDAnalyzer { +class UseValueExampleAnalyzer : public edm::global::EDAnalyzer<> { public: explicit UseValueExampleAnalyzer(const edm::ParameterSet&); - ~UseValueExampleAnalyzer(); - virtual void analyze(const edm::Event&, const edm::EventSetup&); + void analyze(edm::StreamID, const edm::Event&, const edm::EventSetup&) const final; private: // ----------member data --------------------------- @@ -58,17 +57,14 @@ UseValueExampleAnalyzer::UseValueExampleAnalyzer(const edm::ParameterSet& /* iCo //now do what ever initialization is needed } -UseValueExampleAnalyzer::~UseValueExampleAnalyzer() { - // do anything here that needs to be done at desctruction time - // (e.g. close files, deallocate resources etc.) -} - // // member functions // // ------------ method called to produce the data ------------ -void UseValueExampleAnalyzer::analyze(const edm::Event& /* iEvent */, const edm::EventSetup& /* iSetup*/) { +void UseValueExampleAnalyzer::analyze(edm::StreamID, + const edm::Event& /* iEvent */, + const edm::EventSetup& /* iSetup*/) const { std::cout << " value from service " << edm::Service()->value() << std::endl; } diff --git a/FWCore/Integration/test/WhatsItWatcherAnalyzer.cc b/FWCore/Integration/test/WhatsItWatcherAnalyzer.cc index f1e6c0718c426..09ad3dbc7cab0 100644 --- a/FWCore/Integration/test/WhatsItWatcherAnalyzer.cc +++ b/FWCore/Integration/test/WhatsItWatcherAnalyzer.cc @@ -21,7 +21,7 @@ #include // user include files -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -38,12 +38,11 @@ namespace edmtest { - class WhatsItWatcherAnalyzer : public edm::EDAnalyzer { + class WhatsItWatcherAnalyzer : public edm::one::EDAnalyzer<> { public: explicit WhatsItWatcherAnalyzer(const edm::ParameterSet&); - ~WhatsItWatcherAnalyzer(); - virtual void analyze(const edm::Event&, const edm::EventSetup&); + void analyze(const edm::Event&, const edm::EventSetup&) override; private: // ----------member data --------------------------- @@ -76,11 +75,6 @@ namespace edmtest { //now do what ever initialization is needed } - WhatsItWatcherAnalyzer::~WhatsItWatcherAnalyzer() { - // do anything here that needs to be done at desctruction time - // (e.g. close files, deallocate resources etc.) - } - // // member functions // diff --git a/FWCore/MessageService/test/MLexampleModule_1.cc b/FWCore/MessageService/test/MLexampleModule_1.cc index 3f7917f45c3ae..2ce2845ab9c1c 100644 --- a/FWCore/MessageService/test/MLexampleModule_1.cc +++ b/FWCore/MessageService/test/MLexampleModule_1.cc @@ -7,10 +7,11 @@ namespace edmtest { - void MLexampleModule_1::analyze(edm::Event const& /*unused*/ + void MLexampleModule_1::analyze(edm::StreamID, + edm::Event const& /*unused*/ , edm::EventSetup const& /*unused*/ - ) { + ) const { std::string empty_; std::string file_ = "nameOfFile"; LogDebug("cat_A") << "LogDebug was used to send this message"; diff --git a/FWCore/MessageService/test/MLexampleModule_1.h b/FWCore/MessageService/test/MLexampleModule_1.h index b2018994cbe78..86f4441a8dc73 100644 --- a/FWCore/MessageService/test/MLexampleModule_1.h +++ b/FWCore/MessageService/test/MLexampleModule_1.h @@ -2,7 +2,7 @@ #define FWCore_MessageService_test_MLexampleModule_1_h #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/global/EDAnalyzer.h" namespace edm { class ParameterSet; @@ -10,13 +10,11 @@ namespace edm { namespace edmtest { - class MLexampleModule_1 : public edm::EDAnalyzer { + class MLexampleModule_1 : public edm::global::EDAnalyzer<> { public: explicit MLexampleModule_1(edm::ParameterSet const&) {} - virtual ~MLexampleModule_1() {} - - virtual void analyze(edm::Event const& e, edm::EventSetup const& c); + void analyze(edm::StreamID, edm::Event const& e, edm::EventSetup const& c) const override; private: }; diff --git a/FWCore/MessageService/test/MemoryTestClient_A.cc b/FWCore/MessageService/test/MemoryTestClient_A.cc index 775254fe75632..f1a830c10a8c4 100644 --- a/FWCore/MessageService/test/MemoryTestClient_A.cc +++ b/FWCore/MessageService/test/MemoryTestClient_A.cc @@ -15,6 +15,7 @@ namespace edmtest { int pattern = ps.getUntrackedParameter("pattern", 1); edm::LogWarning("memoryPattern") << "Memory Pattern selected: " << pattern; initializeMemoryPattern(pattern); + usesResource("MemoryTestClient_A"); } void MemoryTestClient_A::analyze(edm::Event const& /*unused*/ diff --git a/FWCore/MessageService/test/MemoryTestClient_A.h b/FWCore/MessageService/test/MemoryTestClient_A.h index 70749fc23cf82..18df7aeb9b372 100644 --- a/FWCore/MessageService/test/MemoryTestClient_A.h +++ b/FWCore/MessageService/test/MemoryTestClient_A.h @@ -2,7 +2,7 @@ #define FWCore_MessageService_test_MemoryTestClient_A_h #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Utilities/interface/propagate_const.h" #include @@ -16,7 +16,7 @@ namespace edm { namespace edmtest { - class MemoryTestClient_A : public edm::EDAnalyzer { + class MemoryTestClient_A : public edm::one::EDAnalyzer { public: explicit MemoryTestClient_A(edm::ParameterSet const&); diff --git a/FWCore/MessageService/test/MessageLoggerClient.cc b/FWCore/MessageService/test/MessageLoggerClient.cc index 0f92a6d413bd9..2cdd5e43157e3 100644 --- a/FWCore/MessageService/test/MessageLoggerClient.cc +++ b/FWCore/MessageService/test/MessageLoggerClient.cc @@ -6,10 +6,11 @@ namespace edmtest { - void MessageLoggerClient::analyze(edm::Event const& /*unused*/ + void MessageLoggerClient::analyze(edm::StreamID, + edm::Event const& /*unused*/ , edm::EventSetup const& /*unused*/ - ) { + ) const { //std::cout << "Module reached\n"; LogDebug("aTestMessage") << "LogDebug was used to send this message"; edm::LogInfo("aTestMessage") << "LogInfo was used to send this message"; diff --git a/FWCore/MessageService/test/MessageLoggerClient.h b/FWCore/MessageService/test/MessageLoggerClient.h index 9b7dc790cfa73..22745602abbb7 100644 --- a/FWCore/MessageService/test/MessageLoggerClient.h +++ b/FWCore/MessageService/test/MessageLoggerClient.h @@ -2,7 +2,7 @@ #define Integration_MessageLoggerClient_h #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/global/EDAnalyzer.h" namespace edm { class ParameterSet; @@ -10,13 +10,11 @@ namespace edm { namespace edmtest { - class MessageLoggerClient : public edm::EDAnalyzer { + class MessageLoggerClient : public edm::global::EDAnalyzer<> { public: explicit MessageLoggerClient(edm::ParameterSet const&) {} - virtual ~MessageLoggerClient() {} - - virtual void analyze(edm::Event const& e, edm::EventSetup const& c); + void analyze(edm::StreamID, edm::Event const& e, edm::EventSetup const& c) const final; private: }; diff --git a/FWCore/MessageService/test/PSetTestClient_A.cc b/FWCore/MessageService/test/PSetTestClient_A.cc index 73ecb2c896a59..78c8b9ff76c22 100644 --- a/FWCore/MessageService/test/PSetTestClient_A.cc +++ b/FWCore/MessageService/test/PSetTestClient_A.cc @@ -18,10 +18,11 @@ namespace edmtest { // std::cerr << "...xa = " << xa << "xb = " << xb << "\n"; } - void PSetTestClient_A::analyze(edm::Event const& /*unused*/ + void PSetTestClient_A::analyze(edm::StreamID, + edm::Event const& /*unused*/ , edm::EventSetup const& /*unused*/ - ) { + ) const { // std::cerr << "PSetTestClient_A::analyze called\n"; edm::LogError("x") << "xa = " << xa << " xb = " << xb; } diff --git a/FWCore/MessageService/test/PSetTestClient_A.h b/FWCore/MessageService/test/PSetTestClient_A.h index 2191e02d9e5d2..8d7db7dcec49d 100644 --- a/FWCore/MessageService/test/PSetTestClient_A.h +++ b/FWCore/MessageService/test/PSetTestClient_A.h @@ -2,7 +2,7 @@ #define FWCore_MessageService_test_PSetTestClient_A_h #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/global/EDAnalyzer.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -14,12 +14,11 @@ namespace edm { namespace edmtest { - class PSetTestClient_A : public edm::EDAnalyzer { + class PSetTestClient_A : public edm::global::EDAnalyzer<> { public: explicit PSetTestClient_A(edm::ParameterSet const& p); - virtual ~PSetTestClient_A() {} - virtual void analyze(edm::Event const& e, edm::EventSetup const& c); + void analyze(edm::StreamID, edm::Event const& e, edm::EventSetup const& c) const final; private: edm::ParameterSet a; diff --git a/FWCore/MessageService/test/ProblemTestClient_t1.cc b/FWCore/MessageService/test/ProblemTestClient_t1.cc index e1be73977ddfa..230f434c76fd3 100644 --- a/FWCore/MessageService/test/ProblemTestClient_t1.cc +++ b/FWCore/MessageService/test/ProblemTestClient_t1.cc @@ -7,10 +7,11 @@ namespace edmtest { - void ProblemTestClient_t1::analyze(edm::Event const& /*unused*/ + void ProblemTestClient_t1::analyze(edm::StreamID, + edm::Event const& /*unused*/ , edm::EventSetup const& /*unused*/ - ) { + ) const { LogDebug("cat_A") << "This message should not appear"; LogDebug("TrackerGeom") << "LogDebug was used to send this message"; diff --git a/FWCore/MessageService/test/ProblemTestClient_t1.h b/FWCore/MessageService/test/ProblemTestClient_t1.h index a6dc9ebb33253..538022020d58d 100644 --- a/FWCore/MessageService/test/ProblemTestClient_t1.h +++ b/FWCore/MessageService/test/ProblemTestClient_t1.h @@ -2,7 +2,7 @@ #define FWCore_MessageService_test_ProblemTestClient_t1_h #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/global/EDAnalyzer.h" namespace edm { class ParameterSet; @@ -10,13 +10,11 @@ namespace edm { namespace edmtest { - class ProblemTestClient_t1 : public edm::EDAnalyzer { + class ProblemTestClient_t1 : public edm::global::EDAnalyzer<> { public: explicit ProblemTestClient_t1(edm::ParameterSet const&) {} - virtual ~ProblemTestClient_t1() {} - - virtual void analyze(edm::Event const& e, edm::EventSetup const& c); + void analyze(edm::StreamID, edm::Event const& e, edm::EventSetup const& c) const final; private: }; diff --git a/FWCore/MessageService/test/UnitTestClient_SLumi.h b/FWCore/MessageService/test/UnitTestClient_SLumi.h index e735595c1970c..4f418bdf9b820 100644 --- a/FWCore/MessageService/test/UnitTestClient_SLumi.h +++ b/FWCore/MessageService/test/UnitTestClient_SLumi.h @@ -2,7 +2,7 @@ #define FWCore_MessageService_test_UnitTestClient_SLumi_h #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -13,16 +13,14 @@ namespace edm { namespace edmtest { - class UTC_SL1 : public edm::EDAnalyzer { + class UTC_SL1 : public edm::one::EDAnalyzer<> { public: explicit UTC_SL1(edm::ParameterSet const &p) { identifier = p.getUntrackedParameter("identifier", 99); edm::GroupLogStatistics("grouped_cat"); } - virtual ~UTC_SL1() {} - - virtual void analyze(edm::Event const &e, edm::EventSetup const &c); + void analyze(edm::Event const &e, edm::EventSetup const &c) override; private: int identifier; @@ -30,28 +28,25 @@ namespace edmtest { static int n; }; - class UTC_SL2 : public edm::EDAnalyzer { + class UTC_SL2 : public edm::one::EDAnalyzer<> { public: explicit UTC_SL2(edm::ParameterSet const &p) { identifier = p.getUntrackedParameter("identifier", 98); } - virtual ~UTC_SL2() {} - - virtual void analyze(edm::Event const &e, edm::EventSetup const &c); + void analyze(edm::Event const &e, edm::EventSetup const &c) override; private: int identifier; static int n; }; - class UTC_SLUMMARY : public edm::EDAnalyzer { + class UTC_SLUMMARY : public edm::one::EDAnalyzer { public: explicit UTC_SLUMMARY(edm::ParameterSet const &) {} - virtual ~UTC_SLUMMARY() {} - - virtual void analyze(edm::Event const &e, edm::EventSetup const &c); + void analyze(edm::Event const &e, edm::EventSetup const &c) override; - virtual void endLuminosityBlock(edm::LuminosityBlock const &lb, edm::EventSetup const &c); + void beginLuminosityBlock(edm::LuminosityBlock const &lb, edm::EventSetup const &c) override {} + void endLuminosityBlock(edm::LuminosityBlock const &lb, edm::EventSetup const &c) override; private: }; diff --git a/FWCore/MessageService/test/makeSignals.cc b/FWCore/MessageService/test/makeSignals.cc index 9986aee8835fc..809a09fadcb5a 100644 --- a/FWCore/MessageService/test/makeSignals.cc +++ b/FWCore/MessageService/test/makeSignals.cc @@ -13,8 +13,8 @@ namespace edmtest { - void makeSignals::analyze(edm::Event const& e, edm::EventSetup const& /*unused*/ - ) { + void makeSignals::analyze(edm::StreamID, edm::Event const& e, edm::EventSetup const& /*unused*/ + ) const { #ifdef RAISE_SEGV int signum = 11; std::string SigName("SIGSEGV"); diff --git a/FWCore/MessageService/test/makeSignals.h b/FWCore/MessageService/test/makeSignals.h index a56753971a073..63113c4ee1c7c 100644 --- a/FWCore/MessageService/test/makeSignals.h +++ b/FWCore/MessageService/test/makeSignals.h @@ -2,7 +2,7 @@ #define FWCore_MessageService_test_makeSignals_h #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/global/EDAnalyzer.h" namespace edm { class ParameterSet; @@ -10,13 +10,11 @@ namespace edm { namespace edmtest { - class makeSignals : public edm::EDAnalyzer { + class makeSignals : public edm::global::EDAnalyzer<> { public: explicit makeSignals(edm::ParameterSet const&) {} - virtual ~makeSignals() {} - - virtual void analyze(edm::Event const& e, edm::EventSetup const& c); + void analyze(edm::StreamID, edm::Event const& e, edm::EventSetup const& c) const final; private: }; diff --git a/FWCore/Modules/src/AbortOnEventIDAnalyzer.cc b/FWCore/Modules/src/AbortOnEventIDAnalyzer.cc index 3f81dd6f03bdf..545689afac567 100644 --- a/FWCore/Modules/src/AbortOnEventIDAnalyzer.cc +++ b/FWCore/Modules/src/AbortOnEventIDAnalyzer.cc @@ -18,7 +18,7 @@ // user include files #include "DataFormats/Provenance/interface/EventID.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/global/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" @@ -35,7 +35,7 @@ // class decleration // -class AbortOnEventIDAnalyzer : public edm::EDAnalyzer { +class AbortOnEventIDAnalyzer : public edm::global::EDAnalyzer<> { public: explicit AbortOnEventIDAnalyzer(edm::ParameterSet const&); ~AbortOnEventIDAnalyzer() override; @@ -43,7 +43,7 @@ class AbortOnEventIDAnalyzer : public edm::EDAnalyzer { private: void beginJob() override; - void analyze(edm::Event const&, edm::EventSetup const&) override; + void analyze(edm::StreamID, edm::Event const&, edm::EventSetup const&) const override; void endJob() override; // ----------member data --------------------------- @@ -88,8 +88,8 @@ namespace { } // namespace // ------------ method called to for each event ------------ -void AbortOnEventIDAnalyzer::analyze(edm::Event const& iEvent, edm::EventSetup const&) { - std::vector::iterator itFind = std::find_if(ids_.begin(), ids_.end(), CompareWithoutLumi(iEvent.id())); +void AbortOnEventIDAnalyzer::analyze(edm::StreamID, edm::Event const& iEvent, edm::EventSetup const&) const { + auto itFind = std::find_if(ids_.begin(), ids_.end(), CompareWithoutLumi(iEvent.id())); if (itFind != ids_.end()) { if (throwException_) { throw cms::Exception("AbortEvent") << "Found event " << iEvent.id() << "\n"; diff --git a/FWCore/Modules/src/EventContentAnalyzer.cc b/FWCore/Modules/src/EventContentAnalyzer.cc index ca813d12bd36d..af5acd0136133 100644 --- a/FWCore/Modules/src/EventContentAnalyzer.cc +++ b/FWCore/Modules/src/EventContentAnalyzer.cc @@ -17,7 +17,7 @@ // user include files #include "DataFormats/Provenance/interface/Provenance.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/GenericHandle.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -256,7 +256,7 @@ namespace edm { } } // namespace - class EventContentAnalyzer : public EDAnalyzer { + class EventContentAnalyzer : public one::EDAnalyzer<> { public: explicit EventContentAnalyzer(ParameterSet const&); ~EventContentAnalyzer() override; diff --git a/FWCore/Modules/src/EventSetupCacheIdentifierChecker.cc b/FWCore/Modules/src/EventSetupCacheIdentifierChecker.cc index cb64bfe015a76..c9a58bc32dff1 100644 --- a/FWCore/Modules/src/EventSetupCacheIdentifierChecker.cc +++ b/FWCore/Modules/src/EventSetupCacheIdentifierChecker.cc @@ -23,7 +23,7 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -40,7 +40,8 @@ // namespace edm { - class EventSetupCacheIdentifierChecker : public edm::EDAnalyzer { + class EventSetupCacheIdentifierChecker + : public edm::one::EDAnalyzer { public: explicit EventSetupCacheIdentifierChecker(const edm::ParameterSet&); ~EventSetupCacheIdentifierChecker() override; @@ -53,9 +54,9 @@ namespace edm { //virtual void endJob() ; void beginRun(edm::Run const&, edm::EventSetup const&) override; - //virtual void endRun(edm::Run const&, edm::EventSetup const&); + void endRun(edm::Run const&, edm::EventSetup const&) override {} void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; - //virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&); + void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override {} void check(edm::EventSetup const&); void initialize(); diff --git a/FWCore/Services/test/SiteLocalConfigServiceTester.cc b/FWCore/Services/test/SiteLocalConfigServiceTester.cc index b4f00df25f334..f64c2f39af427 100644 --- a/FWCore/Services/test/SiteLocalConfigServiceTester.cc +++ b/FWCore/Services/test/SiteLocalConfigServiceTester.cc @@ -10,7 +10,7 @@ // Created: Tue Apr 20 16:51:38 CDT 2010 // -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/global/EDAnalyzer.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ServiceRegistry/interface/Service.h" #include "FWCore/Catalog/interface/SiteLocalConfig.h" @@ -20,11 +20,11 @@ #include namespace edmtest { - class SiteLocalConfigServiceTester : public edm::EDAnalyzer { + class SiteLocalConfigServiceTester : public edm::global::EDAnalyzer<> { public: SiteLocalConfigServiceTester(const edm::ParameterSet& iPSet); - void analyze(const edm::Event&, const edm::EventSetup&) override; + void analyze(edm::StreamID, const edm::Event&, const edm::EventSetup&) const override; private: std::string m_cacheHint; @@ -88,7 +88,7 @@ namespace { } // namespace -void SiteLocalConfigServiceTester::analyze(const edm::Event&, const edm::EventSetup&) { +void SiteLocalConfigServiceTester::analyze(edm::StreamID, const edm::Event&, const edm::EventSetup&) const { edm::Service pConfig; if (m_valuesSet) { testValue("sourceCacheTempDir", m_tempDir, pConfig->sourceCacheTempDir()); diff --git a/IOPool/SecondaryInput/test/SecondaryProducer.h b/IOPool/SecondaryInput/test/SecondaryProducer.h index 7d3086649deb3..9cb871db42110 100644 --- a/IOPool/SecondaryInput/test/SecondaryProducer.h +++ b/IOPool/SecondaryInput/test/SecondaryProducer.h @@ -9,7 +9,7 @@ ************************************************************/ #include "DataFormats/Provenance/interface/EventID.h" -#include "FWCore/Framework/interface/EDProducer.h" +#include "FWCore/Framework/interface/one/EDProducer.h" #include "FWCore/Utilities/interface/get_underlying_safe.h" #include @@ -19,7 +19,7 @@ namespace edm { class ProcessConfiguration; class VectorInputSource; - class SecondaryProducer : public EDProducer { + class SecondaryProducer : public one::EDProducer<> { public: /** standard constructor*/ explicit SecondaryProducer(ParameterSet const& pset); @@ -28,14 +28,14 @@ namespace edm { virtual ~SecondaryProducer(); /**Accumulates the pileup events into this event*/ - virtual void produce(Event& e1, EventSetup const& c); + void produce(Event& e1, EventSetup const& c) override; bool processOneEvent(EventPrincipal const& eventPrincipal, Event& e); private: virtual void put(Event&) {} - virtual void beginJob(); - virtual void endJob(); + void beginJob() override; + void endJob() override; std::shared_ptr makeSecInput(ParameterSet const& ps); std::shared_ptr productRegistry() const { return get_underlying_safe(productRegistry_); } diff --git a/IOPool/Streamer/test/StreamThingAnalyzer.h b/IOPool/Streamer/test/StreamThingAnalyzer.h index 8d654bb8d7ca7..97a4d82024b9a 100644 --- a/IOPool/Streamer/test/StreamThingAnalyzer.h +++ b/IOPool/Streamer/test/StreamThingAnalyzer.h @@ -2,7 +2,7 @@ #define IOPool_Streamer_StreamThingAnalyzer_h #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/GetterOfProducts.h" #if 1 @@ -18,7 +18,7 @@ typedef edmtestprod::IntArray WriteThis; namespace edmtest_thing { - class StreamThingAnalyzer : public edm::EDAnalyzer { + class StreamThingAnalyzer : public edm::one::EDAnalyzer<> { public: explicit StreamThingAnalyzer(edm::ParameterSet const&); diff --git a/IOPool/Streamer/test/StreamThingProducer.cc b/IOPool/Streamer/test/StreamThingProducer.cc index 87aa56750e4c2..a6e5a67f44cc7 100644 --- a/IOPool/Streamer/test/StreamThingProducer.cc +++ b/IOPool/Streamer/test/StreamThingProducer.cc @@ -42,7 +42,7 @@ namespace edmtest_thing { StreamThingProducer::~StreamThingProducer() {} // Functions that gets called by framework every event - void StreamThingProducer::produce(edm::Event& e, edm::EventSetup const&) { + void StreamThingProducer::produce(edm::StreamID, edm::Event& e, edm::EventSetup const&) const { for (int i = 0; i < inst_count_; ++i) { auto result = std::make_unique(size_); diff --git a/IOPool/Streamer/test/StreamThingProducer.h b/IOPool/Streamer/test/StreamThingProducer.h index 663fae6060425..fc5d334859db3 100644 --- a/IOPool/Streamer/test/StreamThingProducer.h +++ b/IOPool/Streamer/test/StreamThingProducer.h @@ -9,19 +9,19 @@ ************************************************************/ #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDProducer.h" +#include "FWCore/Framework/interface/global/EDProducer.h" #include #include namespace edmtest_thing { - class StreamThingProducer : public edm::EDProducer { + class StreamThingProducer : public edm::global::EDProducer<> { public: explicit StreamThingProducer(edm::ParameterSet const& ps); ~StreamThingProducer() override; - void produce(edm::Event& e, edm::EventSetup const& c) override; + void produce(edm::StreamID, edm::Event& e, edm::EventSetup const& c) const override; private: int size_;