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('destinationDatabase',
7  '',
8  VarParsing.VarParsing.multiplicity.singleton,
9  VarParsing.VarParsing.varType.string,
10  "the destination database connection string")
11 options.register('destinationTag',
12  '',
13  VarParsing.VarParsing.multiplicity.singleton,
14  VarParsing.VarParsing.varType.string,
15  "the destination tag name")
16 options.parseArguments()
17 
18 def setup_popcon( recordName, tagTimeType ):
19  psetForOutRec = []
20  psetForOutRec.append( cms.PSet( record = cms.string(str( recordName )),
21  tag = cms.string(str( options.destinationTag )),
22  timetype = cms.untracked.string(str(tagTimeType))
23  )
24  )
25 
26  sqliteConnect = 'sqlite:%s' %popcon2dropbox.dbFileForDropBox
27  process = cms.Process("PopCon")
28  process.load("CondCore.CondDB.CondDB_cfi")
29  process.CondDB.DBParameters.messageLevel = cms.untracked.int32( 3 )
30  #process.CondDB.connect = 'sqlite:%s' %popcon2dropbox.dbFileForDropBox
31 
32  process.PoolDBOutputService = cms.Service("PoolDBOutputService",
33  DBParameters = cms.PSet( messageLevel = cms.untracked.int32( 3 ),
34  ),
35  connect = cms.string( sqliteConnect ),
36  toPut = cms.VPSet( psetForOutRec )
37  )
38 
39  process.source = cms.Source("EmptyIOVSource",
40  timetype = cms.string('runnumber'),
41  firstValue = cms.uint64(1),
42  lastValue = cms.uint64(1),
43  interval = cms.uint64(1)
44  )
45  return process
46 
47 def psetForRecord( recordName ):
48  psetForRec = []
49  psetForRec.append( cms.PSet( record = cms.string(str(recordName)),
50  tag = cms.string(str( options.destinationTag ))
51  )
52  )
53  return psetForRec