Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:50:39

0001 import FWCore.ParameterSet.VarParsing as VarParsing
0002 options = VarParsing.VarParsing()
0003 options.register('sinceTime',
0004                  4294967294, #default value
0005                  VarParsing.VarParsing.multiplicity.singleton,
0006                  VarParsing.VarParsing.varType.int,
0007                  "SinceTime; default gives latest IOV")
0008 options.register('numberObj',
0009                  1, #default value
0010                  VarParsing.VarParsing.multiplicity.singleton,
0011                  VarParsing.VarParsing.varType.int,
0012                  "Number of objects to write")
0013 options.register('outOfOrder',
0014                  False, #default value
0015                  VarParsing.VarParsing.multiplicity.singleton,
0016                  VarParsing.VarParsing.varType.int,
0017                  "append out of order")
0018 options.register('closeIOV',
0019                  False, #default value
0020                  VarParsing.VarParsing.multiplicity.singleton,
0021                  VarParsing.VarParsing.varType.int,
0022                  "close the IOV sequence at the last inserted since time")
0023 options.register('tag',
0024                  'Example_tag', #default value
0025                  VarParsing.VarParsing.multiplicity.singleton,
0026                  VarParsing.VarParsing.varType.string,
0027                  "output tag")
0028 options.register('connect',
0029                  'sqlite_file:pop_test.db', #default value
0030                  VarParsing.VarParsing.multiplicity.singleton,
0031                  VarParsing.VarParsing.varType.string,
0032                  "connection string")
0033 options.parseArguments()
0034 
0035 
0036 import FWCore.ParameterSet.Config as cms
0037 
0038 process = cms.Process("TEST")
0039 
0040 process.MessageLogger=cms.Service("MessageLogger",
0041                                   destinations=cms.untracked.vstring("cout"),
0042                                   cout=cms.untracked.PSet(
0043                                                           #treshold=cms.untracked.string("INFO")
0044                                                           )
0045                                   )
0046 
0047 process.load("CondCore.DBCommon.CondDBCommon_cfi")
0048 process.CondDBCommon.connect = cms.string(options.connect)
0049 process.CondDBCommon.DBParameters.authenticationPath = cms.untracked.string('/afs/cern.ch/cms/DB/conddb')
0050 process.CondDBCommon.DBParameters.messageLevel = cms.untracked.int32(3)
0051 
0052 process.source = cms.Source("EmptyIOVSource",
0053                             timetype = cms.string('runnumber'),
0054                             firstValue = cms.uint64(1),
0055                             lastValue = cms.uint64(1),
0056                             interval = cms.uint64(1)
0057                             )
0058 
0059 
0060 process.PoolDBOutputService = cms.Service("PoolDBOutputService",
0061                                           process.CondDBCommon,
0062                                           closeIOV =  cms.untracked.bool(bool(options.closeIOV)),
0063                                           outOfOrder = cms.untracked.bool(bool(options.outOfOrder)),
0064                                           timetype = cms.untracked.string('runnumber'),
0065                                           toPut = cms.VPSet(cms.PSet(record = cms.string('ThisJob'),
0066                                                                      tag = cms.string(options.tag)
0067                                                                      )
0068                                                             ),
0069                                           logconnect= cms.untracked.string('sqlite_file:log.db')                                  
0070                                           )
0071 
0072 process.mytest = cms.EDAnalyzer("ExPopConAnalyzer",
0073                                 record = cms.string('ThisJob'),
0074                                 loggingOn= cms.untracked.bool(True),
0075                                 Source=cms.PSet(firstSince=cms.untracked.int64(options.sinceTime),
0076                                                 number=cms.untracked.int64(options.numberObj)
0077                                                 )                            
0078                                 )
0079 
0080 process.p = cms.Path(process.mytest)