Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 process = cms.Process("L1ConfigWriteIOVDummy")
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('tscKey',
0012                  'dummy', #default value
0013                  VarParsing.VarParsing.multiplicity.singleton,
0014                  VarParsing.VarParsing.varType.string,
0015                  "TSC key")
0016 options.register('runNumber',
0017                  1000, #default value
0018                  VarParsing.VarParsing.multiplicity.singleton,
0019                  VarParsing.VarParsing.varType.int,
0020                  "Run number")
0021 options.register('tagBase',
0022                  'IDEAL', #default value
0023                  VarParsing.VarParsing.multiplicity.singleton,
0024                  VarParsing.VarParsing.varType.string,
0025                  "IOV tags = object_{tagBase}")
0026 options.register('useO2OTags',
0027                  0, #default value
0028                  VarParsing.VarParsing.multiplicity.singleton,
0029                  VarParsing.VarParsing.varType.int,
0030                  "0 = use uniform tags, 1 = ignore tagBase and use O2O tags")
0031 options.register('outputDBConnect',
0032                  'sqlite_file:l1config.db', #default value
0033                  VarParsing.VarParsing.multiplicity.singleton,
0034                  VarParsing.VarParsing.varType.string,
0035                  "Connection string for output DB")
0036 options.register('outputDBAuth',
0037                  '.', #default value
0038                  VarParsing.VarParsing.multiplicity.singleton,
0039                  VarParsing.VarParsing.varType.string,
0040                  "Authentication path for output DB")
0041 options.parseArguments()
0042 
0043 # Get L1TriggerKeyList from DB
0044 process.load("CondCore.DBCommon.CondDBCommon_cfi")
0045 
0046 # Define CondDB tags
0047 if options.useO2OTags == 0:
0048     from CondTools.L1Trigger.L1CondEnum_cfi import L1CondEnum
0049     from CondTools.L1Trigger.L1UniformTags_cfi import initL1UniformTags
0050     initL1UniformTags( tagBase = options.tagBase )
0051     tagBaseVec = initL1UniformTags.tagBaseVec
0052 else:
0053     from CondTools.L1Trigger.L1CondEnum_cfi import L1CondEnum
0054     from CondTools.L1Trigger.L1O2OTags_cfi import initL1O2OTags
0055     initL1O2OTags()
0056     tagBaseVec = initL1O2OTags.tagBaseVec
0057     
0058 # writer modules
0059 from CondTools.L1Trigger.L1CondDBIOVWriter_cff import initIOVWriter
0060 initIOVWriter( process,
0061                outputDBConnect = options.outputDBConnect,
0062                outputDBAuth = options.outputDBAuth,
0063                tagBaseVec = tagBaseVec,
0064                tscKey = options.tscKey )
0065 
0066 process.maxEvents = cms.untracked.PSet(
0067     input = cms.untracked.int32(1)
0068 )
0069 process.source = cms.Source("EmptyIOVSource",
0070     timetype = cms.string('runnumber'),
0071     firstValue = cms.uint64(options.runNumber),
0072     lastValue = cms.uint64(options.runNumber),
0073     interval = cms.uint64(1)
0074 )
0075 
0076 process.outputDB = cms.ESSource("PoolDBESSource",
0077     process.CondDBCommon,
0078     toGet = cms.VPSet(cms.PSet(
0079         record = cms.string('L1TriggerKeyListRcd'),
0080         tag = cms.string('L1TriggerKeyList_' + tagBaseVec[ L1CondEnum.L1TriggerKeyList ])
0081     ))
0082 )
0083 
0084 process.p = cms.Path(process.L1CondDBIOVWriter)
0085 process.outputDB.connect = cms.string(options.outputDBConnect)
0086 process.outputDB.DBParameters.authenticationPath = options.outputDBAuth