Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:29:07

0001 import FWCore.ParameterSet.Config as cms
0002 from FWCore.ParameterSet.MassReplace import massReplaceInputTag as MassReplaceInputTag
0003 #
0004 # mass replace OfflinePrimaryVertices with OfflinePrimaryVerticesWithBS 
0005 # (doesn't affect defaults in the source code, e.g. provided by fillDescriptions)
0006 #
0007 def massReplaceOfflinePrimaryVerticesToUseBeamSpot(process):
0008     # swap all occurrences
0009     process = MassReplaceInputTag(process,"offlinePrimaryVertices","offlinePrimaryVerticesWithBS")
0010     
0011     # excepted of course for the primary source...
0012     if hasattr(process,'offlinePrimaryVerticesWithBS'):
0013         process.offlinePrimaryVerticesWithBS.src = cms.InputTag("offlinePrimaryVertices","WithBS")
0014         
0015     return process
0016 
0017 #
0018 # makes OfflinePrimaryVertices equivalent to OfflinePrimaryVerticesWithBS
0019 # by changing the input vertices collection of the sorted PV
0020 # see file https://github.com/cms-sw/cmssw/blob/master/RecoVertex/Configuration/python/RecoVertex_cff.py
0021 # 
0022 def swapOfflinePrimaryVerticesToUseBeamSpot(process):
0023     if hasattr(process,'offlinePrimaryVertices'):
0024         process.offlinePrimaryVertices.vertices="unsortedOfflinePrimaryVertices:WithBS"
0025 
0026     return process