Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:52:19

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 process = cms.Process("L1ConfigWritePayloadDummy")
0004 process.load("FWCore.MessageLogger.MessageLogger_cfi")
0005 process.MessageLogger.cout.enable = cms.untracked.bool(True)
0006 process.MessageLogger.cout.threshold = cms.untracked.string('INFO')
0007 process.MessageLogger.debugModules = cms.untracked.vstring('*')
0008 
0009 import FWCore.ParameterSet.VarParsing as VarParsing
0010 options = VarParsing.VarParsing()
0011 options.register('runNumber',
0012                  4294967295, #default value
0013                  VarParsing.VarParsing.multiplicity.singleton,
0014                  VarParsing.VarParsing.varType.int,
0015                  "Run number; default gives latest IOV")
0016 options.register('inputDBConnect',
0017                  'sqlite_file:l1config.db', #default value
0018                  VarParsing.VarParsing.multiplicity.singleton,
0019                  VarParsing.VarParsing.varType.string,
0020                  "Connection string for input DB")
0021 options.register('inputDBAuth',
0022                  '.', #default value
0023                  VarParsing.VarParsing.multiplicity.singleton,
0024                  VarParsing.VarParsing.varType.string,
0025                  "Authentication path for input DB")
0026 options.register('outputDBConnect',
0027                  'sqlite_file:l1config.db', #default value
0028                  VarParsing.VarParsing.multiplicity.singleton,
0029                  VarParsing.VarParsing.varType.string,
0030                  "Connection string for output DB")
0031 options.register('outputDBAuth',
0032                  '.', #default value
0033                  VarParsing.VarParsing.multiplicity.singleton,
0034                  VarParsing.VarParsing.varType.string,
0035                  "Authentication path for output DB")
0036 options.parseArguments()
0037 
0038 # Generate dummy L1TriggerKeyExt and L1TriggerKeyListExt
0039 process.load("CondTools.L1TriggerExt.L1TriggerKeyDummyExt_cff")
0040 
0041 # Define CondDB tags
0042 from CondTools.L1TriggerExt.L1CondEnumExt_cfi import L1CondEnumExt
0043 from CondTools.L1TriggerExt.L1O2OTagsExt_cfi import initL1O2OTagsExt
0044 initL1O2OTagsExt()
0045 
0046 # Input DB
0047 from CondTools.L1TriggerExt.L1CondDBSourceExt_cff import initCondDBSourceExt
0048 initCondDBSourceExt( process,
0049                   inputDBConnect = options.inputDBConnect,
0050                   inputDBAuth = options.inputDBAuth,
0051                   tagBaseVec = initL1O2OTagsExt.tagBaseVec,
0052                   includeAllTags = True,
0053                   applyESPrefer = False )
0054 
0055 # writer modules
0056 from CondTools.L1TriggerExt.L1CondDBPayloadWriterExt_cff import initPayloadWriterExt
0057 initPayloadWriterExt( process,
0058                    outputDBConnect = options.outputDBConnect,
0059                    outputDBAuth = options.outputDBAuth,
0060                    tagBaseVec = initL1O2OTagsExt.tagBaseVec )
0061 process.L1CondDBPayloadWriterExt.newL1TriggerKeyListExt = True
0062 
0063 process.maxEvents = cms.untracked.PSet(
0064     input = cms.untracked.int32(1)
0065 )
0066 process.source = cms.Source("EmptyIOVSource",
0067     timetype = cms.string('runnumber'),
0068     firstValue = cms.uint64(options.runNumber),
0069     lastValue = cms.uint64(options.runNumber),
0070     interval = cms.uint64(1)
0071 )
0072 
0073 process.p = cms.Path(process.L1CondDBPayloadWriterExt)