Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:52:19

0001 # Default behavior: deliver current L1-O2O tags from Frontier.
0002 
0003 # IF tagBaseVec is empty then
0004 #    IF tagBaseVec is given, use uniform tags with the given tagBase
0005 #    ELSE use current L1-O2O tags
0006 
0007 # If tagBase AND tagBaseVec are both given, then tagBaseVec trumps tagBase.
0008 
0009 def initCondDBSourceExt( process,
0010                       inputDBConnect = 'frontier://FrontierProd/CMS_CONDITIONS',
0011                       inputDBAuth = '.',
0012                       tagBase = "",
0013                       tagBaseVec = [],
0014                       includeAllTags = False,
0015                       includeRSTags = False,
0016                       applyESPrefer = True ):
0017     import FWCore.ParameterSet.Config as cms
0018     from CondTools.L1TriggerExt.L1CondEnumExt_cfi import L1CondEnumExt
0019 
0020     if len( tagBaseVec ) == 0:
0021         if len( tagBase ) != 0:
0022             from CondTools.L1TriggerExt.L1UniformTagsExt_cfi import initL1UniformTagsExt
0023             initL1UniformTagsExt( tagBase )
0024             tagBaseVec = initL1UniformTagsExt.tagBaseVec
0025         else:
0026             from CondTools.L1TriggerExt.L1O2OTagsExt_cfi import initL1O2OTagsExt
0027             initL1O2OTagsExt()
0028             tagBaseVec = initL1O2OTagsExt.tagBaseVec
0029 
0030     from CondCore.CondDB.CondDB_cfi import CondDB
0031     CondDB.connect = cms.string(inputDBConnect)
0032 
0033     process.l1conddb = cms.ESSource("PoolDBESSource",
0034                             CondDB,
0035                             toGet = cms.VPSet(cms.PSet(
0036         record = cms.string('L1TriggerKeyListExtRcd'),
0037         tag = cms.string('L1TriggerKeyListExt_' + tagBaseVec[ L1CondEnumExt.L1TriggerKeyListExt ])
0038         ),
0039                                               cms.PSet(
0040         record = cms.string('L1TriggerKeyExtRcd'),
0041         tag = cms.string('L1TriggerKeyExt_' + tagBaseVec[ L1CondEnumExt.L1TriggerKeyExt ])
0042         ))
0043                                     )
0044     process.l1conddb.DBParameters.authenticationPath = inputDBAuth
0045 
0046     # The more records, the longer it takes PoolDBESSource to initialize, so be
0047     # selective if possible.
0048 
0049     if includeAllTags == True:
0050         from CondTools.L1TriggerExt.L1SubsystemParamsExt_cfi import initL1SubsystemsExt
0051         initL1SubsystemsExt( tagBaseVec = tagBaseVec )
0052         process.l1conddb.toGet.extend(initL1SubsystemsExt.params.recordInfo)
0053     elif includeRSTags == True:
0054         from CondTools.L1TriggerExt.L1RSSubsystemParamsExt_cfi import initL1RSSubsystemsExt
0055         initL1RSSubsystemsExt( tagBaseVec = tagBaseVec )
0056         process.l1conddb.toGet.extend(initL1RSSubsystemsExt.params.recordInfo)
0057 
0058     if applyESPrefer == True:
0059         process.es_prefer_l1conddb = cms.ESPrefer("PoolDBESSource","l1conddb")