Skip to content

Commit

Permalink
Converted remaining DQM modules to edm::one::EDAnalyzer
Browse files Browse the repository at this point in the history
This fixes the CMS deprecation warnings in the DQM subsystem.
  • Loading branch information
Dr15Jones committed Oct 27, 2022
1 parent e58106d commit 8a78bd0
Show file tree
Hide file tree
Showing 18 changed files with 37 additions and 18 deletions.
1 change: 1 addition & 0 deletions DQM/BeamMonitor/plugins/AlcaBeamMonitorClient.cc
Expand Up @@ -24,6 +24,7 @@ AlcaBeamMonitorClient::AlcaBeamMonitorClient(const ParameterSet& ps)
: parameters_(ps),
monitorName_(parameters_.getUntrackedParameter<string>("MonitorName", "YourSubsystemName")),
numberOfValuesToSave_(0) {
usesResource("DQMStore");
dbe_ = Service<DQMStore>().operator->();

if (!monitorName_.empty())
Expand Down
6 changes: 4 additions & 2 deletions DQM/BeamMonitor/plugins/AlcaBeamMonitorClient.h
Expand Up @@ -12,15 +12,16 @@
#include <string>
// CMS
#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/ParameterSet/interface/ParameterSet.h"
#include "DQMServices/Core/interface/DQMStore.h"
#include "DataFormats/Provenance/interface/LuminosityBlockID.h"
//#include "DataFormats/VertexReco/interface/Vertex.h"
//#include "DataFormats/VertexReco/interface/VertexFwd.h"

class AlcaBeamMonitorClient : public edm::EDAnalyzer {
class AlcaBeamMonitorClient
: public edm::one::EDAnalyzer<edm::one::SharedResources, edm::one::WatchRuns, edm::one::WatchLuminosityBlocks> {
public:
typedef dqm::legacy::MonitorElement MonitorElement;
typedef dqm::legacy::DQMStore DQMStore;
Expand All @@ -32,6 +33,7 @@ class AlcaBeamMonitorClient : public edm::EDAnalyzer {
void beginJob(void) override;
void beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup) override;
void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) override;
void beginLuminosityBlock(const edm::LuminosityBlock& iLumi, const edm::EventSetup& iSetup) override {}
void endLuminosityBlock(const edm::LuminosityBlock& iLumi, const edm::EventSetup& iSetup) override;
void endRun(const edm::Run& iRun, const edm::EventSetup& iSetup) override;

Expand Down
1 change: 1 addition & 0 deletions DQM/BeamMonitor/plugins/BeamConditionsMonitor.cc
Expand Up @@ -30,6 +30,7 @@ BeamConditionsMonitor::BeamConditionsMonitor(const ParameterSet& ps) : countEvt_
bsSrc_ = parameters_.getUntrackedParameter<InputTag>("beamSpot");
debug_ = parameters_.getUntrackedParameter<bool>("Debug");
beamSpotToken_ = esConsumes();
usesResource("DQMStore");
dbe_ = Service<DQMStore>().operator->();

if (!monitorName_.empty())
Expand Down
5 changes: 3 additions & 2 deletions DQM/BeamMonitor/plugins/BeamConditionsMonitor.h
Expand Up @@ -11,7 +11,7 @@
#include <string>
// CMS
#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/ParameterSet/interface/ParameterSet.h"
#include "DQMServices/Core/interface/DQMStore.h"
Expand All @@ -23,7 +23,8 @@
// class declaration
//
class BeamSpotObjectsRcd;
class BeamConditionsMonitor : public edm::EDAnalyzer {
class BeamConditionsMonitor
: public edm::one::EDAnalyzer<edm::one::SharedResources, edm::one::WatchRuns, edm::one::WatchLuminosityBlocks> {
public:
BeamConditionsMonitor(const edm::ParameterSet&);
~BeamConditionsMonitor() override;
Expand Down
1 change: 1 addition & 0 deletions DQM/BeamMonitor/plugins/BeamMonitorBx.cc
Expand Up @@ -58,6 +58,7 @@ BeamMonitorBx::BeamMonitorBx(const ParameterSet& ps) : countBx_(0), countEvt_(0)
fitNLumi_ = parameters_.getUntrackedParameter<int>("fitEveryNLumi", -1);
resetFitNLumi_ = parameters_.getUntrackedParameter<int>("resetEveryNLumi", -1);

usesResource("DQMStore");
dbe_ = Service<DQMStore>().operator->();

if (!monitorName_.empty())
Expand Down
5 changes: 3 additions & 2 deletions DQM/BeamMonitor/plugins/BeamMonitorBx.h
Expand Up @@ -11,7 +11,7 @@
#include <string>
// CMS
#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/ParameterSet/interface/ParameterSet.h"
#include "DQMServices/Core/interface/DQMStore.h"
Expand All @@ -22,7 +22,8 @@
// class declaration
//

class BeamMonitorBx : public edm::EDAnalyzer {
class BeamMonitorBx
: public edm::one::EDAnalyzer<edm::one::SharedResources, edm::one::WatchRuns, edm::one::WatchLuminosityBlocks> {
public:
typedef dqm::legacy::MonitorElement MonitorElement;
typedef dqm::legacy::DQMStore DQMStore;
Expand Down
4 changes: 2 additions & 2 deletions DQM/EcalMonitorDbModule/interface/EcalBarrelMonitorDbModule.h
Expand Up @@ -10,7 +10,7 @@

#include <string>

#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"

Expand All @@ -21,7 +21,7 @@

class MonitorElementsDb;

class EcalBarrelMonitorDbModule : public edm::EDAnalyzer {
class EcalBarrelMonitorDbModule : public edm::one::EDAnalyzer<edm::one::SharedResources> {
public:
typedef dqm::legacy::MonitorElement MonitorElement;
typedef dqm::legacy::DQMStore DQMStore;
Expand Down
Expand Up @@ -26,6 +26,7 @@
#include "FWCore/Framework/interface/MakerMacros.h"

EcalBarrelMonitorDbModule::EcalBarrelMonitorDbModule(const edm::ParameterSet &ps) {
usesResource("DQMStore");
dqmStore_ = edm::Service<DQMStore>().operator->();

prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
Expand Down
1 change: 1 addition & 0 deletions DQM/HLTEvF/plugins/FourVectorHLT.cc
Expand Up @@ -15,6 +15,7 @@ using namespace edm;
FourVectorHLT::FourVectorHLT(const edm::ParameterSet& iConfig) {
LogDebug("FourVectorHLT") << "constructor....";

usesResource("DQMStore");
dbe_ = Service<DQMStore>().operator->();
if (!dbe_) {
LogWarning("Status") << "unable to get DQMStore service?";
Expand Down
4 changes: 2 additions & 2 deletions DQM/HLTEvF/plugins/FourVectorHLT.h
Expand Up @@ -25,7 +25,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"
Expand All @@ -43,7 +43,7 @@
// class decleration
//

class FourVectorHLT : public edm::EDAnalyzer {
class FourVectorHLT : public edm::one::EDAnalyzer<edm::one::SharedResources, edm::one::WatchRuns> {
public:
typedef dqm::legacy::MonitorElement MonitorElement;
typedef dqm::legacy::DQMStore DQMStore;
Expand Down
Expand Up @@ -6,7 +6,7 @@
#include "DQM/SiStripCommissioningClients/interface/SiStripTFile.h"
#include "DQM/SiStripCommissioningClients/interface/SummaryPlotXmlParser.h"
#include "DQM/SiStripCommissioningSummary/interface/SummaryPlot.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
Expand All @@ -26,7 +26,7 @@ class TH1;
histograms", analyzes the histograms to extract "monitorables", and
creates summary histograms.
*/
class SiStripCommissioningOfflineClient : public edm::EDAnalyzer {
class SiStripCommissioningOfflineClient : public edm::one::EDAnalyzer<edm::one::SharedResources, edm::one::WatchRuns> {
public:
typedef dqm::harvesting::MonitorElement MonitorElement;
typedef dqm::harvesting::DQMStore DQMStore;
Expand All @@ -35,6 +35,7 @@ class SiStripCommissioningOfflineClient : public edm::EDAnalyzer {
~SiStripCommissioningOfflineClient() override;

void beginRun(const edm::Run&, const edm::EventSetup&) override;
void endRun(const edm::Run&, const edm::EventSetup&) override {}
void analyze(const edm::Event&, const edm::EventSetup&) override;
void endJob() override;

Expand Down
Expand Up @@ -53,6 +53,7 @@ SiStripCommissioningOfflineClient::SiStripCommissioningOfflineClient(const edm::
parameters_(pset) {
LogTrace(mlDqmClient_) << "[SiStripCommissioningOfflineClient::" << __func__ << "]"
<< " Constructing object...";
usesResource("DQMStore");
setInputFiles(inputFiles_,
pset.getUntrackedParameter<std::string>("FilePath"),
pset.existsAs<std::string>("PartitionName") ? pset.getParameter<std::string>("PartitionName") : "",
Expand Down
Expand Up @@ -12,7 +12,7 @@
#include "DataFormats/SiStripDigi/interface/SiStripDigi.h"
#include "DataFormats/SiStripDigi/interface/SiStripRawDigi.h"
#include "DataFormats/SiStripCluster/interface/SiStripCluster.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "DQMServices/Core/interface/DQMStore.h"
#include "CondFormats/DataRecord/interface/SiStripNoisesRcd.h"
Expand All @@ -31,7 +31,7 @@ class SiStripEventSummary;
/**
@class SiStripCommissioningSource
*/
class SiStripCommissioningSource : public edm::EDAnalyzer {
class SiStripCommissioningSource : public edm::one::EDAnalyzer<edm::one::SharedResources, edm::one::WatchRuns> {
public: // ---------- Public interface ----------
/** Map of task objects, identified through FedChanelId */
typedef std::map<unsigned int, CommissioningTask*> TaskMap;
Expand All @@ -48,6 +48,7 @@ class SiStripCommissioningSource : public edm::EDAnalyzer {
~SiStripCommissioningSource() override;

void beginRun(edm::Run const&, const edm::EventSetup&) override;
void endRun(edm::Run const&, const edm::EventSetup&) override {}
void analyze(const edm::Event&, const edm::EventSetup&) override;
void endJob() override;

Expand Down
Expand Up @@ -76,6 +76,7 @@ SiStripCommissioningSource::SiStripCommissioningSource(const edm::ParameterSet&
base_(""),
view_(pset.getUntrackedParameter<std::string>("View", "Default")),
parameters_(pset) {
usesResource("DQMStore");
inputModuleSummaryToken_ = consumes<SiStripEventSummary>(edm::InputTag(inputModuleLabelSummary_));
digiVirginRawToken_ = mayConsume<edm::DetSetVector<SiStripRawDigi> >(edm::InputTag(inputModuleLabel_, "VirginRaw"));
digiFineDelaySelectionToken_ =
Expand Down
6 changes: 4 additions & 2 deletions DQM/TrigXMonitorClient/interface/HLTScalersClient.h
Expand Up @@ -42,7 +42,7 @@
#include <utility>
#include <vector>

#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"

#include "DQMServices/Core/interface/DQMStore.h"
Expand All @@ -53,7 +53,8 @@
#define MAX_PATHS 200
#define MAX_LUMI_SEG_HLT 2400

class HLTScalersClient : public edm::EDAnalyzer {
class HLTScalersClient
: public edm::one::EDAnalyzer<edm::one::SharedResources, edm::one::WatchRuns, edm::one::WatchLuminosityBlocks> {
private:
std::ofstream textfile_;

Expand Down Expand Up @@ -133,6 +134,7 @@ class HLTScalersClient : public edm::EDAnalyzer {

/// End LumiBlock
/// DQM Client Diagnostic should be performed here
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c) override {}
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c) override;

// unused
Expand Down
6 changes: 4 additions & 2 deletions DQM/TrigXMonitorClient/interface/L1ScalersClient.h
Expand Up @@ -6,7 +6,7 @@
#ifndef L1ScalersCLIENT_H
#define L1ScalersCLIENT_H

#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"

#include "DQMServices/Core/interface/DQMStore.h"
Expand All @@ -19,7 +19,8 @@
#define MAX_TT 80
#define MAX_LUMI_SEG 2000

class L1ScalersClient : public edm::EDAnalyzer {
class L1ScalersClient
: public edm::one::EDAnalyzer<edm::one::SharedResources, edm::one::WatchRuns, edm::one::WatchLuminosityBlocks> {
public:
typedef dqm::legacy::MonitorElement MonitorElement;
typedef dqm::legacy::DQMStore DQMStore;
Expand All @@ -44,6 +45,7 @@ class L1ScalersClient : public edm::EDAnalyzer {

/// End LumiBlock
/// DQM Client Diagnostic should be performed here
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c) override {}
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c) override;

// unused
Expand Down
1 change: 1 addition & 0 deletions DQM/TrigXMonitorClient/src/HLTScalersClient.cc
Expand Up @@ -81,6 +81,7 @@ HLTScalersClient::HLTScalersClient(const edm::ParameterSet &ps)
}
}
// get back-end interface
usesResource("DQMStore");
dbe_ = edm::Service<DQMStore>().operator->();
dbe_->setCurrentFolder(folderName_);

Expand Down
1 change: 1 addition & 0 deletions DQM/TrigXMonitorClient/src/L1ScalersClient.cc
Expand Up @@ -34,6 +34,7 @@ L1ScalersClient::L1ScalersClient(const edm::ParameterSet &ps)
first_tt(true) {
LogDebug("Status") << "constructor";
// get back-end interface
usesResource("DQMStore");
dbe_ = edm::Service<DQMStore>().operator->();
assert(dbe_ != nullptr); // blammo!
dbe_->setCurrentFolder(folderName_);
Expand Down

0 comments on commit 8a78bd0

Please sign in to comment.