Back to home page

Project CMSSW displayed by LXR

 
 

    


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

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 initCondDBSource( process,
0010                       inputDBConnect = 'frontier://FrontierProd/CMS_COND_31X_L1T',
0011                       inputDBAuth = '.',
0012                       tagBase = "",
0013                       tagBaseVec = [],
0014                       includeAllTags = False,
0015                       includeRSTags = False,
0016                       use30XTagList = False,
0017                       applyESPrefer = True ):
0018     import FWCore.ParameterSet.Config as cms
0019     from CondCore.DBCommon.CondDBSetup_cfi import CondDBSetup
0020     from CondTools.L1Trigger.L1CondEnum_cfi import L1CondEnum
0021 
0022     if len( tagBaseVec ) == 0:
0023         if len( tagBase ) != 0:
0024             from CondTools.L1Trigger.L1UniformTags_cfi import initL1UniformTags
0025             initL1UniformTags( tagBase )
0026             tagBaseVec = initL1UniformTags.tagBaseVec
0027         else:
0028             from CondTools.L1Trigger.L1O2OTags_cfi import initL1O2OTags
0029             initL1O2OTags()
0030             tagBaseVec = initL1O2OTags.tagBaseVec
0031                                 
0032     process.l1conddb = cms.ESSource("PoolDBESSource",
0033                             CondDBSetup,
0034                             connect = cms.string(inputDBConnect),
0035                             toGet = cms.VPSet(cms.PSet(
0036         record = cms.string('L1TriggerKeyListRcd'),
0037         tag = cms.string('L1TriggerKeyList_' + tagBaseVec[ L1CondEnum.L1TriggerKeyList ])
0038         ),
0039                                               cms.PSet(
0040         record = cms.string('L1TriggerKeyRcd'),
0041         tag = cms.string('L1TriggerKey_' + tagBaseVec[ L1CondEnum.L1TriggerKey ])
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         if use30XTagList == True:
0051             from CondTools.L1Trigger.L1SubsystemParams30X_cfi import initL1Subsystems
0052         else:
0053             from CondTools.L1Trigger.L1SubsystemParams_cfi import initL1Subsystems
0054         initL1Subsystems( tagBaseVec = tagBaseVec )
0055         process.l1conddb.toGet.extend(initL1Subsystems.params.recordInfo)
0056     elif includeRSTags == True:
0057         from CondTools.L1Trigger.L1RSSubsystemParams_cfi import initL1RSSubsystems
0058         initL1RSSubsystems( tagBaseVec = tagBaseVec )
0059         process.l1conddb.toGet.extend(initL1RSSubsystems.params.recordInfo)
0060 
0061     if applyESPrefer == True:
0062         process.es_prefer_l1conddb = cms.ESPrefer("PoolDBESSource","l1conddb")