Go to the documentation of this file.00001 import FWCore.ParameterSet.Config as cms
00002
00003 def addPoolDBESSource(process,moduleName,record,tag,label='',connect='sqlite_file:'):
00004 from CondCore.DBCommon.CondDBSetup_cfi import CondDBSetup
00005 calibDB = cms.ESSource("PoolDBESSource",
00006 CondDBSetup,
00007 timetype = cms.string('runnumber'),
00008 toGet = cms.VPSet(cms.PSet(
00009 record = cms.string(record),
00010 tag = cms.string(tag),
00011 label = cms.untracked.string(label)
00012 )),
00013 connect = cms.string(connect),
00014 authenticationMethod = cms.untracked.uint32(0))
00015
00016 if connect.find('oracle:') != -1: calibDB.DBParameters.authenticationPath = '/afs/cern.ch/cms/DB/conddb'
00017 setattr(process,moduleName,calibDB)
00018 setattr(process,"es_prefer_" + moduleName,cms.ESPrefer('PoolDBESSource',moduleName))