Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-05-20 22:40:14

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