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('DEBUG')
0007 process.MessageLogger.debugModules = cms.untracked.vstring('*')
0008 
0009 import FWCore.ParameterSet.VarParsing as VarParsing
0010 options = VarParsing.VarParsing()
0011 options.register('tagBase',
0012                  'IDEAL', #default value
0013                  VarParsing.VarParsing.multiplicity.singleton,
0014                  VarParsing.VarParsing.varType.string,
0015                  "IOV tags = object_{tagBase}")
0016 options.register('useO2OTags',
0017                  0, #default value
0018                  VarParsing.VarParsing.multiplicity.singleton,
0019                  VarParsing.VarParsing.varType.int,
0020                  "0 = use uniform tags, 1 = ignore tagBase and use O2O tags")
0021 options.register('outputDBConnect',
0022                  'sqlite_file:l1config.db', #default value
0023                  VarParsing.VarParsing.multiplicity.singleton,
0024                  VarParsing.VarParsing.varType.string,
0025                  "Connection string for output DB")
0026 options.register('outputDBAuth',
0027                  '.', #default value
0028                  VarParsing.VarParsing.multiplicity.singleton,
0029                  VarParsing.VarParsing.varType.string,
0030                  "Authentication path for output DB")
0031 options.parseArguments()
0032 
0033 process.maxEvents = cms.untracked.PSet(
0034     input = cms.untracked.int32(1)
0035 )
0036 process.source = cms.Source("EmptySource")
0037 
0038 # Generate dummy L1TriggerKey
0039 process.load("CondTools.L1TriggerExt.L1TriggerKeyDummyExt_cff")
0040 process.L1TriggerKeyDummyExt.objectKeys = cms.VPSet()
0041 process.L1TriggerKeyDummyExt.tscKey = cms.string(' ')
0042 
0043 # Define CondDB tags
0044 if options.useO2OTags == 0:
0045     from CondTools.L1TriggerExt.L1CondEnumExt_cfi import L1CondEnumExt
0046     from CondTools.L1TriggerExt.L1UniformTagsExt_cfi import initL1UniformTagsExt
0047     initL1UniformTagsExt( tagBase = options.tagBase )
0048     tagBaseVec = initL1UniformTagsExt.tagBaseVec
0049 else:
0050     from CondTools.L1TriggerExt.L1CondEnumExt_cfi import L1CondEnumExt
0051     from CondTools.L1TriggerExt.L1O2OTagsExt_cfi import initL1O2OTagsExt
0052     initL1O2OTagsExt()
0053     tagBaseVec = initL1O2OTagsExt.tagBaseVec
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 = tagBaseVec )
0061 
0062 # Generate dummy L1TriggerKeyListExt to initialize DB on the first time ONLY.
0063 process.L1CondDBPayloadWriterExt.newL1TriggerKeyListExt = True
0064 
0065 process.p = cms.Path(process.L1CondDBPayloadWriterExt)