Skip to content

Commit

Permalink
Merge pull request #45764 from mmusich/mm_dev_fixD88_missing
Browse files Browse the repository at this point in the history
fix a bunch of failing unit tests after D88 and D92 went missing
  • Loading branch information
cmsbuild authored Aug 24, 2024
2 parents 18e28ff + 9c57448 commit 611881f
Show file tree
Hide file tree
Showing 22 changed files with 174 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
filesDefaultMC_DoubleMuonPUPhase_string = '/store/mc/Phase2Fall22DRMiniAOD/DYJetsToMuMu_M-50_TuneCP5_14TeV-madgraphMLM-pythia8/ALCARECO/TkAlZMuMu-PU200ALCA_TkAlPU200_125X_mcRun4_realistic_v5-v1/60000/9382696c-70fd-4b37-8a0f-24bd02aeda5f.root'

filesDefaultMC_MinBiasPUPhase2RECO = cms.untracked.vstring(
'/store/relval/CMSSW_12_5_3/RelValMinBias_14TeV/GEN-SIM-RECO/125X_mcRun4_realistic_v5_2026D88PU-v1/2590000/22e22ae6-a353-4f2e-815e-cc5efee37af9.root',
'/store/relval/CMSSW_14_1_0_pre6/RelValMinBias_14TeV/GEN-SIM-RECO/PU_141X_mcRun4_realistic_v1_STD_2026D110_PU-v3/2560000/c22f1cbd-50e3-458e-aba9-b0a327e4c971.root'
)

filesDefaultMC_TTbarPhase2RECO = cms.untracked.vstring(
'/store/relval/CMSSW_12_6_0_pre5/RelValTTbar_14TeV/GEN-SIM-RECO/125X_mcRun4_realistic_v5_2026D88noPU-v1/2590000/57cbe250-487d-4a47-998b-48f9028a0058.root',
'/store/relval/CMSSW_14_1_0_pre5/RelValTTbar_14TeV/GEN-SIM-RECO/140X_mcRun4_realistic_v4_STD_2026D110_noPU-v1/2580000/b8c9ef5e-9c45-4c47-aae3-4db1304cd66e.root',
)

filesDefaultData_JetHTRun2018D = cms.untracked.vstring(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,17 @@ class RefitType(Enum):
_theRefitter = RefitType.COMMON # RefitType.STANDARD (other option not involving filtering)
_theTrackCollection = 'generalTracks' # FIXME: 'ALCARECOTkAlMinBias' once a sample is available

###################################################################
# Set default phase-2 settings
###################################################################
import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings
_PH2_GLOBAL_TAG, _PH2_ERA = _settings.get_era_and_conditions(_settings.DEFAULT_VERSION)

###################################################################
# Set the era
###################################################################
if(options.isPhase2):
from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
process = cms.Process("Demo",Phase2C17I13M9)
process = cms.Process("Demo", _PH2_ERA)
else:
from Configuration.Eras.Era_Run3_cff import Run3
process = cms.Process("Demo", Run3)
Expand Down Expand Up @@ -104,7 +109,7 @@ class RefitType(Enum):
# Standard loads
###################################################################
if(options.isPhase2):
process.load('Configuration.Geometry.GeometryExtended2026D88Reco_cff')
process.load('Configuration.Geometry.GeometryExtended2026DefaultReco_cff')
else:
process.load("Configuration.Geometry.GeometryRecoDB_cff")

Expand All @@ -118,7 +123,7 @@ class RefitType(Enum):
####################################################################
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
from Configuration.AlCa.GlobalTag import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, ('auto:phase2_realistic_T21' if options.isPhase2 else 'auto:phase1_2022_realistic'), '')
process.GlobalTag = GlobalTag(process.GlobalTag, (_PH2_GLOBAL_TAG if options.isPhase2 else 'auto:phase1_2022_realistic'), '')

if _allFromGT:
print("############ testPVValidation_cfg.py: msg%-i: All is taken from GT")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import FWCore.ParameterSet.VarParsing as VarParsing
import copy, sys, os

process = cms.Process("Misaligner")
import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings
GLOBAL_TAG, ERA = _settings.get_era_and_conditions("2026D107") # this should really be _settings.DEFAULT_VERSION :(
process = cms.Process("Misaligner", ERA)

###################################################################
# Setup 'standard' options
Expand Down Expand Up @@ -46,15 +48,16 @@
###################################################################
# Ideal geometry producer and standard includes
###################################################################
process.load('Configuration.Geometry.GeometryExtended2026D88Reco_cff')
process.load('Configuration.Geometry.GeometryExtended2026D107Reco_cff')
process.trackerGeometry.applyAlignment = True

###################################################################
# Just state the Global Tag (and pick some run)
###################################################################
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
from Configuration.AlCa.GlobalTag import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T21', '') # using realistic Phase 2 geom
#process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T25', '') # using realistic Phase 2 geom
process.GlobalTag = GlobalTag(process.GlobalTag, GLOBAL_TAG, '') # using realistic Phase 2 geom
print("Using global tag:", process.GlobalTag.globaltag.value())

###################################################################
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import FWCore.ParameterSet.Config as cms

process = cms.Process("ICALIB")
###################################################################
# Set default phase-2 settings
###################################################################
import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings
_PH2_GLOBAL_TAG, _PH2_ERA = _settings.get_era_and_conditions(_settings.DEFAULT_VERSION)

process = cms.Process("ICALIB", _PH2_ERA)
import FWCore.ParameterSet.VarParsing as VarParsing

options = VarParsing.VarParsing('analysis')
Expand All @@ -17,13 +23,13 @@
engineName = cms.untracked.string('TRandom3')
)

## specify detector D88, as the geometry is needed (will take tracker T24)
process.load("Configuration.Geometry.GeometryExtended2026D88_cff")
process.load('Configuration.Geometry.GeometryExtended2026D88Reco_cff')
## specify the default phase2 detector
process.load("Configuration.Geometry.GeometryExtended2026Default_cff")
process.load('Configuration.Geometry.GeometryExtended2026DefaultReco_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, _PH2_GLOBAL_TAG, '')

###################################################################
# Messages
Expand Down Expand Up @@ -61,10 +67,10 @@
authenticationPath = cms.untracked.string('')
),
timetype = cms.untracked.string('runnumber'),
connect = cms.string('sqlite_file:SiStripBadStripPhase2_T21_v0.db'),
connect = cms.string('sqlite_file:SiStripBadStripPhase2_T33_v0.db'),
toPut = cms.VPSet(cms.PSet(
record = cms.string('SiStripBadStripRcd'),
tag = cms.string('SiStripBadStripPhase2_T21')
tag = cms.string('SiStripBadStripPhase2_T33')
))
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
import FWCore.ParameterSet.Config as cms
import FWCore.ParameterSet.VarParsing as VarParsing

process = cms.Process("TEST")
###################################################################
# Set default phase-2 settings
###################################################################
import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings
_PH2_GLOBAL_TAG, _PH2_ERA = _settings.get_era_and_conditions(_settings.DEFAULT_VERSION)

process = cms.Process("TEST", _PH2_ERA)
options = VarParsing.VarParsing('analysis')
options.register('fromESSource',
False, # default value
Expand Down Expand Up @@ -48,16 +54,16 @@
# Input data
###################################################################
if(options.fromESSource):
process.load("Configuration.Geometry.GeometryExtended2026D88_cff")
process.load('Configuration.Geometry.GeometryExtended2026D88Reco_cff')
process.load("Configuration.Geometry.GeometryExtended2026Default_cff")
process.load('Configuration.Geometry.GeometryExtended2026DefaultReco_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, _PH2_GLOBAL_TAG, '')
#process.load("SLHCUpgradeSimulations.Geometry.fakePhase2OuterTrackerConditions_cff") # already included
#process.SiPhase2OTFakeBadStripsESSource.printDebug = cms.untracked.bool(True) # this makes it verbose
process.SiPhase2OTFakeBadStripsESSource.badComponentsFraction = cms.double(0.05) # bad components fraction is 5%
else:
tag = 'SiStripBadStripPhase2_T21'
tag = 'SiStripBadStripPhase2_T33'
suffix = 'v0'
inFile = tag+'_'+suffix+'.db'
inDB = 'sqlite_file:'+inFile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
###################################################################
# Input data
###################################################################
tag = 'SiPhase2OuterTrackerLorentzAngle_T21'
tag = 'SiPhase2OuterTrackerLorentzAngle_T33'
suffix = 'v0'
inFile = tag+'_'+suffix+'.db'
inDB = 'sqlite_file:'+inFile
Expand All @@ -58,7 +58,7 @@
###################################################################
process.get = cms.EDAnalyzer("EventSetupRecordDataGetter",
toGet = cms.VPSet(cms.PSet(
record = cms.string(' SiPhase2OuterTrackerLorentzAngleRcd'),
record = cms.string('SiPhase2OuterTrackerLorentzAngleRcd'),
data = cms.vstring('SiPhase2OuterTrackerLorentzAngle')
)),
verbose = cms.untracked.bool(True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@
from __future__ import print_function
import os, shlex, shutil, getpass

###################################################################
# Set default phase-2 settings
###################################################################
import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings
_PH2_GLOBAL_TAG, _PH2_ERA = _settings.get_era_and_conditions(_settings.DEFAULT_VERSION)

import FWCore.ParameterSet.Config as cms
process = cms.Process("TEST")
process = cms.Process("TEST", _PH2_ERA)

###################################################################
# Messages
Expand All @@ -25,7 +31,7 @@
SiPhase2OuterTrackerLorentzAngle = cms.untracked.PSet( limit = cms.untracked.int32(-1)),
)

tag = 'SiPhase2OuterTrackerLorentzAngle_T21'
tag = 'SiPhase2OuterTrackerLorentzAngle_T33'
suffix = 'v0'
outfile = tag+'_'+suffix+'.db'
outdb = 'sqlite_file:'+outfile
Expand All @@ -38,12 +44,12 @@
process.load("CondCore.CondDB.CondDB_cfi")
process.CondDB.connect = cms.string(outdb)

process.load('Configuration.Geometry.GeometryExtended2026D88Reco_cff')
process.load('Configuration.Geometry.GeometryExtended2026D88_cff')
process.load('Configuration.Geometry.GeometryExtended2026DefaultReco_cff')
process.load('Configuration.Geometry.GeometryExtended2026Default_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, _PH2_GLOBAL_TAG)
process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1) )

process.source = cms.Source("EmptyIOVSource",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import FWCore.ParameterSet.Config as cms

from Configuration.Geometry.GeometryDD4hepExtended2026D98Reco_cff import *
from Configuration.Geometry.GeometryDD4hepExtended2026D110Reco_cff import *
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import FWCore.ParameterSet.Config as cms

from Configuration.Geometry.GeometryDD4hepExtended2026D98_cff import *
from Configuration.Geometry.GeometryDD4hepExtended2026D110_cff import *
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import FWCore.ParameterSet.Config as cms

from Configuration.Geometry.GeometryExtended2026D98Reco_cff import *
from Configuration.Geometry.GeometryExtended2026D110Reco_cff import *
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import FWCore.ParameterSet.Config as cms

from Configuration.Geometry.GeometryExtended2026D98_cff import *
from Configuration.Geometry.GeometryExtended2026D110_cff import *
37 changes: 37 additions & 0 deletions Configuration/Geometry/python/defaultPhase2ConditionsEra_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from Configuration.PyReleaseValidation.upgradeWorkflowComponents import upgradeProperties as properties
from Configuration.AlCa.autoCond import autoCond
from Configuration.StandardSequences.Eras import eras

DEFAULT_VERSION = "2026D110"

def get_era_and_conditions(version_key):
"""Retrieve the era and global tag for a given version key.
Args:
version_key (str): The version key to look up.
Returns:
tuple: A tuple containing the global tag and era object.
Raises:
KeyError: If the version key or global tag is not found.
"""
# Ensure the version key exists in the properties for 2026
if version_key not in properties[2026]:
raise KeyError(f"Version key '{version_key}' not found in properties[2026].")

# Retrieve the global tag key
global_tag_key = properties[2026][version_key]['GT']
print(f"Global tag key from properties: {global_tag_key}")

# Validate the existence of the global tag in autoCond
global_tag_name = global_tag_key.replace("auto:", "")
if global_tag_name not in autoCond:
raise KeyError(f"Global tag key '{global_tag_key}' not found in autoCond.")

# Retrieve the era key and get the corresponding era object
era_key = properties[2026][version_key]['Era']
print(f"Constructed era key from properties: {era_key}")
era = getattr(eras, era_key)

return global_tag_key, era
8 changes: 8 additions & 0 deletions Geometry/TrackerGeometryBuilder/src/PixelTopologyMap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ void PixelTopologyMap::buildTopologyMaps() {
for (auto det : m_trackerGeom->detsPXB()) {
const PixelGeomDetUnit* pixelDet = dynamic_cast<const PixelGeomDetUnit*>(det);

// discard dets that are not a geomDetUnit
if (!pixelDet)
continue;

const auto& layer = m_trackerTopo->pxbLayer(pixelDet->geographicalId());
const auto& ladder = m_trackerTopo->pxbLadder(pixelDet->geographicalId());
const auto& module = m_trackerTopo->pxbModule(pixelDet->geographicalId());
Expand Down Expand Up @@ -56,6 +60,10 @@ void PixelTopologyMap::buildTopologyMaps() {
for (auto det : m_trackerGeom->detsPXF()) {
const PixelGeomDetUnit* pixelDet = dynamic_cast<const PixelGeomDetUnit*>(det);

// discard dets that are not a geomDetUnit
if (!pixelDet)
continue;

const auto& disk = m_trackerTopo->pxfDisk(pixelDet->geographicalId());
const auto& blade = m_trackerTopo->pxfBlade(pixelDet->geographicalId());
const auto& pxf_module = m_trackerTopo->pxfModule(pixelDet->geographicalId());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import FWCore.ParameterSet.Config as cms
import FWCore.ParameterSet.VarParsing as VarParsing

###################################################################
# Set default phase-2 settings
###################################################################
import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings
_PH2_GLOBAL_TAG, _PH2_ERA = _settings.get_era_and_conditions(_settings.DEFAULT_VERSION)

process = cms.Process("TopologyAnalysis")
options = VarParsing.VarParsing("analysis")

Expand All @@ -18,6 +24,12 @@

options.parseArguments()

if 'phase2' in options.globalTag:
if options.globalTag != _PH2_GLOBAL_TAG:
raise KeyError(
f"Global tag key given in input ('{options.globalTag}') mismatches the default ('{_PH2_GLOBAL_TAG}')."
)

###################################################################
# Message logger service
###################################################################
Expand All @@ -30,8 +42,8 @@
process.load("Configuration.StandardSequences.Services_cff")

if 'phase2' in options.globalTag:
process.load("Configuration.Geometry.GeometryExtended2026D92_cff")
process.load("Configuration.Geometry.GeometryExtended2026D92Reco_cff")
process.load("Configuration.Geometry.GeometryExtended2026Default_cff")
process.load("Configuration.Geometry.GeometryExtended2026DefaultReco_cff")
else:
process.load("Configuration.StandardSequences.GeometryRecoDB_cff")

Expand Down
2 changes: 1 addition & 1 deletion Geometry/TrackerGeometryBuilder/test/runTest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ do
done

cmsRun ${SCRAM_TEST_PATH}/python/testPixelTopologyMapTest_cfg.py runNumber=300000 || die "Failure using cmsRun testPixelTopologyMapTest_cfg.py runNumber=300000" $?
cmsRun ${SCRAM_TEST_PATH}/python/testPixelTopologyMapTest_cfg.py globalTag=auto:phase2_realistic_T21 || die "Failure using cmsRun testPixelTopologyMapTest_cfg.py globalTag=auto:phase2_realistic_T21" $?
cmsRun ${SCRAM_TEST_PATH}/python/testPixelTopologyMapTest_cfg.py globalTag=auto:phase2_realistic_T33 || die "Failure using cmsRun testPixelTopologyMapTest_cfg.py globalTag=auto:phase2_realistic_T33" $?

FILE1=trackerParametersDD4hep.log
FILE2=trackerParametersDDD.log
Expand Down
13 changes: 9 additions & 4 deletions RecoTracker/MkFit/test/dumpMkFitGeometryPhase2.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
import FWCore.ParameterSet.Config as cms

from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
# from Configuration.ProcessModifiers.trackingMkFit_cff import trackingMkFit
from Configuration.ProcessModifiers.trackingMkFitCommon_cff import trackingMkFitCommon
trackingMkFit = cms.ModifierChain(trackingMkFitCommon)

process = cms.Process('DUMP',Phase2C17I13M9,trackingMkFit)
###################################################################
# Set default phase-2 settings
###################################################################
import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings
_PH2_GLOBAL_TAG, _PH2_ERA = _settings.get_era_and_conditions(_settings.DEFAULT_VERSION)

process = cms.Process('DUMP', _PH2_ERA, trackingMkFit)

# import of standard configurations
process.load('Configuration.StandardSequences.Services_cff')
process.load('FWCore.MessageService.MessageLogger_cfi')
process.load('Configuration.Geometry.GeometryExtended2026D88Reco_cff')
process.load('Configuration.Geometry.GeometryExtended2026DefaultReco_cff')
process.load('Configuration.StandardSequences.MagneticField_cff')
process.load('Configuration.StandardSequences.Reconstruction_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, _PH2_GLOBAL_TAG, '')

process.MessageLogger.cerr.threshold = "INFO"
process.MessageLogger.cerr.MkFitGeometryESProducer = dict(limit=-1)
Expand Down
Loading

0 comments on commit 611881f

Please sign in to comment.