Skip to content

Commit

Permalink
Merge pull request #44003 from bsunanda/Run3-gex176Y
Browse files Browse the repository at this point in the history
Run3-gex176Y Make changes to make pay;oads for the 2024 Geometry
  • Loading branch information
cmsbuild authored Feb 18, 2024
2 parents 2a3645c + 463df12 commit 8520d4d
Show file tree
Hide file tree
Showing 7 changed files with 412 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#!/bin/sh


if [ $# -ne 1 ]
then
echo Error: createExtended2024Payloads.sh requires exactly one argument which is the tag
exit 1
fi
mytag=$1
echo ${mytag}

# Set the tag in all the scripts and the metadata text files
sed -i {s/TagXX/${mytag}/g} *.py
compgen -G "*.txt" > /dev/null && sed -i {s/TagXX/${mytag}/g} *.txt
sed -i {s/TagXX/${mytag}/g} splitExtended2024Database.sh

# First read in the little XML files and create the
# big XML file for the Extended2024DD4hep scenario.
cmsRun geometryExtended2024DD4hep_xmlwriter.py

# Now convert the content of the large XML file into
# a "blob" and write it to the database.
# Also reads in the little XML files again and fills
# the DDCompactView. From the DDCompactView the
# reco parts of the database are also filled.
cmsRun geometryExtended2024DD4hep_writer.py

# Now put the other scenarios into the database.
# Input the many XML files referenced by the cff file and
# output a single big XML file.
# This is repeated several times below. The sed commands
# serve to give the correct sequence of input and output
# files

sed -i '{s/ExtendedGeometry2024/ExtendedGeometry2024ZeroMaterial/g}' geometryExtended2024DD4hep_xmlwriter.py
sed -i '{s/\/ge/\/gez/g}' geometryExtended2024DD4hep_xmlwriter.py
cmsRun geometryExtended2024DD4hep_xmlwriter.py

sed -i '{s/ExtendedGeometry2024ZeroMaterial/ExtendedGeometry2024FlatMinus05Percent/g}' geometryExtended2024DD4hep_xmlwriter.py
sed -i '{s/\/gez/\/geFM05/g}' geometryExtended2024DD4hep_xmlwriter.py
cmsRun geometryExtended2024DD4hep_xmlwriter.py

sed -i '{s/ExtendedGeometry2024FlatMinus05Percent/ExtendedGeometry2024FlatMinus10Percent/g}' geometryExtended2024DD4hep_xmlwriter.py
sed -i '{s/\/geFM05/\/geFM10/g}' geometryExtended2024DD4hep_xmlwriter.py
cmsRun geometryExtended2024DD4hep_xmlwriter.py

sed -i '{s/ExtendedGeometry2024FlatMinus10Percent/ExtendedGeometry2024FlatPlus05Percent/g}' geometryExtended2024DD4hep_xmlwriter.py
sed -i '{s/\/geFM10/\/geFP05/g}' geometryExtended2024DD4hep_xmlwriter.py
cmsRun geometryExtended2024DD4hep_xmlwriter.py

sed -i '{s/ExtendedGeometry2024FlatPlus05Percent/ExtendedGeometry2024FlatPlus10Percent/g}' geometryExtended2024DD4hep_xmlwriter.py
sed -i '{s/\/geFP05/\/geFP10/g}' geometryExtended2024DD4hep_xmlwriter.py
cmsRun geometryExtended2024DD4hep_xmlwriter.py

# Read the one big XML file and output a record to the
# database with the an identifying tag
# This is repeated several times below. The sed commands
# serve to give the correct sequence of input file and output
# tag
# To start:
# Input file Output tag
# gezSingleBigFile.xml XMLFILE_Geometry_${mytag}_Extended2024ZeroMaterial_mc

sed -i '{s/Extended/Extended2024ZeroMaterial/g}' xmlgeometrywriter.py
sed -i '{s/\/ge/\/gez/g}' xmlgeometrywriter.py
cmsRun xmlgeometrywriter.py

sed -i '{s/Extended2024ZeroMaterial/Extended2024FlatMinus05Percent/g}' xmlgeometrywriter.py
sed -i '{s/\/gez/\/geFM05/g}' xmlgeometrywriter.py
cmsRun xmlgeometrywriter.py

sed -i '{s/Extended2024FlatMinus05Percent/Extended2024FlatMinus10Percent/g}' xmlgeometrywriter.py
sed -i '{s/\/geFM05/\/geFM10/g}' xmlgeometrywriter.py
cmsRun xmlgeometrywriter.py

sed -i '{s/Extended2024FlatMinus10Percent/Extended2024FlatPlus05Percent/g}' xmlgeometrywriter.py
sed -i '{s/\/geFM10/\/geFP05/g}' xmlgeometrywriter.py
cmsRun xmlgeometrywriter.py

sed -i '{s/Extended2024FlatPlus05Percent/Extended2024FlatPlus10Percent/g}' xmlgeometrywriter.py
sed -i '{s/\/geFP05/\/geFP10/g}' xmlgeometrywriter.py
cmsRun xmlgeometrywriter.py

# All the database objects were written into one database
# (myfile.db) in the steps above. Extract the different
# pieces into separate database files. These are the payloads
# that get uploaded to the DB. There is one for each tag
./splitExtended2024Database.sh
93 changes: 93 additions & 0 deletions CondTools/Geometry/test/writehelpers/createExtended2024Payloads.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#!/bin/sh


if [ $# -ne 1 ]
then
echo Error: createExtended2024Payloads.sh requires exactly one argument which is the tag
exit 1
fi
mytag=$1
echo ${mytag}

# Set the tag in all the scripts and the metadata text files
sed -i {s/TagXX/${mytag}/g} *.py
compgen -G "*.txt" > /dev/null && sed -i {s/TagXX/${mytag}/g} *.txt
sed -i {s/TagXX/${mytag}/g} splitExtended2024Database.sh

# First read in the little XML files and create the
# large XML file for the Phase1_R30F12_HCal Ideal scenario.
# Input cff Output file
# GeometryExtended2024_cff geSingleBigFile.xml
cmsRun geometryExtended2024_xmlwriter.py

# Now convert the content of the large XML file into
# a "blob" and write it to the database.
# Also reads in the little XML files again and fills
# the DDCompactView. From the DDCompactView the
# reco parts of the database are also filled.
cmsRun geometryExtended2024_writer.py

# Now put the other scenarios into the database.
# Input the many XML files referenced by the cff file and
# output a single big XML file.
# This is repeated several times below. The sed commands
# serve to give the following sequence of input and output
# files
#
# Input cff Output file
# GeometryIdeal_cff giSingleBigFile.xml
#
sed -i '{s/Extended2024/Extended2024ZeroMaterial/g}' geometryExtended2024_xmlwriter.py
sed -i '{s/\/ge/\/gez/g}' geometryExtended2024_xmlwriter.py
cmsRun geometryExtended2024_xmlwriter.py

sed -i '{s/Extended2024ZeroMaterial/Extended2024FlatMinus05Percent/g}' geometryExtended2024_xmlwriter.py
sed -i '{s/\/gez/\/geFM05/g}' geometryExtended2024_xmlwriter.py
cmsRun geometryExtended2024_xmlwriter.py

sed -i '{s/Extended2024FlatMinus05Percent/Extended2024FlatMinus10Percent/g}' geometryExtended2024_xmlwriter.py
sed -i '{s/\/geFM05/\/geFM10/g}' geometryExtended2024_xmlwriter.py
cmsRun geometryExtended2024_xmlwriter.py

sed -i '{s/Extended2024FlatMinus10Percent/Extended2024FlatPlus05Percent/g}' geometryExtended2024_xmlwriter.py
sed -i '{s/\/geFM10/\/geFP05/g}' geometryExtended2024_xmlwriter.py
cmsRun geometryExtended2024_xmlwriter.py

sed -i '{s/Extended2024FlatPlus05Percent/Extended2024FlatPlus10Percent/g}' geometryExtended2024_xmlwriter.py
sed -i '{s/\/geFP05/\/geFP10/g}' geometryExtended2024_xmlwriter.py
cmsRun geometryExtended2024_xmlwriter.py

# Read the one big XML file and output a record to the
# database with the an identifying tag
# This is repeated several times below. The sed commands
# serve to give the following sequence of input file and output
# tag
#
# Input file Output tag
# gezSingleBigFile.xml XMLFILE_Geometry_${mytag}_Extended2024ZeroMaterial_mc
#
sed -i '{s/Extended/Extended2024ZeroMaterial/g}' xmlgeometrywriter.py
sed -i '{s/\/ge/\/gez/g}' xmlgeometrywriter.py
cmsRun xmlgeometrywriter.py

sed -i '{s/Extended2024ZeroMaterial/Extended2024FlatMinus05Percent/g}' xmlgeometrywriter.py
sed -i '{s/\/gez/\/geFM05/g}' xmlgeometrywriter.py
cmsRun xmlgeometrywriter.py

sed -i '{s/Extended2024FlatMinus05Percent/Extended2024FlatMinus10Percent/g}' xmlgeometrywriter.py
sed -i '{s/\/geFM05/\/geFM10/g}' xmlgeometrywriter.py
cmsRun xmlgeometrywriter.py

sed -i '{s/Extended2024FlatMinus10Percent/Extended2024FlatPlus05Percent/g}' xmlgeometrywriter.py
sed -i '{s/\/geFM10/\/geFP05/g}' xmlgeometrywriter.py
cmsRun xmlgeometrywriter.py

sed -i '{s/Extended2024FlatPlus05Percent/Extended2024FlatPlus10Percent/g}' xmlgeometrywriter.py
sed -i '{s/\/geFP05/\/geFP10/g}' xmlgeometrywriter.py
cmsRun xmlgeometrywriter.py

# All the database objects were written into one database
# (myfile.db) in the steps above. Extract the different
# pieces into separate database files. These are the payloads
# that get uploaded to the dropbox. There is one for each tag
./splitExtended2024Database.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import FWCore.ParameterSet.Config as cms
from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep

process = cms.Process("GeometryWriter", Run3_dd4hep)

from Configuration.ProcessModifiers.dd4hep_cff import dd4hep

process.load('CondCore.CondDB.CondDB_cfi')

process.load('Configuration.Geometry.GeometryDD4hepExtended2024_cff')
process.load('Geometry.CaloEventSetup.CaloGeometryDBWriter_cfi')
process.load('CondTools.Geometry.HcalParametersWriter_cff')
process.load("Geometry.MuonNumbering.muonGeometryConstants_cff")

process.CaloGeometryBuilder = cms.ESProducer("CaloGeometryBuilder",
SelectedCalos = cms.vstring(
'HCAL',
'ZDC',
'EcalBarrel',
'EcalEndcap',
'EcalPreshower',
'TOWER'
)
)

process.source = cms.Source("EmptyIOVSource",
lastValue = cms.uint64(1),
timetype = cms.string('runnumber'),
firstValue = cms.uint64(1),
interval = cms.uint64(1)
)

# This reads the big XML file and the only way to fill the
# nonreco part of the database is to read this file.
process.XMLGeometryWriter = cms.EDAnalyzer("XMLGeometryBuilder",
XMLFileName = cms.untracked.string("./geSingleBigFile.xml"),
ZIP = cms.untracked.bool(True)
)

process.TrackerGeometryWriter = cms.EDAnalyzer("PGeometricDetBuilder",fromDD4hep=cms.bool(True))
process.TrackerParametersWriter = cms.EDAnalyzer("PTrackerParametersDBBuilder",fromDD4hep=cms.bool(True))

process.CaloGeometryWriter = cms.EDAnalyzer("PCaloGeometryBuilder",fromDD4hep = cms.untracked.bool(True))

process.CSCGeometryWriter = cms.EDAnalyzer("CSCRecoIdealDBLoader",fromDD4hep = cms.untracked.bool(True))

process.DTGeometryWriter = cms.EDAnalyzer("DTRecoIdealDBLoader",fromDD4hep = cms.untracked.bool(True))

process.RPCGeometryWriter = cms.EDAnalyzer("RPCRecoIdealDBLoader",fromDD4hep = cms.untracked.bool(True))

process.GEMGeometryWriter = cms.EDAnalyzer("GEMRecoIdealDBLoader",fromDD4hep = cms.untracked.bool(True))

process.CondDB.timetype = cms.untracked.string('runnumber')
process.CondDB.connect = cms.string('sqlite_file:myfile.db')
process.PoolDBOutputService = cms.Service("PoolDBOutputService",
process.CondDB,
toPut = cms.VPSet(cms.PSet(record = cms.string('GeometryFileRcd'),tag = cms.string('XMLFILE_Geometry_TagXX_Extended2024_mc')),
cms.PSet(record = cms.string('IdealGeometryRecord'),tag = cms.string('TKRECO_Geometry_TagXX')),
cms.PSet(record = cms.string('PTrackerParametersRcd'),tag = cms.string('TKParameters_Geometry_TagXX')),
cms.PSet(record = cms.string('PEcalBarrelRcd'), tag = cms.string('EBRECO_Geometry_TagXX')),
cms.PSet(record = cms.string('PEcalEndcapRcd'), tag = cms.string('EERECO_Geometry_TagXX')),
cms.PSet(record = cms.string('PEcalPreshowerRcd'),tag = cms.string('EPRECO_Geometry_TagXX')),
cms.PSet(record = cms.string('PHcalRcd'), tag = cms.string('HCALRECO_Geometry_TagXX')),
cms.PSet(record = cms.string('HcalParametersRcd'), tag = cms.string('HCALParameters_Geometry_TagXX')),
cms.PSet(record = cms.string('PCaloTowerRcd'), tag = cms.string('CTRECO_Geometry_TagXX')),
cms.PSet(record = cms.string('PZdcRcd'), tag = cms.string('ZDCRECO_Geometry_TagXX')),
cms.PSet(record = cms.string('PCastorRcd'), tag = cms.string('CASTORRECO_Geometry_TagXX')),
cms.PSet(record = cms.string('CSCRecoGeometryRcd'),tag = cms.string('CSCRECO_Geometry_TagXX')),
cms.PSet(record = cms.string('CSCRecoDigiParametersRcd'),tag = cms.string('CSCRECODIGI_Geometry_TagXX')),
cms.PSet(record = cms.string('DTRecoGeometryRcd'),tag = cms.string('DTRECO_Geometry_TagXX')),
cms.PSet(record = cms.string('RPCRecoGeometryRcd'),tag = cms.string('RPCRECO_Geometry_TagXX')),
cms.PSet(record = cms.string('GEMRecoGeometryRcd'),tag = cms.string('GEMRECO_Geometry_TagXX'))
)
)

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

process.p1 = cms.Path(process.XMLGeometryWriter+process.TrackerGeometryWriter+process.TrackerParametersWriter+process.CaloGeometryWriter+process.HcalParametersWriter+process.CSCGeometryWriter+process.DTGeometryWriter+process.RPCGeometryWriter+process.GEMGeometryWriter)
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import FWCore.ParameterSet.Config as cms

process = cms.Process("GeometryXMLWriter")

process.source = cms.Source("EmptyIOVSource",
lastValue = cms.uint64(1),
timetype = cms.string('runnumber'),
firstValue = cms.uint64(1),
interval = cms.uint64(1)
)

process.DDDetectorESProducer = cms.ESSource("DDDetectorESProducer",
confGeomXMLFiles = cms.FileInPath('Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2024.xml'),
appendToDataLabel = cms.string('make-payload')
)

process.DDCompactViewESProducer = cms.ESProducer("DDCompactViewESProducer",
appendToDataLabel = cms.string('make-payload')
)

process.BigXMLWriter = cms.EDAnalyzer("OutputDD4hepToDDL",
fileName = cms.untracked.string("./geSingleBigFile.xml")
)


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

process.p1 = cms.Path(process.BigXMLWriter)

Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import FWCore.ParameterSet.Config as cms

process = cms.Process("GeometryWriter")

process.load('CondCore.CondDB.CondDB_cfi')

# This will read all the little XML files and from
# that fill the DDCompactView. The modules that fill
# the reco part of the database need the DDCompactView.
process.load('Configuration.Geometry.GeometryExtended2024_cff')
process.load('Geometry.MuonNumbering.muonNumberingInitialization_cfi')
process.load("Geometry.MuonNumbering.muonGeometryConstants_cff")
process.load('Geometry.CaloEventSetup.CaloGeometryDBWriter_cfi')
process.load('CondTools.Geometry.HcalParametersWriter_cff')

process.source = cms.Source("EmptyIOVSource",
lastValue = cms.uint64(1),
timetype = cms.string('runnumber'),
firstValue = cms.uint64(1),
interval = cms.uint64(1)
)

# This reads the big XML file and the only way to fill the
# nonreco part of the database is to read this file. It
# somewhat duplicates the information read from the little
# XML files, but there is no way to directly build the
# DDCompactView from this.
process.XMLGeometryWriter = cms.EDAnalyzer("XMLGeometryBuilder",
XMLFileName = cms.untracked.string("./geSingleBigFile.xml"),
ZIP = cms.untracked.bool(True)
)

process.TrackerGeometryWriter = cms.EDAnalyzer("PGeometricDetBuilder",fromDD4hep=cms.bool(False))
process.TrackerParametersWriter = cms.EDAnalyzer("PTrackerParametersDBBuilder",fromDD4hep=cms.bool(False))

process.CaloGeometryWriter = cms.EDAnalyzer("PCaloGeometryBuilder")

process.CSCGeometryWriter = cms.EDAnalyzer("CSCRecoIdealDBLoader",fromDD4hep = cms.untracked.bool(False))

process.DTGeometryWriter = cms.EDAnalyzer("DTRecoIdealDBLoader",fromDD4hep = cms.untracked.bool(False))

process.RPCGeometryWriter = cms.EDAnalyzer("RPCRecoIdealDBLoader",fromDD4hep = cms.untracked.bool(False))

process.GEMGeometryWriter = cms.EDAnalyzer("GEMRecoIdealDBLoader")

process.CondDB.timetype = cms.untracked.string('runnumber')
process.CondDB.connect = cms.string('sqlite_file:myfile.db')
process.PoolDBOutputService = cms.Service("PoolDBOutputService",
process.CondDB,
toPut = cms.VPSet(cms.PSet(record = cms.string('GeometryFileRcd'),tag = cms.string('XMLFILE_Geometry_TagXX_Extended2024_mc')),
cms.PSet(record = cms.string('IdealGeometryRecord'),tag = cms.string('TKRECO_Geometry_TagXX')),
cms.PSet(record = cms.string('PTrackerParametersRcd'),tag = cms.string('TKParameters_Geometry_TagXX')),
cms.PSet(record = cms.string('PEcalBarrelRcd'), tag = cms.string('EBRECO_Geometry_TagXX')),
cms.PSet(record = cms.string('PEcalEndcapRcd'), tag = cms.string('EERECO_Geometry_TagXX')),
cms.PSet(record = cms.string('PEcalPreshowerRcd'),tag = cms.string('EPRECO_Geometry_TagXX')),
cms.PSet(record = cms.string('PHcalRcd'), tag = cms.string('HCALRECO_Geometry_TagXX')),
cms.PSet(record = cms.string('HcalParametersRcd'), tag = cms.string('HCALParameters_Geometry_TagXX')),
cms.PSet(record = cms.string('PCaloTowerRcd'), tag = cms.string('CTRECO_Geometry_TagXX')),
cms.PSet(record = cms.string('PZdcRcd'), tag = cms.string('ZDCRECO_Geometry_TagXX')),
cms.PSet(record = cms.string('PCastorRcd'), tag = cms.string('CASTORRECO_Geometry_TagXX')),
cms.PSet(record = cms.string('CSCRecoGeometryRcd'),tag = cms.string('CSCRECO_Geometry_TagXX')),
cms.PSet(record = cms.string('CSCRecoDigiParametersRcd'),tag = cms.string('CSCRECODIGI_Geometry_TagXX')),
cms.PSet(record = cms.string('DTRecoGeometryRcd'),tag = cms.string('DTRECO_Geometry_TagXX')),
cms.PSet(record = cms.string('RPCRecoGeometryRcd'),tag = cms.string('RPCRECO_Geometry_TagXX')),
cms.PSet(record = cms.string('GEMRecoGeometryRcd'),tag = cms.string('GEMRECO_Geometry_TagXX'))
)
)

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

process.p1 = cms.Path(process.XMLGeometryWriter+process.TrackerGeometryWriter+process.TrackerParametersWriter+process.CaloGeometryWriter+process.HcalParametersWriter+process.CSCGeometryWriter+process.DTGeometryWriter+process.RPCGeometryWriter+process.GEMGeometryWriter)
Loading

0 comments on commit 8520d4d

Please sign in to comment.