Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-05-20 22:40:15

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun runHGCGeomCheck_cfg.py geometry=D99
0004 #
0005 #   Options for geometry D98, D99, D108, D94, D103, D104, D106, D107, D108,
0006 #                        D109, D110, D111, D112, D113
0007 #
0008 ###############################################################################
0009 import FWCore.ParameterSet.Config as cms
0010 import os, sys, importlib, re
0011 import FWCore.ParameterSet.VarParsing as VarParsing
0012 
0013 ####################################################################
0014 ### SETUP OPTIONS
0015 options = VarParsing.VarParsing('standard')
0016 options.register('geometry',
0017                  "D99",
0018                   VarParsing.VarParsing.multiplicity.singleton,
0019                   VarParsing.VarParsing.varType.string,
0020                   "geometry of operations: D98, D99, D108, D94, D103, D104, D106, D107, D108, D109, D110, D111, D112, D113")
0021 
0022 ### get and parse the command line arguments
0023 options.parseArguments()
0024 
0025 print(options)
0026 
0027 ####################################################################
0028 # Use the options
0029 if (options.geometry == "D94"):
0030     from Configuration.Eras.Era_Phase2C20I13M9_cff import Phase2C20I13M9
0031     process = cms.Process('Client',Phase2C20I13M9)
0032 elif (options.geometry == "D104"):
0033     from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9
0034     process = cms.Process('Client',PhaseC22I13M9)
0035 elif (options.geometry == "D106"):
0036     from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9
0037     process = cms.Process('Client',PhaseC22I13M9)
0038 elif (options.geometry == "D109"):
0039     from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9
0040     process = cms.Process('Client',PhaseC22I13M9)
0041 else:
0042     from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
0043     process = cms.Process('Client',Phase2C17I13M9)
0044 
0045 geomFile = "Configuration.Geometry.GeometryExtended2026" + options.geometry + "Reco_cff"
0046 inFile = "file:testHGCalSimWatcher" + options.geometry + ".root"
0047 outFile = "hgcGeomCheck" + options.geometry + ".root"
0048 
0049 print("Geometry file: ", geomFile)
0050 print("Input file:    ", inFile)
0051 print("Output file:   ", outFile)
0052 
0053 process.load(geomFile)
0054 process.load('Configuration.StandardSequences.Services_cff')
0055 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')    
0056 process.load('FWCore.MessageService.MessageLogger_cfi')
0057 process.load('Configuration.EventContent.EventContent_cff')
0058 process.load('Configuration.StandardSequences.MagneticField_cff')
0059 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0060 from Configuration.AlCa.GlobalTag import GlobalTag
0061 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T21', '')
0062 
0063 process.MessageLogger.cerr.FwkReport.reportEvery = 5
0064 if hasattr(process,'MessageLogger'):
0065     process.MessageLogger.HGCalValid=dict()
0066     process.MessageLogger.HGCalGeom=dict()
0067 
0068 process.MessageLogger.cerr.FwkReport.reportEvery = 100
0069 process.source = cms.Source("PoolSource",
0070     fileNames = cms.untracked.vstring(inFile)
0071 )
0072 
0073 process.load('Validation.HGCalValidation.hgcGeomCheck_cff')
0074 
0075 process.TFileService = cms.Service("TFileService",
0076                                    fileName = cms.string(outFile),
0077                                    closeFileFast = cms.untracked.bool(True)
0078 )
0079 
0080 SimpleMemoryCheck = cms.Service("SimpleMemoryCheck",ignoreTotal = cms.untracked.int32(1) )
0081 
0082 process.p = cms.Path(process.hgcGeomCheck)