1 import FWCore.ParameterSet.Config
as cms
2 import FWCore.ParameterSet.VarParsing
as VarParsing
6 options.register(
'targetFile',
8 VarParsing.VarParsing.multiplicity.singleton,
9 VarParsing.VarParsing.varType.string,
10 "the target sqlite file name")
11 options.register(
'destinationDatabase',
13 VarParsing.VarParsing.multiplicity.singleton,
14 VarParsing.VarParsing.varType.string,
15 "the destination database connection string")
16 options.register(
'destinationTag',
18 VarParsing.VarParsing.multiplicity.singleton,
19 VarParsing.VarParsing.varType.string,
20 "the destination tag name")
21 options.parseArguments()
25 psetForOutRec.append( cms.PSet( record = cms.string(
str( recordName )),
26 tag = cms.string(
str( options.destinationTag )),
27 timetype = cms.untracked.string(
str(tagTimeType))
31 sqliteConnect =
'sqlite:%s' %options.targetFile
32 process = cms.Process(
"PopCon")
33 process.load(
"CondCore.CondDB.CondDB_cfi")
34 process.CondDB.DBParameters.messageLevel = cms.untracked.int32( 3 )
36 process.PoolDBOutputService = cms.Service(
"PoolDBOutputService",
37 DBParameters = cms.PSet( messageLevel = cms.untracked.int32( 3 ),
39 connect = cms.string( sqliteConnect ),
40 toPut = cms.VPSet( psetForOutRec )
43 process.source = cms.Source(
"EmptyIOVSource",
44 timetype = cms.string(
'runnumber'),
45 firstValue = cms.uint64(1),
46 lastValue = cms.uint64(1),
47 interval = cms.uint64(1)
53 psetForRec.append( cms.PSet( record = cms.string(
str(recordName)),
54 tag = cms.string(
str( options.destinationTag ))
def psetForRecord(recordName)
def setup_popcon(recordName, tagTimeType)