Skip to content

Commit

Permalink
Add an example of CMS scenario with only HGCal detector (backport cms…
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunanda committed Feb 6, 2024
1 parent 70c7fb8 commit 8947335
Show file tree
Hide file tree
Showing 6 changed files with 156 additions and 5 deletions.
3 changes: 3 additions & 0 deletions Configuration/Eras/python/Modifier_phase2_hgcalOnly_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import FWCore.ParameterSet.Config as cms

phase2_hgcalOnly = cms.Modifier()
22 changes: 22 additions & 0 deletions Geometry/HGCalCommonData/python/testHGCalV18OReco_cff.py
Original file line number Diff line number Diff line change
@@ -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.testHGCalV18OXML_cfi import *
from Geometry.HGCalCommonData.hgcalParametersInitialization_cfi import *
from Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi import *
from Geometry.HcalCommonData.caloSimulationParameters_cff import *

# calo
from Geometry.CaloEventSetup.HGCalTopology_cfi import *
from Geometry.HGCalGeometry.HGCalGeometryESProducer_cfi import *
CaloGeometryBuilder = cms.ESProducer("CaloGeometryBuilder",
SelectedCalos = cms.vstring("HCAL",
"ZDC",
"EcalBarrel",
"TOWER",
"HGCalEESensitive",
"HGCalHESiliconSensitive",
"HGCalHEScintillatorSensitive"
)
)
34 changes: 34 additions & 0 deletions Geometry/HGCalCommonData/python/testHGCalV18OXML_cfi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import FWCore.ParameterSet.Config as cms

# This config was generated automatically using generate2026Geometry.py
# If you notice a mistake, please update the generating script, not just this config

XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource",
geomXMLFiles = cms.vstring(
'Geometry/CMSCommonData/data/materials/2021/v1/materials.xml',
'Geometry/CMSCommonData/data/rotations.xml',
'Geometry/CMSCommonData/data/extend/v2/cmsextent.xml',
'Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml',
'Geometry/CMSCommonData/data/cms/2026/v5/cms.xml',
'Geometry/CMSCommonData/data/cmsMother.xml',
'Geometry/CMSCommonData/data/eta3/etaMax.xml',
'Geometry/CMSCommonData/data/caloBase/2026/v7/caloBase.xml',
'Geometry/CMSCommonData/data/cmsCalo.xml',
'Geometry/HGCalCommonData/data/hgcalMaterial/v2/hgcalMaterial.xml',
'Geometry/HGCalCommonData/data/hgcal/v18/hgcal.xml',
'Geometry/HGCalCommonData/data/hgcalcell/v17/hgcalcell.xml',
'Geometry/HGCalCommonData/data/hgcalwafer/v18/hgcalwafer.xml',
'Geometry/HGCalCommonData/data/hgcalPassive/v18/hgcalPassive.xml',
'Geometry/HGCalCommonData/data/hgcalEE/v18/hgcalEE.xml',
'Geometry/HGCalCommonData/data/hgcalHEsil/v18/hgcalHEsil.xml',
'Geometry/HGCalCommonData/data/hgcalHEmix/v18/hgcalHEmix.xml',
'Geometry/HGCalCommonData/data/hgcalCons/v18/hgcalCons.xml',
'Geometry/HGCalCommonData/data/hgcalConsData/v17/hgcalConsData.xml',
'Geometry/HcalSimData/data/CaloUtil/2026/v2c/CaloUtil.xml',
'Geometry/HGCalSimData/data/hgcsensv15.xml',
'Geometry/HcalSimData/data/CaloUtil/2026/v2c/CaloUtil.xml',
'Geometry/HGCalSimData/data/hgcProdCutsv15.xml',
'Geometry/CMSCommonData/data/FieldParameters.xml',
),
rootNodeName = cms.string('cms:OCMS')
)
11 changes: 8 additions & 3 deletions Geometry/HGCalCommonData/test/python/g4OverlapCheck_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
# Way to use this:
# cmsRun g4OverlapCheck_cfg.py type=V17 tol=0.01
#
# Options for type V16, V17, V17n, V17ng, V18, V18n, Wafer, WaferFR, WaferPR
# Options for type V16, V17, V17n, V17ng, V18, V18n, V18O, Wafer, WaferFR,
# WaferPR
# tol 1.0, 0.1, 0.01, 0.0
#
###############################################################################
Expand All @@ -17,7 +18,7 @@
"V17",
VarParsing.VarParsing.multiplicity.singleton,
VarParsing.VarParsing.varType.string,
"type of operations: V16, V17, V17n, V7ng, V18, V18n, Wafer, WaferFR, WaferPR")
"type of operations: V16, V17, V17n, V7ng, V18, V18n, V18O, Wafer, WaferFR, WaferPR")
options.register('tol',
0.01,
VarParsing.VarParsing.multiplicity.singleton,
Expand All @@ -29,8 +30,12 @@
print(options)

from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
from Configuration.Eras.Modifier_phase2_hgcalOnly_cff import phase2_hgcalOnly

process = cms.Process("OverlapCheck",Phase2C17I13M9)
if (options.type == "V18O"):
process = cms.Process("OverlapCheck",Phase2C17I13M9,phase2_hgcalOnly)
else:
process = cms.Process("OverlapCheck",Phase2C17I13M9)

####################################################################
# Use the options
Expand Down
79 changes: 79 additions & 0 deletions SimG4CMS/Calo/test/python/runHGC9_cfg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import FWCore.ParameterSet.Config as cms
from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
from Configuration.Eras.Modifier_phase2_hgcalOnly_cff import phase2_hgcalOnly
from Configuration.Eras.Modifier_phase2_hgcalV18_cff import phase2_hgcalV18

process = cms.Process("PROD",Phase2C17I13M9,phase2_hgcalOnly,phase2_hgcalV18)
process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")
process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi")
process.load("Geometry.HGCalCommonData.testHGCalV18OReco_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.HGCalSim=dict()
process.MessageLogger.HGCSim=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('hgcV18O.root')
)

process.hgcalHitScintillator.tileFileName = "extraTiles.txt"
process.g4SimHits.HGCScintSD.TileFileName = "extraTiles.txt"

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
12 changes: 10 additions & 2 deletions SimG4Core/Application/python/g4SimHits_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,9 +752,9 @@

from Configuration.Eras.Modifier_hgcaltb_cff import hgcaltb
hgcaltb.toModify(g4SimHits,
OnlySDs = ['AHcalSensitiveDetector','CaloTrkProcessing','FP420SensitiveDetector','HFNoseSensitiveDetector','HGCSensitiveDetector','HGCalSensitiveDetector','HGCalTB1601SensitiveDetector','HcalTB06BeamDetector'],
OnlySDs = ['AHcalSensitiveDetector','CaloTrkProcessing','HFNoseSensitiveDetector','HGCSensitiveDetector','HGCalSensitiveDetector','HGCalTB1601SensitiveDetector','HcalTB06BeamDetector'],
TrackHits = ['FP420SI'],
CaloHits = ['CalibrationHGCHitsEE','CalibrationHGCHitsHEback','CalibrationHGCHitsHEfront','CaloHitsTk','ChamberHits','EcalHitsEB','EcalHitsEE','EcalHitsES','EcalTBH4BeamHits','FibreHits','HFNoseHits','HcalSensitiveDetector','HGCHitsEE','HGCHitsHEback','HGCHitsHEfront','HcalHits','HcalTB06BeamHits','WedgeHits'],
CaloHits = ['CalibrationHGCHitsEE','CalibrationHGCHitsHEback','CalibrationHGCHitsHEfront','CaloHitsTk','ChamberHits','HFNoseHits','HGCHitsEE','HGCHitsHEback','HGCHitsHEfront','HcalHits','HcalTB06BeamHits','WedgeHits'],
NonBeamEvent = True,
UseMagneticField = False,
CaloSD = dict(
Expand All @@ -766,6 +766,14 @@
ForTBHCAL = True)
)

from Configuration.Eras.Modifier_phase2_hgcalOnly_cff import phase2_hgcalOnly
phase2_hgcalOnly.toModify(g4SimHits,
OnlySDs = ['CaloTrkProcessing','HGCScintillatorSensitiveDetector','HGCalSensitiveDetector'],
TrackHits = [],
CaloHits = ["CalibrationHGCHitsEE",'CalibrationHGCHitsHEback',"CalibrationHGCHitsHEfront","CaloHitsTk","HGCHitsEE","HGCHitsHEback","HGCHitsHEfront",],
LHCTransport = False
)

from Configuration.Eras.Modifier_phase2_hgcalV18_cff import phase2_hgcalV18
phase2_hgcalV18.toModify(g4SimHits,
HGCSD = dict(
Expand Down

0 comments on commit 8947335

Please sign in to comment.