Skip to content

Commit

Permalink
Remove beginJob/endJob in DQMEDAnalyzer.
Browse files Browse the repository at this point in the history
Most of them where useless, or only to call DQMStore::save().
That might be useful, but we really don't like people doing that so I removed them.

In a few cases modules were migrated to DQMOneEDAnalyzer because they had nontrivial logic in the beginJOb/endJob.
That logic is most likely broken either ways, but like this it at least still compiles.
  • Loading branch information
schneiml committed Jan 28, 2020
1 parent d44f62a commit cd7f1fe
Show file tree
Hide file tree
Showing 42 changed files with 10 additions and 158 deletions.
2 changes: 0 additions & 2 deletions Calibration/EcalCalibAlgos/interface/ECALpedestalPCLworker.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,8 @@ class ECALpedestalPCLworker : public DQMEDAnalyzer {
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions);

private:
void beginJob() override;
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
void analyze(const edm::Event &, const edm::EventSetup &) override;
void endJob() override;

edm::EDGetTokenT<EBDigiCollection> digiTokenEB_;
edm::EDGetTokenT<EEDigiCollection> digiTokenEE_;
Expand Down
4 changes: 0 additions & 4 deletions Calibration/EcalCalibAlgos/src/ECALpedestalPCLworker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,6 @@ void ECALpedestalPCLworker::analyze(const edm::Event& iEvent, const edm::EventSe
} // ee digis
}

void ECALpedestalPCLworker::beginJob() {}

void ECALpedestalPCLworker::endJob() {}

void ECALpedestalPCLworker::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.setUnknown();
Expand Down
2 changes: 0 additions & 2 deletions DQM/EcalPreshowerMonitorModule/interface/ESFEDIntegrityTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ class ESFEDIntegrityTask : public DQMEDAnalyzer {
/// Analyze
void analyze(const edm::Event& e, const edm::EventSetup& c) override;

void endJob() override;

private:
int ievt_;

Expand Down
1 change: 0 additions & 1 deletion DQM/EcalPreshowerMonitorModule/interface/ESPedestalTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class ESPedestalTask : public DQMEDAnalyzer {
private:
void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
void analyze(const edm::Event&, const edm::EventSetup&) override;
void endJob(void) override;

edm::EDGetTokenT<ESDigiCollection> digitoken_;
edm::FileInPath lookup_;
Expand Down
3 changes: 0 additions & 3 deletions DQM/EcalPreshowerMonitorModule/interface/ESRawDataTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ class ESRawDataTask : public DQMEDAnalyzer {
/// Analyze
void analyze(const edm::Event& e, const edm::EventSetup& c) override;

/// EndJob
void endJob(void) override;

/// Setup
void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;

Expand Down
3 changes: 0 additions & 3 deletions DQM/EcalPreshowerMonitorModule/interface/ESTrendTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ class ESTrendTask : public DQMEDAnalyzer {
// Analyze
void analyze(const edm::Event& e, const edm::EventSetup& c) override;

// EndJob
void endJob(void) override;

// BeginRun
void dqmBeginRun(const edm::Run& r, const edm::EventSetup& c) override;

Expand Down
2 changes: 0 additions & 2 deletions DQM/EcalPreshowerMonitorModule/src/ESFEDIntegrityTask.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ void ESFEDIntegrityTask::bookHistograms(DQMStore::IBooker& iBooker, Run const&,
meESFedsNonFatal_ = iBooker.book1D(histo, histo, 56, 520, 576);
}

void ESFEDIntegrityTask::endJob(void) { LogInfo("ESFEDIntegrityTask") << "analyzed " << ievt_ << " events"; }

void ESFEDIntegrityTask::analyze(const Event& e, const EventSetup& c) {
ievt_++;

Expand Down
2 changes: 0 additions & 2 deletions DQM/EcalPreshowerMonitorModule/src/ESPedestalTask.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ void ESPedestalTask::bookHistograms(DQMStore::IBooker& iBooker, Run const&, Even
}
}

void ESPedestalTask::endJob(void) { LogInfo("ESPedestalTask") << "analyzed " << ievt_ << " events"; }

void ESPedestalTask::analyze(const edm::Event& e, const edm::EventSetup& iSetup) {
ievt_++;
runNum_ = e.id().run();
Expand Down
2 changes: 0 additions & 2 deletions DQM/EcalPreshowerMonitorModule/src/ESRawDataTask.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ void ESRawDataTask::bookHistograms(DQMStore::IBooker& iBooker, Run const&, Event
meOrbitNumberDiff_->setAxisTitle("Num of Events", 2);
}

void ESRawDataTask::endJob(void) { LogInfo("ESRawDataTask") << "analyzed " << ievt_ << " events"; }

void ESRawDataTask::analyze(const Event& e, const EventSetup& c) {
ievt_++;
runNum_ = e.id().run();
Expand Down
2 changes: 0 additions & 2 deletions DQM/EcalPreshowerMonitorModule/src/ESTrendTask.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ void ESTrendTask::bookHistograms(DQMStore::IBooker& iBooker, Run const&, EventSe
hESFiberErrTrendHr_->setAxisTitle("ES Fiber Err / hour", 2);
}

void ESTrendTask::endJob(void) { LogInfo("ESTrendTask") << "analyzed " << ievt_ << " events"; }

void ESTrendTask::analyze(const Event& e, const EventSetup& c) {
ievt_++;

Expand Down
4 changes: 2 additions & 2 deletions DQM/SiStripCommon/test/plugins/testTkHistoMap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// user include files
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "DQMServices/Core/interface/DQMEDAnalyzer.h"
#include "DQMServices/Core/interface/DQMOneEDAnalyzer.h"

#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
Expand Down Expand Up @@ -35,7 +35,7 @@
// class declaration
//

class testTkHistoMap : public DQMEDAnalyzer {
class testTkHistoMap : public DQMOneEDAnalyzer<> {
public:
explicit testTkHistoMap(const edm::ParameterSet&);
~testTkHistoMap();
Expand Down
7 changes: 2 additions & 5 deletions DQM/TrackingMonitor/interface/LogMessageMonitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
#include <memory>

// user include files
#include "DQMServices/Core/interface/DQMOneEDAnalyzer.h"
#include "FWCore/Utilities/interface/EDGetToken.h"
#include "FWCore/Framework/interface/ConsumesCollector.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"

#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
Expand All @@ -32,11 +32,8 @@
#include "FWCore/ParameterSet/interface/ParameterSet.h"

#include "FWCore/ServiceRegistry/interface/Service.h"
#include "DQMServices/Core/interface/DQMStore.h"
#include "FWCore/MessageLogger/interface/ErrorSummaryEntry.h"

#include <DQMServices/Core/interface/DQMEDAnalyzer.h>

#include <vector>
#include <string>
#include <map>
Expand All @@ -49,7 +46,7 @@ class GetLumi;
// class declaration
//

class LogMessageMonitor : public DQMEDAnalyzer {
class LogMessageMonitor : public DQMOneEDAnalyzer<> {
public:
explicit LogMessageMonitor(const edm::ParameterSet&);
~LogMessageMonitor() override;
Expand Down
2 changes: 0 additions & 2 deletions DQM/TrackingMonitor/interface/TrackEfficiencyMonitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ class TrackEfficiencyMonitor : public DQMEDAnalyzer {
typedef reco::TrackCollection TrackCollection;
explicit TrackEfficiencyMonitor(const edm::ParameterSet&);
~TrackEfficiencyMonitor() override;
void beginJob(void) override;
void endJob(void) override;
void analyze(const edm::Event&, const edm::EventSetup&) override;

void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
Expand Down
1 change: 0 additions & 1 deletion DQM/TrackingMonitor/interface/dEdxAnalyzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class dEdxAnalyzer : public DQMEDAnalyzer {
static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);

void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) override;
void endJob() override;
double mass(double P, double I);

void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
Expand Down
18 changes: 0 additions & 18 deletions DQM/TrackingMonitor/src/TrackEfficiencyMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,6 @@ void TrackEfficiencyMonitor::bookHistograms(DQMStore::IBooker& ibooker,
StandaloneMuonPtEtaPhiHighPt->setAxisTitle("");
}

//-----------------------------------------------------------------------------------
void TrackEfficiencyMonitor::beginJob(void)
//-----------------------------------------------------------------------------------
{}

//-----------------------------------------------------------------------------------
void TrackEfficiencyMonitor::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
//-----------------------------------------------------------------------------------
Expand Down Expand Up @@ -366,19 +361,6 @@ void TrackEfficiencyMonitor::analyze(const edm::Event& iEvent, const edm::EventS
delete theNavigation;
}

//-----------------------------------------------------------------------------------
void TrackEfficiencyMonitor::endJob(void)
//-----------------------------------------------------------------------------------
{
bool outputMEsInRootFile = conf_.getParameter<bool>("OutputMEsInRootFile");
std::string outputFileName = conf_.getParameter<std::string>("OutputFileName");
if (outputMEsInRootFile) {
dqmStore_->save(outputFileName);
}

//if ( theNavigation ) delete theNavigation;
}

//-----------------------------------------------------------------------------------
void TrackEfficiencyMonitor::testTrackerTracks(edm::Handle<reco::TrackCollection> tkTracks,
edm::Handle<reco::TrackCollection> staTracks,
Expand Down
9 changes: 0 additions & 9 deletions DQM/TrackingMonitor/src/dEdxAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,6 @@ dEdxAnalyzer::~dEdxAnalyzer() {
delete genTriggerEventFlag_;
}

// ------------ method called once each job just after ending the event loop ------------
void dEdxAnalyzer::endJob() {
bool outputMEsInRootFile = conf_.getParameter<bool>("OutputMEsInRootFile");
std::string outputFileName = conf_.getParameter<std::string>("OutputFileName");
if (outputMEsInRootFile) {
dqmStore_->save(outputFileName);
}
}

/*
// -- BeginRun
//---------------------------------------------------------------------------------//
Expand Down
2 changes: 0 additions & 2 deletions DQMOffline/Hcal/interface/CaloTowersAnalyzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ class CaloTowersAnalyzer : public DQMEDAnalyzer {
~CaloTowersAnalyzer() override;

void analyze(edm::Event const &, edm::EventSetup const &) override;
void beginJob() override;
void endJob() override;
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override;

Expand Down
2 changes: 0 additions & 2 deletions DQMOffline/Hcal/interface/HcalNoiseRates.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ class HcalNoiseRates : public DQMEDAnalyzer {
~HcalNoiseRates() override;

private:
void beginJob() override;
void analyze(const edm::Event &, const edm::EventSetup &) override;
void endJob() override;
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;

std::string outputFile_;
Expand Down
4 changes: 0 additions & 4 deletions DQMOffline/Hcal/src/CaloTowersAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,6 @@ void CaloTowersAnalyzer::bookHistograms(DQMStore::IBooker &ibooker,

CaloTowersAnalyzer::~CaloTowersAnalyzer() {}

void CaloTowersAnalyzer::endJob() {}

void CaloTowersAnalyzer::beginJob() { nevent = 0; }

void CaloTowersAnalyzer::analyze(edm::Event const &event, edm::EventSetup const &) {
nevent++;

Expand Down
11 changes: 0 additions & 11 deletions DQMOffline/Hcal/src/HcalNoiseRates.cc
Original file line number Diff line number Diff line change
Expand Up @@ -165,16 +165,5 @@ void HcalNoiseRates::analyze(const edm::Event &iEvent, const edm::EventSetup &ev
} // done looping over RBXs
}

// ------------ method called once each job just before starting event loop
// ------------
void HcalNoiseRates::beginJob() {}

// ------------ method called once each job just after ending the event loop
// ------------
void HcalNoiseRates::endJob() {
if (useAllHistos_)
hLumiBlockCount_->Fill(0.0, lumiCountMap_.size());
}

// define this as a plug-in
DEFINE_FWK_MODULE(HcalNoiseRates);
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ class L1TStage2CaloLayer2Offline : public DQMEDAnalyzer {
void dqmBeginRun(edm::Run const&, edm::EventSetup const&) override;
void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
void analyze(edm::Event const& e, edm::EventSetup const& eSetup) override;
void endJob() override;

private:
//histos booking function
Expand Down
1 change: 0 additions & 1 deletion DQMOffline/L1Trigger/interface/L1TTauOffline.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ class L1TTauOffline : public DQMEDAnalyzer {
void dqmBeginRun(const edm::Run& run, const edm::EventSetup& iSetup) override;
void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
void analyze(edm::Event const& e, edm::EventSetup const& eSetup) override;
void endJob() override;

const reco::Vertex getPrimaryVertex(edm::Handle<reco::VertexCollection> const& vertex,
edm::Handle<reco::BeamSpot> const& beamSpot);
Expand Down
5 changes: 0 additions & 5 deletions DQMOffline/L1Trigger/src/L1TStage2CaloLayer2Offline.cc
Original file line number Diff line number Diff line change
Expand Up @@ -988,11 +988,6 @@ bool L1TStage2CaloLayer2Offline::doesNotOverlapWithHLTObjects(const l1t::Jet& je
return matchedObjects.empty();
}

void L1TStage2CaloLayer2Offline::endJob() {
// TODO: In offline, this runs after histograms are saved!
//normalise2DHistogramsToBinArea();
}

void L1TStage2CaloLayer2Offline::normalise2DHistogramsToBinArea() {
std::vector<MonitorElement*> monElementstoNormalize = {
h_L1METvsCaloMET_, h_L1ETMHFvsCaloETMHF_, h_L1METvsPFMetNoMu_, h_L1MHTvsRecoMHT_,
Expand Down
4 changes: 0 additions & 4 deletions DQMOffline/L1Trigger/src/L1TTauOffline.cc
Original file line number Diff line number Diff line change
Expand Up @@ -670,10 +670,6 @@ void L1TTauOffline::getProbeTaus(const edm::Event& iEvent,
}
}
}
void L1TTauOffline::endJob() {
// TODO: In offline, this runs after histograms are saved!
//normalise2DHistogramsToBinArea();
}

void L1TTauOffline::normalise2DHistogramsToBinArea() {
std::vector<MonitorElement*> monElementstoNormalize = {h_L1TauETvsTauET_EB_,
Expand Down
4 changes: 1 addition & 3 deletions FastSimulation/MaterialEffects/test/testMaterialEffects.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// user include files
#include "FWCore/Framework/interface/stream/EDAnalyzer.h"
#include "DQMServices/Core/interface/DQMEDAnalyzer.h"

#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
Expand All @@ -13,8 +13,6 @@
#include "FastSimulation/Event/interface/FSimTrack.h"
#include "FastSimulation/Event/interface/FSimVertex.h"

#include "DQMServices/Core/interface/DQMEDAnalyzer.h"
#include "DQMServices/Core/interface/DQMStore.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include <vector>
#include <string>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// user include files
#include "FWCore/Framework/interface/stream/EDProducer.h"
#include "DQMServices/Core/interface/DQMEDAnalyzer.h"

#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
Expand All @@ -16,9 +16,6 @@
#include "FastSimulation/Event/interface/FSimVertex.h"
#include "FastSimDataFormats/NuclearInteractions/interface/NUEvent.h"

#include "DQMServices/Core/interface/DQMEDAnalyzer.h"
#include "DQMServices/Core/interface/DQMStore.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include <vector>
#include <string>
#include "TFile.h"
Expand Down
4 changes: 2 additions & 2 deletions Validation/HcalHits/interface/HcalSimHitsValidation.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef HcalSimHitsValidation_H
#define HcalSimHitsValidation_H

#include "DQMServices/Core/interface/DQMEDAnalyzer.h"
#include "DQMServices/Core/interface/DQMOneEDAnalyzer.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
Expand Down Expand Up @@ -38,7 +38,7 @@
#include <utility>
#include <vector>

class HcalSimHitsValidation : public DQMEDAnalyzer {
class HcalSimHitsValidation : public DQMOneEDAnalyzer<> {
public:
HcalSimHitsValidation(edm::ParameterSet const &conf);
~HcalSimHitsValidation() override;
Expand Down
3 changes: 0 additions & 3 deletions Validation/RecoMuon/src/MuonTrackAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ MuonTrackAnalyzer::~MuonTrackAnalyzer() {
delete theService;
}

void MuonTrackAnalyzer::beginJob() {
//theFile->cd();
}
void MuonTrackAnalyzer::bookHistograms(DQMStore::IBooker &ibooker,
edm::Run const &iRun,
edm::EventSetup const & /* iSetup */) {
Expand Down
1 change: 0 additions & 1 deletion Validation/RecoMuon/src/MuonTrackAnalyzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ class MuonTrackAnalyzer : public DQMEDAnalyzer {

// Operations

void beginJob() override;
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override;
void tracksAnalysis(const edm::Event &event,
const edm::EventSetup &eventSetup,
Expand Down
7 changes: 2 additions & 5 deletions Validation/RecoTrack/interface/SiPixelTrackingRecHitsValid.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@
#define Validation_RecoTrack_SiPixelTrackingRecHitsValid_h

//DQM services for histogram
#include "DQMServices/Core/interface/DQMStore.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "DQMServices/Core/interface/DQMEDAnalyzer.h"
#include "DQMServices/Core/interface/DQMOneEDAnalyzer.h"

#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/Event.h"
#include "DataFormats/Common/interface/Handle.h"
#include "FWCore/Framework/interface/EventSetup.h"
Expand Down Expand Up @@ -65,7 +62,7 @@
class TTree;
class TFile;

class SiPixelTrackingRecHitsValid : public DQMEDAnalyzer {
class SiPixelTrackingRecHitsValid : public DQMOneEDAnalyzer<> {
public:
explicit SiPixelTrackingRecHitsValid(const edm::ParameterSet& conf);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ class SiStripTrackingRecHitsValid : public DQMEDAnalyzer {
void analyze(const edm::Event& e, const edm::EventSetup& c) override;
void bookHistograms(DQMStore::IBooker& ibooker, const edm::Run& run, const edm::EventSetup& es) override;
const MagneticField* magfield2_;
void endJob() override;

private:
DQMStore* dbe_;
Expand Down
Loading

0 comments on commit cd7f1fe

Please sign in to comment.