Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-06-20 00:21:58

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun testHGCalSimHitSTudy_cfg.py geometry=D77
0004 #
0005 #   Options for geometry D49, D68, D77, D83, D84, D88, D92
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('geometry',
0016                  "D88",
0017                   VarParsing.VarParsing.multiplicity.singleton,
0018                   VarParsing.VarParsing.varType.string,
0019                   "geometry of operations: D49, D68, D84, D77, D83, D88, D92")
0020 
0021 ### get and parse the command line arguments
0022 options.parseArguments()
0023 
0024 print(options)
0025 
0026 ####################################################################
0027 # Use the options
0028 
0029 if (options.geometry == "D49"):
0030     from Configuration.Eras.Era_Phase2C9_cff import Phase2C9
0031     process = cms.Process('HGCSimHitStudy',Phase2C9)
0032     process.load('Configuration.Geometry.GeometryExtended2026D49_cff')
0033     process.load('Configuration.Geometry.GeometryExtended2026D49Reco_cff')
0034     fileName = 'HGCSimHitV11.root'
0035 elif (options.geometry == "D68"):
0036     from Configuration.Eras.Era_Phase2C12_cff import Phase2C12
0037     process = cms.Process('HGCSimHitStudy',Phase2C12)
0038     process.load('Configuration.Geometry.GeometryExtended2026D68_cff')
0039     process.load('Configuration.Geometry.GeometryExtended2026D68Reco_cff')
0040     fileName = 'HGCSimHitV12.root'
0041 elif (options.geometry == "D83"):
0042     from Configuration.Eras.Era_Phase2C11M9_cff import Phase2C11M9
0043     process = cms.Process('HGCSimHitStudy',Phase2C11M9)
0044     process.load('Configuration.Geometry.GeometryExtended2026D83_cff')
0045     process.load('Configuration.Geometry.GeometryExtended2026D83Reco_cff')
0046     fileName = 'HGCSimHitV15.root'
0047 elif (options.geometry == "D84"):
0048     from Configuration.Eras.Era_Phase2C11_cff import Phase2C11
0049     process = cms.Process('HGCSimHitStudy',Phase2C11)
0050     process.load('Configuration.Geometry.GeometryExtended2026D84_cff')
0051     process.load('Configuration.Geometry.GeometryExtended2026D84Reco_cff')
0052     fileName = 'HGCSimHitV13.root'
0053 elif (options.geometry == "D88"):
0054     from Configuration.Eras.Era_Phase2C11_cff import Phase2C11
0055     process = cms.Process('HGCSimHitStudy',Phase2C11)
0056     process.load('Configuration.Geometry.GeometryExtended2026D88_cff')
0057     process.load('Configuration.Geometry.GeometryExtended2026D88Reco_cff')
0058     fileName = 'HGCSimHitV16.root'
0059 elif (options.geometry == "D92"):
0060     from Configuration.Eras.Era_Phase2C11_cff import Phase2C11
0061     process = cms.Process('HGCSimHitStudy',Phase2C11)
0062     process.load('Configuration.Geometry.GeometryExtended2026D92_cff')
0063     process.load('Configuration.Geometry.GeometryExtended2026D92Reco_cff')
0064     fileName = 'HGCSimHitV17.root'
0065 else:
0066     from Configuration.Eras.Era_Phase2C11M9_cff import Phase2C11M9
0067     process = cms.Process('HGCSimHitStudy',Phase2C11M9)
0068     process.load('Configuration.Geometry.GeometryExtended2026D77_cff')
0069     process.load('Configuration.Geometry.GeometryExtended2026D77Reco_cff')
0070     fileName = 'HGCSimHitV14.root'
0071 
0072 print("Output file: ", fileName)
0073 
0074 process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")
0075 process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi")
0076 process.load("Configuration.StandardSequences.MagneticField_cff")
0077 process.load("Configuration.EventContent.EventContent_cff")
0078 process.load('Configuration.StandardSequences.Generator_cff')
0079 process.load('Configuration.StandardSequences.SimIdeal_cff')
0080 process.load('FWCore.MessageService.MessageLogger_cfi')
0081 process.load('Validation.HGCalValidation.hgcSimHitStudy_cfi')
0082 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0083 from Configuration.AlCa.autoCond import autoCond
0084 process.GlobalTag.globaltag = autoCond['phase2_realistic']
0085 
0086 process.load("IOMC.RandomEngine.IOMC_cff")
0087 process.RandomNumberGeneratorService.generator.initialSeed = 456789
0088 process.RandomNumberGeneratorService.g4SimHits.initialSeed = 9876
0089 process.RandomNumberGeneratorService.VtxSmeared.initialSeed = 123456789
0090 
0091 process.Timing = cms.Service("Timing")
0092 
0093 process.maxEvents = cms.untracked.PSet(
0094     input = cms.untracked.int32(10000)
0095 )
0096 
0097 process.source = cms.Source("EmptySource",
0098     firstRun        = cms.untracked.uint32(1),
0099     firstEvent      = cms.untracked.uint32(1)
0100 )
0101 
0102 process.generator = cms.EDProducer("FlatRandomEGunProducer",
0103     PGunParameters = cms.PSet(
0104         PartID = cms.vint32(13),
0105         MinEta = cms.double(1.25),
0106         MaxEta = cms.double(3.00),
0107         MinPhi = cms.double(-3.1415926),
0108         MaxPhi = cms.double(3.1415926),
0109         MinE   = cms.double(100.00),
0110         MaxE   = cms.double(100.00)
0111     ),
0112     Verbosity       = cms.untracked.int32(0),
0113     AddAntiParticle = cms.bool(True)
0114 )
0115 
0116 process.output = cms.OutputModule("PoolOutputModule",
0117     process.FEVTSIMEventContent,
0118     fileName = cms.untracked.string('simevent.root')
0119 )
0120 
0121 process.TFileService = cms.Service("TFileService",
0122                                    fileName = cms.string(fileName),
0123                                    closeFileFast = cms.untracked.bool(True)
0124                                    )
0125 
0126 process.generation_step = cms.Path(process.pgen)
0127 process.simulation_step = cms.Path(process.psim)
0128 process.analysis_step   = cms.Path(process.hgcalSimHitStudy)
0129 process.out_step = cms.EndPath(process.output)
0130 
0131 process.g4SimHits.Physics.type = 'SimG4Core/Physics/FTFP_BERT_EMM'
0132 process.g4SimHits.Physics.DefaultCutValue   = 0.1
0133 process.hgcalSimHitStudy.verbosity = 0
0134 process.hgcalSimHitStudy.nBinZ = 3000
0135 
0136 # Schedule definition
0137 process.schedule = cms.Schedule(process.generation_step,
0138                                 process.simulation_step,
0139                                 process.analysis_step,
0140                                 )
0141 
0142 # filter all path with the production filter sequence
0143 for path in process.paths:
0144         getattr(process,path)._seq = process.generator * getattr(process,path)._seq