From cddf889543db11d6e09f11aa0f5fd5f7c494bc65 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen Date: Sat, 29 Aug 2020 03:28:46 +0200 Subject: [PATCH] Migrate Geometry from setConsumes() to type-deducing consumes() --- .../plugins/CSCGeometryESModule.cc | 6 ++++-- .../plugins/GEMGeometryESModule.cc | 14 ++++++++------ .../plugins/ME0GeometryESModule.cc | 8 +++++--- .../plugins/MuonNumberingInitialization.cc | 7 +++---- .../plugins/RPCGeometryESModule.cc | 8 +++++--- .../plugins/TrackerParametersESModule.cc | 7 +++---- .../plugins/dd4hep/TrackerParametersESProducer.cc | 5 ++--- 7 files changed, 30 insertions(+), 25 deletions(-) diff --git a/Geometry/CSCGeometryBuilder/plugins/CSCGeometryESModule.cc b/Geometry/CSCGeometryBuilder/plugins/CSCGeometryESModule.cc index c680e28d21d72..44a65d68ce257 100644 --- a/Geometry/CSCGeometryBuilder/plugins/CSCGeometryESModule.cc +++ b/Geometry/CSCGeometryBuilder/plugins/CSCGeometryESModule.cc @@ -128,9 +128,11 @@ CSCGeometryESModule::CSCGeometryESModule(const edm::ParameterSet& p) debugV_ = p.getUntrackedParameter("debugV", false); if (fromDDD_) { - cc.setConsumes(cpvToken_).setConsumes(mdcToken_); + cpvToken_ = cc.consumes(); + mdcToken_ = cc.consumes(); } else if (fromDD4hep_) { - cc.setConsumes(cpvTokendd4hep_).setConsumes(mdcToken_); + cpvTokendd4hep_ = cc.consumes(); + mdcToken_ = cc.consumes(); } else { rigToken_ = cc.consumesFrom(edm::ESInputTag{}); rdpToken_ = cc.consumesFrom(edm::ESInputTag{}); diff --git a/Geometry/GEMGeometryBuilder/plugins/GEMGeometryESModule.cc b/Geometry/GEMGeometryBuilder/plugins/GEMGeometryESModule.cc index bbe5d440be5de..74c9e5edd5af8 100644 --- a/Geometry/GEMGeometryBuilder/plugins/GEMGeometryESModule.cc +++ b/Geometry/GEMGeometryBuilder/plugins/GEMGeometryESModule.cc @@ -71,16 +71,18 @@ GEMGeometryESModule::GEMGeometryESModule(const edm::ParameterSet& p) alignmentsLabel_(p.getParameter("alignmentsLabel")) { auto cc = setWhatProduced(this); if (fromDDD_) { - cc.setConsumes(cpvToken_).setConsumes(mdcToken_); + cpvToken_ = cc.consumes(); + mdcToken_ = cc.consumes(); } else if (fromDD4hep_) { - cc.setConsumes(dd4hepcpvToken_).setConsumes(mdcToken_); + dd4hepcpvToken_ = cc.consumes(); + mdcToken_ = cc.consumes(); } else { - cc.setConsumes(riggemToken_); + riggemToken_ = cc.consumes(); } if (applyAlignment_) { - cc.setConsumes(globalPositionToken_, edm::ESInputTag{"", alignmentsLabel_}) - .setConsumes(alignmentsToken_, edm::ESInputTag{"", alignmentsLabel_}) - .setConsumes(alignmentErrorsToken_, edm::ESInputTag{"", alignmentsLabel_}); + globalPositionToken_ = cc.consumes(edm::ESInputTag{"", alignmentsLabel_}); + alignmentsToken_ = cc.consumes(edm::ESInputTag{"", alignmentsLabel_}); + alignmentErrorsToken_ = cc.consumes(edm::ESInputTag{"", alignmentsLabel_}); } } diff --git a/Geometry/GEMGeometryBuilder/plugins/ME0GeometryESModule.cc b/Geometry/GEMGeometryBuilder/plugins/ME0GeometryESModule.cc index 806dc02caa30e..65c32536cb867 100644 --- a/Geometry/GEMGeometryBuilder/plugins/ME0GeometryESModule.cc +++ b/Geometry/GEMGeometryBuilder/plugins/ME0GeometryESModule.cc @@ -54,11 +54,13 @@ ME0GeometryESModule::ME0GeometryESModule(const edm::ParameterSet& p) { fromDD4hep_ = p.getParameter("fromDD4hep"); auto cc = setWhatProduced(this); if (fromDDD_) { - cc.setConsumes(cpvToken_).setConsumes(mdcToken_); + cpvToken_ = cc.consumes(); + mdcToken_ = cc.consumes(); } else if (fromDD4hep_) { - cc.setConsumes(dd4hepcpvToken_).setConsumes(mdcToken_); + dd4hepcpvToken_ = cc.consumes(); + mdcToken_ = cc.consumes(); } else { - cc.setConsumes(rigme0Token_); + rigme0Token_ = cc.consumes(); } } diff --git a/Geometry/MuonNumbering/plugins/MuonNumberingInitialization.cc b/Geometry/MuonNumbering/plugins/MuonNumberingInitialization.cc index dbcd24701ef28..82faf8857af39 100644 --- a/Geometry/MuonNumbering/plugins/MuonNumberingInitialization.cc +++ b/Geometry/MuonNumbering/plugins/MuonNumberingInitialization.cc @@ -34,12 +34,11 @@ class MuonNumberingInitialization : public edm::ESProducer { ReturnType produce(const MuonNumberingRecord&); private: - edm::ESGetToken geomToken_; + const edm::ESGetToken geomToken_; }; -MuonNumberingInitialization::MuonNumberingInitialization(const edm::ParameterSet&) { - setWhatProduced(this).setConsumes(geomToken_); -} +MuonNumberingInitialization::MuonNumberingInitialization(const edm::ParameterSet&) + : geomToken_{setWhatProduced(this).consumes()} {} MuonNumberingInitialization::ReturnType MuonNumberingInitialization::produce(const MuonNumberingRecord& iRecord) { edm::ESTransientHandle pDD = iRecord.getTransientHandle(geomToken_); diff --git a/Geometry/RPCGeometryBuilder/plugins/RPCGeometryESModule.cc b/Geometry/RPCGeometryBuilder/plugins/RPCGeometryESModule.cc index b43053fa217b7..fcb3d92622e21 100644 --- a/Geometry/RPCGeometryBuilder/plugins/RPCGeometryESModule.cc +++ b/Geometry/RPCGeometryBuilder/plugins/RPCGeometryESModule.cc @@ -55,11 +55,13 @@ RPCGeometryESModule::RPCGeometryESModule(const edm::ParameterSet& p) auto cc = setWhatProduced(this); if (fromDDD_) { - cc.setConsumes(idealGeomToken_).setConsumes(dddConstantsToken_); + idealGeomToken_ = cc.consumes(); + dddConstantsToken_ = cc.consumes(); } else if (fromDD4hep_) { - cc.setConsumes(idealDD4hepGeomToken_).setConsumes(dddConstantsToken_); + idealDD4hepGeomToken_ = cc.consumes(); + dddConstantsToken_ = cc.consumes(); } else { - cc.setConsumes(recoIdealToken_); + recoIdealToken_ = cc.consumes(); } } diff --git a/Geometry/TrackerGeometryBuilder/plugins/TrackerParametersESModule.cc b/Geometry/TrackerGeometryBuilder/plugins/TrackerParametersESModule.cc index ac326444a02ff..5686ee471c4a0 100644 --- a/Geometry/TrackerGeometryBuilder/plugins/TrackerParametersESModule.cc +++ b/Geometry/TrackerGeometryBuilder/plugins/TrackerParametersESModule.cc @@ -32,13 +32,12 @@ class TrackerParametersESModule : public edm::ESProducer { ReturnType produce(const PTrackerParametersRcd&); private: - edm::ESGetToken geomToken_; + const edm::ESGetToken geomToken_; }; -TrackerParametersESModule::TrackerParametersESModule(const edm::ParameterSet&) { +TrackerParametersESModule::TrackerParametersESModule(const edm::ParameterSet&) + : geomToken_{setWhatProduced(this).consumes()} { edm::LogInfo("TRACKER") << "TrackerParametersESModule::TrackerParametersESModule"; - - setWhatProduced(this).setConsumes(geomToken_); } TrackerParametersESModule::~TrackerParametersESModule() {} diff --git a/Geometry/TrackerGeometryBuilder/plugins/dd4hep/TrackerParametersESProducer.cc b/Geometry/TrackerGeometryBuilder/plugins/dd4hep/TrackerParametersESProducer.cc index 3d35d062c2789..a4eafe84e0d64 100644 --- a/Geometry/TrackerGeometryBuilder/plugins/dd4hep/TrackerParametersESProducer.cc +++ b/Geometry/TrackerGeometryBuilder/plugins/dd4hep/TrackerParametersESProducer.cc @@ -36,10 +36,9 @@ class TrackerParametersESProducer : public edm::ESProducer { edm::ESGetToken geomToken_; }; -TrackerParametersESProducer::TrackerParametersESProducer(const edm::ParameterSet&) { +TrackerParametersESProducer::TrackerParametersESProducer(const edm::ParameterSet&) + : geomToken_(setWhatProduced(this).consumes()) { edm::LogInfo("TRACKER") << "TrackerParametersESProducer::TrackerParametersESProducer"; - - setWhatProduced(this).setConsumes(geomToken_); } TrackerParametersESProducer::~TrackerParametersESProducer() {}