CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/CondTools/L1Trigger/python/L1CondDBSource_cff.py

Go to the documentation of this file.
00001 # Default behavior: deliver current L1-O2O tags from Frontier.
00002 
00003 # IF tagBaseVec is empty then
00004 #    IF tagBaseVec is given, use uniform tags with the given tagBase
00005 #    ELSE use current L1-O2O tags
00006 
00007 # If tagBase AND tagBaseVec are both given, then tagBaseVec trumps tagBase.
00008 
00009 def initCondDBSource( process,
00010                       inputDBConnect = 'frontier://FrontierProd/CMS_COND_31X_L1T',
00011                       inputDBAuth = '.',
00012                       tagBase = "",
00013                       tagBaseVec = [],
00014                       includeAllTags = False,
00015                       includeRSTags = False,
00016                       use30XTagList = False,
00017                       applyESPrefer = True ):
00018     import FWCore.ParameterSet.Config as cms
00019     from CondCore.DBCommon.CondDBSetup_cfi import CondDBSetup
00020     from CondTools.L1Trigger.L1CondEnum_cfi import L1CondEnum
00021 
00022     if len( tagBaseVec ) == 0:
00023         if len( tagBase ) != 0:
00024             from CondTools.L1Trigger.L1UniformTags_cfi import initL1UniformTags
00025             initL1UniformTags( tagBase )
00026             tagBaseVec = initL1UniformTags.tagBaseVec
00027         else:
00028             from CondTools.L1Trigger.L1O2OTags_cfi import initL1O2OTags
00029             initL1O2OTags()
00030             tagBaseVec = initL1O2OTags.tagBaseVec
00031                                 
00032     process.l1conddb = cms.ESSource("PoolDBESSource",
00033                             CondDBSetup,
00034                             connect = cms.string(inputDBConnect),
00035                             toGet = cms.VPSet(cms.PSet(
00036         record = cms.string('L1TriggerKeyListRcd'),
00037         tag = cms.string('L1TriggerKeyList_' + tagBaseVec[ L1CondEnum.L1TriggerKeyList ])
00038         ),
00039                                               cms.PSet(
00040         record = cms.string('L1TriggerKeyRcd'),
00041         tag = cms.string('L1TriggerKey_' + tagBaseVec[ L1CondEnum.L1TriggerKey ])
00042         ))
00043                                     )
00044     process.l1conddb.DBParameters.authenticationPath = inputDBAuth
00045 
00046     # The more records, the longer it takes PoolDBESSource to initialize, so be
00047     # selective if possible.
00048 
00049     if includeAllTags == True:
00050         if use30XTagList == True:
00051             from CondTools.L1Trigger.L1SubsystemParams30X_cfi import initL1Subsystems
00052         else:
00053             from CondTools.L1Trigger.L1SubsystemParams_cfi import initL1Subsystems
00054         initL1Subsystems( tagBaseVec = tagBaseVec )
00055         process.l1conddb.toGet.extend(initL1Subsystems.params.recordInfo)
00056     elif includeRSTags == True:
00057         from CondTools.L1Trigger.L1RSSubsystemParams_cfi import initL1RSSubsystems
00058         initL1RSSubsystems( tagBaseVec = tagBaseVec )
00059         process.l1conddb.toGet.extend(initL1RSSubsystems.params.recordInfo)
00060 
00061     if applyESPrefer == True:
00062         process.es_prefer_l1conddb = cms.ESPrefer("PoolDBESSource","l1conddb")