Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun testHGCalGeomCheck_cfg.py geometry=V17
0004 #
0005 #   Options for geometry V15, V16, V17
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                  "V17",
0017                   VarParsing.VarParsing.multiplicity.singleton,
0018                   VarParsing.VarParsing.varType.string,
0019                   "geometry of operations: V15, V16, V17")
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 == "V15"):
0030     from Configuration.Eras.Era_Phase2C11M9_cff import Phase2C11M9
0031     process = cms.Process('HGCGeomCheck',Phase2C11M9)
0032     process.load("Geometry.HGCalCommonData.testHGCalV15XML_cfi")
0033     fileName = 'HGCGeomCheckV15.root'
0034 elif (options.geometry == "V16"):
0035     from Configuration.Eras.Era_Phase2C11_cff import Phase2C11
0036     process = cms.Process('HGCGeomCheck',Phase2C11)
0037     process.load("Geometry.HGCalCommonData.testHGCalV16XML_cfi")
0038     fileName = 'HGCGeomCheckV16.root'
0039 else:
0040     from Configuration.Eras.Era_Phase2C11_cff import Phase2C11
0041     process = cms.Process('HGCGeomCheck',Phase2C11)
0042     process.load("Geometry.HGCalCommonData.testHGCalV17XML_cfi")
0043     fileName = 'HGCGeomCheckV17.root'
0044 
0045 print("Output file: ", fileName)
0046 
0047 process.load("SimGeneral.HepPDTESSource.pdt_cfi")
0048 process.load("Geometry.HGCalCommonData.hgcalV15ParametersInitialization_cfi")
0049 process.load("Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi")
0050 process.load("Geometry.CaloEventSetup.HGCalV9Topology_cfi")
0051 process.load("Geometry.HGCalGeometry.HGCalGeometryESProducer_cfi")
0052 process.load('Geometry.HGCalGeometry.hgcalGeometryCheck_cfi')
0053 process.load('FWCore.MessageService.MessageLogger_cfi')
0054 
0055 if hasattr(process,'MessageLogger'):
0056     process.MessageLogger.HGCalGeom=dict()
0057 
0058 process.load("IOMC.RandomEngine.IOMC_cff")
0059 process.RandomNumberGeneratorService.generator.initialSeed = 456789
0060 
0061 process.source = cms.Source("EmptySource")
0062 
0063 process.generator = cms.EDProducer("FlatRandomEGunProducer",
0064     PGunParameters = cms.PSet(
0065         PartID = cms.vint32(14),
0066         MinEta = cms.double(-3.5),
0067         MaxEta = cms.double(3.5),
0068         MinPhi = cms.double(-3.14159265359),
0069         MaxPhi = cms.double(3.14159265359),
0070         MinE   = cms.double(9.99),
0071         MaxE   = cms.double(10.01)
0072     ),
0073     AddAntiParticle = cms.bool(False),
0074     Verbosity       = cms.untracked.int32(0),
0075     firstRun        = cms.untracked.uint32(1)
0076 )
0077 
0078 process.maxEvents = cms.untracked.PSet(
0079     input = cms.untracked.int32(1)
0080 )
0081 
0082 process.TFileService = cms.Service("TFileService",
0083                                    fileName = cms.string(fileName),
0084                                    closeFileFast = cms.untracked.bool(True)
0085                                    )
0086 
0087 #process.hgcalGeometryCheck.verbosity = True
0088 
0089 process.p1 = cms.Path(process.generator*process.hgcalGeometryCheck)