Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-05-28 01:33:55

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun testHGCalParametersVXDD4hep_cfg.py type=V17
0004 #
0005 #   Options for type 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('type',
0016                  "V17",
0017                   VarParsing.VarParsing.multiplicity.singleton,
0018                   VarParsing.VarParsing.varType.string,
0019                   "type of operations: V15, V16, V17")
0020 
0021 ### get and parse the command line arguments
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 process.load("SimGeneral.HepPDTESSource.pdt_cfi")
0029 process.load("Geometry.HGCalCommonData.hgcalV15ParametersInitialization_cfi")
0030 process.load('FWCore.MessageService.MessageLogger_cfi')
0031 
0032 if hasattr(process,'MessageLogger'):
0033     process.MessageLogger.HGCalGeom=dict()
0034 
0035 ####################################################################
0036 # Use the options
0037 if (options.type == "V15"):
0038     process.DDDetectorESProducer = cms.ESSource("DDDetectorESProducer",
0039                                                  confGeomXMLFiles = cms.FileInPath('Geometry/HGCalCommonData/data/dd4hep/testHGCalV15.xml'),
0040                                                  appendToDataLabel = cms.string('')
0041                                                 )
0042 elif (options.type == "V16"):
0043     process.DDDetectorESProducer = cms.ESSource("DDDetectorESProducer",
0044                                                  confGeomXMLFiles = cms.FileInPath('Geometry/HGCalCommonData/data/dd4hep/testHGCalV16.xml'),
0045                                                  appendToDataLabel = cms.string('')
0046                                                  )
0047 else:
0048     process.DDDetectorESProducer = cms.ESSource("DDDetectorESProducer",
0049                                                  confGeomXMLFiles = cms.FileInPath('Geometry/HGCalCommonData/data/dd4hep/testHGCalV17.xml'),
0050                                                  appendToDataLabel = cms.string('')
0051                                                  )
0052 
0053 process.DDCompactViewESProducer = cms.ESProducer("DDCompactViewESProducer",
0054                                                  appendToDataLabel = cms.string('')
0055 )
0056 
0057 process.load("IOMC.RandomEngine.IOMC_cff")
0058 process.RandomNumberGeneratorService.generator.initialSeed = 456789
0059 
0060 process.source = cms.Source("EmptySource")
0061 
0062 process.maxEvents = cms.untracked.PSet(
0063     input = cms.untracked.int32(1)
0064 )
0065 
0066 process.generator = cms.EDProducer("FlatRandomEGunProducer",
0067     PGunParameters = cms.PSet(
0068         PartID = cms.vint32(14),
0069         MinEta = cms.double(-3.5),
0070         MaxEta = cms.double(3.5),
0071         MinPhi = cms.double(-3.14159265359),
0072         MaxPhi = cms.double(3.14159265359),
0073         MinE   = cms.double(9.99),
0074         MaxE   = cms.double(10.01)
0075     ),
0076     AddAntiParticle = cms.bool(False),
0077     Verbosity       = cms.untracked.int32(0),
0078     firstRun        = cms.untracked.uint32(1)
0079 )
0080 
0081 process.hgcalEEParametersInitialize.fromDD4hep = cms.bool(True)
0082 process.hgcalHESiParametersInitialize.fromDD4hep = cms.bool(True)
0083 process.hgcalHEScParametersInitialize.fromDD4hep = cms.bool(True)
0084 
0085 process.load("Geometry.HGCalCommonData.hgcParameterTesterEE_cfi")
0086 
0087 process.hgcParameterTesterHESil = process.hgcParameterTesterEE.clone(
0088     Name = cms.string("HGCalHESiliconSensitive")
0089 )
0090 
0091 process.hgcParameterTesterHESci = process.hgcParameterTesterEE.clone(
0092     Name = cms.string("HGCalHEScintillatorSensitive"),
0093     Mode = cms.int32(2)
0094 )
0095  
0096 process.p1 = cms.Path(process.generator*process.hgcParameterTesterEE*process.hgcParameterTesterHESil*process.hgcParameterTesterHESci)