Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-05-26 22:38:29

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun testHGCalParametersDDD_cfg.py type=V18
0004 #
0005 #   Options for type D88, D92, V17Shift, V18
0006 #
0007 ###############################################################################
0008 import FWCore.ParameterSet.Config as cms
0009 import os, sys, imp, re
0010 import FWCore.ParameterSet.VarParsing as VarParsing
0011 
0012 ####################################################################
0013 ### SETUP OPTIONS
0014 options = VarParsing.VarParsing('standard')
0015 options.register('type',
0016                  "V18",
0017                   VarParsing.VarParsing.multiplicity.singleton,
0018                   VarParsing.VarParsing.varType.string,
0019                   "type of operations: D88, D92, V17Shift, V18")
0020 
0021 ### get and parse the command line arguments
0022 options.parseArguments()
0023 print(options)
0024 
0025 from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
0026 
0027 process = cms.Process("HGCalParametersTest",Phase2C17I13M9)
0028 
0029 if (options.type == "V18"):
0030     geomFile = "Geometry.HGCalCommonData.testHGCal" + options.type + "Reco_cff"
0031 elif (options.type == "V17Shift"):
0032     geomFile = "Geometry.HGCalCommonData.testHGCal" + options.type + "Reco_cff"
0033 else:
0034     geomFile = "Configuration.Geometry.GeometryExtended2026" + options.type + "Reco_cff"
0035 outFile = "minbias" + options.type + ".root"
0036 
0037 print("Geometry file: ", geomFile)
0038 print("Output file: ", outFile)
0039 
0040 process.load("SimG4CMS.Calo.PythiaMinBias_cfi")
0041 process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")
0042 process.load('FWCore.MessageService.MessageLogger_cfi')
0043 process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi")
0044 process.load(geomFile)
0045 process.load("Configuration.StandardSequences.MagneticField_cff")
0046 process.load("Configuration.EventContent.EventContent_cff")
0047 process.load('Configuration.StandardSequences.Generator_cff')
0048 process.load('Configuration.StandardSequences.SimIdeal_cff')
0049 
0050 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0051 from Configuration.AlCa.GlobalTag import GlobalTag
0052 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T21', '')
0053 
0054 if 'MessageLogger' in process.__dict__:
0055     process.MessageLogger.G4cerr=dict()
0056     process.MessageLogger.HGCSim=dict()
0057 
0058 process.source = cms.Source("EmptySource")
0059 
0060 process.maxEvents = cms.untracked.PSet(
0061     input = cms.untracked.int32(10)
0062 )
0063 
0064 process.Timing = cms.Service("Timing")
0065 
0066 process.SimpleMemoryCheck = cms.Service("SimpleMemoryCheck",
0067     oncePerEventMode = cms.untracked.bool(True),
0068     showMallocInfo = cms.untracked.bool(True),
0069     dump = cms.untracked.bool(True),
0070     ignoreTotal = cms.untracked.int32(1)
0071 )
0072 
0073 process.load("IOMC.RandomEngine.IOMC_cff")
0074 process.RandomNumberGeneratorService.generator.initialSeed = 456789
0075 process.RandomNumberGeneratorService.g4SimHits.initialSeed = 9876
0076 process.RandomNumberGeneratorService.VtxSmeared.initialSeed = 123456789
0077 process.rndmStore = cms.EDProducer("RandomEngineStateProducer")
0078 
0079 # Event output
0080 process.output = cms.OutputModule("PoolOutputModule",
0081     process.FEVTSIMEventContent,
0082     fileName = cms.untracked.string(outFile)
0083 )
0084 
0085 process.generation_step = cms.Path(process.pgen)
0086 process.simulation_step = cms.Path(process.psim)
0087 process.out_step = cms.EndPath(process.output)
0088 
0089 process.generator.pythiaHepMCVerbosity = False
0090 process.generator.pythiaPylistVerbosity = 0
0091 process.g4SimHits.Physics.type = 'SimG4Core/Physics/FTFP_BERT_EMM'
0092 
0093 
0094 # Schedule definition                                                          
0095 process.schedule = cms.Schedule(process.generation_step,
0096                                 process.simulation_step,
0097                                 process.out_step
0098                                 )
0099 
0100 # filter all path with the production filter sequence                          
0101 for path in process.paths:
0102         getattr(process,path)._seq = process.generator * getattr(process,path)._seq
0103