File indexing completed on 2024-10-10 23:05:02
0001 import FWCore.ParameterSet.Config as cms
0002 import argparse
0003 import sys
0004
0005 parser = argparse.ArgumentParser(prog=sys.argv[0], description='Generate XML geometry.')
0006 parser.add_argument("--tag", help="global tag to use", type=str)
0007 args = parser.parse_args()
0008
0009
0010 import FWCore.ParameterSet.Config as cms
0011 from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep
0012
0013 process = cms.Process("GeometryWriter", Run3_dd4hep)
0014
0015 from Configuration.ProcessModifiers.dd4hep_cff import dd4hep
0016
0017 process.load('CondCore.CondDB.CondDB_cfi')
0018
0019 process.load('Configuration.Geometry.GeometryDD4hepExtended2024_cff')
0020 process.load('Geometry.CaloEventSetup.CaloGeometryDBWriter_cfi')
0021 process.load('CondTools.Geometry.HcalParametersWriter_cff')
0022 process.load("Geometry.MuonNumbering.muonGeometryConstants_cff")
0023 process.load("Geometry.ForwardGeometry.ZdcGeometry_cfi")
0024
0025 process.CaloGeometryBuilder = cms.ESProducer("CaloGeometryBuilder",
0026 SelectedCalos = cms.vstring(
0027 'HCAL',
0028 'ZDC',
0029 'EcalBarrel',
0030 'EcalEndcap',
0031 'EcalPreshower',
0032 'TOWER'
0033 )
0034 )
0035
0036 process.source = cms.Source("EmptyIOVSource",
0037 lastValue = cms.uint64(1),
0038 timetype = cms.string('runnumber'),
0039 firstValue = cms.uint64(1),
0040 interval = cms.uint64(1)
0041 )
0042
0043
0044
0045 process.XMLGeometryWriter = cms.EDAnalyzer("XMLGeometryBuilder",
0046 XMLFileName = cms.untracked.string("./geSingleBigFile.xml"),
0047 ZIP = cms.untracked.bool(True)
0048 )
0049
0050 process.TrackerGeometryWriter = cms.EDAnalyzer("PGeometricDetBuilder",fromDD4hep=cms.bool(True))
0051 process.TrackerParametersWriter = cms.EDAnalyzer("PTrackerParametersDBBuilder",fromDD4hep=cms.bool(True))
0052
0053 process.CaloGeometryWriter = cms.EDAnalyzer("PCaloGeometryBuilder",fromDD4hep = cms.untracked.bool(True))
0054
0055 process.CSCGeometryWriter = cms.EDAnalyzer("CSCRecoIdealDBLoader",fromDD4hep = cms.untracked.bool(True))
0056
0057 process.DTGeometryWriter = cms.EDAnalyzer("DTRecoIdealDBLoader",fromDD4hep = cms.untracked.bool(True))
0058
0059 process.RPCGeometryWriter = cms.EDAnalyzer("RPCRecoIdealDBLoader",fromDD4hep = cms.untracked.bool(True))
0060
0061 process.GEMGeometryWriter = cms.EDAnalyzer("GEMRecoIdealDBLoader",fromDD4hep = cms.untracked.bool(True))
0062
0063 process.CondDB.timetype = cms.untracked.string('runnumber')
0064 process.CondDB.connect = cms.string('sqlite_file:myfile.db')
0065 process.PoolDBOutputService = cms.Service("PoolDBOutputService",
0066 process.CondDB,
0067 toPut = cms.VPSet(cms.PSet(record = cms.string('GeometryFileRcd'),tag = cms.string('XMLFILE_Geometry_'+args.tag+'_Extended2024_mc')),
0068 cms.PSet(record = cms.string('IdealGeometryRecord'),tag = cms.string('TKRECO_Geometry_'+args.tag)),
0069 cms.PSet(record = cms.string('PTrackerParametersRcd'),tag = cms.string('TKParameters_Geometry_'+args.tag)),
0070 cms.PSet(record = cms.string('PEcalBarrelRcd'), tag = cms.string('EBRECO_Geometry_'+args.tag)),
0071 cms.PSet(record = cms.string('PEcalEndcapRcd'), tag = cms.string('EERECO_Geometry_'+args.tag)),
0072 cms.PSet(record = cms.string('PEcalPreshowerRcd'),tag = cms.string('EPRECO_Geometry_'+args.tag)),
0073 cms.PSet(record = cms.string('PHcalRcd'), tag = cms.string('HCALRECO_Geometry_'+args.tag)),
0074 cms.PSet(record = cms.string('HcalParametersRcd'), tag = cms.string('HCALParameters_Geometry_'+args.tag)),
0075 cms.PSet(record = cms.string('PCaloTowerRcd'), tag = cms.string('CTRECO_Geometry_'+args.tag)),
0076 cms.PSet(record = cms.string('PZdcRcd'), tag = cms.string('ZDCRECO_Geometry_'+args.tag)),
0077 cms.PSet(record = cms.string('PCastorRcd'), tag = cms.string('CASTORRECO_Geometry_'+args.tag)),
0078 cms.PSet(record = cms.string('CSCRecoGeometryRcd'),tag = cms.string('CSCRECO_Geometry_'+args.tag)),
0079 cms.PSet(record = cms.string('CSCRecoDigiParametersRcd'),tag = cms.string('CSCRECODIGI_Geometry_'+args.tag)),
0080 cms.PSet(record = cms.string('DTRecoGeometryRcd'),tag = cms.string('DTRECO_Geometry_'+args.tag)),
0081 cms.PSet(record = cms.string('RPCRecoGeometryRcd'),tag = cms.string('RPCRECO_Geometry_'+args.tag)),
0082 cms.PSet(record = cms.string('GEMRecoGeometryRcd'),tag = cms.string('GEMRECO_Geometry_'+args.tag))
0083 )
0084 )
0085
0086 process.maxEvents = cms.untracked.PSet(
0087 input = cms.untracked.int32(1)
0088 )
0089
0090 process.p1 = cms.Path(process.XMLGeometryWriter+process.TrackerGeometryWriter+process.TrackerParametersWriter+process.CaloGeometryWriter+process.HcalParametersWriter+process.CSCGeometryWriter+process.DTGeometryWriter+process.RPCGeometryWriter+process.GEMGeometryWriter)