Skip to content

Commit

Permalink
Add an example script which can work for 2023 July simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunanda committed Oct 2, 2023
1 parent 4ff3ed6 commit 5457853
Showing 1 changed file with 117 additions and 0 deletions.
117 changes: 117 additions & 0 deletions SimG4CMS/HGCalTestBeam/test/HGCalTB230Jul_cfg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
import FWCore.ParameterSet.Config as cms

process = cms.Process('SIM')

# import of standard configurations
process.load("FWCore.MessageService.MessageLogger_cfi")
process.load('Configuration.StandardSequences.Services_cff')
process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
process.load('Configuration.EventContent.EventContent_cff')
process.load('Geometry.HGCalTBCommonData.testTB230JulXML_cfi')
process.load('Geometry.HGCalCommonData.hgcalEENumberingInitialization_cfi')
process.load('Geometry.HGCalCommonData.hgcalEEParametersInitialization_cfi')
process.load('Geometry.HcalTestBeamData.hcalTB06Parameters_cff')
process.load('Configuration.StandardSequences.MagneticField_0T_cff')
process.load('Configuration.StandardSequences.Generator_cff')
process.load('IOMC.EventVertexGenerators.VtxSmearedFlat_cfi')
process.load('GeneratorInterface.Core.genFilterSummary_cff')
process.load('Configuration.StandardSequences.SimIdeal_cff')
process.load('Configuration.StandardSequences.EndOfProcess_cff')
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
#process.load('SimG4CMS.HGCalTestBeam.HGCalTB23Analyzer_cfi')

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

if 'MessageLogger' in process.__dict__:
process.MessageLogger.HGCSim=dict()
process.MessageLogger.CaloSim=dict()
process.MessageLogger.FlatThetaGun=dict()
# process.MessageLogger.FlatEvtVtx=dict()

# Input source
process.source = cms.Source("EmptySource")

process.options = cms.untracked.PSet(
)

# Production Info
process.configurationMetadata = cms.untracked.PSet(
annotation = cms.untracked.string('SingleMuonE200_cfi nevts:10'),
name = cms.untracked.string('Applications'),
version = cms.untracked.string('$Revision: 1.19 $')
)

# Output definition

process.RAWSIMoutput = cms.OutputModule("PoolOutputModule",
SelectEvents = cms.untracked.PSet(
SelectEvents = cms.vstring('generation_step')
),
dataset = cms.untracked.PSet(
dataTier = cms.untracked.string('GEN-SIM'),
filterName = cms.untracked.string('')
),
eventAutoFlushCompressedSize = cms.untracked.int32(5242880),
fileName = cms.untracked.string('file:gensim.root'),
outputCommands = process.RAWSIMEventContent.outputCommands,
splitLevel = cms.untracked.int32(0)
)

# Additional output definition
process.TFileService = cms.Service("TFileService",
fileName = cms.string('TBGenSim.root')
)

# Other statements
process.genstepfilter.triggerConditions=cms.vstring("generation_step")
from Configuration.AlCa.GlobalTag import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_mc', '')

process.generator = cms.EDProducer("FlatRandomEThetaGunProducer",
AddAntiParticle = cms.bool(False),
PGunParameters = cms.PSet(
MinE = cms.double(9.99),
MaxE = cms.double(10.01),
MinTheta = cms.double(0.0),
MaxTheta = cms.double(0.0),
MinPhi = cms.double(-3.14159265359),
MaxPhi = cms.double(3.14159265359),
PartID = cms.vint32(11)
),
Verbosity = cms.untracked.int32(1),
firstRun = cms.untracked.uint32(1),
psethack = cms.string('single electron E 10')
)
process.VtxSmeared.MinZ = 0.0
process.VtxSmeared.MaxZ = 0.0
#process.VtxSmeared.MinX = -1.0
#process.VtxSmeared.MaxX = 1.0
#process.VtxSmeared.MinY = -1.0
#process.VtxSmeared.MaxY = 1.0
process.g4SimHits.OnlySDs = ['HGCalSensitiveDetector', 'HcalTB06BeamDetector']
process.g4SimHits.HGCSD.Detectors = 1
process.g4SimHits.HGCSD.RejectMouseBite = False
process.g4SimHits.HGCSD.RotatedWafer = False

# Path and EndPath definitions
process.generation_step = cms.Path(process.pgen)
process.simulation_step = cms.Path(process.psim)
process.genfiltersummary_step = cms.EndPath(process.genFilterSummary)
#process.analysis_step = cms.Path(process.HGCalTBAnalyzer)
process.endjob_step = cms.EndPath(process.endOfProcess)
process.RAWSIMoutput_step = cms.EndPath(process.RAWSIMoutput)

# Schedule definition
process.schedule = cms.Schedule(process.generation_step,
process.simulation_step,
# process.analysis_step,
process.endjob_step,
process.RAWSIMoutput_step,
)
# filter all path with the production filter sequence
for path in process.paths:
getattr(process,path)._seq = process.generator * getattr(process,path)._seq


0 comments on commit 5457853

Please sign in to comment.