Skip to content

Commit

Permalink
add beamspot checks to several test configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
mmusich committed Jan 3, 2025
1 parent ac94068 commit 1580c96
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 19 deletions.
17 changes: 14 additions & 3 deletions Alignment/OfflineValidation/test/PVValidation_TEMPL_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,22 @@ def customiseKinksAndBows(process):
process.filterOutLowPt.ptmin = PTCUTTEMPLATE
process.filterOutLowPt.runControl = RUNCONTROLTEMPLATE
process.filterOutLowPt.runControlNumber = [runboundary]


###################################################################
# Beamspot compatibility check
###################################################################
from RecoVertex.BeamSpotProducer.beamSpotCompatibilityChecker_cfi import beamSpotCompatibilityChecker
process.BeamSpotChecker = beamSpotCompatibilityChecker.clone(
bsFromEvent = cms.InputTag("offlineBeamSpot::RECO"), # source of the event beamspot (in the ALCARECO files)
bsFromDB = cms.InputTag("offlineBeamSpot"), # source of the DB beamspot (from Global Tag) NOTE: only if dbFromEvent is True!
warningThr = 3, # significance threshold to emit a warning message
errorThr = 5, # significance threshold to abort the job
)

if isMC:
process.goodvertexSkim = cms.Sequence(process.noscraping + process.filterOutLowPt)
process.goodvertexSkim = cms.Sequence(process.BeamSpotChecker + process.noscraping + process.filterOutLowPt)
else:
process.goodvertexSkim = cms.Sequence(process.primaryVertexFilter + process.noscraping + process.filterOutLowPt)
process.goodvertexSkim = cms.Sequence(process.BeamSpotChecker + process.primaryVertexFilter + process.noscraping + process.filterOutLowPt)

####################################################################
# Load and Configure Measurement Tracker Event
Expand Down
15 changes: 13 additions & 2 deletions Alignment/OfflineValidation/test/PVValidation_T_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,21 @@ def customiseKinksAndBows(process):
process.filterOutLowPt.runControl = RUNCONTROLTEMPLATE
process.filterOutLowPt.runControlNumber = [runboundary]

####################################################################
# BeamSpot check
####################################################################
from RecoVertex.BeamSpotProducer.beamSpotCompatibilityChecker_cfi import beamSpotCompatibilityChecker
process.BeamSpotChecker = beamSpotCompatibilityChecker.clone(
bsFromEvent = "offlineBeamSpot::RECO", # source of the event beamspot (in the ALCARECO files)
bsFromDB = "offlineBeamSpot", # source of the DB beamspot (from Global Tag) NOTE: only if dbFromEvent is True!
warningThr = 3, # significance threshold to emit a warning message
errorThr = 5, # significance threshold to abort the job
)

if isMC:
process.goodvertexSkim = cms.Sequence(process.noscraping+process.filterOutLowPt)
process.goodvertexSkim = cms.Sequence(process.BeamSpotChecker + process.noscraping+process.filterOutLowPt)
else:
process.goodvertexSkim = cms.Sequence(process.primaryVertexFilter + process.noscraping + process.filterOutLowPt)
process.goodvertexSkim = cms.Sequence(process.BeamSpotChecker + process.primaryVertexFilter + process.noscraping + process.filterOutLowPt)

####################################################################
# Load and Configure Measurement Tracker Event
Expand Down
20 changes: 18 additions & 2 deletions Alignment/OfflineValidation/test/PrimaryVertexResolution_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,17 +188,33 @@ def best_match(rcd):
nVtxBins = cms.untracked.double(40.)
)

###################################################################
# TFileService
###################################################################
process.TFileService = cms.Service("TFileService",
fileName = cms.string(options.outputRootFile),
closeFileFast = cms.untracked.bool(False)
)

###################################################################
# Beamspot compatibility check
###################################################################
from RecoVertex.BeamSpotProducer.beamSpotCompatibilityChecker_cfi import beamSpotCompatibilityChecker
process.BeamSpotChecker = beamSpotCompatibilityChecker.clone(
bsFromEvent = cms.InputTag("offlineBeamSpot::RECO"), # source of the event beamspot (in the ALCARECO files)
bsFromDB = cms.InputTag("offlineBeamSpot"), # source of the DB beamspot (from Global Tag) NOTE: only if dbFromEvent is True!
warningThr = 3, # significance threshold to emit a warning message
errorThr = 5 # significance threshold to abort the job
)

###################################################################
# Path
###################################################################
process.p = cms.Path(process.HLTFilter +
#process.offlineBeamSpot +
#process.TrackRefitter +
process.BeamSpotChecker +
process.seqTrackselRefit +
process.offlinePrimaryVerticesFromRefittedTrks +
process.PrimaryVertexResolution +
process.myanalysis)


Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,31 @@ def best_match(rcd):
nVtxBins = cms.untracked.double(40.)
)

###################################################################
# TFileService
###################################################################
process.TFileService = cms.Service("TFileService",
fileName = cms.string(options.outputRootFile),
closeFileFast = cms.untracked.bool(False)
)

process.p = cms.Path(process.seqTrackselRefit +
###################################################################
# Beamspot compatibility check
###################################################################
from RecoVertex.BeamSpotProducer.beamSpotCompatibilityChecker_cfi import beamSpotCompatibilityChecker
process.BeamSpotChecker = beamSpotCompatibilityChecker.clone(
bsFromEvent = cms.InputTag("offlineBeamSpot::RECO"), # source of the event beamspot (in the ALCARECO files)
bsFromDB = cms.InputTag("offlineBeamSpot"), # source of the DB beamspot (from Global Tag) NOTE: only if dbFromEvent is True!
warningThr = 3, # significance threshold to emit a warning message
errorThr = 5 # significance threshold to abort the job
)

###################################################################
# Path
###################################################################
process.p = cms.Path(process.BeamSpotChecker +
process.seqTrackselRefit +
#process.offlineBeamSpot +
#process.TrackRefitter +
process.offlinePrimaryVerticesFromRefittedTrks +
process.PrimaryVertexResolution)


Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ class RefitType(Enum):
###################################################################
# 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)
if(options.isPhase2):
import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings
_PH2_GLOBAL_TAG, _PH2_ERA = _settings.get_era_and_conditions(_settings.DEFAULT_VERSION)

###################################################################
# Set the era
Expand Down Expand Up @@ -123,7 +124,7 @@ class RefitType(Enum):
####################################################################
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
from Configuration.AlCa.GlobalTag import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, (_PH2_GLOBAL_TAG if options.isPhase2 else 'auto:phase1_2022_realistic'), '')
process.GlobalTag = GlobalTag(process.GlobalTag, (_PH2_GLOBAL_TAG if options.isPhase2 else '125X_mcRun3_2022_realistic_v3'), '')

if _allFromGT:
print("############ testPVValidation_cfg.py: msg%-i: All is taken from GT")
Expand Down Expand Up @@ -214,10 +215,21 @@ class RefitType(Enum):
runControlNumber = cms.untracked.vuint32(int(runboundary))
)

####################################################################
# BeamSpot check
####################################################################
from RecoVertex.BeamSpotProducer.beamSpotCompatibilityChecker_cfi import beamSpotCompatibilityChecker
process.BeamSpotChecker = beamSpotCompatibilityChecker.clone(
bsFromEvent = "offlineBeamSpot::RECO", # source of the event beamspot (in the ALCARECO files)
bsFromDB = "offlineBeamSpot", # source of the DB beamspot (from Global Tag) NOTE: only if dbFromEvent is True!
warningThr = 5, # significance threshold to emit a warning message
errorThr = 10, # significance threshold to abort the job
)

if _isMC:
process.goodvertexSkim = cms.Sequence(process.noscraping)
process.goodvertexSkim = cms.Sequence(process.BeamSpotChecker + process.noscraping)
else:
process.goodvertexSkim = cms.Sequence(process.primaryVertexFilter + process.noscraping + process.noslowpt)
process.goodvertexSkim = cms.Sequence(process.BeamSpotChecker + process.primaryVertexFilter + process.noscraping + process.noslowpt)


if(_theRefitter == RefitType.COMMON):
Expand Down
15 changes: 13 additions & 2 deletions Alignment/OfflineValidation/test/test_all_Phase2_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,21 @@ class RefitType(Enum):
runControlNumber = cms.untracked.vuint32(int(runboundary))
)

####################################################################
# BeamSpot check
####################################################################
from RecoVertex.BeamSpotProducer.beamSpotCompatibilityChecker_cfi import beamSpotCompatibilityChecker
process.BeamSpotChecker = beamSpotCompatibilityChecker.clone(
bsFromEvent = "offlineBeamSpot::RECO", # source of the event beamspot (in the ALCARECO files)
bsFromDB = "offlineBeamSpot", # source of the DB beamspot (from Global Tag) NOTE: only if dbFromEvent is True!
warningThr = 3, # significance threshold to emit a warning message
errorThr = 5, # significance threshold to abort the job
)

if isMC:
process.goodvertexSkim = cms.Sequence(process.noscraping)
process.goodvertexSkim = cms.Sequence(process.BeamSpotChecker + process.noscraping)
else:
process.goodvertexSkim = cms.Sequence(process.primaryVertexFilter + process.noscraping + process.noslowpt)
process.goodvertexSkim = cms.Sequence(process.BeamSpotChecker + process.primaryVertexFilter + process.noscraping + process.noslowpt)


if(theRefitter == RefitType.COMMON):
Expand Down
15 changes: 13 additions & 2 deletions Alignment/OfflineValidation/test/test_all_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,21 @@ class RefitType(Enum):
runControlNumber = cms.untracked.vuint32(int(runboundary))
)

####################################################################
# BeamSpot check
####################################################################
from RecoVertex.BeamSpotProducer.beamSpotCompatibilityChecker_cfi import beamSpotCompatibilityChecker
process.BeamSpotChecker = beamSpotCompatibilityChecker.clone(
bsFromEvent = "offlineBeamSpot::RECO", # source of the event beamspot (in the ALCARECO files)
bsFromDB = "offlineBeamSpot", # source of the DB beamspot (from Global Tag) NOTE: only if dbFromEvent is True!
warningThr = 3, # significance threshold to emit a warning message
errorThr = 5, # significance threshold to abort the job
)

if isMC:
process.goodvertexSkim = cms.Sequence(process.noscraping)
process.goodvertexSkim = cms.Sequence(process.BeamSpotChecker + process.noscraping)
else:
process.goodvertexSkim = cms.Sequence(process.primaryVertexFilter + process.noscraping + process.noslowpt)
process.goodvertexSkim = cms.Sequence(process.BeamSpotChecker + process.primaryVertexFilter + process.noscraping + process.noslowpt)


if(theRefitter == RefitType.COMMON):
Expand Down

0 comments on commit 1580c96

Please sign in to comment.