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