Back to home page

Project CMSSW displayed by LXR

 
 

    


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

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