Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 10:06:41

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun testHGCalCellHitSum_cfg.py geometry=D92 layers=1 type=mu
0004 #
0005 #   Options for geometry D88, D92, D93
0006 #               layers '1', '1,2', any combination from 1..47           
0007 #               type mu, tt
0008 #
0009 ###############################################################################
0010 import FWCore.ParameterSet.Config as cms
0011 import os, sys, imp, re
0012 import FWCore.ParameterSet.VarParsing as VarParsing
0013 
0014 ####################################################################
0015 ### SETUP OPTIONS
0016 options = VarParsing.VarParsing('standard')
0017 options.register('geometry',
0018                  "D92",
0019                   VarParsing.VarParsing.multiplicity.singleton,
0020                   VarParsing.VarParsing.varType.string,
0021                   "geometry of operations: D88, D92, D93")
0022 
0023 options.register('layers',
0024                  "1",
0025                   VarParsing.VarParsing.multiplicity.singleton,
0026                   VarParsing.VarParsing.varType.string,
0027                   "For single layer use 'layers=3' (default is 'layers=1'); or for multiple layers use 'layers=1,27,41,46'; or for all layers use 'layers=1-47'. Note that the size may increase by ~10 times in memory usage and ~50 times in file volume if 'all layers' option is applied.")
0028 
0029 options.register('type',
0030                  "mu",
0031                  VarParsing.VarParsing.multiplicity.singleton,
0032                  VarParsing.VarParsing.varType.string,
0033                  "type of operations: mu, tt")
0034 
0035 ### get and parse the command line arguments
0036 options.parseArguments()
0037 
0038 import FWCore.ParameterSet.Config as cms
0039 from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
0040 process = cms.Process('HGCalCellHit',Phase2C17I13M9)
0041 
0042 print(options)
0043 
0044 ####################################################################
0045 # Use the options
0046 
0047 loadFile = "Configuration.Geometry.GeometryExtended2026" + options.geometry + "Reco_cff"
0048 inputFile = "file:step1" + options.geometry + options.type + ".root"
0049 outputFile = "file:geantoutput" + options.geometry + options.type + ".root"
0050 
0051 if (options.geometry == "D88"):
0052     geomFile = 'Validation/HGCalValidation/data/wafer_v16.csv'
0053 elif (options.geometry == "D93"):
0054     geomFile = 'Validation/HGCalValidation/data/wafer_v17.csv'
0055 else:
0056     geomFile = 'Validation/HGCalValidation/data/wafer_v17.csv'
0057 
0058 print("Geometry file: ", loadFile)
0059 print("Wafer file:    ", geomFile)
0060 print("Input file:    ", inputFile)
0061 print("Output file:   ", outputFile)
0062 
0063 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
0064 process.load(loadFile)
0065 process.load('FWCore.MessageService.MessageLogger_cfi')
0066 process.MessageLogger.cerr.FwkReport.reportEvery = 100
0067 if hasattr(process,'MessageLogger'):
0068     process.MessageLogger.ValidHGCal=dict()
0069 
0070 process.load("IOMC.RandomEngine.IOMC_cff")
0071 process.RandomNumberGeneratorService.generator.initialSeed = 456789
0072 
0073 process.source = cms.Source("PoolSource",
0074     fileNames = cms.untracked.vstring(inputFile)
0075 )
0076 
0077 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1))
0078 
0079 process.load('Validation.HGCalValidation.hgcalCellHitSum_cff')
0080 
0081 process.hgcalCellHitSumEE.geometryFileName = geomFile
0082 process.hgcalCellHitSumHEF.geometryFileName = geomFile
0083 process.hgcalCellHitSumHEB.geometryFileName = geomFile
0084 
0085 process.TFileService = cms.Service("TFileService",
0086                                    fileName = cms.string(outputFile) )
0087 
0088 process.p = cms.Path(process.hgcalCellHitSumEE*process.hgcalCellHitSumHEF*process.hgcalCellHitSumHEB)