Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-02-14 04:12:18

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun runHGCalWaferStudy_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:step2" + options.geometry + "tt.root"
0046 fileName = "hgcWafer" + 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('FWCore.MessageService.MessageLogger_cfi')
0056 process.load('Configuration.StandardSequences.RawToDigi_cff')
0057 process.load('Validation.HGCalValidation.hgcalWaferStudy_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 if hasattr(process,'MessageLogger'):
0063     process.MessageLogger.HGCalValidation=dict()
0064 
0065 process.source = cms.Source("PoolSource",
0066                             fileNames = cms.untracked.vstring(fileInput)
0067                             )
0068 
0069 process.maxEvents = cms.untracked.PSet(
0070     input = cms.untracked.int32(-1)
0071 )
0072 
0073 process.TFileService = cms.Service("TFileService",
0074                                    fileName = cms.string(fileName),
0075                                    closeFileFast = cms.untracked.bool(True)
0076                                    )
0077 
0078 process.raw2digi_step = cms.Path(process.RawToDigi)
0079 process.analysis_step = cms.Path(process.hgcalWaferStudy)
0080 process.hgcalWaferStudy.verbosity = 1
0081 process.hgcalWaferStudy.nBinHit   = 60
0082 process.hgcalWaferStudy.nBinDig   = 60
0083 process.hgcalWaferStudy.layerMinSim = cms.untracked.vint32(1,1)
0084 process.hgcalWaferStudy.layerMaxSim = cms.untracked.vint32(10,10)
0085 process.hgcalWaferStudy.layerMinDig = cms.untracked.vint32(1,1)
0086 process.hgcalWaferStudy.layerMaxDig = cms.untracked.vint32(10,10)
0087 
0088 # Schedule definition
0089 process.schedule = cms.Schedule(process.raw2digi_step,process.analysis_step)