Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run3-hcx338 Modify the dumping for geometry visualisation of HCAL #39968

Merged
merged 1 commit into from Nov 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 0 additions & 27 deletions Geometry/HcalCommonData/test/python/dump2016_cfg.py

This file was deleted.

30 changes: 0 additions & 30 deletions Geometry/HcalCommonData/test/python/dump2017DD4hep_cfg.py

This file was deleted.

32 changes: 0 additions & 32 deletions Geometry/HcalCommonData/test/python/dump2017DDD_cfg.py

This file was deleted.

60 changes: 60 additions & 0 deletions Geometry/HcalCommonData/test/python/dumpGeometryDD4hep_cfg.py
@@ -0,0 +1,60 @@
###############################################################################
# Way to use this:
# cmsRun dumpGeometryDD4hep_cfg.py geometry=2021
#
# Options for geometry 2017, 2018, 2021
#
###############################################################################
import FWCore.ParameterSet.Config as cms
import os, sys, imp, re
import FWCore.ParameterSet.VarParsing as VarParsing

####################################################################
### SETUP OPTIONS
options = VarParsing.VarParsing('standard')
options.register('geometry',
"2021",
VarParsing.VarParsing.multiplicity.singleton,
VarParsing.VarParsing.varType.string,
"geometry of operations: 2017, 2018, 2021")

### get and parse the command line arguments
options.parseArguments()

print(options)

####################################################################
# Use the options

from Configuration.ProcessModifiers.dd4hep_cff import dd4hep
process = cms.Process('GeomDump',dd4hep)

geomFile = "Configuration.Geometry.GeometryDD4hepExtended" + options.geometry + "Reco_cff"
fileName = "hcal" + options.geometry + "DD4hep.root"

print("Geometry file: ", geomFile)
print("Output file: ", fileName)

process.load(geomFile)
process.load('FWCore.MessageService.MessageLogger_cfi')

if 'MessageLogger' in process.__dict__:
process.MessageLogger.HCalGeom=dict()

process.source = cms.Source("EmptySource")

process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(1)
)

process.add_(cms.ESProducer("TGeoMgrFromDdd",
verbose = cms.untracked.bool(False),
level = cms.untracked.int32(14)
))


process.dump = cms.EDAnalyzer("DumpSimGeometry",
outputFileName = cms.untracked.string(fileName)
)

process.p = cms.Path(process.dump)
59 changes: 59 additions & 0 deletions Geometry/HcalCommonData/test/python/dumpGeometryDDD_cfg.py
@@ -0,0 +1,59 @@
###############################################################################
# Way to use this:
# cmsRun dumpGeometryDDD_cfg.py geometry=2021
#
# Options for geometry 2015, 2016, 2017, 2018, 2021
#
###############################################################################
import FWCore.ParameterSet.Config as cms
import os, sys, imp, re
import FWCore.ParameterSet.VarParsing as VarParsing

####################################################################
### SETUP OPTIONS
options = VarParsing.VarParsing('standard')
options.register('geometry',
"2021",
VarParsing.VarParsing.multiplicity.singleton,
VarParsing.VarParsing.varType.string,
"geometry of operations: 2015, 2016, 2017, 2018, 2021")

### get and parse the command line arguments
options.parseArguments()

print(options)

####################################################################
# Use the options

process = cms.Process('GeomDump')

geomFile = "Configuration.Geometry.GeometryExtended" + options.geometry + "Reco_cff"
fileName = "hcal" + options.geometry + "DDD.root"

print("Geometry file: ", geomFile)
print("Output file: ", fileName)

process.load(geomFile)
process.load('FWCore.MessageService.MessageLogger_cfi')

if 'MessageLogger' in process.__dict__:
process.MessageLogger.HCalGeom=dict()

process.source = cms.Source("EmptySource")

process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(1)
)

process.add_(cms.ESProducer("TGeoMgrFromDdd",
verbose = cms.untracked.bool(False),
level = cms.untracked.int32(14)
))


process.dump = cms.EDAnalyzer("DumpSimGeometry",
outputFileName = cms.untracked.string(fileName)
)

process.p = cms.Path(process.dump)