|
| 1 | +############################################################################### |
| 2 | +# Way to use this: |
| 3 | +# cmsRun runHGC1_cfg.py geometry=V18 |
| 4 | +# Options for geometry D107, D116, D104, D120 |
| 5 | +# (V16) (V17) (V18) (V19) |
| 6 | +############################################################################### |
| 7 | +import FWCore.ParameterSet.Config as cms |
| 8 | +import os, sys, importlib, re |
| 9 | +import FWCore.ParameterSet.VarParsing as VarParsing |
| 10 | + |
| 11 | +#################################################################### |
| 12 | +### SETUP OPTIONS |
| 13 | +options = VarParsing.VarParsing('standard') |
| 14 | +options.register('geometry', |
| 15 | + "D116", |
| 16 | + VarParsing.VarParsing.multiplicity.singleton, |
| 17 | + VarParsing.VarParsing.varType.string, |
| 18 | + "geometry of operations: D107, D116, D104, D120") |
| 19 | + |
| 20 | +### get and parse the command line arguments |
| 21 | + |
| 22 | +options.parseArguments() |
| 23 | +print(options) |
| 24 | + |
| 25 | +#################################################################### |
| 26 | + |
| 27 | +geomName = "Run4" + options.geometry |
| 28 | +geomFile = "Configuration.Geometry.GeometryExtended" + geomName + "Reco_cff" |
| 29 | +import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings |
| 30 | +GLOBAL_TAG, ERA = _settings.get_era_and_conditions(geomName) |
| 31 | +print("Geometry Name: ", geomName) |
| 32 | +print("Geom file Name: ", geomFile) |
| 33 | +print("Global Tag Name: ", GLOBAL_TAG) |
| 34 | +print("Era Name: ", ERA) |
| 35 | + |
| 36 | +process = cms.Process("PROD",ERA) |
| 37 | + |
| 38 | +process.load('Configuration.StandardSequences.Services_cff') |
| 39 | +process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") |
| 40 | +process.load('FWCore.MessageService.MessageLogger_cfi') |
| 41 | +process.load('Configuration.EventContent.EventContent_cff') |
| 42 | +process.load('SimGeneral.MixingModule.mixNoPU_cfi') |
| 43 | +process.load(geomFile) |
| 44 | +process.load("Configuration.StandardSequences.MagneticField_cff") |
| 45 | +process.load('Configuration.StandardSequences.Generator_cff') |
| 46 | +process.load('IOMC.EventVertexGenerators.VtxSmearedRealisticHLLHC_cfi') |
| 47 | +process.load('GeneratorInterface.Core.genFilterSummary_cff') |
| 48 | +process.load('Configuration.StandardSequences.SimIdeal_cff') |
| 49 | +process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") |
| 50 | +from Configuration.AlCa.GlobalTag import GlobalTag |
| 51 | +process.GlobalTag = GlobalTag(process.GlobalTag, GLOBAL_TAG, '') |
| 52 | + |
| 53 | +if hasattr(process,'MessageLogger'): |
| 54 | + process.MessageLogger.HGCalGeom = dict() |
| 55 | + process.MessageLogger.HGCSim = dict() |
| 56 | +# process.MessageLogger.CaloSim = dict() |
| 57 | + |
| 58 | +process.load("IOMC.RandomEngine.IOMC_cff") |
| 59 | +process.RandomNumberGeneratorService.generator.initialSeed = 456789 |
| 60 | +process.RandomNumberGeneratorService.g4SimHits.initialSeed = 9876 |
| 61 | +process.RandomNumberGeneratorService.VtxSmeared.initialSeed = 123456789 |
| 62 | + |
| 63 | +process.maxEvents = cms.untracked.PSet( |
| 64 | + input = cms.untracked.int32(100) |
| 65 | +) |
| 66 | + |
| 67 | +process.source = cms.Source("EmptySource", |
| 68 | + firstRun = cms.untracked.uint32(1), |
| 69 | + firstEvent = cms.untracked.uint32(1) |
| 70 | +) |
| 71 | + |
| 72 | +process.generator = cms.EDFilter("Pythia8PtGun", |
| 73 | + PGunParameters = cms.PSet( |
| 74 | + MaxPt = cms.double(100.01), |
| 75 | + MinPt = cms.double(99.99), |
| 76 | + ParticleID = cms.vint32(-11), |
| 77 | + AddAntiParticle = cms.bool(True), |
| 78 | + MaxEta = cms.double(3.1), |
| 79 | + MaxPhi = cms.double(3.14159265359), |
| 80 | + MinEta = cms.double(2.5), |
| 81 | + MinPhi = cms.double(-3.14159265359) ## in radians |
| 82 | + ), |
| 83 | + Verbosity = cms.untracked.int32(0), ## set to 1 (or greater) for printouts |
| 84 | + psethack = cms.string('single mu pt 100'), |
| 85 | + firstRun = cms.untracked.uint32(1), |
| 86 | + PythiaParameters = cms.PSet(parameterSets = cms.vstring()) |
| 87 | +) |
| 88 | + |
| 89 | +# Other statements |
| 90 | +process.genstepfilter.triggerConditions=cms.vstring("generation_step") |
| 91 | +process.ProductionFilterSequence = cms.Sequence(process.generator) |
| 92 | + |
| 93 | +process.generation_step = cms.Path(process.pgen) |
| 94 | +process.simulation_step = cms.Path(process.psim) |
| 95 | +process.genfiltersummary_step = cms.EndPath(process.genFilterSummary) |
| 96 | + |
| 97 | +# Schedule definition |
| 98 | +process.schedule = cms.Schedule(process.generation_step, |
| 99 | + process.genfiltersummary_step, |
| 100 | + process.simulation_step, |
| 101 | + ) |
| 102 | + |
| 103 | +# filter all path with the production filter sequence |
| 104 | +for path in process.paths: |
| 105 | + getattr(process,path).insert(0, process.ProductionFilterSequence) |
0 commit comments