Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-25 02:29:20

0001 import FWCore.ParameterSet.Config as cms
0002 import FWCore.ParameterSet.VarParsing as VarParsing
0003 from . import popcon2dropbox
0004 
0005 options = VarParsing.VarParsing()
0006 options.register('targetFile',
0007                 'popcon.db',
0008                 VarParsing.VarParsing.multiplicity.singleton,
0009                 VarParsing.VarParsing.varType.string,
0010                 "the target sqlite file name")
0011 options.register('destinationDatabase',
0012                 '',
0013                 VarParsing.VarParsing.multiplicity.singleton,
0014                 VarParsing.VarParsing.varType.string,
0015                 "the destination database connection string")
0016 options.register('destinationTag',
0017                 '',
0018                 VarParsing.VarParsing.multiplicity.singleton,
0019                 VarParsing.VarParsing.varType.string,
0020                 "the destination tag name")
0021 options.parseArguments()
0022 
0023 def setup_popcon( recordName, tagTimeType ):
0024     psetForOutRec = []
0025     psetForOutRec.append( cms.PSet( record = cms.string(str( recordName )),
0026                                     tag = cms.string(str( options.destinationTag )),
0027                                     timetype = cms.untracked.string(str(tagTimeType))
0028                                     )
0029                           )
0030 
0031     sqliteConnect = 'sqlite:%s' %options.targetFile
0032     process = cms.Process("PopCon")
0033     process.load("CondCore.CondDB.CondDB_cfi")
0034     process.CondDB.DBParameters.messageLevel = cms.untracked.int32( 3 )
0035 
0036     process.PoolDBOutputService = cms.Service("PoolDBOutputService",
0037                                               DBParameters = cms.PSet( messageLevel = cms.untracked.int32( 3 ),
0038                                                                        ),
0039                                               connect = cms.string( sqliteConnect ),
0040                                               toPut = cms.VPSet( psetForOutRec )
0041     )
0042     
0043     process.source = cms.Source("EmptyIOVSource",
0044                                 timetype   = cms.string('runnumber'),
0045                                 firstValue = cms.uint64(1),
0046                                 lastValue  = cms.uint64(1),
0047                                 interval   = cms.uint64(1)
0048     )
0049     return process
0050 
0051 def psetForRecord( recordName ):
0052     psetForRec = []
0053     psetForRec.append( cms.PSet( record = cms.string(str(recordName)),
0054                                  tag = cms.string(str( options.destinationTag ))
0055                                  ) 
0056                        )
0057     return psetForRec