CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1CondDBSource_cff.py
Go to the documentation of this file.
1 def initCondDBSource( process,
2  inputDBConnect = 'frontier://FrontierProd/CMS_COND_31X_L1T',
3  inputDBAuth = '.',
4  tagBaseVec = [],
5  includeAllTags = False,
6  includeRSTags = False,
7  use30XTagList = False,
8  applyESPrefer = True ):
9  import FWCore.ParameterSet.Config as cms
10  from CondCore.DBCommon.CondDBSetup_cfi import CondDBSetup
11  from CondTools.L1Trigger.L1CondEnum_cfi import L1CondEnum
12 
13  if len( tagBaseVec ) == 0:
14  from CondTools.L1Trigger.L1O2OTags_cfi import initL1O2OTags
16  tagBaseVec = initL1O2OTags.tagBaseVec
17 
18  process.l1conddb = cms.ESSource("PoolDBESSource",
19  CondDBSetup,
20  connect = cms.string(inputDBConnect),
21  toGet = cms.VPSet(cms.PSet(
22  record = cms.string('L1TriggerKeyListRcd'),
23  tag = cms.string('L1TriggerKeyList_' + tagBaseVec[ L1CondEnum.L1TriggerKeyList ])
24  ),
25  cms.PSet(
26  record = cms.string('L1TriggerKeyRcd'),
27  tag = cms.string('L1TriggerKey_' + tagBaseVec[ L1CondEnum.L1TriggerKey ])
28  ))
29  )
30  process.l1conddb.DBParameters.authenticationPath = inputDBAuth
31 
32  # The more records, the longer it takes PoolDBESSource to initialize, so be
33  # selective if possible.
34 
35  if includeAllTags == True:
36  if use30XTagList == True:
37  from CondTools.L1Trigger.L1SubsystemParams30X_cfi import initL1Subsystems
38  else:
39  from CondTools.L1Trigger.L1SubsystemParams_cfi import initL1Subsystems
40  initL1Subsystems( tagBaseVec = tagBaseVec )
41  process.l1conddb.toGet.extend(initL1Subsystems.params.recordInfo)
42  elif includeRSTags == True:
43  from CondTools.L1Trigger.L1RSSubsystemParams_cfi import initL1RSSubsystems
44  initL1RSSubsystems( tagBaseVec = tagBaseVec )
45  process.l1conddb.toGet.extend(initL1RSSubsystems.params.recordInfo)
46 
47  if applyESPrefer == True:
48  process.es_prefer_l1conddb = cms.ESPrefer("PoolDBESSource","l1conddb")