File indexing completed on 2024-04-06 12:15:06
0001
0002
0003
0004
0005
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
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, V17n, V17Shift, V18")
0020
0021
0022 options.parseArguments()
0023 print(options)
0024
0025 from Configuration.Eras.Era_Phase2C11_dd4hep_cff import Phase2C11_dd4hep
0026 process = cms.Process("HGCalParametersTest",Phase2C11_dd4hep)
0027
0028 geomFile = "Geometry/HGCalCommonData/data/dd4hep/testHGCal" + options.type + ".xml"
0029
0030 print("Geometry file: ", geomFile)
0031
0032 process.load("SimGeneral.HepPDTESSource.pdt_cfi")
0033 process.load("Geometry.HGCalCommonData.hgcalParametersInitialization_cfi")
0034 process.load('FWCore.MessageService.MessageLogger_cfi')
0035
0036 if hasattr(process,'MessageLogger'):
0037 process.MessageLogger.HGCalGeom=dict()
0038
0039 process.DDDetectorESProducer = cms.ESSource("DDDetectorESProducer",
0040 confGeomXMLFiles = cms.FileInPath(geomFile),
0041 appendToDataLabel = cms.string(''))
0042
0043 process.DDCompactViewESProducer = cms.ESProducer("DDCompactViewESProducer",
0044 appendToDataLabel = cms.string(''))
0045
0046 process.load("IOMC.RandomEngine.IOMC_cff")
0047 process.RandomNumberGeneratorService.generator.initialSeed = 456789
0048
0049 process.source = cms.Source("EmptySource")
0050
0051 process.maxEvents = cms.untracked.PSet(
0052 input = cms.untracked.int32(1)
0053 )
0054
0055 process.generator = cms.EDProducer("FlatRandomEGunProducer",
0056 PGunParameters = cms.PSet(
0057 PartID = cms.vint32(14),
0058 MinEta = cms.double(-3.5),
0059 MaxEta = cms.double(3.5),
0060 MinPhi = cms.double(-3.14159265359),
0061 MaxPhi = cms.double(3.14159265359),
0062 MinE = cms.double(9.99),
0063 MaxE = cms.double(10.01)
0064 ),
0065 AddAntiParticle = cms.bool(False),
0066 Verbosity = cms.untracked.int32(0),
0067 firstRun = cms.untracked.uint32(1)
0068 )
0069
0070 process.hgcalEEParametersInitialize.fromDD4hep = cms.bool(True)
0071 process.hgcalHESiParametersInitialize.fromDD4hep = cms.bool(True)
0072 process.hgcalHEScParametersInitialize.fromDD4hep = cms.bool(True)
0073
0074 process.load("Geometry.HGCalCommonData.hgcParameterTesterEE_cfi")
0075
0076 process.hgcParameterTesterHESil = process.hgcParameterTesterEE.clone(
0077 Name = cms.string("HGCalHESiliconSensitive")
0078 )
0079
0080 process.hgcParameterTesterHESci = process.hgcParameterTesterEE.clone(
0081 Name = cms.string("HGCalHEScintillatorSensitive"),
0082 Mode = cms.int32(2)
0083 )
0084
0085 process.p1 = cms.Path(process.generator*process.hgcParameterTesterEE*process.hgcParameterTesterHESil*process.hgcParameterTesterHESci)