CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
addPoolDBESSource.py
Go to the documentation of this file.
2 
3 def addPoolDBESSource(process,moduleName,record,tag,label='',connect='sqlite_file:'):
4  from CondCore.DBCommon.CondDBSetup_cfi import CondDBSetup
5  calibDB = cms.ESSource("PoolDBESSource",
6  CondDBSetup,
7  timetype = cms.string('runnumber'),
8  toGet = cms.VPSet(cms.PSet(
9  record = cms.string(record),
10  tag = cms.string(tag),
11  label = cms.untracked.string(label)
12  )),
13  connect = cms.string(connect),
14  authenticationMethod = cms.untracked.uint32(0))
15  #if authPath: calibDB.DBParameters.authenticationPath = authPath
16  if connect.find('oracle:') != -1: calibDB.DBParameters.authenticationPath = '/afs/cern.ch/cms/DB/conddb'
17  setattr(process,moduleName,calibDB)
18  setattr(process,"es_prefer_" + moduleName,cms.ESPrefer('PoolDBESSource',moduleName))