Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
###############################################################################
# Way to use this:
#   cmsRun testZdcTopology_cfg.py type=2024
#
#   Options for type 2021, 2023, 2024
#
###############################################################################
import FWCore.ParameterSet.Config as cms
import os, sys, imp, re
import FWCore.ParameterSet.VarParsing as VarParsing

####################################################################
### SETUP OPTIONS 
options = VarParsing.VarParsing('standard')
options.register('type',
                 "2024",
                  VarParsing.VarParsing.multiplicity.singleton,
                  VarParsing.VarParsing.varType.string,
                  "type of operations:2021, 2023, 2024")

### get and parse the command line arguments
options.parseArguments()

geomFile = "Configuration.Geometry.GeometryExtended" + options.type + "Reco_cff"

print(options)
print("Geometry file: ", geomFile)

####################################################################
# Use the options

from Configuration.Eras.Era_Run3_DDD_cff import Run3_DDD
process = cms.Process('TestZdcTopology',Run3_DDD)

process.load("SimGeneral.HepPDTESSource.pdt_cfi")
process.load(geomFile)
process.load("Geometry.ForwardGeometry.zdcTopologyTester_cfi")
process.load('FWCore.MessageService.MessageLogger_cfi')

if hasattr(process,'MessageLogger'):
    process.MessageLogger.HCalGeom=dict()

process.load("IOMC.RandomEngine.IOMC_cff")
process.RandomNumberGeneratorService.generator.initialSeed = 456789

process.source = cms.Source("EmptySource")

process.generator = cms.EDProducer("FlatRandomEGunProducer",
    PGunParameters = cms.PSet(
        PartID = cms.vint32(14),
        MinEta = cms.double(-3.5),
        MaxEta = cms.double(3.5),
        MinPhi = cms.double(-3.14159265359),
        MaxPhi = cms.double(3.14159265359),
        MinE   = cms.double(9.99),
        MaxE   = cms.double(10.01)
    ),
    AddAntiParticle = cms.bool(False),
    Verbosity       = cms.untracked.int32(0),
    firstRun        = cms.untracked.uint32(1)
)

process.maxEvents = cms.untracked.PSet(
    input = cms.untracked.int32(1)
)

process.p1 = cms.Path(process.generator*process.zdcTopologyTester)