Skip to content

Commit

Permalink
Fix CMS deprecation warnings in RecoLuminosity/LumiProducer
Browse files Browse the repository at this point in the history
- moved to thread friendly module types
- added esConsumes when needed
  • Loading branch information
Dr15Jones committed Jun 29, 2022
1 parent 0f0c0f3 commit 33ab7ae
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 69 deletions.
5 changes: 3 additions & 2 deletions RecoLuminosity/LumiProducer/plugins/LumiCalculator.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef RecoLuminosity_LumiProducer_LumiCalculator_h
#define RecoLuminosity_LumiProducer_LumiCalculator_h
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/Run.h"
Expand Down Expand Up @@ -31,7 +31,7 @@ struct MyPerLumiInfo {
unsigned long long deadcount;
};

class LumiCalculator : public edm::EDAnalyzer {
class LumiCalculator : public edm::one::EDAnalyzer<edm::one::WatchRuns, edm::one::WatchLuminosityBlocks> {
public:
explicit LumiCalculator(edm::ParameterSet const& pset);
~LumiCalculator() override;
Expand All @@ -40,6 +40,7 @@ class LumiCalculator : public edm::EDAnalyzer {
void beginJob() override;
void beginRun(const edm::Run& run, const edm::EventSetup& c) override;
void analyze(edm::Event const& e, edm::EventSetup const& c) override;
void beginLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c) override {}
void endLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c) override;
void endRun(edm::Run const&, edm::EventSetup const&) override;
void endJob() override;
Expand Down
22 changes: 10 additions & 12 deletions RecoLuminosity/LumiProducer/test/TestDIPLumiProducer.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/LuminosityBlock.h"
Expand All @@ -21,22 +21,21 @@ namespace edm {
using namespace std;
using namespace edm;

class TestDIPLumiProducer : public edm::EDAnalyzer {
class TestDIPLumiProducer : public edm::one::EDAnalyzer<edm::one::WatchLuminosityBlocks> {
public:
explicit TestDIPLumiProducer(edm::ParameterSet const&);
virtual ~TestDIPLumiProducer();

virtual void analyze(edm::Event const& e, edm::EventSetup const& c);
virtual void endLuminosityBlock(LuminosityBlock const& lumiBlock, EventSetup const& c);
};

// -----------------------------------------------------------------
void beginLuminosityBlock(LuminosityBlock const& lumiBlock, EventSetup const& c) override {}
void analyze(edm::Event const& e, edm::EventSetup const& c) override;
void endLuminosityBlock(LuminosityBlock const& lumiBlock, EventSetup const& c) override;

TestDIPLumiProducer::TestDIPLumiProducer(edm::ParameterSet const& ps) {}
private:
edm::ESGetToken<DIPLumiSummary, DIPLuminosityRcd> token_;
};

// -----------------------------------------------------------------

TestDIPLumiProducer::~TestDIPLumiProducer() {}
TestDIPLumiProducer::TestDIPLumiProducer(edm::ParameterSet const& ps) : token_(esConsumes()) {}

// -----------------------------------------------------------------

Expand All @@ -53,8 +52,7 @@ void TestDIPLumiProducer::endLuminosityBlock(edm::LuminosityBlock const& lumiBlo
<< "\" does not exist " << std::endl;
}
try {
edm::ESHandle<DIPLumiSummary> datahandle;
es.getData(datahandle);
edm::ESHandle<DIPLumiSummary> datahandle = es.getHandle(token_);
if (datahandle.isValid()) {
const DIPLumiSummary* mydata = datahandle.product();
if (!mydata->isNull()) {
Expand Down
14 changes: 5 additions & 9 deletions RecoLuminosity/LumiProducer/test/TestExpressLumiProducer.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/LuminosityBlock.h"
Expand All @@ -19,13 +19,13 @@ using namespace edm;

namespace edmtest {

class TestExpressLumiProducer : public edm::EDAnalyzer {
class TestExpressLumiProducer : public edm::one::EDAnalyzer<edm::one::WatchLuminosityBlocks> {
public:
explicit TestExpressLumiProducer(edm::ParameterSet const&);
virtual ~TestExpressLumiProducer();

virtual void analyze(edm::Event const& e, edm::EventSetup const& c);
virtual void endLuminosityBlock(LuminosityBlock const& lumiBlock, EventSetup const& c);
void beginLuminosityBlock(LuminosityBlock const& lumiBlock, EventSetup const& c) override {}
void analyze(edm::Event const& e, edm::EventSetup const& c) override;
void endLuminosityBlock(LuminosityBlock const& lumiBlock, EventSetup const& c) override;
};

// -----------------------------------------------------------------
Expand All @@ -37,10 +37,6 @@ namespace edmtest {

// -----------------------------------------------------------------

TestExpressLumiProducer::~TestExpressLumiProducer() {}

// -----------------------------------------------------------------

void TestExpressLumiProducer::analyze(edm::Event const& e, edm::EventSetup const&) {}

// -----------------------------------------------------------------
Expand Down
14 changes: 5 additions & 9 deletions RecoLuminosity/LumiProducer/test/TestLumiProducer.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/LuminosityBlock.h"
Expand All @@ -20,13 +20,13 @@ using namespace edm;

namespace edmtest {

class TestLumiProducer : public edm::EDAnalyzer {
class TestLumiProducer : public edm::one::EDAnalyzer<edm::one::WatchLuminosityBlocks> {
public:
explicit TestLumiProducer(edm::ParameterSet const&);
virtual ~TestLumiProducer();

virtual void analyze(edm::Event const& e, edm::EventSetup const& c);
virtual void endLuminosityBlock(LuminosityBlock const& lumiBlock, EventSetup const& c);
void beginLuminosityBlock(LuminosityBlock const& lumiBlock, EventSetup const& c) override {}
void analyze(edm::Event const& e, edm::EventSetup const& c) override;
void endLuminosityBlock(LuminosityBlock const& lumiBlock, EventSetup const& c) override;
};

// -----------------------------------------------------------------
Expand All @@ -38,10 +38,6 @@ namespace edmtest {

// -----------------------------------------------------------------

TestLumiProducer::~TestLumiProducer() {}

// -----------------------------------------------------------------

void TestLumiProducer::analyze(edm::Event const& e, edm::EventSetup const&) {}

// -----------------------------------------------------------------
Expand Down
19 changes: 10 additions & 9 deletions RecoLuminosity/LumiProducer/test/genLumiRaw.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef RecoLuminosity_LumiProducer_genLumiRaw_h
#define RecoLuminosity_LumiProducer_genLumiRaw_h
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/Run.h"
Expand All @@ -19,18 +19,19 @@
one job can generate data for at most 1 run and unlimited number of LS
**/

class genLumiRaw : public edm::EDAnalyzer {
class genLumiRaw : public edm::one::EDAnalyzer<edm::one::WatchRuns, edm::one::WatchLuminosityBlocks> {
public:
explicit genLumiRaw(edm::ParameterSet const&);
virtual ~genLumiRaw();
~genLumiRaw();

private:
virtual void beginJob();
virtual void beginRun(const edm::Run& run, const edm::EventSetup& c);
virtual void analyze(edm::Event const& e, edm::EventSetup const& c);
virtual void endLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c);
virtual void endRun(edm::Run const&, edm::EventSetup const&);
virtual void endJob();
void beginJob() override;
void beginRun(const edm::Run& run, const edm::EventSetup& c) override;
void beginLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c) override {}
void analyze(edm::Event const& e, edm::EventSetup const& c) override;
void endLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c) override;
void endRun(edm::Run const&, edm::EventSetup const&) override;
void endJob() override;

void generateRunSummary(unsigned int runnumber, unsigned int totalCMSls);
void generateHLT(unsigned int runnumber, unsigned int lsnumber);
Expand Down
22 changes: 9 additions & 13 deletions RecoLuminosity/LumiProducer/test/testEvtLoop.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef RecoLuminosity_LumiProducer_testEvtLoop_h
#define RecoLuminosity_LumiProducer_testEvtLoop_h
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/Run.h"
Expand All @@ -9,18 +9,18 @@
#include "FWCore/Framework/interface/MakerMacros.h"
#include <iostream>

class testEvtLoop : public edm::EDAnalyzer {
class testEvtLoop : public edm::one::EDAnalyzer<edm::one::WatchRuns, edm::one::WatchLuminosityBlocks> {
public:
explicit testEvtLoop(edm::ParameterSet const&);
virtual ~testEvtLoop();

private:
virtual void beginJob();
virtual void beginRun(const edm::Run& run, const edm::EventSetup& c);
virtual void analyze(edm::Event const& e, edm::EventSetup const& c);
virtual void endLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c);
virtual void endRun(edm::Run const&, edm::EventSetup const&);
virtual void endJob();
void beginJob() override;
void beginRun(const edm::Run& run, const edm::EventSetup& c) override;
void beginLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c) override {}
void analyze(edm::Event const& e, edm::EventSetup const& c) override;
void endLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c) override;
void endRun(edm::Run const&, edm::EventSetup const&) override;
void endJob() override;
}; //end class

// -----------------------------------------------------------------
Expand All @@ -29,10 +29,6 @@ testEvtLoop::testEvtLoop(edm::ParameterSet const& iConfig) {}

// -----------------------------------------------------------------

testEvtLoop::~testEvtLoop() {}

// -----------------------------------------------------------------

void testEvtLoop::analyze(edm::Event const& e, edm::EventSetup const&) {
//std::cout<<"testEvtLoop::analyze"<<std::endl;
}
Expand Down
22 changes: 7 additions & 15 deletions RecoLuminosity/LumiProducer/test/testSiteService.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef RecoLuminosity_LumiProducer_testSiteService_h
#define RecoLuminosity_LumiProducer_testSiteService_h
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/Run.h"
Expand All @@ -13,24 +13,20 @@

#include <iostream>

class testSiteService : public edm::EDAnalyzer {
class testSiteService : public edm::one::EDAnalyzer<edm::one::WatchLuminosityBlocks> {
public:
explicit testSiteService(edm::ParameterSet const&);
virtual ~testSiteService();

private:
virtual void beginJob();
virtual void beginRun(const edm::Run& run, const edm::EventSetup& c);
virtual void analyze(edm::Event const& e, edm::EventSetup const& c);
virtual void endLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c);
virtual void endRun(edm::Run const&, edm::EventSetup const&);
virtual void endJob();
void beginJob() override;
void beginLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c) override {}
void analyze(edm::Event const& e, edm::EventSetup const& c) override;
void endLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c) override;
void endJob() override;
}; //end class
// -----------------------------------------------------------------
testSiteService::testSiteService(edm::ParameterSet const& iConfig) {}
// -----------------------------------------------------------------
testSiteService::~testSiteService() {}
// -----------------------------------------------------------------
void testSiteService::analyze(edm::Event const& e, edm::EventSetup const&) {}
// -----------------------------------------------------------------
void testSiteService::endLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c) {
Expand All @@ -53,10 +49,6 @@ void testSiteService::endLuminosityBlock(edm::LuminosityBlock const& lumiBlock,
// -----------------------------------------------------------------
void testSiteService::beginJob() { std::cout << "testEvtLoop::beginJob" << std::endl; }
// -----------------------------------------------------------------
void testSiteService::beginRun(const edm::Run& run, const edm::EventSetup& c) {}
// -----------------------------------------------------------------
void testSiteService::endRun(edm::Run const& run, edm::EventSetup const& c) {}
// -----------------------------------------------------------------
void testSiteService::endJob() {}
DEFINE_FWK_MODULE(testSiteService);
#endif

0 comments on commit 33ab7ae

Please sign in to comment.