File indexing completed on 2024-11-14 04:15:58
0001
0002
0003
0004
0005
0006
0007
0008
0009 import FWCore.ParameterSet.Config as cms
0010 import os, sys, importlib, re
0011 import FWCore.ParameterSet.VarParsing as VarParsing
0012
0013
0014
0015 options = VarParsing.VarParsing('standard')
0016 options.register('geometry',
0017 "D110",
0018 VarParsing.VarParsing.multiplicity.singleton,
0019 VarParsing.VarParsing.varType.string,
0020 "geometry of operations: D98, D99, D103, D104, D105, D106, D107, D108, D109, D110, D111, D112, D113, D114, D115")
0021
0022
0023 options.parseArguments()
0024
0025 print(options)
0026
0027
0028
0029
0030 if (options.geometry == "D115"):
0031 from Configuration.Eras.Era_Phase2C20I13M9_cff import Phase2C20I13M9
0032 process = cms.Process('Client',Phase2C20I13M9)
0033 elif (options.geometry == "D104"):
0034 from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9
0035 process = cms.Process('Client',PhaseC22I13M9)
0036 elif (options.geometry == "D106"):
0037 from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9
0038 process = cms.Process('Client',PhaseC22I13M9)
0039 elif (options.geometry == "D109"):
0040 from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9
0041 process = cms.Process('Client',PhaseC22I13M9)
0042 elif (options.geometry == "D111"):
0043 from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9
0044 process = cms.Process('Client',PhaseC22I13M9)
0045 elif (options.geometry == "D112"):
0046 from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9
0047 process = cms.Process('Client',PhaseC22I13M9)
0048 elif (options.geometry == "D113"):
0049 from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9
0050 process = cms.Process('Client',PhaseC22I13M9)
0051 else:
0052 from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
0053 process = cms.Process('PROD',Phase2C17I13M9)
0054
0055 geomFile = "Configuration.Geometry.GeometryExtendedRun4" + options.geometry + "Reco_cff"
0056 fileCheck = "testHGCalSimWatcherRun4" + options.geometry + ".root"
0057
0058 if (options.geometry == "D93"):
0059 runMode = 2
0060 else:
0061 runMode = 1
0062
0063 print("Geometry file: ", geomFile)
0064 print("Output file: ", fileCheck)
0065 print("Run Mode: ", runMode)
0066
0067
0068 process.load(geomFile)
0069 process.load('Configuration.StandardSequences.Services_cff')
0070 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
0071 process.load('FWCore.MessageService.MessageLogger_cfi')
0072 process.load('Configuration.EventContent.EventContent_cff')
0073 process.load('SimGeneral.MixingModule.mixNoPU_cfi')
0074 process.load('Configuration.StandardSequences.MagneticField_cff')
0075 process.load('Configuration.StandardSequences.Generator_cff')
0076 process.load('IOMC.EventVertexGenerators.VtxSmearedRealistic50ns13TeVCollision_cfi')
0077 process.load('GeneratorInterface.Core.genFilterSummary_cff')
0078 process.load('Configuration.StandardSequences.SimIdeal_cff')
0079 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0080 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0081 process.load('Configuration.StandardSequences.Digi_cff')
0082 process.load('Configuration.StandardSequences.SimL1Emulator_cff')
0083 process.load('Configuration.StandardSequences.L1TrackTrigger_cff')
0084 process.load('Configuration.StandardSequences.DigiToRaw_cff')
0085 process.load('HLTrigger.Configuration.HLT_Fake2_cff')
0086 process.load('Configuration.StandardSequences.RawToDigi_cff')
0087 process.load('Configuration.StandardSequences.L1Reco_cff')
0088 process.load('Configuration.StandardSequences.Reconstruction_cff')
0089 process.load('Configuration.StandardSequences.RecoSim_cff')
0090 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0091
0092 process.maxEvents = cms.untracked.PSet(
0093 input = cms.untracked.int32(1000)
0094 )
0095
0096 process.MessageLogger.cerr.FwkReport.reportEvery = 5
0097 if hasattr(process,'MessageLogger'):
0098 process.MessageLogger.ValidHGCal=dict()
0099 process.MessageLogger.HGCalGeom=dict()
0100
0101
0102 process.source = cms.Source("EmptySource")
0103
0104 process.options = cms.untracked.PSet(
0105 wantSummary = cms.untracked.bool(True),
0106 numberOfConcurrentRuns = cms.untracked.uint32(1),
0107 numberOfStreams = cms.untracked.uint32(0),
0108 numberOfThreads = cms.untracked.uint32(1),
0109 printDependencies = cms.untracked.bool(False),
0110 sizeOfStackForThreadsInKB = cms.optional.untracked.uint32,
0111 )
0112
0113
0114 process.configurationMetadata = cms.untracked.PSet(
0115 version = cms.untracked.string(''),
0116 annotation = cms.untracked.string(''),
0117 name = cms.untracked.string('Applications')
0118 )
0119
0120
0121 process.output = cms.OutputModule("PoolOutputModule",
0122 splitLevel = cms.untracked.int32(0),
0123 eventAutoFlushCompressedSize = cms.untracked.int32(5242880),
0124 outputCommands = cms.untracked.vstring(
0125 'keep *_*hbhe*_*_*',
0126 'keep *_g4SimHits_*_*',
0127 'keep *_*HGC*_*_*',
0128 ),
0129 fileName = cms.untracked.string(fileCheck),
0130 dataset = cms.untracked.PSet(
0131 filterName = cms.untracked.string(''),
0132 dataTier = cms.untracked.string('GEN-SIM-DIGI-RAW-RECO')
0133 ),
0134 SelectEvents = cms.untracked.PSet(
0135 SelectEvents = cms.vstring('generation_step')
0136 )
0137 )
0138
0139
0140 if (runMode == 1):
0141 process.g4SimHits.Watchers = cms.VPSet(cms.PSet(
0142 SimG4HGCalValidation = cms.PSet(
0143 Names = cms.vstring(
0144 'HGCalEECellSensitive',
0145 'HGCalHESiliconCellSensitive',
0146 'HGCalHEScintillatorSensitive',
0147 ),
0148 Types = cms.vint32(0,0,0),
0149 DetTypes = cms.vint32(0,1,2),
0150 LabelLayerInfo = cms.string("HGCalInfoLayer"),
0151 Verbosity = cms.untracked.int32(0),
0152 ),
0153 type = cms.string('SimG4HGCalValidation')
0154 ))
0155 else:
0156 process.g4SimHits.Watchers = cms.VPSet(cms.PSet(
0157 SimG4HGCalValidation = cms.PSet(
0158 Names = cms.vstring(
0159 'HGCalEESensitive',
0160 'HGCalHESensitive',
0161 'HGCalHESiliconSensitive',
0162 'HGCalHEScintillatorSensitive',
0163 ),
0164 Types = cms.vint32(0,0,0,0),
0165 DetTypes = cms.vint32(0,1,1,2),
0166 LabelLayerInfo = cms.string("HGCalInfoLayer"),
0167 Verbosity = cms.untracked.int32(0),
0168 ),
0169 type = cms.string('SimG4HGCalValidation')
0170 ))
0171
0172
0173 process.genstepfilter.triggerConditions=cms.vstring("generation_step")
0174 from Configuration.AlCa.GlobalTag import GlobalTag
0175 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T21', '')
0176
0177 process.generator = cms.EDProducer("FlatRandomPtGunProducer",
0178 PGunParameters = cms.PSet(
0179 MaxPt = cms.double(20.0),
0180 MinPt = cms.double(20.0),
0181 PartID = cms.vint32(13),
0182 MaxEta = cms.double(3.0),
0183 MaxPhi = cms.double(3.14159265359),
0184 MinEta = cms.double(1.2),
0185 MinPhi = cms.double(-3.14159265359)
0186 ),
0187 Verbosity = cms.untracked.int32(0),
0188 psethack = cms.string('single muon pt 20'),
0189 AddAntiParticle = cms.bool(False),
0190 firstRun = cms.untracked.uint32(1)
0191 )
0192
0193
0194
0195 process.mix.digitizers = cms.PSet(process.theDigitizersValid)
0196
0197 process.ProductionFilterSequence = cms.Sequence(process.generator)
0198
0199
0200 process.generation_step = cms.Path(process.pgen)
0201 process.simulation_step = cms.Path(process.psim)
0202 process.genfiltersummary_step = cms.EndPath(process.genFilterSummary)
0203 process.digitisation_step = cms.Path(process.pdigi_valid)
0204 process.L1simulation_step = cms.Path(process.SimL1Emulator)
0205 process.L1TrackTrigger_step = cms.Path(process.L1TrackTrigger)
0206 process.digi2raw_step = cms.Path(process.DigiToRaw)
0207 process.raw2digi_step = cms.Path(process.RawToDigi)
0208 process.L1Reco_step = cms.Path(process.L1Reco)
0209 process.reconstruction_step = cms.Path(process.localreco)
0210 process.recosim_step = cms.Path(process.recosim)
0211 process.out_step = cms.EndPath(process.output)
0212
0213
0214 process.schedule = cms.Schedule(process.generation_step,
0215 process.simulation_step,
0216 process.digitisation_step,
0217 process.L1simulation_step,
0218 process.L1TrackTrigger_step,
0219 process.digi2raw_step,
0220
0221
0222
0223
0224 process.out_step
0225 )
0226
0227
0228 for path in process.paths:
0229 if getattr(process,path)._seq is not None: getattr(process,path)._seq = process.ProductionFilterSequence * getattr(process,path)._seq