CMS 3D CMS Logo

L1CondDBSourceExt_cff.py
Go to the documentation of this file.
1 # Default behavior: deliver current L1-O2O tags from Frontier.
2 
3 # IF tagBaseVec is empty then
4 # IF tagBaseVec is given, use uniform tags with the given tagBase
5 # ELSE use current L1-O2O tags
6 
7 # If tagBase AND tagBaseVec are both given, then tagBaseVec trumps tagBase.
8 
9 def initCondDBSourceExt( process,
10  inputDBConnect = 'frontier://FrontierProd/CMS_CONDITIONS',
11  inputDBAuth = '.',
12  tagBase = "",
13  tagBaseVec = [],
14  includeAllTags = False,
15  includeRSTags = False,
16  applyESPrefer = True ):
17  import FWCore.ParameterSet.Config as cms
18  from CondTools.L1TriggerExt.L1CondEnumExt_cfi import L1CondEnumExt
19 
20  if len( tagBaseVec ) == 0:
21  if len( tagBase ) != 0:
22  from CondTools.L1TriggerExt.L1UniformTagsExt_cfi import initL1UniformTagsExt
23  initL1UniformTagsExt( tagBase )
24  tagBaseVec = initL1UniformTagsExt.tagBaseVec
25  else:
26  from CondTools.L1TriggerExt.L1O2OTagsExt_cfi import initL1O2OTagsExt
28  tagBaseVec = initL1O2OTagsExt.tagBaseVec
29 
30  from CondCore.CondDB.CondDB_cfi import CondDB
31  CondDB.connect = cms.string(inputDBConnect)
32 
33  process.l1conddb = cms.ESSource("PoolDBESSource",
34  CondDB,
35  toGet = cms.VPSet(cms.PSet(
36  record = cms.string('L1TriggerKeyListExtRcd'),
37  tag = cms.string('L1TriggerKeyListExt_' + tagBaseVec[ L1CondEnumExt.L1TriggerKeyListExt ])
38  ),
39  cms.PSet(
40  record = cms.string('L1TriggerKeyExtRcd'),
41  tag = cms.string('L1TriggerKeyExt_' + tagBaseVec[ L1CondEnumExt.L1TriggerKeyExt ])
42  ))
43  )
44  process.l1conddb.DBParameters.authenticationPath = inputDBAuth
45 
46  # The more records, the longer it takes PoolDBESSource to initialize, so be
47  # selective if possible.
48 
49  if includeAllTags == True:
50  from CondTools.L1TriggerExt.L1SubsystemParamsExt_cfi import initL1SubsystemsExt
51  initL1SubsystemsExt( tagBaseVec = tagBaseVec )
52  process.l1conddb.toGet.extend(initL1SubsystemsExt.params.recordInfo)
53  elif includeRSTags == True:
54  from CondTools.L1TriggerExt.L1RSSubsystemParamsExt_cfi import initL1RSSubsystemsExt
55  initL1RSSubsystemsExt( tagBaseVec = tagBaseVec )
56  process.l1conddb.toGet.extend(initL1RSSubsystemsExt.params.recordInfo)
57 
58  if applyESPrefer == True:
59  process.es_prefer_l1conddb = cms.ESPrefer("PoolDBESSource","l1conddb")
def initL1SubsystemsExt(tagBaseVec=[], objectKey='dummy')
def initL1UniformTagsExt(tagBase="IDEAL")
def initCondDBSourceExt(process, inputDBConnect='frontier://FrontierProd/CMS_CONDITIONS', inputDBAuth='.', tagBase="", tagBaseVec=[], includeAllTags=False, includeRSTags=False, applyESPrefer=True)