Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-09-10 01:03:21

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun testHGCalCellHitSum_cfg.py geometry=D92
0004 #
0005 #   Options for geometry D49, D88, D92, D93
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('geometry',
0016                  "D92",
0017                   VarParsing.VarParsing.multiplicity.singleton,
0018                   VarParsing.VarParsing.varType.string,
0019                   "geometry of operations: D49, D88, D92, D93")
0020 
0021 ### get and parse the command line arguments
0022 options.parseArguments()
0023 
0024 import FWCore.ParameterSet.Config as cms
0025 
0026 print(options)
0027 
0028 ####################################################################
0029 # Use the options
0030 
0031 if (options.geometry == "D49"):
0032     from Configuration.Eras.Era_Phase2C9_cff import Phase2C9
0033     process = cms.Process('SingleMuon',Phase2C9)
0034     process.load('Configuration.Geometry.GeometryExtended2026D49Reco_cff')
0035     geomFile = 'Validation/HGCalValidation/data/wafer_v16.csv'
0036     outputFile = 'file:geantoutputD49.root'
0037 elif (options.geometry == "D88"):
0038     from Configuration.Eras.Era_Phase2C11I13M9_cff import Phase2C11I13M9
0039     process = cms.Process('HGCalCellHit',Phase2C11I13M9)
0040     process.load('Configuration.Geometry.GeometryExtended2026D88Reco_cff')
0041     geomFile = 'Validation/HGCalValidation/data/wafer_v16.csv'
0042     outputFile = 'file:geantoutputD88.root'
0043 elif (options.geometry == "D93"):
0044     from Configuration.Eras.Era_Phase2C11I13M9_cff import Phase2C11I13M9
0045     process = cms.Process('HGCalCellHit',Phase2C11I13M9)
0046     process.load('Configuration.Geometry.GeometryExtended2026D93Reco_cff')
0047     geomFile = 'Validation/HGCalValidation/data/wafer_v17.csv'
0048     outputFile = 'file:geantoutputD93.root'
0049 else:
0050     from Configuration.Eras.Era_Phase2C11I13M9_cff import Phase2C11I13M9
0051     process = cms.Process('HGCalCellHit',Phase2C11I13M9)
0052     process.load('Configuration.Geometry.GeometryExtended2026D92Reco_cff')
0053     geomFile = 'Validation/HGCalValidation/data/wafer_v17.csv'
0054     outputFile = 'file:geantoutputD92.root'
0055 
0056 print("Geometry file: ", geomFile)
0057 print("Output file: ", outputFile)
0058 
0059 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
0060 process.load('FWCore.MessageService.MessageLogger_cfi')
0061 process.MessageLogger.cerr.FwkReport.reportEvery = 100
0062 if hasattr(process,'MessageLogger'):
0063     process.MessageLogger.ValidHGCal=dict()
0064 
0065 process.load("IOMC.RandomEngine.IOMC_cff")
0066 process.RandomNumberGeneratorService.generator.initialSeed = 456789
0067 
0068 process.source = cms.Source("PoolSource",
0069     fileNames = cms.untracked.vstring('file:step1.root')
0070 )
0071 
0072 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1))
0073 
0074 process.load('Validation.HGCalValidation.hgcalCellHitSum_cfi')
0075 
0076 process.hgcalCellHitSumEE = process.hgcalCellHitSum.clone(
0077     geometryFileName = geomFile
0078 )
0079 
0080 process.hgcalCellHitSumHEF = process.hgcalCellHitSum.clone(
0081     simhits = ('g4SimHits', 'HGCHitsHEfront'),
0082     detector = 'HGCalHESiliconSensitive',
0083     geometryFileName = geomFile
0084 )
0085 
0086 process.hgcalCellHitSumHEB = process.hgcalCellHitSum.clone(
0087     simhits = ('g4SimHits', 'HGCHitsHEback'),
0088     detector   = 'HGCalHEScintillatorSensitive'
0089 )
0090 
0091 process.TFileService = cms.Service("TFileService",
0092                                    fileName = cms.string(outputFile) )
0093 
0094 process.p = cms.Path(process.hgcalCellHitSumEE*process.hgcalCellHitSumHEF*process.hgcalCellHitSumHEB)