Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-05-23 02:05:03

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun testHGCalWaferID_cfg.py type=V17
0004 #
0005 #   Options for type V16, V17, V17Shift, V18, V19
0006 #
0007 ###############################################################################
0008 import FWCore.ParameterSet.Config as cms
0009 import os, sys, importlib, re
0010 import FWCore.ParameterSet.VarParsing as VarParsing
0011 
0012 ####################################################################
0013 ### SETUP OPTIONS
0014 options = VarParsing.VarParsing('standard')
0015 options.register('type',
0016                  "V17",
0017                   VarParsing.VarParsing.multiplicity.singleton,
0018                   VarParsing.VarParsing.varType.string,
0019                   "type of operations: V16, V17, V17Shift, V18, V19")
0020 
0021 ### get and parse the command line arguments
0022 options.parseArguments()
0023 print(options)
0024 
0025 if (options.type == "V18"):
0026         from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9
0027         process = cms.Process("HGCalWaferIDTest",Phase2C22I13M9)
0028 elif (options.type == "V19"):
0029         from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9
0030         process = cms.Process("HGCalWaferIDTest",Phase2C22I13M9)
0031 else:
0032         from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
0033         process = cms.Process("HGCalWaferIDTest",Phase2C17I13M9)
0034 
0035 ####################################################################
0036 # Use the options
0037 if (options.type == "V18"):
0038     geomFile = "Configuration.Geometry.GeometryExtendedRun4D104_cff"
0039 elif (options.type == "V17Shift"):
0040     geomFile = "Geometry.HGCalCommonData.testHGCalV17ShiftReco_cff"
0041 elif (options.type == "V16"):
0042     geomFile = "Configuration.Geometry.GeometryExtendedRun4D98_cff"
0043 elif (options.type == "V19"):
0044     geomFile = "Configuration.Geometry.GeometryExtendedRun4D120_cff"
0045 else:
0046     geomFile = "Configuration.Geometry.GeometryExtendedRun4D110_cff"
0047 
0048 print("Geometry file: ", geomFile)
0049 
0050 process.load("SimGeneral.HepPDTESSource.pdt_cfi")
0051 process.load(geomFile)
0052 process.load('FWCore.MessageService.MessageLogger_cfi')
0053 
0054 if hasattr(process,'MessageLogger'):
0055     process.MessageLogger.HGCalGeomW=dict()
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.load("Geometry.HGCalCommonData.hgcalWaferIDTester_cff")
0083 
0084 if (options.type == "V17Shift"):
0085     process.p1 = cms.Path(process.generator*process.hgcalWaferIDShiftTesterEE*process.hgcalWaferIDShiftTesterHEF)
0086 else: 
0087     process.p1 = cms.Path(process.generator*process.hgcalWaferIDTesterEE*process.hgcalWaferIDTesterHEF)