Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:32:38

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun testHGCalSimHitSTudy_cfg.py geometry=D99
0004 #
0005 #   Options for geometry D98, D99, D108, D94, D103, D104, D106, D109
0006 #
0007 ###############################################################################
0008 import FWCore.ParameterSet.Config as cms
0009 import os, sys, importlib, re
0010 import FWCore.ParameterSet.VarParsing as VarParsing
0011 
0012 ####################################################################
0013 ### SETUP OPTIONS
0014 options = VarParsing.VarParsing('standard')
0015 options.register('geometry',
0016                  "D99",
0017                   VarParsing.VarParsing.multiplicity.singleton,
0018                   VarParsing.VarParsing.varType.string,
0019                   "geometry of operations: D98, D99, D108, D94, D103, D104, D106, D109")
0020 
0021 ### get and parse the command line arguments
0022 options.parseArguments()
0023 
0024 print(options)
0025 
0026 ####################################################################
0027 # Use the options
0028 if (options.geometry == "D94"):
0029     from Configuration.Eras.Era_Phase2C20I13M9_cff import Phase2C20I13M9
0030     process = cms.Process('Client',Phase2C20I13M9)
0031 elif (options.geometry == "D104"):
0032     from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9
0033     process = cms.Process('Client',PhaseC22I13M9)
0034 elif (options.geometry == "D106"):
0035     from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9
0036     process = cms.Process('Client',PhaseC22I13M9)
0037 elif (options.geometry == "D109"):
0038     from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9
0039     process = cms.Process('Client',PhaseC22I13M9)
0040 else:
0041     from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
0042     process = cms.Process('Client',Phase2C17I13M9)
0043 
0044 geomFile = "Configuration.Geometry.GeometryExtended2026" + options.geometry + "Reco_cff"
0045 fileName = "hgcalSimHit" + options.geometry + ".root"
0046 
0047 print("Geometry file:  ", geomFile)
0048 print("Output file:    ", fileName)
0049 
0050 # import of standard configurations
0051 process.load(geomFile)
0052 process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")
0053 process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi")
0054 process.load("Configuration.StandardSequences.MagneticField_cff")
0055 process.load("Configuration.EventContent.EventContent_cff")
0056 process.load('Configuration.StandardSequences.Generator_cff')
0057 process.load('Configuration.StandardSequences.SimIdeal_cff')
0058 process.load('FWCore.MessageService.MessageLogger_cfi')
0059 process.load('Validation.HGCalValidation.hgcSimHitStudy_cfi')
0060 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0061 from Configuration.AlCa.GlobalTag import GlobalTag
0062 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T21', '')
0063 
0064 process.load("IOMC.RandomEngine.IOMC_cff")
0065 process.RandomNumberGeneratorService.generator.initialSeed = 456789
0066 process.RandomNumberGeneratorService.g4SimHits.initialSeed = 9876
0067 process.RandomNumberGeneratorService.VtxSmeared.initialSeed = 123456789
0068 
0069 process.Timing = cms.Service("Timing")
0070 
0071 process.maxEvents = cms.untracked.PSet(
0072     input = cms.untracked.int32(10000)
0073 )
0074 
0075 process.source = cms.Source("EmptySource",
0076     firstRun        = cms.untracked.uint32(1),
0077     firstEvent      = cms.untracked.uint32(1)
0078 )
0079 
0080 process.generator = cms.EDProducer("FlatRandomEGunProducer",
0081     PGunParameters = cms.PSet(
0082         PartID = cms.vint32(13),
0083         MinEta = cms.double(1.25),
0084         MaxEta = cms.double(3.00),
0085         MinPhi = cms.double(-3.1415926),
0086         MaxPhi = cms.double(3.1415926),
0087         MinE   = cms.double(100.00),
0088         MaxE   = cms.double(100.00)
0089     ),
0090     Verbosity       = cms.untracked.int32(0),
0091     AddAntiParticle = cms.bool(True)
0092 )
0093 
0094 process.output = cms.OutputModule("PoolOutputModule",
0095     process.FEVTSIMEventContent,
0096     fileName = cms.untracked.string('simevent.root')
0097 )
0098 
0099 process.TFileService = cms.Service("TFileService",
0100                                    fileName = cms.string(fileName),
0101                                    closeFileFast = cms.untracked.bool(True)
0102                                    )
0103 
0104 process.generation_step = cms.Path(process.pgen)
0105 process.simulation_step = cms.Path(process.psim)
0106 process.analysis_step   = cms.Path(process.hgcalSimHitStudy)
0107 process.out_step = cms.EndPath(process.output)
0108 
0109 process.g4SimHits.Physics.type = 'SimG4Core/Physics/FTFP_BERT_EMM'
0110 process.g4SimHits.Physics.DefaultCutValue   = 0.1
0111 process.hgcalSimHitStudy.verbosity = 0
0112 process.hgcalSimHitStudy.nBinZ = 3000
0113 
0114 # Schedule definition
0115 process.schedule = cms.Schedule(process.generation_step,
0116                                 process.simulation_step,
0117                                 process.analysis_step,
0118                                 )
0119 
0120 # filter all path with the production filter sequence
0121 for path in process.paths:
0122         getattr(process,path)._seq = process.generator * getattr(process,path)._seq