Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun testHGCalGeometryCheck_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('HGCGeomCheck',Phase2C9)
0032     process.load('Configuration.Geometry.GeometryExtended2026D49Reco_cff')
0033     fileName = 'HGCGeomStudyV11.root'
0034 elif (options.geometry == "D68"):
0035     from Configuration.Eras.Era_Phase2C12_cff import Phase2C12
0036     process = cms.Process('HGCGeomCheck',Phase2C12)
0037     process.load('Configuration.Geometry.GeometryExtended2026D68Reco_cff')
0038     fileName = 'HGCGeomStudyV12.root'
0039 elif (options.geometry == "D83"):
0040     from Configuration.Eras.Era_Phase2C11M9_cff import Phase2C11M9
0041     process = cms.Process('HGCGeomCheck',Phase2C11M9)
0042     process.load('Configuration.Geometry.GeometryExtended2026D83Reco_cff')
0043     fileName = 'HGCGeomStudyV15.root'
0044 elif (options.geometry == "D84"):
0045     from Configuration.Eras.Era_Phase2C11_cff import Phase2C11
0046     process = cms.Process('HGCGeomCheck',Phase2C11)
0047     process.load('Configuration.Geometry.GeometryExtended2026D84Reco_cff')
0048     fileName = 'HGCGeomStudyV13.root'
0049 elif (options.geometry == "D88"):
0050     from Configuration.Eras.Era_Phase2C11_cff import Phase2C11
0051     process = cms.Process('HGCGeomCheck',Phase2C11)
0052     process.load('Configuration.Geometry.GeometryExtended2026D88Reco_cff')
0053     fileName = 'HGCGeomStudyV16.root'
0054 elif (options.geometry == "D92"):
0055     from Configuration.Eras.Era_Phase2C11_cff import Phase2C11
0056     process = cms.Process('HGCGeomCheck',Phase2C11)
0057     process.load('Configuration.Geometry.GeometryExtended2026D92Reco_cff')
0058     fileName = 'HGCGeomStudyV17.root'
0059 else:
0060     from Configuration.Eras.Era_Phase2C11M9_cff import Phase2C11M9
0061     process = cms.Process('HGCGeomCheck',Phase2C11M9)
0062     process.load('Configuration.Geometry.GeometryExtended2026D77Reco_cff')
0063     fileName = 'HGCGeomStudyV14.root'
0064 
0065 print("Output file: ", fileName)
0066 
0067 process.load("SimGeneral.HepPDTESSource.pdt_cfi")
0068 process.load('Geometry.HGCalGeometry.hgcalGeometryCheck_cfi')
0069 process.load('FWCore.MessageService.MessageLogger_cfi')
0070 
0071 if hasattr(process,'MessageLogger'):
0072     process.MessageLogger.HGCalGeom=dict()
0073 
0074 process.load("IOMC.RandomEngine.IOMC_cff")
0075 process.RandomNumberGeneratorService.generator.initialSeed = 456789
0076 
0077 process.source = cms.Source("EmptySource")
0078 
0079 process.generator = cms.EDProducer("FlatRandomEGunProducer",
0080     PGunParameters = cms.PSet(
0081         PartID = cms.vint32(14),
0082         MinEta = cms.double(-3.5),
0083         MaxEta = cms.double(3.5),
0084         MinPhi = cms.double(-3.14159265359),
0085         MaxPhi = cms.double(3.14159265359),
0086         MinE   = cms.double(9.99),
0087         MaxE   = cms.double(10.01)
0088     ),
0089     AddAntiParticle = cms.bool(False),
0090     Verbosity       = cms.untracked.int32(0),
0091     firstRun        = cms.untracked.uint32(1)
0092 )
0093 
0094 process.maxEvents = cms.untracked.PSet(
0095     input = cms.untracked.int32(1)
0096 )
0097 
0098 process.TFileService = cms.Service("TFileService",
0099                                    fileName = cms.string(fileName),
0100                                    closeFileFast = cms.untracked.bool(True)
0101                                    )
0102 
0103 #process.hgcalGeometryCheck.verbosity = True
0104 
0105 process.p1 = cms.Path(process.generator*process.hgcalGeometryCheck)