Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:32:38

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