From 9fa06c4aa7a229756c19dd468fde952c7c86b7bc Mon Sep 17 00:00:00 2001 From: Sunanda Date: Wed, 15 Jan 2025 15:54:07 +0100 Subject: [PATCH] Enable a scenario with only HGCal for the V17 version --- .../CMSCommonData/data/cms/2030/v0/cms.xml | 150 ++++++++++++++++++ .../data/extend/v1/cmsextent.xml | 14 ++ .../python/testHGCalV17OnlyReco_cff.py | 22 +++ .../python/testHGCalV17OnlyXML_cfi.py | 29 ++++ .../test/python/g4OverlapCheck_cfg.py | 6 +- .../data/CaloUtil/2030/v5n/CaloUtil.xml | 15 ++ SimG4CMS/Calo/test/python/runHGC10_cfg.py | 81 ++++++++++ 7 files changed, 315 insertions(+), 2 deletions(-) create mode 100644 Geometry/CMSCommonData/data/cms/2030/v0/cms.xml create mode 100644 Geometry/CMSCommonData/data/extend/v1/cmsextent.xml create mode 100644 Geometry/HGCalCommonData/python/testHGCalV17OnlyReco_cff.py create mode 100644 Geometry/HGCalCommonData/python/testHGCalV17OnlyXML_cfi.py create mode 100644 Geometry/HcalSimData/data/CaloUtil/2030/v5n/CaloUtil.xml create mode 100644 SimG4CMS/Calo/test/python/runHGC10_cfg.py diff --git a/Geometry/CMSCommonData/data/cms/2030/v0/cms.xml b/Geometry/CMSCommonData/data/cms/2030/v0/cms.xml new file mode 100644 index 0000000000000..8229cf347344f --- /dev/null +++ b/Geometry/CMSCommonData/data/cms/2030/v0/cms.xml @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/CMSCommonData/data/extend/v1/cmsextent.xml b/Geometry/CMSCommonData/data/extend/v1/cmsextent.xml new file mode 100644 index 0000000000000..6ca751a0b2083 --- /dev/null +++ b/Geometry/CMSCommonData/data/extend/v1/cmsextent.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/Geometry/HGCalCommonData/python/testHGCalV17OnlyReco_cff.py b/Geometry/HGCalCommonData/python/testHGCalV17OnlyReco_cff.py new file mode 100644 index 0000000000000..d55b8364d4dff --- /dev/null +++ b/Geometry/HGCalCommonData/python/testHGCalV17OnlyReco_cff.py @@ -0,0 +1,22 @@ +import FWCore.ParameterSet.Config as cms + +# This config came from a copy of 2 files from Configuration/Geometry/python + +from Geometry.HGCalCommonData.testHGCalV17OnlyXML_cfi import * +from Geometry.HcalCommonData.caloSimulationParameters_cff import * +from Geometry.HGCalCommonData.hgcalParametersInitialization_cfi import * +from Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi import * + +# calo +from Geometry.CaloEventSetup.HGCalTopology_cfi import * +from Geometry.HGCalGeometry.HGCalGeometryESProducer_cfi import * +from Geometry.CaloEventSetup.CaloTopology_cfi import * +from Geometry.CaloEventSetup.CaloGeometryBuilder_cfi import * +CaloGeometryBuilder = cms.ESProducer("CaloGeometryBuilder", + SelectedCalos = cms.vstring("HGCalEESensitive", + "HGCalHESiliconSensitive", + "HGCalHEScintillatorSensitive" + ) +) + + diff --git a/Geometry/HGCalCommonData/python/testHGCalV17OnlyXML_cfi.py b/Geometry/HGCalCommonData/python/testHGCalV17OnlyXML_cfi.py new file mode 100644 index 0000000000000..d0d2cbe3bbbab --- /dev/null +++ b/Geometry/HGCalCommonData/python/testHGCalV17OnlyXML_cfi.py @@ -0,0 +1,29 @@ +import FWCore.ParameterSet.Config as cms + +XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource", + geomXMLFiles = cms.vstring( + 'Geometry/CMSCommonData/data/materials/2021/v1/materials.xml', + 'Geometry/CMSCommonData/data/rotations.xml', + 'Geometry/CMSCommonData/data/extend/v1/cmsextent.xml', + 'Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml', + 'Geometry/CMSCommonData/data/cms/2030/v0/cms.xml', + 'Geometry/CMSCommonData/data/cmsMother.xml', + 'Geometry/CMSCommonData/data/eta3/etaMax.xml', + 'Geometry/CMSCommonData/data/caloBase/2030/v7/caloBase.xml', + 'Geometry/CMSCommonData/data/cmsCalo.xml', + 'Geometry/HGCalCommonData/data/hgcalMaterial/v2/hgcalMaterial.xml', + 'Geometry/HGCalCommonData/data/hgcal/v17/hgcal.xml', + 'Geometry/HGCalCommonData/data/hgcalcell/v17/hgcalcell.xml', + 'Geometry/HGCalCommonData/data/hgcalwafer/v17/hgcalwafer.xml', + 'Geometry/HGCalCommonData/data/hgcalEE/v17/hgcalEE.xml', + 'Geometry/HGCalCommonData/data/hgcalHEsil/v17/hgcalHEsil.xml', + 'Geometry/HGCalCommonData/data/hgcalHEmix/v17/hgcalHEmix.xml', + 'Geometry/HGCalCommonData/data/hgcalCons/v17/hgcalCons.xml', + 'Geometry/HGCalCommonData/data/hgcalConsData/v17/hgcalConsData.xml', + 'Geometry/HcalSimData/data/CaloUtil/2030/v5n/CaloUtil.xml', + 'Geometry/HGCalSimData/data/hgcsensv15.xml', + 'Geometry/HGCalSimData/data/hgcProdCutsv15.xml', + 'Geometry/CMSCommonData/data/FieldParameters.xml' + ), + rootNodeName = cms.string('cms:OCMS') +) diff --git a/Geometry/HGCalCommonData/test/python/g4OverlapCheck_cfg.py b/Geometry/HGCalCommonData/test/python/g4OverlapCheck_cfg.py index ae67cec0848a0..b3b6a629357de 100644 --- a/Geometry/HGCalCommonData/test/python/g4OverlapCheck_cfg.py +++ b/Geometry/HGCalCommonData/test/python/g4OverlapCheck_cfg.py @@ -3,7 +3,7 @@ # cmsRun g4OverlapCheck_cfg.py type=V17 tol=0.01 # # Options for type V16, V17, V17n, V17ng, V18, V18n, V18O, V19, Wafer, -# WaferFR, WaferPR +# WaferFR, WaferPR, V17Only # tol 1.0, 0.1, 0.01, 0.0 # ############################################################################### @@ -18,7 +18,7 @@ "V17", VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.string, - "type of operations: V16, V17, V17n, V7ng, V18, V18n, V18O, V19, Wafer, WaferFR, WaferPR") + "type of operations: V16, V17, V17n, V7ng, V17Only, V18, V18n, V18O, V19, Wafer, WaferFR, WaferPR") options.register('tol', 0.01, VarParsing.VarParsing.multiplicity.singleton, @@ -34,6 +34,8 @@ if (options.type == "V18O"): process = cms.Process("OverlapCheck",Phase2C17I13M9,phase2_hgcalOnly) +elif (options.type == "V17Only"): + process = cms.Process("OverlapCheck",Phase2C17I13M9,phase2_hgcalOnly) else: process = cms.Process("OverlapCheck",Phase2C17I13M9) diff --git a/Geometry/HcalSimData/data/CaloUtil/2030/v5n/CaloUtil.xml b/Geometry/HcalSimData/data/CaloUtil/2030/v5n/CaloUtil.xml new file mode 100644 index 0000000000000..837235b4314e3 --- /dev/null +++ b/Geometry/HcalSimData/data/CaloUtil/2030/v5n/CaloUtil.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/SimG4CMS/Calo/test/python/runHGC10_cfg.py b/SimG4CMS/Calo/test/python/runHGC10_cfg.py new file mode 100644 index 0000000000000..d7fa3cc7eb136 --- /dev/null +++ b/SimG4CMS/Calo/test/python/runHGC10_cfg.py @@ -0,0 +1,81 @@ +import FWCore.ParameterSet.Config as cms +from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9 +from Configuration.Eras.Modifier_phase2_hgcalOnly_cff import phase2_hgcalOnly + +process = cms.Process("PROD",Phase2C17I13M9,phase2_hgcalOnly) +process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") +process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") +process.load("Geometry.HGCalCommonData.testHGCalV17OnlyReco_cff") +process.load("Configuration.StandardSequences.MagneticField_cff") +process.load("Configuration.EventContent.EventContent_cff") +process.load('Configuration.StandardSequences.Generator_cff') +process.load('Configuration.StandardSequences.SimIdeal_cff') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('SimG4CMS.Calo.hgcalHitScintillator_cfi') +process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T21', '') + +if hasattr(process,'MessageLogger'): + process.MessageLogger.HGCalGeom=dict() + process.MessageLogger.HCalGeom=dict() + process.MessageLogger.HGCalSim=dict() + process.MessageLogger.HGCSim=dict() + process.MessageLogger.CaloSim=dict() + +process.load("IOMC.RandomEngine.IOMC_cff") +process.RandomNumberGeneratorService.generator.initialSeed = 456789 +process.RandomNumberGeneratorService.g4SimHits.initialSeed = 9876 +process.RandomNumberGeneratorService.VtxSmeared.initialSeed = 123456789 + +process.Timing = cms.Service("Timing") + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(50) +) + +process.source = cms.Source("EmptySource", + firstRun = cms.untracked.uint32(1), + firstEvent = cms.untracked.uint32(1) +) + +process.generator = cms.EDProducer("FlatRandomEGunProducer", + PGunParameters = cms.PSet( + PartID = cms.vint32(211), + MinEta = cms.double(1.50), + MaxEta = cms.double(2.20), + MinPhi = cms.double(-3.1415926), + MaxPhi = cms.double(-1.5707963), + MinE = cms.double(100.00), + MaxE = cms.double(100.00) + ), + Verbosity = cms.untracked.int32(0), + AddAntiParticle = cms.bool(True) +) + +process.output = cms.OutputModule("PoolOutputModule", + process.FEVTSIMEventContent, + fileName = cms.untracked.string('hgcV17Only.root') +) + +#process.hgcalHitScintillator.tileFileName = "extraTiles.txt" +#process.g4SimHits.HGCScintSD.TileFileName = "extraTiles.txt" +process.g4SimHits.FileNameGDML = 'hgcalV17.gdml' + +process.generation_step = cms.Path(process.pgen) +process.simulation_step = cms.Path(process.psim) +#process.analysis_step = cms.Path(process.hgcalHitScintillator) +process.out_step = cms.EndPath(process.output) + +process.g4SimHits.Physics.type = 'SimG4Core/Physics/FTFP_BERT_EMM' + +# Schedule definition +process.schedule = cms.Schedule(process.generation_step, + process.simulation_step, +# process.analysis_step, + process.out_step + ) + +# filter all path with the production filter sequence +for path in process.paths: + getattr(process,path)._seq = process.generator * getattr(process,path)._seq