Skip to content

Commit

Permalink
Merged extended2019-scenario-scripts from repository ianna
Browse files Browse the repository at this point in the history
  • Loading branch information
ianna committed Oct 7, 2015
2 parents f56b7b1 + 74b0280 commit df3c01f
Show file tree
Hide file tree
Showing 5 changed files with 185 additions and 0 deletions.
30 changes: 30 additions & 0 deletions CondTools/Geometry/test/gemgeometrywriter.py
@@ -0,0 +1,30 @@
import FWCore.ParameterSet.Config as cms

process = cms.Process("RPCGeometryWriter")
process.load('CondCore.DBCommon.CondDBCommon_cfi')
process.load('Configuration.Geometry.GeometryExtended2019_cff')
process.load('Geometry.MuonNumbering.muonNumberingInitialization_cfi')

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

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

process.CondDBCommon.BlobStreamerName = cms.untracked.string('TBufferBlobStreamingService')
process.CondDBCommon.timetype = cms.untracked.string('runnumber')
process.CondDBCommon.connect = cms.string('sqlite_file:myfile.db')
process.PoolDBOutputService = cms.Service("PoolDBOutputService",
process.CondDBCommon,
toPut = cms.VPSet(cms.PSet(record = cms.string('GEMRecoGeometryRcd'),tag = cms.string('GEMRECO_Geometry_Test01'))
)
)

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

process.p1 = cms.Path(process.GEMGeometryWriter)
34 changes: 34 additions & 0 deletions CondTools/Geometry/test/writehelpers/createExtended2019Payloads.sh
@@ -0,0 +1,34 @@
#!/bin/sh


if [ $# -ne 1 ]
then
echo Error: createExtended2019Payloads.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
sed -i {s/TagXX/${mytag}/g} *.txt
sed -i {s/TagXX/${mytag}/g} splitExtended2019Database.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
# GeometryExtended2019_cff geSingleBigFile.xml
cmsRun geometryExtended2019_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 geometryExtended2019_writer.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
./splitExtended2019Database.sh
@@ -0,0 +1,77 @@
import FWCore.ParameterSet.Config as cms

process = cms.Process("GeometryWriter")
process.load("CondCore.DBCommon.CondDBCommon_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.GeometryExtended2019_cff')
process.load('Geometry.MuonNumbering.muonNumberingInitialization_cfi')
process.load('Geometry.CaloEventSetup.CaloGeometryDBWriter_cfi')

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.TrackerGeometricDetExtraESModule = cms.ESProducer( "TrackerGeometricDetExtraESModule",
fromDDD = cms.bool( True ),
)

process.TrackerGeometryWriter = cms.EDAnalyzer("PGeometricDetBuilder")
process.TrackerGeometryExtraWriter = cms.EDAnalyzer("PGeometricDetExtraBuilder")
process.TrackerParametersWriter = cms.EDAnalyzer("PTrackerParametersDBBuilder")

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

process.CSCGeometryWriter = cms.EDAnalyzer("CSCRecoIdealDBLoader")

process.DTGeometryWriter = cms.EDAnalyzer("DTRecoIdealDBLoader")

process.RPCGeometryWriter = cms.EDAnalyzer("RPCRecoIdealDBLoader")

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

process.CondDBCommon.BlobStreamerName = cms.untracked.string('TBufferBlobStreamingService')
process.CondDBCommon.timetype = cms.untracked.string('runnumber')
process.CondDBCommon.connect = cms.string('sqlite_file:myfile.db')
process.PoolDBOutputService = cms.Service("PoolDBOutputService",
process.CondDBCommon,
toPut = cms.VPSet(cms.PSet(record = cms.string('GeometryFileRcd'),tag = cms.string('XMLFILE_Geometry_TagXX_Extended2019_mc')),
cms.PSet(record = cms.string('IdealGeometryRecord'),tag = cms.string('TKRECO_Geometry_TagXX')),
cms.PSet(record = cms.string('PGeometricDetExtraRcd'),tag = cms.string('TKExtra_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.TrackerGeometryExtraWriter+process.TrackerParametersWriter+process.CaloGeometryWriter+process.HcalParametersWriter+process.CSCGeometryWriter+process.DTGeometryWriter+process.RPCGeometryWriter+process.GEMGeometryWriter)
@@ -0,0 +1,25 @@
import FWCore.ParameterSet.Config as cms

process = cms.Process("GeometryXMLWriter")
process.load('CondCore.DBCommon.CondDBCommon_cfi')
process.load('Configuration.Geometry.GeometryExtended2019_cff')

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

process.BigXMLWriter = cms.EDAnalyzer("OutputDDToDDL",
rotNumSeed = cms.int32(0),
fileName = cms.untracked.string("./geSingleBigFile.xml")
)


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

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

19 changes: 19 additions & 0 deletions CondTools/Geometry/test/writehelpers/splitExtended2019Database.sh
@@ -0,0 +1,19 @@
#!/bin/sh

conddb_import -f sqlite_file:myfile.db -c sqlite_file:GeometryFileExtended2019.db -t XMLFILE_Geometry_TagXX_Extended2019_mc -i XMLFILE_Geometry_TagXX_Extended2019_mc
conddb_import -f sqlite_file:myfile.db -c sqlite_file:TKRECO_Geometry.db -t TKRECO_Geometry_TagXX -i TKRECO_Geometry_TagXX
conddb_import -f sqlite_file:myfile.db -c sqlite_file:TKExtra_Geometry.db -t TKExtra_Geometry_TagXX -i TKExtra_Geometry_TagXX
conddb_import -f sqlite_file:myfile.db -c sqlite_file:TKParameters_Geometry.db -t TKParameters_Geometry_TagXX -i TKParameters_Geometry_TagXX
conddb_import -f sqlite_file:myfile.db -c sqlite_file:EBRECO_Geometry.db -t EBRECO_Geometry_TagXX -i EBRECO_Geometry_TagXX
conddb_import -f sqlite_file:myfile.db -c sqlite_file:EERECO_Geometry.db -t EERECO_Geometry_TagXX -i EERECO_Geometry_TagXX
conddb_import -f sqlite_file:myfile.db -c sqlite_file:EPRECO_Geometry.db -t EPRECO_Geometry_TagXX -i EPRECO_Geometry_TagXX
conddb_import -f sqlite_file:myfile.db -c sqlite_file:HCALRECO_Geometry.db -t HCALRECO_Geometry_TagXX -i HCALRECO_Geometry_TagXX
conddb_import -f sqlite_file:myfile.db -c sqlite_file:HCALParameters_Geometry.db -t HCALParameters_Geometry_TagXX -i HCALParameters_Geometry_TagXX
conddb_import -f sqlite_file:myfile.db -c sqlite_file:CTRECO_Geometry.db -t CTRECO_Geometry_TagXX -i CTRECO_Geometry_TagXX
conddb_import -f sqlite_file:myfile.db -c sqlite_file:ZDCRECO_Geometry.db -t ZDCRECO_Geometry_TagXX -i ZDCRECO_Geometry_TagXX
conddb_import -f sqlite_file:myfile.db -c sqlite_file:CASTORRECO_Geometry.db -t CASTORRECO_Geometry_TagXX -i CASTORRECO_Geometry_TagXX
conddb_import -f sqlite_file:myfile.db -c sqlite_file:CSCRECO_Geometry.db -t CSCRECO_Geometry_TagXX -i CSCRECO_Geometry_TagXX
conddb_import -f sqlite_file:myfile.db -c sqlite_file:CSCRECODIGI_Geometry.db -t CSCRECODIGI_Geometry_TagXX -i CSCRECODIGI_Geometry_TagXX
conddb_import -f sqlite_file:myfile.db -c sqlite_file:DTRECO_Geometry.db -t DTRECO_Geometry_TagXX -i DTRECO_Geometry_TagXX
conddb_import -f sqlite_file:myfile.db -c sqlite_file:RPCRECO_Geometry.db -t RPCRECO_Geometry_TagXX -i RPCRECO_Geometry_TagXX
conddb_import -f sqlite_file:myfile.db -c sqlite_file:GEMRECO_Geometry.db -t GEMRECO_Geometry_TagXX -i GEMRECO_Geometry_TagXX

0 comments on commit df3c01f

Please sign in to comment.