|
| 1 | +############################################################################### |
| 2 | +# Way to use this: |
| 3 | +# cmsRun runHcalCellKountRun3_cfg.py geometry=2021 |
| 4 | +# |
| 5 | +# Options for geometry 2016, 2016dev, 2017, 2018, 2021, 2023, 2024 |
| 6 | +# |
| 7 | +############################################################################### |
| 8 | +import FWCore.ParameterSet.Config as cms |
| 9 | +import os, sys, importlib, re |
| 10 | +import FWCore.ParameterSet.VarParsing as VarParsing |
| 11 | + |
| 12 | +#################################################################### |
| 13 | +### SETUP OPTIONS |
| 14 | +options = VarParsing.VarParsing('standard') |
| 15 | +options.register('geometry', |
| 16 | + "2024", |
| 17 | + VarParsing.VarParsing.multiplicity.singleton, |
| 18 | + VarParsing.VarParsing.varType.string, |
| 19 | + "geometry of operations: 2016, 2016dev, 2017, 2018, 2021, 2023, 2024") |
| 20 | +### get and parse the command line arguments |
| 21 | +options.parseArguments() |
| 22 | + |
| 23 | +print(options) |
| 24 | + |
| 25 | +#################################################################### |
| 26 | +# Use the options |
| 27 | + |
| 28 | +geomName = "Configuration.Geometry.GeometryExtended" + options.geometry + "Reco_cff" |
| 29 | + |
| 30 | +if (options.geometry == "2016"): |
| 31 | + from Configuration.Eras.Era_Run2_2016_cff import Run2_2016 |
| 32 | + process = cms.Process('G4PrintGeometry',Run2_2016) |
| 33 | +elif (options.geometry == "2016dev"): |
| 34 | + from Configuration.Eras.Era_Run2_2016_cff import Run2_2016 |
| 35 | + process = cms.Process('G4PrintGeometry',Run2_2016) |
| 36 | +elif (options.geometry == "2017"): |
| 37 | + from Configuration.Eras.Era_Run2_2017_cff import Run2_2017 |
| 38 | + process = cms.Process('G4PrintGeometry',Run2_2017) |
| 39 | +elif (options.geometry == "2018"): |
| 40 | + from Configuration.Eras.Era_Run2_2018_cff import Run2_2018 |
| 41 | + process = cms.Process('G4PrintGeometry',Run2_2018) |
| 42 | +else: |
| 43 | + from Configuration.Eras.Era_Run3_DDD_cff import Run3_DDD |
| 44 | + process = cms.Process('G4PrintGeometry',Run3_DDD) |
| 45 | + |
| 46 | +print("Geom file Name: ", geomName) |
| 47 | + |
| 48 | +process.load('Configuration.StandardSequences.Services_cff') |
| 49 | +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') |
| 50 | +process.load('FWCore.MessageService.MessageLogger_cfi') |
| 51 | +process.load('Configuration.EventContent.EventContent_cff') |
| 52 | +process.load(geomName) |
| 53 | +process.load('Configuration.StandardSequences.MagneticField_cff') |
| 54 | +process.load('Configuration.StandardSequences.Generator_cff') |
| 55 | +process.load('IOMC.EventVertexGenerators.VtxSmearedRealistic_cfi') |
| 56 | +process.load('GeneratorInterface.Core.genFilterSummary_cff') |
| 57 | +process.load('Configuration.StandardSequences.SimIdeal_cff') |
| 58 | +process.load('Configuration.StandardSequences.EndOfProcess_cff') |
| 59 | +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') |
| 60 | +process.load('Geometry.HcalTowerAlgo.hcalCellKount_cfi') |
| 61 | + |
| 62 | +process.MessageLogger.G4cout=dict() |
| 63 | + |
| 64 | +process.maxEvents = cms.untracked.PSet( |
| 65 | + input = cms.untracked.int32(1) |
| 66 | +) |
| 67 | + |
| 68 | +if hasattr(process,'MessageLogger'): |
| 69 | + process.MessageLogger.HCalGeom=dict() |
| 70 | + |
| 71 | + |
| 72 | +process.source = cms.Source("EmptySource") |
| 73 | + |
| 74 | +process.generator = cms.EDProducer("FlatRandomPtGunProducer", |
| 75 | + PGunParameters = cms.PSet( |
| 76 | + PartID = cms.vint32(13), |
| 77 | + MinEta = cms.double(-2.5), |
| 78 | + MaxEta = cms.double(2.5), |
| 79 | + MinPhi = cms.double(-3.14159265359), |
| 80 | + MaxPhi = cms.double(3.14159265359), |
| 81 | + MinPt = cms.double(9.99), |
| 82 | + MaxPt = cms.double(10.01) |
| 83 | + ), |
| 84 | + AddAntiParticle = cms.bool(False), |
| 85 | + Verbosity = cms.untracked.int32(0), |
| 86 | + firstRun = cms.untracked.uint32(1) |
| 87 | +) |
| 88 | + |
| 89 | +process.options = cms.untracked.PSet( |
| 90 | + IgnoreCompletely = cms.untracked.vstring(), |
| 91 | + Rethrow = cms.untracked.vstring(), |
| 92 | + TryToContinue = cms.untracked.vstring(), |
| 93 | + accelerators = cms.untracked.vstring('*'), |
| 94 | + allowUnscheduled = cms.obsolete.untracked.bool, |
| 95 | + canDeleteEarly = cms.untracked.vstring(), |
| 96 | + deleteNonConsumedUnscheduledModules = cms.untracked.bool(True), |
| 97 | + dumpOptions = cms.untracked.bool(False), |
| 98 | + emptyRunLumiMode = cms.obsolete.untracked.string, |
| 99 | + eventSetup = cms.untracked.PSet( |
| 100 | + forceNumberOfConcurrentIOVs = cms.untracked.PSet( |
| 101 | + allowAnyLabel_=cms.required.untracked.uint32 |
| 102 | + ), |
| 103 | + numberOfConcurrentIOVs = cms.untracked.uint32(0) |
| 104 | + ), |
| 105 | + fileMode = cms.untracked.string('FULLMERGE'), |
| 106 | + forceEventSetupCacheClearOnNewRun = cms.untracked.bool(False), |
| 107 | + holdsReferencesToDeleteEarly = cms.untracked.VPSet(), |
| 108 | + makeTriggerResults = cms.obsolete.untracked.bool, |
| 109 | + modulesToCallForTryToContinue = cms.untracked.vstring(), |
| 110 | + modulesToIgnoreForDeleteEarly = cms.untracked.vstring(), |
| 111 | + numberOfConcurrentLuminosityBlocks = cms.untracked.uint32(0), |
| 112 | + numberOfConcurrentRuns = cms.untracked.uint32(1), |
| 113 | + numberOfStreams = cms.untracked.uint32(0), |
| 114 | + numberOfThreads = cms.untracked.uint32(1), |
| 115 | + printDependencies = cms.untracked.bool(False), |
| 116 | + sizeOfStackForThreadsInKB = cms.optional.untracked.uint32, |
| 117 | + throwIfIllegalParameter = cms.untracked.bool(True), |
| 118 | + wantSummary = cms.untracked.bool(False) |
| 119 | +) |
| 120 | + |
| 121 | +process.ProductionFilterSequence = cms.Sequence(process.generator) |
| 122 | +from Configuration.AlCa.GlobalTag import GlobalTag |
| 123 | +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2024_realistic', '') |
| 124 | + |
| 125 | +# Path and EndPath definitions |
| 126 | +process.generation_step = cms.Path(process.pgen) |
| 127 | +process.simulation_step = cms.Path(process.psim) |
| 128 | +process.genfiltersummary_step = cms.EndPath(process.genFilterSummary) |
| 129 | +process.endjob_step = cms.EndPath(process.endOfProcess) |
| 130 | +process.analysis_step = cms.EndPath(process.hcalCellKount) |
| 131 | + |
| 132 | +# Schedule definition |
| 133 | +process.schedule = cms.Schedule(process.generation_step, |
| 134 | + process.genfiltersummary_step, |
| 135 | + process.simulation_step, |
| 136 | + process.analysis_step, |
| 137 | + process.endjob_step) |
| 138 | + |
| 139 | +from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask |
| 140 | +associatePatAlgosToolsTask(process) |
| 141 | +# filter all path with the production filter sequence |
| 142 | +for path in process.paths: |
| 143 | + getattr(process,path).insert(0, process.ProductionFilterSequence) |
| 144 | + |
| 145 | +process.g4SimHits.UseMagneticField = False |
| 146 | +process.g4SimHits.Physics.DefaultCutValue = 10. |
| 147 | + |
0 commit comments