Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-06 06:06:57

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun Sim2026_cfg.py geometry=D98 type=DDD data=Muon
0004 #
0005 #   Options for geometry: D98, D99
0006 #               type: DDD, DD4hep
0007 #               data: Muon, MinBias
0008 #
0009 ###############################################################################
0010 import FWCore.ParameterSet.Config as cms
0011 import os, sys, imp, re, random
0012 import FWCore.ParameterSet.VarParsing as VarParsing
0013 
0014 ####################################################################
0015 ### SETUP OPTIONS
0016 options = VarParsing.VarParsing('standard')
0017 options.register('geometry',
0018                  "D98",
0019                   VarParsing.VarParsing.multiplicity.singleton,
0020                   VarParsing.VarParsing.varType.string,
0021                   "geometry of operations: D98, D99")
0022 options.register('type',
0023                  "DDD",
0024                   VarParsing.VarParsing.multiplicity.singleton,
0025                   VarParsing.VarParsing.varType.string,
0026                   "type of operations: DDD, DD4hep")
0027 options.register('data',
0028                  "Muon",
0029                  VarParsing.VarParsing.multiplicity.singleton,
0030                  VarParsing.VarParsing.varType.string,
0031                  "data of operations: Muon, MinBias")
0032 
0033 ### get and parse the command line arguments
0034 options.parseArguments()
0035 
0036 print(options)
0037 
0038 ####################################################################
0039 # Use the options
0040 
0041 from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
0042 if (options.type == "DD4hep"):
0043     from Configuration.ProcessModifiers.dd4hep_cff import dd4hep
0044     process = cms.Process('Sim2026',Phase2C17I13M9,dd4hep)
0045     geomFile = "Configuration.Geometry.Geometry" + options.type +"Extended2026" + options.geometry + "Reco_cff"
0046 else:
0047     process = cms.Process('Sim2026',Phase2C17I13M9)
0048     geomFile = "Configuration.Geometry.GeometryExtended2026" + options.geometry + "Reco_cff"
0049 
0050 globalTag = "auto:phase2_realistic_T25"
0051 inFile = "file:step0" + options.data + ".root"
0052 outFile = "file:step1" + options.type + options.geometry + options.data + ".root"
0053 tFile = "file:" + options.type + options.geometry + options.data + ".root"
0054 
0055 print("Geometry file: ", geomFile)
0056 print("Global Tag:    ", globalTag)
0057 print("Input file:    ", inFile)
0058 print("Output file:   ", outFile)
0059 print("Histogram file:", tFile)
0060 
0061 process.load(geomFile)
0062 process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")
0063 process.load("FWCore.MessageService.MessageLogger_cfi")
0064 process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi")
0065 process.load("Configuration.StandardSequences.MagneticField_cff")
0066 process.load("Configuration.EventContent.EventContent_cff")
0067 process.load("Configuration.StandardSequences.SimIdeal_cff")
0068 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0069 from Configuration.AlCa.GlobalTag import GlobalTag
0070 process.GlobalTag = GlobalTag(process.GlobalTag, globalTag, '')
0071 
0072 process.source = cms.Source("PoolSource",
0073     dropDescendantsOfDroppedBranches = cms.untracked.bool(False),
0074     fileNames = cms.untracked.vstring(inFile),
0075     secondaryFileNames = cms.untracked.vstring()
0076 )
0077 
0078 process.maxEvents = cms.untracked.PSet(
0079     input = cms.untracked.int32(-1),
0080     output = cms.optional.untracked.allowed(cms.int32,cms.PSet)
0081 )
0082 
0083 if 'MessageLogger' in process.__dict__:
0084     process.MessageLogger.G4cerr=dict()
0085     process.MessageLogger.HitStudy=dict()
0086     process.MessageLogger.HGCSim=dict()
0087 #   process.MessageLogger.SensitiveDetector=dict()
0088 
0089 process.Timing = cms.Service("Timing")
0090 
0091 process.load("IOMC.RandomEngine.IOMC_cff")
0092 process.RandomNumberGeneratorService.generator.initialSeed = 456789
0093 process.RandomNumberGeneratorService.g4SimHits.initialSeed = 9876
0094 process.RandomNumberGeneratorService.VtxSmeared.initialSeed = 123456789
0095 process.rndmStore = cms.EDProducer("RandomEngineStateProducer")
0096 
0097 # Event output
0098 process.output = cms.OutputModule("PoolOutputModule",
0099     process.FEVTSIMEventContent,
0100     fileName = cms.untracked.string(outFile)
0101 )
0102 
0103 process.load("SimG4CMS.Calo.hgcalHitCheck_cff")
0104 process.TFileService = cms.Service("TFileService",
0105                                    fileName = cms.string(tFile)
0106 )
0107 
0108 process.simulation_step = cms.Path(process.psim)
0109 process.out_step = cms.EndPath(process.output)
0110 process.analysis_step1 = cms.EndPath(process.hgcalHitCheckEE)
0111 process.analysis_step2 = cms.EndPath(process.hgcalHitCheckHEF)
0112 process.analysis_step3 = cms.EndPath(process.hgcalHitCheckHEB)
0113 
0114 process.g4SimHits.Physics.type = 'SimG4Core/Physics/FTFP_BERT_EMM'
0115 process.g4SimHits.HGCSD.Verbosity = 0
0116 
0117 # Schedule definition
0118 process.schedule = cms.Schedule(process.simulation_step,
0119                                 process.out_step,
0120                                 process.analysis_step1,
0121                                 process.analysis_step2,
0122                                 process.analysis_step3,
0123                                 )