File indexing completed on 2024-04-06 12:01:39
0001
0002 from __future__ import print_function
0003 import time
0004
0005 import FWCore.ParameterSet.Config as cms
0006 import FWCore.ParameterSet.VarParsing as VarParsing
0007 from Configuration.AlCa.autoCond import autoCond
0008
0009 options = VarParsing.VarParsing()
0010 options.register('connectionString',
0011 'sqlite:cms_conditions.db',
0012 VarParsing.VarParsing.multiplicity.singleton,
0013 VarParsing.VarParsing.varType.string,
0014 "CondDB Connection string")
0015 options.register('tag',
0016 'BeamSpot_test_updateByLumi_00',
0017 VarParsing.VarParsing.multiplicity.singleton,
0018 VarParsing.VarParsing.varType.string,
0019 "tag for record BeamSpotObjectsRcd")
0020 options.register('runNumber',
0021 250000,
0022 VarParsing.VarParsing.multiplicity.singleton,
0023 VarParsing.VarParsing.varType.int,
0024 "Run number; default gives latest IOV")
0025 options.register('eventsPerLumi',
0026 20,
0027 VarParsing.VarParsing.multiplicity.singleton,
0028 VarParsing.VarParsing.varType.int,
0029 "number of events per lumi")
0030 options.register('numberOfLumis',
0031 20,
0032 VarParsing.VarParsing.multiplicity.singleton,
0033 VarParsing.VarParsing.varType.int,
0034 "number of lumisections per run")
0035 options.register('numberOfRuns',
0036 1,
0037 VarParsing.VarParsing.multiplicity.singleton,
0038 VarParsing.VarParsing.varType.int,
0039 "number of runs in the job")
0040 options.register('messageLevel',
0041 0,
0042 VarParsing.VarParsing.multiplicity.singleton,
0043 VarParsing.VarParsing.varType.int,
0044 "Message level; default to 0")
0045
0046 options.parseArguments()
0047
0048 process = cms.Process("TEST")
0049
0050 process.MessageLogger = cms.Service("MessageLogger",
0051 cout = cms.untracked.PSet(threshold = cms.untracked.string('INFO')),
0052 destinations = cms.untracked.vstring('cout')
0053 )
0054
0055 CondDBParameters = cms.PSet( authenticationPath = cms.untracked.string( '/build/gg/' ),
0056 authenticationSystem = cms.untracked.int32( 0 ),
0057 messageLevel = cms.untracked.int32( 1 ),
0058 )
0059
0060
0061 process.GlobalTag = cms.ESSource( "PoolDBESSource",
0062 DBParameters = CondDBParameters,
0063 connect = cms.string( options.connectionString ),
0064 frontierKey = cms.untracked.string('abcdefghijklmnopqrstuvwxyz0123456789'),
0065 toGet = cms.VPSet(cms.PSet(
0066 record = cms.string('BeamSpotObjectsRcd'),
0067 tag = cms.string( options.tag ),
0068 refreshTime = cms.uint64( 2 )
0069 )),
0070 DumpStat = cms.untracked.bool( True ),
0071 )
0072
0073
0074 process.source = cms.Source( "EmptySource",
0075 firstRun = cms.untracked.uint32( options.runNumber ),
0076 firstLuminosityBlock = cms.untracked.uint32( 1 ),
0077
0078
0079
0080 numberEventsInRun = cms.untracked.uint32( 240 ),
0081
0082 numberEventsInLuminosityBlock = cms.untracked.uint32( 10 )
0083 )
0084
0085 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(100))
0086
0087 process.prod = cms.EDAnalyzer("LumiTestWriteReadAnalyzer",
0088 )
0089
0090 process.p = cms.Path( process.prod )
0091
0092 for name, module in process.es_sources_().items():
0093 print("ESModules> provider:%s '%s'" % ( name, module.type_() ))
0094 for name, module in process.es_producers_().items():
0095 print("ESModules> provider:%s '%s'" % ( name, module.type_() ))