Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-14 04:15:36

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun testHGCalPartialIDTester2_cfg.py geometry=D104 type=DDD
0004 #
0005 #   Options for geometry: D104, D106, D109
0006 #               type: DDD, DD4hep
0007 #
0008 ###############################################################################
0009 import FWCore.ParameterSet.Config as cms
0010 import os, sys, importlib, re, random
0011 import FWCore.ParameterSet.VarParsing as VarParsing
0012 
0013 ####################################################################
0014 ### SETUP OPTIONS
0015 options = VarParsing.VarParsing('standard')
0016 options.register('geometry',
0017                  "D104",
0018                   VarParsing.VarParsing.multiplicity.singleton,
0019                   VarParsing.VarParsing.varType.string,
0020                   "geometry of operations: D104, D106, D109")
0021 options.register('type',
0022                  "DDD",
0023                   VarParsing.VarParsing.multiplicity.singleton,
0024                   VarParsing.VarParsing.varType.string,
0025                   "type of operations: DDD, DD4hep")
0026 
0027 ### get and parse the command line arguments
0028 options.parseArguments()
0029 
0030 print(options)
0031 
0032 ####################################################################
0033 # Use the options
0034 
0035 from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9
0036 if (options.type == "DD4hep"):
0037     from Configuration.ProcessModifiers.dd4hep_cff import dd4hep
0038     process = cms.Process('SimRun4',Phase2C22I13M9,dd4hep)
0039     geomFile = "Configuration.Geometry.Geometry" + options.type +"ExtendedRun4" + options.geometry + "Reco_cff"
0040 else:
0041     process = cms.Process('SimRun4',Phase2C22I13M9)
0042     geomFile = "Configuration.Geometry.GeometryExtendedRun4" + options.geometry + "Reco_cff"
0043 
0044 globalTag = "auto:phase2_realistic_T33"
0045 inFile = "partial" + options.geometry + ".txt"
0046 
0047 print("Geometry file: ", geomFile)
0048 print("Global Tag:    ", globalTag)
0049 print("Input file:    ", inFile)
0050 
0051 process.load(geomFile)
0052 process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")
0053 process.load("FWCore.MessageService.MessageLogger_cfi")
0054 process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi")
0055 process.load("Configuration.StandardSequences.MagneticField_cff")
0056 process.load("Configuration.EventContent.EventContent_cff")
0057 process.load("Configuration.StandardSequences.SimIdeal_cff")
0058 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0059 from Configuration.AlCa.GlobalTag import GlobalTag
0060 process.GlobalTag = GlobalTag(process.GlobalTag, globalTag, '')
0061 
0062 process.source = cms.Source("EmptySource")
0063 
0064 process.maxEvents = cms.untracked.PSet(
0065     input = cms.untracked.int32(1),
0066     output = cms.optional.untracked.allowed(cms.int32,cms.PSet)
0067 )
0068 
0069 if 'MessageLogger' in process.__dict__:
0070     process.MessageLogger.G4cerr=dict()
0071     process.MessageLogger.HGCalGeom=dict()
0072 
0073 process.load("IOMC.RandomEngine.IOMC_cff")
0074 process.RandomNumberGeneratorService.generator.initialSeed = 456789
0075 process.RandomNumberGeneratorService.g4SimHits.initialSeed = 9876
0076 process.RandomNumberGeneratorService.VtxSmeared.initialSeed = 123456789
0077 process.rndmStore = cms.EDProducer("RandomEngineStateProducer")
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.load("Geometry.HGCalCommonData.hgcalPartialIDTester_cff")
0095 process.hgcalPartialIDTesterEE.fileName = inFile
0096 process.hgcalPartialIDTesterHEF.fileName = inFile
0097 process.hgcalPartialIDTesterEE.invert = True
0098 process.hgcalPartialIDTesterHEF.invert = True
0099 process.hgcalPartialIDTesterEE.debug = False
0100 process.hgcalPartialIDTesterHEF.debug = False
0101 
0102 process.p1 = cms.Path(process.generator*process.hgcalPartialIDTesterEE*process.hgcalPartialIDTesterHEF)