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 
6 options.register('popconConfigFileName',
7  'popcon2dropbox.json',
8  VarParsing.VarParsing.multiplicity.singleton,
9  VarParsing.VarParsing.varType.string,
10  "PopCon config file name")
11 
12 options.parseArguments()
13 
14 md = popcon2dropbox.CondMetaData( options.popconConfigFileName )
15 
16 psetForRec = []
17 for k,v in md.records().items():
18  psetForRec.append( cms.PSet( record = cms.string(str(k)),
19  tag = cms.string(str(v.get('destinationTag'))),
20  )
21  )
22 
23 psetForOutRec = []
24 for k,v in md.records().items():
25  outRec = v.get('outputRecord')
26  if outRec == None:
27  outRec = k
28  sqliteTag = v.get('sqliteTag')
29  if sqliteTag == None:
30  sqliteTag = v.get('destinationTag')
31  psetForOutRec.append( cms.PSet( record = cms.string(str( outRec )),
32  tag = cms.string(str( sqliteTag )),
33  timetype = cms.untracked.string(str(v.get('timetype')))
34  )
35  )
36 
37 destinationDatabase = md.destinationDatabase()
38 
39 
40 process = cms.Process("PopCon")
41 process.load("CondCore.CondDB.CondDB_cfi")
42 process.CondDB.DBParameters.messageLevel = cms.untracked.int32( 3 )
43 process.CondDB.connect = 'sqlite:%s' %popcon2dropbox.dbFileForDropBox
44 
45 process.PoolDBOutputService = cms.Service("PoolDBOutputService",
46  process.CondDB,
47  toPut = cms.VPSet( psetForOutRec )
48 )
49 
50 process.source = cms.Source("EmptyIOVSource",
51  timetype = cms.string('runnumber'),
52  firstValue = cms.uint64(1),
53  lastValue = cms.uint64(1),
54  interval = cms.uint64(1)
55 )
56 
57