CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
popcon2dropbox_job_conf.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 import FWCore.ParameterSet.VarParsing as VarParsing
3 import popcon2dropbox
4 
5 options = VarParsing.VarParsing()
6 options.register('targetFile',
7  'popcon.db',
8  VarParsing.VarParsing.multiplicity.singleton,
9  VarParsing.VarParsing.varType.string,
10  "the target sqlite file name")
11 options.register('destinationDatabase',
12  '',
13  VarParsing.VarParsing.multiplicity.singleton,
14  VarParsing.VarParsing.varType.string,
15  "the destination database connection string")
16 options.register('destinationTag',
17  '',
18  VarParsing.VarParsing.multiplicity.singleton,
19  VarParsing.VarParsing.varType.string,
20  "the destination tag name")
21 options.parseArguments()
22 
23 def setup_popcon( recordName, tagTimeType ):
24  psetForOutRec = []
25  psetForOutRec.append( cms.PSet( record = cms.string(str( recordName )),
26  tag = cms.string(str( options.destinationTag )),
27  timetype = cms.untracked.string(str(tagTimeType))
28  )
29  )
30 
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 )
35 
36  process.PoolDBOutputService = cms.Service("PoolDBOutputService",
37  DBParameters = cms.PSet( messageLevel = cms.untracked.int32( 3 ),
38  ),
39  connect = cms.string( sqliteConnect ),
40  toPut = cms.VPSet( psetForOutRec )
41  )
42 
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)
48  )
49  return process
50 
51 def psetForRecord( recordName ):
52  psetForRec = []
53  psetForRec.append( cms.PSet( record = cms.string(str(recordName)),
54  tag = cms.string(str( options.destinationTag ))
55  )
56  )
57  return psetForRec
def setup_popcon(recordName, tagTimeType)
#define str(s)