process.CondDB.connect = 'sqlite_file:EcalPedestals_mc2016_corrected.db' process.MessageLogger = cms.Service("MessageLogger", debugModules = cms.untracked.vstring('*'), destinations = cms.untracked.vstring('cout') ) process.source = cms.Source("EmptyIOVSource", firstValue = cms.uint64(1), lastValue = cms.uint64(1), timetype = cms.string('runnumber'), interval = cms.uint64(1) ) db_reader_account = 'CMS_ECAL_R' db_service,db_user,db_pwd = auth.get_db_credentials( db_reader_account ) process.PoolDBOutputService = cms.Service("PoolDBOutputService", process.CondDB, logconnect = cms.untracked.string('sqlite_file:DBLog.db'), timetype = cms.untracked.string('runnumber'), toPut = cms.VPSet( cms.PSet( record = cms.string('EcalPedestalsRcd'), tag = cms.string('EcalPedestals_MC') ) ) ) process.Test1 = cms.EDAnalyzer("ExTestEcalPedestalsAnalyzer", SinceAppendMode = cms.bool(True),
# Script to extract the gain used by ES providing the TAG of the run key. # I needs in this order: # - the tag name __author__ = 'Giacomo Cucciati' import sys import cx_Oracle import CondTools.Ecal.db_credentials as auth db_target_account = 'CMS_ES_CONF' db_service,db_user,db_pwd = auth.get_db_credentials( db_target_account ) conn_str = u'%s/%s@%s' %(db_user,db_pwd,db_service) def main(argv): if len(argv) !=2: print("Wrong number of parameters") return runKey_tag = argv[1] conn = cx_Oracle.connect(conn_str) conn.current_schema = db_target_account c = conn.cursor() sql_query = "select max(version) from ES_RUN_CONFIGURATION_DAT where tag='" sql_query += runKey_tag + "'" c.execute(sql_query) print_row = [] for row in c: print_row.append(str(row[0]))