Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-08-29 02:16:54

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun testHGCalScintID_cfg.py geometry=D110
0004 #
0005 #   Options for geometry D95, D96, D98, D99, D100, D101, D102, D103, D104, D105,
0006 #                        D106, D107, D108, D109, D110, D111, D112, D113, D114
0007 #
0008 ###############################################################################
0009 import FWCore.ParameterSet.Config as cms
0010 import os, sys, imp, re
0011 import FWCore.ParameterSet.VarParsing as VarParsing
0012 
0013 ####################################################################
0014 ### SETUP OPTIONS
0015 options = VarParsing.VarParsing('standard')
0016 options.register('geometry',
0017                  "D110",
0018                   VarParsing.VarParsing.multiplicity.singleton,
0019                   VarParsing.VarParsing.varType.string,
0020                   "geometry of operations: D95, D96, D98, D99, D100, D101, D102, D103, D104, D105, D106, D107, D108, D109, D110, D111, D112, D113, D114")
0021 
0022 ### get and parse the command line arguments
0023 options.parseArguments()
0024 
0025 print(options)
0026 
0027 ####################################################################
0028 # Use the options
0029 from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
0030 process = cms.Process('TestHGCalScintID',Phase2C17I13M9)
0031 
0032 geomFile = "Configuration.Geometry.GeometryExtended2026" + options.geometry + "_cff"
0033 inputFile = "errorScint" + options.geometry + ".txt"
0034 
0035 print("Geometry file: ", geomFile)
0036 print("Input file:    ", inputFile)
0037 
0038 process.load("SimGeneral.HepPDTESSource.pdt_cfi")
0039 process.load(geomFile)
0040 process.load('FWCore.MessageService.MessageLogger_cfi')
0041 
0042 if hasattr(process,'MessageLogger'):
0043     process.MessageLogger.HGCalGeom=dict()
0044 
0045 process.load("IOMC.RandomEngine.IOMC_cff")
0046 process.RandomNumberGeneratorService.generator.initialSeed = 456789
0047 
0048 process.source = cms.Source("EmptySource")
0049 
0050 process.generator = cms.EDProducer("FlatRandomEGunProducer",
0051                                    PGunParameters = cms.PSet(
0052                                        PartID = cms.vint32(14),
0053                                        MinEta = cms.double(-3.5),
0054                                        MaxEta = cms.double(3.5),
0055                                        MinPhi = cms.double(-3.14159265359),
0056                                        MaxPhi = cms.double(3.14159265359),
0057                                        MinE   = cms.double(9.99),
0058                                        MaxE   = cms.double(10.01)
0059                                    ),
0060                                    AddAntiParticle = cms.bool(False),
0061                                    Verbosity       = cms.untracked.int32(0),
0062                                    firstRun        = cms.untracked.uint32(1)
0063                                )
0064 
0065 process.maxEvents = cms.untracked.PSet(
0066     input = cms.untracked.int32(1)
0067 )
0068 
0069 process.load("Geometry.HGCalCommonData.hgcalScintIDTester_cfi")
0070 process.hgcalScintIDTester.fileName = inputFile
0071 
0072 process.p1 = cms.Path(process.generator*process.hgcalScintIDTester)