Skip to content

Commit

Permalink
Merge pull request #31070 from bsunanda/Run3-gem48
Browse files Browse the repository at this point in the history
Run3-gem48 Use uniformly fromDD.. in all muon geometry builder
  • Loading branch information
cmsbuild committed Aug 10, 2020
2 parents 466f55d + fa5a5a0 commit 130562c
Show file tree
Hide file tree
Showing 15 changed files with 83 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
useRealWireGeometry = cms.bool(True),
useCentreTIOffsets = cms.bool(False),
applyAlignment = cms.bool(False),
useDDD = cms.bool(True)
fromDDD = cms.bool(True),
fromDD4hep = cms.bool(False)
)

Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,6 @@
useRealWireGeometry = cms.bool(True),
useCentreTIOffsets = cms.bool(False),
applyAlignment = cms.bool(False), ## GF: to be abandoned
useDDD = cms.bool(True)
fromDDD = cms.bool(True),
fromDD4hep = cms.bool(False)
)
6 changes: 4 additions & 2 deletions Alignment/MuonAlignment/python/convertSQLitetoXML_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
useRealWireGeometry = cms.bool(True),
useCentreTIOffsets = cms.bool(False),
applyAlignment = cms.bool(False),
useDDD = cms.bool(True)
fromDDD = cms.bool(True),
fromDD4hep = cms.bool(False)
)

process.DTGeometryAlOutputXML = cms.ESProducer("DTGeometryESModule",
Expand All @@ -42,7 +43,8 @@
useRealWireGeometry = cms.bool(True),
useCentreTIOffsets = cms.bool(False),
applyAlignment = cms.bool(False),
useDDD = cms.bool(True)
fromDDD = cms.bool(True),
fromDD4hep = cms.bool(False)
)

process.load("CondCore.DBCommon.CondDBSetup_cfi")
Expand Down
6 changes: 4 additions & 2 deletions Alignment/MuonAlignment/python/convertXMLtoXML_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
useRealWireGeometry = cms.bool(True),
useCentreTIOffsets = cms.bool(False),
applyAlignment = cms.bool(False),
useDDD = cms.bool(True)
fromDDD = cms.bool(True),
fromDD4hep = cms.bool(False)
)

process.DTGeometryAlOutputXML = cms.ESProducer("DTGeometryESModule",
Expand All @@ -42,7 +43,8 @@
useRealWireGeometry = cms.bool(True),
useCentreTIOffsets = cms.bool(False),
applyAlignment = cms.bool(False),
useDDD = cms.bool(True)
fromDDD = cms.bool(True),
fromDD4hep = cms.bool(False)
)

process.MuonGeometryDBConverter = cms.EDAnalyzer("MuonGeometryDBConverter",
Expand Down
9 changes: 6 additions & 3 deletions Alignment/MuonAlignment/test/MuonGeometryArrange.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
useRealWireGeometry = cms.bool(True),
useCentreTIOffsets = cms.bool(False),
applyAlignment = cms.bool(False),
useDDD = cms.bool(True)
fromDDD = cms.bool(True),
fromDD4hep = cms.bool(False)
)

process.DTGeometryMuonGeometryArrange2 = cms.ESProducer("DTGeometryESModule",
Expand All @@ -43,7 +44,8 @@
useRealWireGeometry = cms.bool(True),
useCentreTIOffsets = cms.bool(False),
applyAlignment = cms.bool(False),
useDDD = cms.bool(True)
fromDDD = cms.bool(True),
fromDD4hep = cms.bool(False)
)

process.DTGeometryMuonGeometryArrange2a = cms.ESProducer("DTGeometryESModule",
Expand All @@ -62,7 +64,8 @@
useRealWireGeometry = cms.bool(True),
useCentreTIOffsets = cms.bool(False),
applyAlignment = cms.bool(False),
useDDD = cms.bool(True)
fromDDD = cms.bool(True),
fromDD4hep = cms.bool(False)
)

process.MessageLogger = cms.Service("MessageLogger",
Expand Down
12 changes: 8 additions & 4 deletions Alignment/MuonAlignment/test/muonGeometryDBConverter_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
useRealWireGeometry = cms.bool(True),
useCentreTIOffsets = cms.bool(False),
applyAlignment = cms.bool(False),
useDDD = cms.bool(True)
fromDDD = cms.bool(True),
fromDD4hep = cms.bool(False)
)

process.DTGeometryAlInputDB = cms.ESProducer("DTGeometryESModule",
Expand All @@ -68,7 +69,8 @@
useRealWireGeometry = cms.bool(True),
useCentreTIOffsets = cms.bool(False),
applyAlignment = cms.bool(False),
useDDD = cms.bool(True)
fromDDD = cms.bool(True),
fromDD4hep = cms.bool(False)
)

process.DTGeometryAlOutputXML = cms.ESProducer("DTGeometryESModule",
Expand All @@ -87,7 +89,8 @@
useRealWireGeometry = cms.bool(True),
useCentreTIOffsets = cms.bool(False),
applyAlignment = cms.bool(False),
useDDD = cms.bool(True)
fromDDD = cms.bool(True),
fromDD4hep = cms.bool(False)
)

process.DTGeometryAlInputXML = cms.ESProducer("DTGeometryESModule",
Expand All @@ -106,7 +109,8 @@
useRealWireGeometry = cms.bool(True),
useCentreTIOffsets = cms.bool(False),
applyAlignment = cms.bool(False),
useDDD = cms.bool(True)
fromDDD = cms.bool(True),
fromDD4hep = cms.bool(False)
)


Expand Down
3 changes: 2 additions & 1 deletion Alignment/MuonAlignment/test/test-db-read_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
useRealWireGeometry = cms.bool(True),
useCentreTIOffsets = cms.bool(False),
applyAlignment = cms.bool(False),
useDDD = cms.bool(True)
fromDDD = cms.bool(True),
fromDD4hep = cms.bool(False)
)


Expand Down
3 changes: 2 additions & 1 deletion Alignment/MuonAlignment/test/test-misalign_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
useRealWireGeometry = cms.bool(True),
useCentreTIOffsets = cms.bool(False),
applyAlignment = cms.bool(False),
useDDD = cms.bool(True)
fromDDD = cms.bool(True),
fromDD4hep = cms.bool(False)
)


Expand Down
20 changes: 10 additions & 10 deletions Geometry/CSCGeometryBuilder/plugins/CSCGeometryESModule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,17 @@ class CSCGeometryESModule : public edm::ESProducer {
bool useCentreTIOffsets_;
bool debugV_;
bool applyAlignment_; // Switch to apply alignment corrections
bool useDDD_; // whether to build from DDD or DB
bool useDD4hep_;
bool fromDDD_; // whether to build from DDD or DB
bool fromDD4hep_;
const std::string alignmentsLabel_;
const std::string myLabel_;
};

using namespace edm;

CSCGeometryESModule::CSCGeometryESModule(const edm::ParameterSet& p)
: useDDD_(p.getParameter<bool>("useDDD")),
useDD4hep_(p.getParameter<bool>("useDD4hep")),
: fromDDD_(p.getParameter<bool>("fromDDD")),
fromDD4hep_(p.getParameter<bool>("fromDD4hep")),
alignmentsLabel_(p.getParameter<std::string>("alignmentsLabel")),
myLabel_(p.getParameter<std::string>("appendToDataLabel")) {
auto cc = setWhatProduced(this);
Expand Down Expand Up @@ -127,9 +127,9 @@ CSCGeometryESModule::CSCGeometryESModule(const edm::ParameterSet& p)

debugV_ = p.getUntrackedParameter<bool>("debugV", false);

if (useDDD_) {
if (fromDDD_) {
cc.setConsumes(cpvToken_).setConsumes(mdcToken_);
} else if (useDD4hep_) {
} else if (fromDD4hep_) {
cc.setConsumes(cpvTokendd4hep_).setConsumes(mdcToken_);
} else {
rigToken_ = cc.consumesFrom<RecoIdealGeometry, CSCRecoGeometryRcd>(edm::ESInputTag{});
Expand Down Expand Up @@ -158,8 +158,8 @@ void CSCGeometryESModule::fillDescriptions(edm::ConfigurationDescriptions& descr
// GF would like to have a shorter name (e.g. CSCGeometry), but since originally
// there was no name, replace statements in other configs would not work anymore...
edm::ParameterSetDescription desc;
desc.add<bool>("useDDD", true);
desc.add<bool>("useDD4hep", false);
desc.add<bool>("fromDDD", true);
desc.add<bool>("fromDD4hep", false);
desc.add<std::string>("alignmentsLabel", "");
desc.add<std::string>("appendToDataLabel", "");
desc.add<bool>("useRealWireGeometry", true);
Expand Down Expand Up @@ -202,15 +202,15 @@ std::shared_ptr<CSCGeometry> CSCGeometryESModule::produce(const MuonGeometryReco
}

void CSCGeometryESModule::initCSCGeometry_(const MuonGeometryRecord& record, std::shared_ptr<HostType>& host) {
if (useDDD_) {
if (fromDDD_) {
host->ifRecordChanges<IdealGeometryRecord>(record, [&host, &record, this](auto const& rec) {
host->clear();
edm::ESTransientHandle<DDCompactView> cpv = record.getTransientHandle(cpvToken_);
const auto& mdc = rec.get(mdcToken_);
CSCGeometryBuilderFromDDD builder;
builder.build(*host, cpv.product(), mdc);
});
} else if (useDD4hep_) {
} else if (fromDD4hep_) {
host->ifRecordChanges<IdealGeometryRecord>(record, [&host, &record, this](auto const& rec) {
host->clear();
edm::ESTransientHandle<cms::DDCompactView> cpv = record.getTransientHandle(cpvTokendd4hep_);
Expand Down
4 changes: 2 additions & 2 deletions Geometry/CSCGeometryBuilder/python/cscGeometryDB_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# GF would like to have a shorter name (e.g. CSCGeometry), but since originally
# there was no name, replace statements in other configs would not work anymore...
CSCGeometryESModule = cms.ESProducer("CSCGeometryESModule",
useDDD = cms.bool(False),
useDD4hep = cms.bool(False),
fromDDD = cms.bool(False),
fromDD4hep = cms.bool(False),
alignmentsLabel = cms.string(''),
appendToDataLabel = cms.string(''),
useRealWireGeometry = cms.bool(True),
Expand Down
2 changes: 1 addition & 1 deletion Geometry/CSCGeometryBuilder/python/cscGeometry_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
#
from Configuration.ProcessModifiers.dd4hep_cff import dd4hep

dd4hep.toModify( CSCGeometryESModule, useDDD = False, useDD4hep = True )
dd4hep.toModify( CSCGeometryESModule, fromDDD = False, fromDD4hep = True )
20 changes: 10 additions & 10 deletions Geometry/RPCGeometryBuilder/plugins/RPCGeometryESModule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,18 @@ class RPCGeometryESModule : public edm::ESProducer {
// Reco
edm::ESGetToken<RecoIdealGeometry, RPCRecoGeometryRcd> recoIdealToken_;

const bool useDDD_;
const bool useDD4hep_;
const bool fromDDD_;
const bool fromDD4hep_;
};

RPCGeometryESModule::RPCGeometryESModule(const edm::ParameterSet& p)
: useDDD_{p.getUntrackedParameter<bool>("useDDD", true)},
useDD4hep_{p.getUntrackedParameter<bool>("useDD4hep", false)} {
: fromDDD_{p.getUntrackedParameter<bool>("fromDDD", true)},
fromDD4hep_{p.getUntrackedParameter<bool>("fromDD4hep", false)} {
auto cc = setWhatProduced(this);

if (useDDD_) {
if (fromDDD_) {
cc.setConsumes(idealGeomToken_).setConsumes(dddConstantsToken_);
} else if (useDD4hep_) {
} else if (fromDD4hep_) {
cc.setConsumes(idealDD4hepGeomToken_).setConsumes(dddConstantsToken_);
} else {
cc.setConsumes(recoIdealToken_);
Expand All @@ -65,18 +65,18 @@ RPCGeometryESModule::RPCGeometryESModule(const edm::ParameterSet& p)

void RPCGeometryESModule::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.addUntracked<bool>("useDDD", true);
desc.addUntracked<bool>("useDD4hep", false);
desc.addUntracked<bool>("fromDDD", true);
desc.addUntracked<bool>("fromDD4hep", false);
descriptions.add("RPCGeometryESModule", desc);
}

std::unique_ptr<RPCGeometry> RPCGeometryESModule::produce(const MuonGeometryRecord& record) {
if (useDDD_) {
if (fromDDD_) {
edm::ESTransientHandle<DDCompactView> cpv = record.getTransientHandle(idealGeomToken_);
auto const& mdc = record.get(dddConstantsToken_);
RPCGeometryBuilder builder;
return std::unique_ptr<RPCGeometry>(builder.build(&(*cpv), mdc));
} else if (useDD4hep_) {
} else if (fromDD4hep_) {
edm::ESTransientHandle<cms::DDCompactView> cpv = record.getTransientHandle(idealDD4hepGeomToken_);
auto const& mdc = record.get(dddConstantsToken_);
RPCGeometryBuilder builder;
Expand Down
4 changes: 2 additions & 2 deletions Geometry/RPCGeometryBuilder/python/rpcGeometryDB_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# This cfi should be included to build the RPC geometry model.
#
RPCGeometryESModule = cms.ESProducer("RPCGeometryESModule",
useDDD = cms.untracked.bool(False),
useDD4hep = cms.untracked.bool(False)
fromDDD = cms.untracked.bool(False),
fromDD4hep = cms.untracked.bool(False)
)


2 changes: 1 addition & 1 deletion Geometry/RPCGeometryBuilder/python/rpcGeometry_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

from Configuration.ProcessModifiers.dd4hep_cff import dd4hep

dd4hep.toModify(RPCGeometryESModule, useDDD = False, useDD4hep = True)
dd4hep.toModify(RPCGeometryESModule, fromDDD = False, fromDD4hep = True)
27 changes: 27 additions & 0 deletions HLTrigger/Configuration/python/customizeHLTforCMSSW.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,38 @@ def customiseFor30936(process):

return process

def customiseFor31070(process):
"""Adapt the HLT to run with new geometry for CSC and RPC"""

if hasattr(process,'CSCGeometryESModule'):
process.CSCGeometryESModule = cms.ESProducer( "CSCGeometryESModule",
appendToDataLabel = cms.string( "" ),
fromDDD = cms.bool( False ),
debugV = cms.untracked.bool( False ),
useGangedStripsInME1a = cms.bool( False ),
alignmentsLabel = cms.string( "" ),
fromDD4hep = cms.bool( False ),
useOnlyWiresInME1a = cms.bool( False ),
useRealWireGeometry = cms.bool( True ),
useCentreTIOffsets = cms.bool( False ),
applyAlignment = cms.bool( True )
)

if hasattr(process,'RPCGeometryESModule'):
process.RPCGeometryESModule = cms.ESProducer( "RPCGeometryESModule",
appendToDataLabel = cms.string( "" ),
fromDDD = cms.untracked.bool( False ),
fromDD4hep = cms.untracked.bool( False ),
)

return process

# CMSSW version specific customizations
def customizeHLTforCMSSW(process, menuType="GRun"):

# add call to action function in proper order: newest last!
# process = customiseFor12718(process)
process = customiseFor30936(process)
process = customiseFor31070(process)

return process

0 comments on commit 130562c

Please sign in to comment.