From f43a5f2151aba30cddbce503d97612600966fd4b Mon Sep 17 00:00:00 2001 From: Sunanda Date: Tue, 14 Jan 2025 17:16:30 +0100 Subject: [PATCH] Update some of the test scripts in Validation/HGCalValidation/test/python using a new tool which finds the right ERA and Global Tag --- .../test/python/runHFNoseDigiStudy_cfg.py | 16 +++++-- .../test/python/runHFNoseRecHitStudy_cfg.py | 18 +++++--- .../test/python/runHFNoseSimHitStudy_cfg.py | 16 +++++-- .../test/python/runHGCGeomCheck_cfg.py | 40 ++++++----------- .../test/python/runHGCHitAnalyzer_cfg.py | 41 ++++++------------ .../test/python/runHGCMissingRecHit_cfg.py | 38 +++++----------- .../test/python/runHGCalDigiStudy_cfg.py | 38 +++++----------- .../test/python/runHGCalHitCalibration_cfg.py | 43 ++++++------------- .../test/python/runHGCalRecHitStudy_cfg.py | 41 ++++++------------ .../test/python/runHGCalSimHitStudy_cfg.py | 39 ++++++----------- .../test/python/runHGCalWaferHitCheck_cfg.py | 39 +++++------------ .../test/python/runHGCalWaferStudy_cfg.py | 39 ++++++----------- 12 files changed, 145 insertions(+), 263 deletions(-) diff --git a/Validation/HGCalValidation/test/python/runHFNoseDigiStudy_cfg.py b/Validation/HGCalValidation/test/python/runHFNoseDigiStudy_cfg.py index 4c1ed21ce0a0a..bb62c57a2063f 100644 --- a/Validation/HGCalValidation/test/python/runHFNoseDigiStudy_cfg.py +++ b/Validation/HGCalValidation/test/python/runHFNoseDigiStudy_cfg.py @@ -1,17 +1,25 @@ import FWCore.ParameterSet.Config as cms -from Configuration.Eras.Era_Phase2C20I13M9_cff import Phase2C20I13M9 -process = cms.Process('PROD',Phase2C20I13M9) +geomName = "Run4D115" +geomFile = "Configuration.Geometry.GeometryExtended" + geomName + "Reco_cff" +import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings +GLOBAL_TAG, ERA = _settings.get_era_and_conditions(geomName) +print("Geometry Name: ", geomName) +print("Geom file Name: ", geomFile) +print("Global Tag Name: ", GLOBAL_TAG) +print("Era Name: ", ERA) + +process = cms.Process('HFNoseDigiStudy',ERA) process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") -process.load('Configuration.Geometry.GeometryExtendedRun4D115Reco_cff') +process.load(geomFile) process.load("Configuration.StandardSequences.MagneticField_cff") process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.StandardSequences.RawToDigi_cff') process.load('Validation.HGCalValidation.hfnoseDigiStudy_cfi') process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") from Configuration.AlCa.GlobalTag import GlobalTag -process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T33', '') +process.GlobalTag = GlobalTag(process.GlobalTag, GLOBAL_TAG, '') if hasattr(process,'MessageLogger'): process.MessageLogger.HGCalValidation=dict() diff --git a/Validation/HGCalValidation/test/python/runHFNoseRecHitStudy_cfg.py b/Validation/HGCalValidation/test/python/runHFNoseRecHitStudy_cfg.py index ae091613a672f..0009298d76549 100644 --- a/Validation/HGCalValidation/test/python/runHFNoseRecHitStudy_cfg.py +++ b/Validation/HGCalValidation/test/python/runHFNoseRecHitStudy_cfg.py @@ -1,10 +1,18 @@ import FWCore.ParameterSet.Config as cms import FWCore.Utilities.FileUtils as FileUtils -from Configuration.Eras.Era_Phase2C20I13M9_cff import Phase2C20I13M9 -process = cms.Process('PROD',Phase2C20I13M9) - -process.load('Configuration.Geometry.GeometryExtendedRun4D115Reco_cff') +geomName = "Run4D115" +geomFile = "Configuration.Geometry.GeometryExtended" + geomName + "Reco_cff" +import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings +GLOBAL_TAG, ERA = _settings.get_era_and_conditions(geomName) +print("Geometry Name: ", geomName) +print("Geom file Name: ", geomFile) +print("Global Tag Name: ", GLOBAL_TAG) +print("Era Name: ", ERA) + +process = cms.Process('HFNoseRecHitStudy',ERA) + +process.load(geomFile) process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.Services_cff') @@ -12,7 +20,7 @@ process.load('Configuration.EventContent.EventContent_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') from Configuration.AlCa.GlobalTag import GlobalTag -process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T33', '') +process.GlobalTag = GlobalTag(process.GlobalTag, GLOBAL_TAG, '') process.MessageLogger.cerr.FwkReport.reportEvery = 2 if 'MessageLogger' in process.__dict__: diff --git a/Validation/HGCalValidation/test/python/runHFNoseSimHitStudy_cfg.py b/Validation/HGCalValidation/test/python/runHFNoseSimHitStudy_cfg.py index 2921e0003c288..0e4ceca7a7906 100644 --- a/Validation/HGCalValidation/test/python/runHFNoseSimHitStudy_cfg.py +++ b/Validation/HGCalValidation/test/python/runHFNoseSimHitStudy_cfg.py @@ -1,18 +1,26 @@ import FWCore.ParameterSet.Config as cms -from Configuration.Eras.Era_Phase2C20I13M9_cff import Phase2C20I13M9 -process = cms.Process('PROD',Phase2C20I13M9) +geomName = "Run4D115" +geomFile = "Configuration.Geometry.GeometryExtended" + geomName + "Reco_cff" +import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings +GLOBAL_TAG, ERA = _settings.get_era_and_conditions(geomName) +print("Geometry Name: ", geomName) +print("Geom file Name: ", geomFile) +print("Global Tag Name: ", GLOBAL_TAG) +print("Era Name: ", ERA) + +process = cms.Process('HFNoseSimHitStudy',ERA) process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") -process.load('Configuration.Geometry.GeometryExtendedRun4D115_cff') +process.load(geomFile) process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.EventContent.EventContent_cff") process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Validation.HGCalValidation.hfnoseSimHitStudy_cfi') process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") from Configuration.AlCa.GlobalTag import GlobalTag -process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T33', '') +process.GlobalTag = GlobalTag(process.GlobalTag, GLOBAL_TAG, '') if hasattr(process,'MessageLogger'): process.MessageLogger.HGCalValidation=dict() diff --git a/Validation/HGCalValidation/test/python/runHGCGeomCheck_cfg.py b/Validation/HGCalValidation/test/python/runHGCGeomCheck_cfg.py index 86bb29c32af26..7aeefc16a80e5 100644 --- a/Validation/HGCalValidation/test/python/runHGCGeomCheck_cfg.py +++ b/Validation/HGCalValidation/test/python/runHGCGeomCheck_cfg.py @@ -26,36 +26,20 @@ #################################################################### # Use the options -if (options.geometry == "D115"): - from Configuration.Eras.Era_Phase2C20I13M9_cff import Phase2C20I13M9 - process = cms.Process('GeomCheck',Phase2C20I13M9) -elif (options.geometry == "D104"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('GeomCheck',PhaseC22I13M9) -elif (options.geometry == "D106"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('GeomCheck',PhaseC22I13M9) -elif (options.geometry == "D109"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('GeomCheck',PhaseC22I13M9) -elif (options.geometry == "D111"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('GeomCheck',PhaseC22I13M9) -elif (options.geometry == "D112"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('GeomCheck',PhaseC22I13M9) -elif (options.geometry == "D113"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('GeomCheck',PhaseC22I13M9) -else: - from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9 - process = cms.Process('GeomCheck',Phase2C17I13M9) -geomFile = "Configuration.Geometry.GeometryExtendedRun4" + options.geometry + "Reco_cff" +geomName = "Run4" + options.geometry +geomFile = "Configuration.Geometry.GeometryExtended" + geomName + "Reco_cff" +import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings +GLOBAL_TAG, ERA = _settings.get_era_and_conditions(geomName) +print("Geometry Name: ", geomName) +print("Geom file Name: ", geomFile) +print("Global Tag Name: ", GLOBAL_TAG) +print("Era Name: ", ERA) + +process = cms.Process('GeomCheck',ERA) + inFile = "file:testHGCalSimWatcher" + options.geometry + ".root" outFile = "hgcGeomCheck" + options.geometry + ".root" - -print("Geometry file: ", geomFile) print("Input file: ", inFile) print("Output file: ", outFile) @@ -67,7 +51,7 @@ process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') from Configuration.AlCa.GlobalTag import GlobalTag -process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T21', '') +process.GlobalTag = GlobalTag(process.GlobalTag, GLOBAL_TAG, '') process.MessageLogger.cerr.FwkReport.reportEvery = 5 if hasattr(process,'MessageLogger'): diff --git a/Validation/HGCalValidation/test/python/runHGCHitAnalyzer_cfg.py b/Validation/HGCalValidation/test/python/runHGCHitAnalyzer_cfg.py index 114f018459aad..d57d205655307 100644 --- a/Validation/HGCalValidation/test/python/runHGCHitAnalyzer_cfg.py +++ b/Validation/HGCalValidation/test/python/runHGCHitAnalyzer_cfg.py @@ -26,36 +26,21 @@ #################################################################### # Use the options -if (options.geometry == "D115"): - from Configuration.Eras.Era_Phase2C20I13M9_cff import Phase2C20I13M9 - process = cms.Process('HitAnalysis',Phase2C20I13M9) -elif (options.geometry == "D104"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('HitAnalysis',PhaseC22I13M9) -elif (options.geometry == "D106"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('HitAnalysis',PhaseC22I13M9) -elif (options.geometry == "D109"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('HitAnalysis',PhaseC22I13M9) -elif (options.geometry == "D111"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('HitAnalysis',PhaseC22I13M9) -elif (options.geometry == "D112"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('HitAnalysis',PhaseC22I13M9) -elif (options.geometry == "D113"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('HitAnalysis',PhaseC22I13M9) -else: - from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9 - process = cms.Process('HitAnalysis',Phase2C17I13M9) - -geomFile = "Configuration.Geometry.GeometryExtendedRun4" + options.geometry + "Reco_cff" + +geomName = "Run4" + options.geometry +geomFile = "Configuration.Geometry.GeometryExtended" + geomName + "Reco_cff" +import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings +GLOBAL_TAG, ERA = _settings.get_era_and_conditions(geomName) +print("Geometry Name: ", geomName) +print("Geom file Name: ", geomFile) +print("Global Tag Name: ", GLOBAL_TAG) +print("Era Name: ", ERA) + +process = cms.Process('HitAnalysis',ERA) + inFile = "file:step3" + options.geometry + ".root" outFile = "relValTTbar" + options.geometry + ".root" -print("Geometry file: ", geomFile) print("Input file: ", inFile) print("Output file: ", outFile) @@ -69,7 +54,7 @@ process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') from Configuration.AlCa.GlobalTag import GlobalTag -process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T21', '') +process.GlobalTag = GlobalTag(process.GlobalTag, GLOBAL_TAG, '') process.MessageLogger.cerr.FwkReport.reportEvery = 10 # diff --git a/Validation/HGCalValidation/test/python/runHGCMissingRecHit_cfg.py b/Validation/HGCalValidation/test/python/runHGCMissingRecHit_cfg.py index 9e657ed4989ec..2f612b8f1b9f6 100644 --- a/Validation/HGCalValidation/test/python/runHGCMissingRecHit_cfg.py +++ b/Validation/HGCalValidation/test/python/runHGCMissingRecHit_cfg.py @@ -26,36 +26,20 @@ #################################################################### # Use the options -if (options.geometry == "D115"): - from Configuration.Eras.Era_Phase2C20I13M9_cff import Phase2C20I13M9 - process = cms.Process('HGCMissingHits',Phase2C20I13M9) -elif (options.geometry == "D104"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('HGCMissingHits',PhaseC22I13M9) -elif (options.geometry == "D106"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('HGCMissingHits',PhaseC22I13M9) -elif (options.geometry == "D109"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('HGCMissingHits',PhaseC22I13M9) -elif (options.geometry == "D111"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('HGCMissingHits',PhaseC22I13M9) -elif (options.geometry == "D112"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('HGCMissingHits',PhaseC22I13M9) -elif (options.geometry == "D113"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('HGCMissingHits',PhaseC22I13M9) -else: - from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9 - process = cms.Process('HGCMissingHits',Phase2C17I13M9) +geomName = "Run4" + options.geometry +geomFile = "Configuration.Geometry.GeometryExtended" + geomName + "Reco_cff" +import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings +GLOBAL_TAG, ERA = _settings.get_era_and_conditions(geomName) +print("Geometry Name: ", geomName) +print("Geom file Name: ", geomFile) +print("Global Tag Name: ", GLOBAL_TAG) +print("Era Name: ", ERA) + +process = cms.Process('HGCMissingHits',ERA) -geomFile = "Configuration.Geometry.GeometryExtendedRun4" + options.geometry + "Reco_cff" inFile = "file:step3" + options.geometry + ".root" outFile = "missedRecHit" + options.geometry + ".root" -print("Geometry file: ", geomFile) print("Input file: ", inFile) print("Output file: ", outFile) @@ -68,7 +52,7 @@ process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') from Configuration.AlCa.GlobalTag import GlobalTag -process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T21', '') +process.GlobalTag = GlobalTag(process.GlobalTag, GLOBAL_TAG, '') process.MessageLogger.cerr.FwkReport.reportEvery = 1 if hasattr(process,'MessageLogger'): process.MessageLogger.HGCalMiss=dict() diff --git a/Validation/HGCalValidation/test/python/runHGCalDigiStudy_cfg.py b/Validation/HGCalValidation/test/python/runHGCalDigiStudy_cfg.py index 70f5635c0a242..adf031e4cbbc3 100644 --- a/Validation/HGCalValidation/test/python/runHGCalDigiStudy_cfg.py +++ b/Validation/HGCalValidation/test/python/runHGCalDigiStudy_cfg.py @@ -26,36 +26,20 @@ #################################################################### # Use the options -if (options.geometry == "D115"): - from Configuration.Eras.Era_Phase2C20I13M9_cff import Phase2C20I13M9 - process = cms.Process('DigiStudy',Phase2C20I13M9) -elif (options.geometry == "D104"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('DigiStudy',PhaseC22I13M9) -elif (options.geometry == "D106"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('DigiStudy',PhaseC22I13M9) -elif (options.geometry == "D109"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('DigiStudy',PhaseC22I13M9) -elif (options.geometry == "D111"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('DigiStudy',PhaseC22I13M9) -elif (options.geometry == "D112"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('DigiStudy',PhaseC22I13M9) -elif (options.geometry == "D113"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('DigiStudy',PhaseC22I13M9) -else: - from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9 - process = cms.Process('DigiStudy',Phase2C17I13M9) +geomName = "Run4" + options.geometry +geomFile = "Configuration.Geometry.GeometryExtended" + geomName + "Reco_cff" +import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings +GLOBAL_TAG, ERA = _settings.get_era_and_conditions(geomName) +print("Geometry Name: ", geomName) +print("Geom file Name: ", geomFile) +print("Global Tag Name: ", GLOBAL_TAG) +print("Era Name: ", ERA) + +process = cms.Process('DigiStudy',ERA) -geomFile = "Configuration.Geometry.GeometryExtendedRun4" + options.geometry + "Reco_cff" fileInput = "file:step2" + options.geometry + "tt.root" fileName = "hgcDigi" + options.geometry + "tt.root" -print("Geometry file: ", geomFile) print("Input file: ", fileInput) print("Output file: ", fileName) @@ -67,7 +51,7 @@ process.load('Validation.HGCalValidation.hgcDigiStudy_cfi') process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") from Configuration.AlCa.GlobalTag import GlobalTag -process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T21', '') +process.GlobalTag = GlobalTag(process.GlobalTag, GLOBAL_TAG, '') process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring(fileInput) ) diff --git a/Validation/HGCalValidation/test/python/runHGCalHitCalibration_cfg.py b/Validation/HGCalValidation/test/python/runHGCalHitCalibration_cfg.py index 2830ecf670d2e..1e9acc4385b84 100644 --- a/Validation/HGCalValidation/test/python/runHGCalHitCalibration_cfg.py +++ b/Validation/HGCalValidation/test/python/runHGCalHitCalibration_cfg.py @@ -27,36 +27,20 @@ #################################################################### # Use the options -if (options.geometry == "D115"): - from Configuration.Eras.Era_Phase2C20I13M9_cff import Phase2C20I13M9 - process = cms.Process('HitCalibration',Phase2C20I13M9) -elif (options.geometry == "D104"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('HitCalibration',PhaseC22I13M9) -elif (options.geometry == "D106"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('HitCalibration',PhaseC22I13M9) -elif (options.geometry == "D109"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('HitCalibration',PhaseC22I13M9) -elif (options.geometry == "D111"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('HitCalibration',PhaseC22I13M9) -elif (options.geometry == "D112"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('HitCalibration',PhaseC22I13M9) -elif (options.geometry == "D113"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('HitCalibration',PhaseC22I13M9) -else: - from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9 - process = cms.Process('HitCalibration',Phase2C17I13M9) - -geomFile = "Configuration.Geometry.GeometryExtendedRun4" + options.geometry + "Reco_cff" + +geomName = "Run4" + options.geometry +geomFile = "Configuration.Geometry.GeometryExtended" + geomName + "Reco_cff" +import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings +GLOBAL_TAG, ERA = _settings.get_era_and_conditions(geomName) +print("Geometry Name: ", geomName) +print("Geom file Name: ", geomFile) +print("Global Tag Name: ", GLOBAL_TAG) +print("Era Name: ", ERA) + +process = cms.Process('HitCalibration',ERA) + fileInput = "file:step3" + options.geometry + "tt.root" fileName = "relVal" + options.geometry + "tt.root" - -print("Geometry file: ", geomFile) print("Input file: ", fileInput) print("Output file: ", fileName) @@ -68,8 +52,7 @@ process.load('Configuration.StandardSequences.MagneticField_cff') process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") from Configuration.AlCa.GlobalTag import GlobalTag -process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T21', '') -process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +process.GlobalTag = GlobalTag(process.GlobalTag, GLOBAL_TAG, '') process.MessageLogger.cerr.FwkReport.reportEvery = 100 diff --git a/Validation/HGCalValidation/test/python/runHGCalRecHitStudy_cfg.py b/Validation/HGCalValidation/test/python/runHGCalRecHitStudy_cfg.py index 66a3f07ef8e41..ba422de8728b7 100644 --- a/Validation/HGCalValidation/test/python/runHGCalRecHitStudy_cfg.py +++ b/Validation/HGCalValidation/test/python/runHGCalRecHitStudy_cfg.py @@ -26,36 +26,21 @@ #################################################################### # Use the options -if (options.geometry == "D115"): - from Configuration.Eras.Era_Phase2C20I13M9_cff import Phase2C20I13M9 - process = cms.Process('RecHit',Phase2C20I13M9) -elif (options.geometry == "D104"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('RecHit',PhaseC22I13M9) -elif (options.geometry == "D106"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('RecHit',PhaseC22I13M9) -elif (options.geometry == "D109"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('RecHit',PhaseC22I13M9) -elif (options.geometry == "D111"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('RecHit',PhaseC22I13M9) -elif (options.geometry == "D112"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('RecHit',PhaseC22I13M9) -elif (options.geometry == "D113"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('RecHit',PhaseC22I13M9) -else: - from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9 - process = cms.Process('RecHit',Phase2C17I13M9) - -geomFile = "Configuration.Geometry.GeometryExtendedRun4" + options.geometry + "Reco_cff" + +geomName = "Run4" + options.geometry +geomFile = "Configuration.Geometry.GeometryExtended" + geomName + "Reco_cff" +import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings +GLOBAL_TAG, ERA = _settings.get_era_and_conditions(geomName) +print("Geometry Name: ", geomName) +print("Geom file Name: ", geomFile) +print("Global Tag Name: ", GLOBAL_TAG) +print("Era Name: ", ERA) + +process = cms.Process('RecHit',ERA) + fileInput = "file:step3" + options.geometry + "tt.root" fileName = "hgcRecHit" + options.geometry + "tt.root" -print("Geometry file: ", geomFile) print("Input file: ", fileInput) print("Output file: ", fileName) @@ -67,7 +52,7 @@ process.load('Configuration.EventContent.EventContent_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') from Configuration.AlCa.GlobalTag import GlobalTag -process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T21', '') +process.GlobalTag = GlobalTag(process.GlobalTag, GLOBAL_TAG, '') process.MessageLogger.cerr.FwkReport.reportEvery = 2 diff --git a/Validation/HGCalValidation/test/python/runHGCalSimHitStudy_cfg.py b/Validation/HGCalValidation/test/python/runHGCalSimHitStudy_cfg.py index 4e89483563533..576bac4cb3dfe 100644 --- a/Validation/HGCalValidation/test/python/runHGCalSimHitStudy_cfg.py +++ b/Validation/HGCalValidation/test/python/runHGCalSimHitStudy_cfg.py @@ -26,36 +26,21 @@ #################################################################### # Use the options -if (options.geometry == "D115"): - from Configuration.Eras.Era_Phase2C20I13M9_cff import Phase2C20I13M9 - process = cms.Process('SimHit',Phase2C20I13M9) -elif (options.geometry == "D104"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('SimHit',PhaseC22I13M9) -elif (options.geometry == "D106"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('SimHit',PhaseC22I13M9) -elif (options.geometry == "D109"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('SimHit',PhaseC22I13M9) -elif (options.geometry == "D111"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('SimHit',PhaseC22I13M9) -elif (options.geometry == "D112"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('SimHit',PhaseC22I13M9) -elif (options.geometry == "D113"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('SimHit',PhaseC22I13M9) -else: - from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9 - process = cms.Process('SimHit',Phase2C17I13M9) -geomFile = "Configuration.Geometry.GeometryExtendedRun4" + options.geometry + "Reco_cff" +geomName = "Run4" + options.geometry +geomFile = "Configuration.Geometry.GeometryExtended" + geomName + "Reco_cff" +import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings +GLOBAL_TAG, ERA = _settings.get_era_and_conditions(geomName) +print("Geometry Name: ", geomName) +print("Geom file Name: ", geomFile) +print("Global Tag Name: ", GLOBAL_TAG) +print("Era Name: ", ERA) + +process = cms.Process('SimHit',ERA) + fileInput = "file:step1" + options.geometry + "tt.root" fileName = "hgcSimHit" + options.geometry + "tt.root" -print("Geometry file: ", geomFile) print("Input file: ", fileInput) print("Output file: ", fileName) @@ -67,7 +52,7 @@ process.load('Validation.HGCalValidation.hgcSimHitStudy_cfi') process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") from Configuration.AlCa.GlobalTag import GlobalTag -process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T21', '') +process.GlobalTag = GlobalTag(process.GlobalTag, GLOBAL_TAG, '') process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring(fileInput) ) diff --git a/Validation/HGCalValidation/test/python/runHGCalWaferHitCheck_cfg.py b/Validation/HGCalValidation/test/python/runHGCalWaferHitCheck_cfg.py index 12f6bdc11c9c9..09f6ebaa6263b 100644 --- a/Validation/HGCalValidation/test/python/runHGCalWaferHitCheck_cfg.py +++ b/Validation/HGCalValidation/test/python/runHGCalWaferHitCheck_cfg.py @@ -26,36 +26,19 @@ #################################################################### # Use the options -if (options.geometry == "D115"): - from Configuration.Eras.Era_Phase2C20I13M9_cff import Phase2C20I13M9 - process = cms.Process('WaferHitCheck',Phase2C20I13M9) -elif (options.geometry == "D104"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('WaferHitCheck',PhaseC22I13M9) -elif (options.geometry == "D106"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('WaferHitCheck',PhaseC22I13M9) -elif (options.geometry == "D109"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('WaferHitCheck',PhaseC22I13M9) -elif (options.geometry == "D111"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('WaferHitCheck',PhaseC22I13M9) -elif (options.geometry == "D112"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('WaferHitCheck',PhaseC22I13M9) -elif (options.geometry == "D113"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('WaferHitCheck',PhaseC22I13M9) -else: - from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9 - process = cms.Process('WaferHitCheck',Phase2C17I13M9) -geomFile = "Configuration.Geometry.GeometryExtendedRun4" + options.geometry + "Reco_cff" +geomName = "Run4" + options.geometry +geomFile = "Configuration.Geometry.GeometryExtended" + geomName + "Reco_cff" fileInput = "file:step1" + options.geometry + "tt.root" +import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings +GLOBAL_TAG, ERA = _settings.get_era_and_conditions(geomName) +print("Geometry Name: ", geomName) +print("Geom file Name: ", geomFile) +print("Global Tag Name: ", GLOBAL_TAG) +print("Era Name: ", ERA) +print("Input file: ", fileInput) -print("Geometry file: ", geomFile) -print("Input file: ", fileInput) +process = cms.Process('WaferHitCheck',ERA) process.load(geomFile) process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") @@ -65,7 +48,7 @@ process.load('Validation.HGCalValidation.hgcWaferHitCheck_cfi') process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") from Configuration.AlCa.GlobalTag import GlobalTag -process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T21', '') +process.GlobalTag = GlobalTag(process.GlobalTag, GLOBAL_TAG, '') if hasattr(process,'MessageLogger'): process.MessageLogger.HGCalValidation=dict() diff --git a/Validation/HGCalValidation/test/python/runHGCalWaferStudy_cfg.py b/Validation/HGCalValidation/test/python/runHGCalWaferStudy_cfg.py index 63c7166f15015..cb14fb67c275f 100644 --- a/Validation/HGCalValidation/test/python/runHGCalWaferStudy_cfg.py +++ b/Validation/HGCalValidation/test/python/runHGCalWaferStudy_cfg.py @@ -26,36 +26,21 @@ ############################################################ # Use the options -if (options.geometry == "D115"): - from Configuration.Eras.Era_Phase2C20I13M9_cff import Phase2C20I13M9 - process = cms.Process('WaferStudy',Phase2C20I13M9) -elif (options.geometry == "D104"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('WaferStudy',PhaseC22I13M9) -elif (options.geometry == "D106"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('WaferStudy',PhaseC22I13M9) -elif (options.geometry == "D109"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('WaferStudy',PhaseC22I13M9) -elif (options.geometry == "D111"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('WaferStudy',PhaseC22I13M9) -elif (options.geometry == "D112"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('WaferStudy',PhaseC22I13M9) -elif (options.geometry == "D113"): - from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 - process = cms.Process('WaferStudy',PhaseC22I13M9) -else: - from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9 - process = cms.Process('WaferStudy',Phase2C17I13M9) -geomFile = "Configuration.Geometry.GeometryExtendedRun4" + options.geometry + "Reco_cff" +geomName = "Run4" + options.geometry +geomFile = "Configuration.Geometry.GeometryExtended" + geomName + "Reco_cff" +import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings +GLOBAL_TAG, ERA = _settings.get_era_and_conditions(geomName) +print("Geometry Name: ", geomName) +print("Geom file Name: ", geomFile) +print("Global Tag Name: ", GLOBAL_TAG) +print("Era Name: ", ERA) + +process = cms.Process('WaferStudy',ERA) + fileInput = "file:step2" + options.geometry + "tt.root" fileName = "hgcWafer" + options.geometry + "tt.root" -print("Geometry file: ", geomFile) print("Input file: ", fileInput) print("Output file: ", fileName) @@ -67,7 +52,7 @@ process.load('Validation.HGCalValidation.hgcalWaferStudy_cfi') process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") from Configuration.AlCa.GlobalTag import GlobalTag -process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T21', '') +process.GlobalTag = GlobalTag(process.GlobalTag, GLOBAL_TAG, '') if hasattr(process,'MessageLogger'): process.MessageLogger.HGCalValidation=dict()