Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-14 04:15:58

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