-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run3-gex187X Add a test script to test all scenarios of 2021 #47243
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
############################################################################### | ||
# Way to use this: | ||
# cmsRun minbias2021_cfg.py type=DDD var=ZeroMaterial | ||
# | ||
# Options for type: DDD, DD4hep | ||
# for var: ZeroMaterial, FlatMinus05Percent, FlatMinus10Percent, | ||
# FlatPlus05Percent, FlatPlus10Percent | ||
# | ||
############################################################################### | ||
import FWCore.ParameterSet.Config as cms | ||
import os, sys, importlib, re, random | ||
import FWCore.ParameterSet.VarParsing as VarParsing | ||
|
||
#################################################################### | ||
### SETUP OPTIONS | ||
options = VarParsing.VarParsing('standard') | ||
options.register('type', | ||
"DD4hep", | ||
VarParsing.VarParsing.multiplicity.singleton, | ||
VarParsing.VarParsing.varType.string, | ||
"type of operations: DDD, DD4hep") | ||
options.register('var', | ||
"", | ||
VarParsing.VarParsing.multiplicity.singleton, | ||
VarParsing.VarParsing.varType.string, | ||
"var of operations: ZeroMaterial, FlatMinus05Percent, FlatMinus10Percent, FlatPlus05Percent, FlatPlus10Percent") | ||
|
||
### get and parse the command line arguments | ||
options.parseArguments() | ||
|
||
print(options) | ||
|
||
#################################################################### | ||
# Use the options | ||
if (options.type == "DD4hep"): | ||
from Configuration.Eras.Era_Run3_cff import Run3 | ||
process = cms.Process("Sim",Run3) | ||
geomfile = "Configuration.Geometry.GeometryDD4hepExtended2021" + options.var + "Reco_cff" | ||
outfile = "minbias_FTFP_BERT_EMM_" + options.var + "_DD4hep.root" | ||
else: | ||
from Configuration.Eras.Era_Run3_DDD_cff import Run3_DDD | ||
process = cms.Process("Sim",Run3_DDD) | ||
geomfile = "Configuration.Geometry.GeometryExtended2021" + options.var + "Reco_cff" | ||
outfile = "minbias_FTFP_BERT_EMM_" + options.var + "_DDD.root" | ||
|
||
print("Geometry file: ", geomfile) | ||
print("Output file: ", outfile) | ||
|
||
process.load("SimG4CMS.Calo.PythiaMinBias_cfi") | ||
process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") | ||
process.load('FWCore.MessageService.MessageLogger_cfi') | ||
process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") | ||
process.load(geomfile) | ||
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('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') | ||
from Configuration.AlCa.GlobalTag import GlobalTag | ||
process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2022_realistic', '') | ||
|
||
if 'MessageLogger' in process.__dict__: | ||
process.MessageLogger.G4cerr=dict() | ||
process.MessageLogger.SimG4CoreApplication=dict() | ||
|
||
process.source = cms.Source("EmptySource") | ||
|
||
process.maxEvents = cms.untracked.PSet( | ||
input = cms.untracked.int32(2) | ||
) | ||
|
||
process.Timing = cms.Service("Timing") | ||
|
||
process.SimpleMemoryCheck = cms.Service("SimpleMemoryCheck", | ||
oncePerEventMode = cms.untracked.bool(True), | ||
showMallocInfo = cms.untracked.bool(True), | ||
ignoreTotal = cms.untracked.int32(1) | ||
) | ||
|
||
process.load("IOMC.RandomEngine.IOMC_cff") | ||
process.RandomNumberGeneratorService.generator.initialSeed = 456789 | ||
process.RandomNumberGeneratorService.g4SimHits.initialSeed = 9876 | ||
process.RandomNumberGeneratorService.VtxSmeared.initialSeed = 123456789 | ||
process.rndmStore = cms.EDProducer("RandomEngineStateProducer") | ||
|
||
process.TFileService = cms.Service("TFileService", | ||
fileName = cms.string('minbias_FTFP_BERT_EMM.root') | ||
) | ||
|
||
# Event output | ||
process.output = cms.OutputModule("PoolOutputModule", | ||
process.FEVTSIMEventContent, | ||
fileName = cms.untracked.string(outfile) | ||
) | ||
|
||
process.generation_step = cms.Path(process.pgen) | ||
process.simulation_step = cms.Path(process.psim) | ||
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.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 | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Informational comment: while VarParsing is still allowed, it should be considered deprecated and argparse should be preferred, since it is now supported by cmsRun (since #42650). An example migration can be found here: ec33ffd