Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:49:52

0001 import FWCore.ParameterSet.Config as cms
0002 import os, sys, imp, re, random
0003 import FWCore.ParameterSet.VarParsing as VarParsing
0004 
0005 from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
0006 process = cms.Process('SingleMuonSim',Phase2C17I13M9)
0007 
0008 geomFile = "Geometry.HGCalCommonData.testHGCalV17ShiftReco_cff"
0009 globalTag = "auto:phase2_realistic_T21"
0010 outFile = "file:step1V17ShiftMu.root"
0011 
0012 print("Geometry file: ", geomFile)
0013 print("Global Tag:    ", globalTag)
0014 print("Output file:   ", outFile)
0015 
0016 # import of standard configurations
0017 process.load(geomFile)
0018 process.load('Configuration.StandardSequences.Services_cff')
0019 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
0020 process.load('FWCore.MessageService.MessageLogger_cfi')
0021 process.load('Configuration.EventContent.EventContent_cff')
0022 process.load('SimGeneral.MixingModule.mixNoPU_cfi')
0023 process.load('Configuration.StandardSequences.MagneticField_cff')
0024 process.load('Configuration.StandardSequences.Generator_cff')
0025 process.load('IOMC.EventVertexGenerators.VtxSmearedRealistic50ns13TeVCollision_cfi')
0026 process.load('GeneratorInterface.Core.genFilterSummary_cff')
0027 process.load('Configuration.StandardSequences.SimIdeal_cff')
0028 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0029 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0030 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0031 process.load('SimG4CMS.Calo.hgcalHitPartial_cff')
0032 process.load("IOMC.RandomEngine.IOMC_cff")
0033 
0034 rndm = random.randint(0,200000)
0035 process.RandomNumberGeneratorService.generator.initialSeed = rndm
0036 print("Processing with random number seed: ", rndm)
0037 
0038 process.maxEvents = cms.untracked.PSet(
0039     input = cms.untracked.int32(5000)
0040 )
0041 
0042 process.MessageLogger.cerr.FwkReport.reportEvery = 1
0043 if hasattr(process,'MessageLogger'):
0044     process.MessageLogger.HGCalError=dict()
0045 #   process.MessageLogger.HGCSim=dict()
0046 #   process.MessageLogger.HGCalSim=dict()
0047 
0048 # Input source
0049 process.source = cms.Source("EmptySource")
0050 
0051 process.options = cms.untracked.PSet(
0052     wantSummary = cms.untracked.bool(True),
0053     numberOfConcurrentRuns = cms.untracked.uint32(1),
0054     numberOfStreams = cms.untracked.uint32(0),
0055     numberOfThreads = cms.untracked.uint32(1),
0056     printDependencies = cms.untracked.bool(False),
0057     sizeOfStackForThreadsInKB = cms.optional.untracked.uint32,
0058 )
0059 
0060 # Production Info
0061 process.configurationMetadata = cms.untracked.PSet(
0062     version = cms.untracked.string(''),
0063     annotation = cms.untracked.string(''),
0064     name = cms.untracked.string('Applications')
0065 )
0066 
0067 # Output definition
0068 process.output = cms.OutputModule("PoolOutputModule",
0069     SelectEvents = cms.untracked.PSet(
0070         SelectEvents = cms.vstring('generation_step')
0071     ),
0072     dataset = cms.untracked.PSet(
0073         filterName = cms.untracked.string(''),
0074         dataTier = cms.untracked.string('GEN-SIM-DIGI-RAW-RECO')
0075     ),
0076     fileName = cms.untracked.string(outFile),
0077     outputCommands = process.FEVTDEBUGEventContent.outputCommands,
0078     eventAutoFlushCompressedSize = cms.untracked.int32(5242880),
0079     splitLevel = cms.untracked.int32(0)
0080 )
0081 
0082 # Additional output definition
0083 
0084 # Other statements
0085 process.genstepfilter.triggerConditions=cms.vstring("generation_step")
0086 from Configuration.AlCa.GlobalTag import GlobalTag
0087 process.GlobalTag = GlobalTag(process.GlobalTag, globalTag, '')
0088 
0089 process.generator = cms.EDFilter("Pythia8PtGun",
0090     PGunParameters = cms.PSet(
0091         MaxPt = cms.double(100.01),
0092         MinPt = cms.double(99.99),
0093         ParticleID = cms.vint32(-13),
0094         AddAntiParticle = cms.bool(True),
0095         MaxEta = cms.double(3.1),
0096         MaxPhi = cms.double(3.14159265359),
0097         MinEta = cms.double(2.8),
0098         MinPhi = cms.double(-3.14159265359) ## in radians
0099         ),
0100         Verbosity = cms.untracked.int32(0), ## set to 1 (or greater)  for printouts
0101         psethack = cms.string('single mu pt 100'),
0102         firstRun = cms.untracked.uint32(1),
0103         PythiaParameters = cms.PSet(parameterSets = cms.vstring())
0104 )
0105 
0106 
0107 #Modified to produce hgceedigis
0108 process.ProductionFilterSequence = cms.Sequence(process.generator)
0109 
0110 process.g4SimHits.HGCSD.CheckID = True
0111 process.g4SimHits.HGCScintSD.CheckID = True
0112 
0113 # Path and EndPath definitions
0114 process.generation_step = cms.Path(process.pgen)
0115 process.simulation_step = cms.Path(process.psim)
0116 process.genfiltersummary_step = cms.EndPath(process.genFilterSummary)
0117 process.endjob_step = cms.EndPath(process.endOfProcess)
0118 process.analysis_step = cms.Path(process.hgcalHitPartialEE+process.hgcalHitPartialHE+process.hgcalHitPartialHEB)
0119 process.out_step = cms.EndPath(process.output)
0120 
0121 # Schedule definition
0122 process.schedule = cms.Schedule(process.generation_step,
0123                                 process.genfiltersummary_step,
0124                 process.simulation_step,
0125                                 process.endjob_step,
0126                                 process.analysis_step,
0127                 process.out_step
0128                 )
0129 
0130 from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask
0131 associatePatAlgosToolsTask(process)
0132 # filter all path with the production filter sequence
0133 for path in process.paths:
0134         getattr(process,path).insert(0, process.ProductionFilterSequence)
0135 
0136 
0137 # Customisation from command line
0138 
0139 # Add early deletion of temporary data products to reduce peak memory need
0140 from Configuration.StandardSequences.earlyDeleteSettings_cff import customiseEarlyDelete
0141 process = customiseEarlyDelete(process)
0142 # End adding early deletion