Skip to content

Commit

Permalink
Merge pull request #19247 from Dr15Jones/useDQMToken
Browse files Browse the repository at this point in the history
Finish conversion of DQMEDHarvester to EDProducers
  • Loading branch information
cmsbuild committed Jul 4, 2017
2 parents d3b3564 + 08aa7e7 commit 89319f9
Show file tree
Hide file tree
Showing 58 changed files with 285 additions and 246 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
+ SiPixelPhase1TrackEfficiencyHarvester
+ SiPixelPhase1RawDataHarvester
+ RunQTests_offline
+ SiPixelPhase1Summary_Offline
+ SiPixelPhase1SummaryOffline
)

siPixelPhase1OfflineDQM_harvesting_cosmics = siPixelPhase1OfflineDQM_harvesting.copyAndExclude([
SiPixelPhase1TrackEfficiencyHarvester,
])

siPixelPhase1OfflineDQM_harvesting_cosmics.replace(RunQTests_offline, RunQTests_cosmics)
siPixelPhase1OfflineDQM_harvesting_cosmics.replace(SiPixelPhase1Summary_Offline, SiPixelPhase1Summary_Cosmics)
siPixelPhase1OfflineDQM_harvesting_cosmics.replace(SiPixelPhase1SummaryOffline, SiPixelPhase1SummaryCosmics)
4 changes: 2 additions & 2 deletions DQM/SiPixelPhase1Config/python/SiPixelPhase1OnlineDQM_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@
+ SiPixelPhase1ClustersHarvester
+ SiPixelPhase1RawDataHarvester
+ RunQTests_online
+ SiPixelPhase1Summary_Online
+ SiPixelPhase1SummaryOnline
# + SiPixelPhase1GeometryDebugHarvester
)

siPixelPhase1OnlineDQM_timing_harvesting = siPixelPhase1OnlineDQM_harvesting.copyAndExclude([
RunQTests_online,
SiPixelPhase1Summary_Online,
SiPixelPhase1SummaryOnline,
])
6 changes: 3 additions & 3 deletions DQM/SiPixelPhase1Summary/python/SiPixelPhase1Summary_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# This object is used to make changes for different running scenarios
#

SiPixelPhase1Summary_Online = DQMEDHarvester("SiPixelPhase1Summary",
SiPixelPhase1SummaryOnline = DQMEDHarvester("SiPixelPhase1Summary",
TopFolderName = cms.string('PixelPhase1/Phase1_MechanicalView/'),
RunOnEndLumi = cms.bool(True),
RunOnEndJob = cms.bool(True),
Expand Down Expand Up @@ -33,7 +33,7 @@
)
)

SiPixelPhase1Summary_Offline = DQMEDHarvester("SiPixelPhase1Summary",
SiPixelPhase1SummaryOffline = DQMEDHarvester("SiPixelPhase1Summary",
TopFolderName = cms.string('PixelPhase1/Phase1_MechanicalView/'),
RunOnEndLumi = cms.bool(False),
RunOnEndJob = cms.bool(True),
Expand Down Expand Up @@ -61,7 +61,7 @@
)
)

SiPixelPhase1Summary_Cosmics = DQMEDHarvester("SiPixelPhase1Summary",
SiPixelPhase1SummaryCosmics = DQMEDHarvester("SiPixelPhase1Summary",
TopFolderName = cms.string('PixelPhase1/Phase1_MechanicalView/'),
RunOnEndLumi = cms.bool(False),
RunOnEndJob = cms.bool(True),
Expand Down
2 changes: 1 addition & 1 deletion DQMOffline/L1Trigger/python/L1TEfficiencyHarvesting_cfi.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FWCore.ParameterSet.Config as cms
from DQMServices.Core.DQMEDHarvester import DQMEDHarvester

l1tEfficiencyMuons_Harvesting = DQMEDHarvester("L1TEfficiency_Harvesting",
l1tEfficiencyMuonsHarvesting = DQMEDHarvester("L1TEfficiency_Harvesting",
verbose = cms.untracked.bool(False),
plotCfgs = cms.untracked.VPSet(
cms.untracked.PSet( dqmBaseDir = cms.untracked.string("L1T/Efficiency/Muons"),
Expand Down
2 changes: 1 addition & 1 deletion DQMOffline/L1Trigger/python/L1TriggerDqmOffline_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@
l1tStage2EmulatorMonitorClient *
l1tStage2MonitorClient *
DQMHarvestL1Trigger *
l1tEfficiencyMuons_Harvesting
l1tEfficiencyMuonsHarvesting
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@


# Path and EndPath definitions
process.myHarvesting = cms.Path(process.DQMExample_Step2)
process.myHarvesting = cms.Path(process.DQMExampleStep2)
process.myEff = cms.Path(
process.l1tStage2CaloLayer2Efficiency * process.l1tStage2CaloLayer2EmuDiff +
process. l1tEGammaEfficiency * process.l1tEGammaEmuDiff
Expand Down
12 changes: 6 additions & 6 deletions DQMOffline/Muon/python/EfficencyPlotter_cfi.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FWCore.ParameterSet.Config as cms
from DQMServices.Core.DQMEDHarvester import DQMEDHarvester

effPlotter_Loose = DQMEDHarvester("EfficiencyPlotter",
effPlotterLoose = DQMEDHarvester("EfficiencyPlotter",
folder = cms.string("Muons/EfficiencyAnalyzer"),
phiMin = cms.double(-3.2),
etaMin = cms.double(-2.5),
Expand All @@ -19,7 +19,7 @@
)


effPlotter_Medium = DQMEDHarvester("EfficiencyPlotter",
effPlotterMedium = DQMEDHarvester("EfficiencyPlotter",
folder = cms.string("Muons/EfficiencyAnalyzer"),
phiMin = cms.double(-3.2),
etaMin = cms.double(-2.5),
Expand All @@ -37,7 +37,7 @@
)


effPlotter_Tight = DQMEDHarvester("EfficiencyPlotter",
effPlotterTight = DQMEDHarvester("EfficiencyPlotter",
folder = cms.string("Muons/EfficiencyAnalyzer"),
phiMin = cms.double(-3.2),
etaMin = cms.double(-2.5),
Expand All @@ -53,7 +53,7 @@
vtxMax = cms.double(40.5),
MuonID = cms.string("Tight")
)
effPlotter_Loose_miniAOD = DQMEDHarvester("EfficiencyPlotter",
effPlotterLooseMiniAOD = DQMEDHarvester("EfficiencyPlotter",
folder = cms.string("Muons_miniAOD/EfficiencyAnalyzer"),
phiMin = cms.double(-3.2),
etaMin = cms.double(-2.5),
Expand All @@ -71,7 +71,7 @@
)


effPlotter_Medium_miniAOD = DQMEDHarvester("EfficiencyPlotter",
effPlotterMediumMiniAOD = DQMEDHarvester("EfficiencyPlotter",
folder = cms.string("Muons_miniAOD/EfficiencyAnalyzer"),
phiMin = cms.double(-3.2),
etaMin = cms.double(-2.5),
Expand All @@ -89,7 +89,7 @@
)


effPlotter_Tight_miniAOD = DQMEDHarvester("EfficiencyPlotter",
effPlotterTightMiniAOD = DQMEDHarvester("EfficiencyPlotter",
folder = cms.string("Muons_miniAOD/EfficiencyAnalyzer"),
phiMin = cms.double(-3.2),
etaMin = cms.double(-2.5),
Expand Down
12 changes: 6 additions & 6 deletions DQMOffline/Muon/python/muonQualityTests_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@

muonQualityTests = cms.Sequence(muonSourcesQualityTests*
muTrackResidualsTest*
effPlotter_Loose*
effPlotter_Medium*
effPlotter_Tight*
effPlotterLoose*
effPlotterMedium*
effPlotterTight*
muRecoTest*
muonClientsQualityTests*
muonComp2RefQualityTests*
Expand All @@ -50,9 +50,9 @@

muonQualityTests_miniAOD = cms.Sequence(muonSourcesQualityTests*
muTrackResidualsTest*
effPlotter_Loose_miniAOD*
effPlotter_Medium_miniAOD*
effPlotter_Tight_miniAOD*
effPlotterLooseMiniAOD*
effPlotterMediumMiniAOD*
effPlotterTightMiniAOD*
muRecoTest*
muonClientsQualityTests*
muonComp2RefQualityTests*
Expand Down
2 changes: 1 addition & 1 deletion DQMOffline/PFTau/python/PFClient_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
)

# need a different Client to store the slices
pfClient_JetRes = DQMEDHarvester("PFClient_JetRes",
pfClientJetRes = DQMEDHarvester("PFClient_JetRes",
FolderNames = cms.vstring("PFJet/CompWithGenJet","PFJet/CompWithCaloJet"),
HistogramNames = cms.vstring( "delta_et_Over_et_VS_et_"),
CreateEfficiencyPlots = cms.bool(False),
Expand Down
12 changes: 6 additions & 6 deletions DQMOffline/Trigger/python/HLTTauPostProcessor_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ def _addEfficiencies(level, quantities, nameFormat, titleObject="#tau", postfix=
return (m1, m2)


(HLTTauPostAnalysis_Inclusive, HLTTauPostAnalysis_Inclusive2) = makeInclusiveAnalyzer(hltTauOfflineMonitor_Inclusive)
(HLTTauPostAnalysis_PFTaus, HLTTauPostAnalysis_PFTaus2) = makePFTauAnalyzer(hltTauOfflineMonitor_PFTaus)
(HLTTauPostAnalysis_TP, HLTTauPostAnalysis_TP2) = makePFTauAnalyzer(hltTauOfflineMonitor_TagAndProbe)
(HLTTauPostAnalysisInclusive, HLTTauPostAnalysisInclusive2) = makeInclusiveAnalyzer(hltTauOfflineMonitor_Inclusive)
(HLTTauPostAnalysisPFTaus, HLTTauPostAnalysisPFTaus2) = makePFTauAnalyzer(hltTauOfflineMonitor_PFTaus)
(HLTTauPostAnalysisTP, HLTTauPostAnalysisTP2) = makePFTauAnalyzer(hltTauOfflineMonitor_TagAndProbe)

HLTTauPostSeq = cms.Sequence(
HLTTauPostAnalysis_Inclusive+HLTTauPostAnalysis_Inclusive2+
HLTTauPostAnalysis_PFTaus+HLTTauPostAnalysis_PFTaus2+
HLTTauPostAnalysis_TP+HLTTauPostAnalysis_TP2
HLTTauPostAnalysisInclusive+HLTTauPostAnalysisInclusive2+
HLTTauPostAnalysisPFTaus+HLTTauPostAnalysisPFTaus2+
HLTTauPostAnalysisTP+HLTTauPostAnalysisTP2
)
5 changes: 3 additions & 2 deletions DQMServices/Components/plugins/MEtoEDMConverter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "DQMServices/Components/plugins/MEtoEDMConverter.h"
#include "classlib/utils/StringList.h"
#include "classlib/utils/StringOps.h"
#include "DataFormats/Histograms/interface/DQMToken.h"

using namespace lat;

Expand Down Expand Up @@ -78,9 +79,9 @@ MEtoEDMConverter::MEtoEDMConverter(const edm::ParameterSet & iPSet) :
produces<MEtoEDM<long long>, edm::Transition::EndLuminosityBlock>(sName);
produces<MEtoEDM<TString>, edm::Transition::EndLuminosityBlock>(sName);

iCount.clear();
consumesMany<DQMToken>();

assert(sizeof(int64_t) == sizeof(long long));
static_assert(sizeof(int64_t) == sizeof(long long),"type int64_t is not the same length as long long");

}

Expand Down
12 changes: 5 additions & 7 deletions DQMServices/Core/interface/DQMEDHarvester.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define CORE_DQMED_HARVESTER_H

//<<<<<< INCLUDES >>>>>>
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/Framework/interface/one/EDProducer.h"
#include "DQMServices/Core/interface/DQMStore.h"

Expand All @@ -19,23 +18,22 @@ edm::EndLuminosityBlockProducer>
{
public:
DQMEDHarvester(void);
#ifdef __INTEL_COMPILER
virtual ~DQMEDHarvester() = default;
#endif

// implicit copy constructor
// implicit assignment operator
// implicit destructor
virtual void beginRun(edm::Run const&, edm::EventSetup const&) override {};
virtual void produce(edm::Event&, edm::EventSetup const&) override final {};
virtual void endRun(edm::Run const&, edm::EventSetup const&) override {};
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const&) final {};
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const&) final;
virtual void endJob() final;
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const&) override final {};
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const&) override final;
virtual void endJob() override final;
virtual void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const&) {};
virtual void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) = 0;
void endLuminosityBlockProduce(edm::LuminosityBlock&, edm::EventSetup const&) override final;

private:
virtual void endLuminosityBlockProduce(edm::LuminosityBlock&, edm::EventSetup const&) override final;

};

Expand Down
10 changes: 8 additions & 2 deletions DQMServices/Core/src/DQMEDHarvester.cc
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
#include "DQMServices/Core/interface/DQMEDHarvester.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/Framework/interface/LuminosityBlock.h"
#include "DataFormats/Histograms/interface/DQMToken.h"

#include <memory>

DQMEDHarvester::DQMEDHarvester() {
usesResource("DQMStore");
produces<DQMToken,edm::Transition::EndLuminosityBlock>();
}

void DQMEDHarvester::endJob() {
Expand All @@ -21,5 +26,6 @@ void DQMEDHarvester::endLuminosityBlock(edm::LuminosityBlock const& iLumi,
});
}

void DQMEDHarvester::endLuminosityBlockProduce(edm::LuminosityBlock&, edm::EventSetup const&) {}

void DQMEDHarvester::endLuminosityBlockProduce(edm::LuminosityBlock& iLumi, edm::EventSetup const&) {
iLumi.put(std::make_unique<DQMToken>());
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FWCore.ParameterSet.Config as cms
from DQMServices.Core.DQMEDHarvester import DQMEDHarvester

DQMExample_GenericClient = DQMEDHarvester("DQMGenericClient",
DQMExampleGenericClient = DQMEDHarvester("DQMGenericClient",
subDirs = cms.untracked.vstring("Physics/TopTest"),
efficiency = cms.vstring(
"myEfficiencyEta 'Efficiency vs Eta' EleEta_leading_HLT_matched EleEta_leading",
Expand Down
4 changes: 2 additions & 2 deletions DQMServices/Examples/python/test/DQMExample_Step2_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@


# Path and EndPath definitions
process.myHarvesting = cms.Path(process.DQMExample_Step2)
process.myEff = cms.Path(process.DQMExample_GenericClient)
process.myHarvesting = cms.Path(process.DQMExampleStep2)
process.myEff = cms.Path(process.DQMExampleGenericClient)
process.myTest = cms.Path(process.DQMExample_qTester)
process.dqmsave_step = cms.Path(process.DQMSaver)

Expand Down
2 changes: 1 addition & 1 deletion DQMServices/Examples/python/test/DQMExample_Step2_cfi.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FWCore.ParameterSet.Config as cms
from DQMServices.Core.DQMEDHarvester import DQMEDHarvester

DQMExample_Step2 = DQMEDHarvester("DQMExample_Step2",
DQMExampleStep2 = DQMEDHarvester("DQMExample_Step2",
numMonitorName = cms.string("Physics/TopTest/ElePt_leading_HLT_matched"),
denMonitorName = cms.string("Physics/TopTest/ElePt_leading")
)
3 changes: 2 additions & 1 deletion DQMServices/FwkIO/plugins/DQMRootOutputModule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,8 @@ DQMRootOutputModule::fillDescriptions(edm::ConfigurationDescriptions& descriptio
->setComment("Only write the run with this run number. 0 means write all runs.");
desc.addOptionalUntracked<int>("splitLevel", 99)
->setComment("UNUSED Only here to allow older configurations written for PoolOutputModule to work.");
edm::OutputModule::fillDescription(desc, std::vector<std::string>(1U, std::string("drop *")));
const std::vector<std::string> keep = {"drop *", "keep DQMToken_*_*_*"};
edm::OutputModule::fillDescription(desc, keep);

edm::ParameterSetDescription dataSet;
dataSet.setAllowAnything();
Expand Down
29 changes: 29 additions & 0 deletions DataFormats/Histograms/interface/DQMToken.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#ifndef DataFormats_Histograms_DQMToken_h
#define DataFormats_Histograms_DQMToken_h
// -*- C++ -*-
//
// Package: DataFormats/Histograms
// Class : DQMToken
//
/**\class DQMToken DQMToken.h "DataFormats/Histograms/interface/DQMToken.h"
Description: Token to put in Run or LuminosityBlock to designate that a EDProducer fills DQM MonitorElements
Usage:
*/
//
// Original Author: Christopher Jones
// Created: Wed, 14 Jun 2017 13:48:54 GMT
//

class DQMToken
{

public:
DQMToken() {}
};


#endif
1 change: 1 addition & 0 deletions DataFormats/Histograms/src/classes.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "TProfile2D.h"
#include "TProfile3D.h"
#include "DataFormats/Histograms/interface/MEtoEDMFormat.h"
#include "DataFormats/Histograms/interface/DQMToken.h"
#include "TString.h"
#include <stdint.h>

Expand Down
3 changes: 3 additions & 0 deletions DataFormats/Histograms/src/classes_def.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,7 @@
<class name="edm::Wrapper<MEtoEDM<int> >"/>
<class name="edm::Wrapper<MEtoEDM<long long> >"/>
<class name="edm::Wrapper<MEtoEDM<TString> >"/>

<class name="DQMToken" ClassVersion="0"/>
<class name="edm::Wrapper<DQMToken>" persistent="false"/>
</lcgdict>
4 changes: 2 additions & 2 deletions GeneratorInterface/RivetInterface/python/PostProcessor_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@
###################
#CMS_2011_S9088458
###################
postCMS_2011_S9088458 = DQMEDHarvester(
postCMSo2011oS9088458 = DQMEDHarvester(
"DQMGenericClient",
subDirs = cms.untracked.vstring("Rivet/CMS_2011_S9088458"),
efficiencyProfile = cms.untracked.vstring("d01-x01-y01 d01-x01-y01 trijet dijet"),
Expand All @@ -312,5 +312,5 @@
postCMS_2011_S8957746 +
postCMS_2011_S8968497 +
postCMS_2011_S9086218 +
postCMS_2011_S9088458 )
postCMSo2011oS9088458 )

Loading

0 comments on commit 89319f9

Please sign in to comment.