2 import FWCore.ParameterSet.Config
as cms
3 import FWCore.ParameterSet.VarParsing
as VarParsing
4 process = cms.Process(
"BeamSpotOnlineStartRun")
8 options.register(
'destinationConnection' 9 ,
'sqlite_file:beamspot_test.db' 10 , VarParsing.VarParsing.multiplicity.singleton
11 , VarParsing.VarParsing.varType.string
12 ,
"Connection string to the DB where payloads will be possibly written." 14 options.register(
'targetConnection' 16 , VarParsing.VarParsing.multiplicity.singleton
17 , VarParsing.VarParsing.varType.string
18 ,
"""Connection string to the target DB: 19 if not empty (default), this provides the latest IOV and payloads to compare; 20 it is the DB where payloads should be finally uploaded.""" 22 options.register(
'tag' 24 , VarParsing.VarParsing.multiplicity.singleton
25 , VarParsing.VarParsing.varType.string
26 ,
"Tag written in destinationConnection and finally appended in targetConnection." 28 options.register(
'sourceTag' 30 , VarParsing.VarParsing.multiplicity.singleton
31 , VarParsing.VarParsing.varType.string
32 ,
"Tag used to retrieve the source payload from the targetConnection." 34 options.register(
'runNumber' 36 , VarParsing.VarParsing.multiplicity.singleton
37 , VarParsing.VarParsing.varType.int
38 ,
"Run number for the target since." 40 options.register(
'messageLevel' 42 , VarParsing.VarParsing.multiplicity.singleton
43 , VarParsing.VarParsing.varType.int
44 ,
"Message level; default to 0" 46 options.parseArguments()
48 CondDBConnection = CondDB.clone( connect = cms.string( options.destinationConnection ) )
49 CondDBConnection.DBParameters.messageLevel = cms.untracked.int32( options.messageLevel )
51 process.MessageLogger = cms.Service(
"MessageLogger",
52 cout = cms.untracked.PSet(threshold = cms.untracked.string(
'INFO')),
53 destinations = cms.untracked.vstring(
'cout')
56 process.source = cms.Source(
"EmptyIOVSource",
57 lastValue = cms.uint64(1),
58 timetype = cms.string(
'runnumber'),
59 firstValue = cms.uint64(1),
60 interval = cms.uint64(1)
63 process.PoolDBOutputService = cms.Service(
"PoolDBOutputService",
65 timetype = cms.untracked.string(
'lumiid'),
66 toPut = cms.VPSet(cms.PSet(record = cms.string(
'BeamSpotRcd'),
67 tag = cms.string( options.tag )
72 process.PopCon = cms.EDAnalyzer(
"BeamSpotOnlinePopConAnalyzer",
73 SinceAppendMode = cms.bool(
True),
74 record = cms.string(
'BeamSpotRcd'),
75 name = cms.untracked.string(
'BeamSpotOnline'),
77 runNumber = cms.untracked.uint32( options.runNumber ),
78 sourcePayloadTag = cms.untracked.string( options.sourceTag ),
80 maxAge = cms.untracked.uint32( 86400 ),
81 debug=cms.untracked.bool(
False)
83 loggingOn = cms.untracked.bool(
True),
84 IsDestDbCheckedInQueryLog = cms.untracked.bool(
False)
87 process.p = cms.Path(process.PopCon)