File indexing completed on 2024-11-25 02:29:19
0001
0002 import time
0003
0004 import FWCore.ParameterSet.Config as cms
0005 import FWCore.ParameterSet.VarParsing as VarParsing
0006 from Configuration.AlCa.autoCond import autoCond
0007
0008 options = VarParsing.VarParsing()
0009 options.register('processId',
0010 '0',
0011 VarParsing.VarParsing.multiplicity.singleton,
0012 VarParsing.VarParsing.varType.string,
0013 "Process Id")
0014 options.register('connectionString',
0015
0016
0017 'frontier://FrontierPrep/CMS_CONDITIONS',
0018
0019 VarParsing.VarParsing.multiplicity.singleton,
0020 VarParsing.VarParsing.varType.string,
0021 "CondDB Connection string")
0022 options.register('tag',
0023
0024 'BeamSpot_test_updateByTime_01',
0025 VarParsing.VarParsing.multiplicity.singleton,
0026 VarParsing.VarParsing.varType.string,
0027 "tag for record BeamSpotObjectsRcd")
0028 options.register('snapshotTime',
0029 '',
0030 VarParsing.VarParsing.multiplicity.singleton,
0031 VarParsing.VarParsing.varType.string,
0032 "GlobalTag snapshot time")
0033 options.register('refresh',
0034 0,
0035 VarParsing.VarParsing.multiplicity.singleton,
0036 VarParsing.VarParsing.varType.int,
0037 "Refresh type: default no refresh")
0038 options.register('runNumber',
0039 120013,
0040 VarParsing.VarParsing.multiplicity.singleton,
0041 VarParsing.VarParsing.varType.int,
0042 "Run number; default gives latest IOV")
0043 options.register('eventsPerLumi',
0044 20,
0045 VarParsing.VarParsing.multiplicity.singleton,
0046 VarParsing.VarParsing.varType.int,
0047 "number of events per lumi")
0048 options.register('numberOfLumis',
0049 20,
0050 VarParsing.VarParsing.multiplicity.singleton,
0051 VarParsing.VarParsing.varType.int,
0052 "number of lumisections per run")
0053 options.register('numberOfRuns',
0054 1,
0055 VarParsing.VarParsing.multiplicity.singleton,
0056 VarParsing.VarParsing.varType.int,
0057 "number of runs in the job")
0058 options.register('messageLevel',
0059 0,
0060 VarParsing.VarParsing.multiplicity.singleton,
0061 VarParsing.VarParsing.varType.int,
0062 "Message level; default to 0")
0063 options.register('security',
0064 '',
0065 VarParsing.VarParsing.multiplicity.singleton,
0066 VarParsing.VarParsing.varType.string,
0067 "FroNTier connection security: activate it with 'sig'")
0068
0069 options.parseArguments()
0070
0071 process = cms.Process("TEST")
0072
0073 process.MessageLogger = cms.Service("MessageLogger",
0074 cout = cms.untracked.PSet(threshold = cms.untracked.string('INFO')),
0075 destinations = cms.untracked.vstring('cout')
0076 )
0077
0078
0079
0080
0081
0082 CondDBParameters = cms.PSet( authenticationPath = cms.untracked.string( '/build/gg/' ),
0083 authenticationSystem = cms.untracked.int32( 0 ),
0084 messageLevel = cms.untracked.int32( 3 ),
0085 security = cms.untracked.string( options.security ),
0086 )
0087
0088 refreshAlways, refreshOpenIOVs, refreshEachRun, reconnectEachRun = False, False, False, False
0089 if options.refresh == 0:
0090 refreshAlways, refreshOpenIOVs, refreshEachRun, reconnectEachRun = False, False, False, False
0091 elif options.refresh == 1:
0092 refreshAlways = True
0093 refreshOpenIOVs, refreshEachRun, reconnectEachRun = False, False, False
0094 elif options.refresh == 2:
0095 refreshAlways = False
0096 refreshOpenIOVs = True
0097 refreshEachRun, reconnectEachRun = False, False
0098 elif options.refresh == 3:
0099 refreshAlways, refreshOpenIOVs = False, False
0100 refreshEachRun = True
0101 reconnectEachRun = False
0102 elif options.refresh == 4:
0103 refreshAlways, refreshOpenIOVs, refreshEachRun = False, False, False
0104 reconnectEachRun = True
0105
0106 process.GlobalTag = cms.ESSource( "PoolDBESSource",
0107 DBParameters = CondDBParameters,
0108 connect = cms.string( options.connectionString ),
0109 snapshotTime = cms.string( options.snapshotTime ),
0110 frontierKey = cms.untracked.string('abcdefghijklmnopqrstuvwxyz0123456789'),
0111 toGet = cms.VPSet(cms.PSet(
0112 record = cms.string('BeamSpotObjectsRcd'),
0113 tag = cms.string( options.tag ),
0114 refreshTime = cms.uint64( 0 )
0115 )),
0116 RefreshAlways = cms.untracked.bool( refreshAlways ),
0117 RefreshOpenIOVs = cms.untracked.bool( refreshOpenIOVs ),
0118 RefreshEachRun = cms.untracked.bool( refreshEachRun ),
0119 ReconnectEachRun = cms.untracked.bool( reconnectEachRun ),
0120 DumpStat = cms.untracked.bool( True ),
0121 )
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132 process.source = cms.Source( "EmptySource",
0133
0134
0135
0136 firstTime = cms.untracked.uint64( 5771327162577584128 ),
0137 timeBetweenEvents = cms.untracked.uint64( 429496729600 ),
0138 numberEventsInRun = cms.untracked.uint32( 1000 ),
0139
0140 numberEventsInLuminosityBlock = cms.untracked.uint32( options.eventsPerLumi )
0141 )
0142
0143
0144
0145
0146
0147
0148
0149
0150
0151
0152
0153
0154 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(100))
0155
0156
0157
0158 process.prod = cms.EDAnalyzer("LumiTestReadAnalyzer",
0159 processId = cms.untracked.string( options.processId ),
0160 pathForLastLumiFile = cms.untracked.string("/build/gg/last_lumi.txt"),
0161 pathForAllLumiFile = cms.untracked.string("./all_time.txt" ),
0162 pathForErrorFile = cms.untracked.string("./lumi_read_errors")
0163 )
0164
0165
0166
0167
0168
0169
0170
0171
0172
0173
0174
0175
0176
0177
0178
0179 process.p = cms.Path( process.prod )
0180
0181
0182
0183
0184 for name, module in process.es_sources_().items():
0185 print("ESModules> provider:%s '%s'" % ( name, module.type_() ))
0186 for name, module in process.es_producers_().items():
0187 print("ESModules> provider:%s '%s'" % ( name, module.type_() ))