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("L1ConfigWriteIOVOnline")
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 # Get L1TriggerKeyList from DB
0010 process.load("CondCore.DBCommon.CondDBCommon_cfi")
0011 
0012 import FWCore.ParameterSet.VarParsing as VarParsing
0013 options = VarParsing.VarParsing()
0014 options.register('tscKey',
0015                  '', #default value
0016                  VarParsing.VarParsing.multiplicity.singleton,
0017                  VarParsing.VarParsing.varType.string,
0018                  "TSC key")
0019 options.register('runNumber',
0020                  0, #default value
0021                  VarParsing.VarParsing.multiplicity.singleton,
0022                  VarParsing.VarParsing.varType.int,
0023                  "Run number")
0024 options.register('outputDBConnect',
0025                  'sqlite_file:l1config.db', #default value
0026                  VarParsing.VarParsing.multiplicity.singleton,
0027                  VarParsing.VarParsing.varType.string,
0028                  "Connection string for output DB")
0029 options.register('outputDBAuth',
0030                  '.', #default value
0031                  VarParsing.VarParsing.multiplicity.singleton,
0032                  VarParsing.VarParsing.varType.string,
0033                  "Authentication path for output DB")
0034 options.register('logTransactions',
0035                  1, #default value
0036                  VarParsing.VarParsing.multiplicity.singleton,
0037                  VarParsing.VarParsing.varType.int,
0038                  "Record transactions in log DB")
0039 options.parseArguments()
0040 
0041 # Define CondDB tags
0042 from CondTools.L1Trigger.L1CondEnum_cfi import L1CondEnum
0043 from CondTools.L1Trigger.L1O2OTags_cfi import initL1O2OTags
0044 initL1O2OTags()
0045 
0046 # writer modules
0047 from CondTools.L1Trigger.L1CondDBIOVWriter_cff import initIOVWriter
0048 initIOVWriter( process,
0049                outputDBConnect = options.outputDBConnect,
0050                outputDBAuth = options.outputDBAuth,
0051                tagBaseVec = initL1O2OTags.tagBaseVec,
0052                tscKey = options.tscKey )
0053 
0054 if options.logTransactions == 1:
0055 #    initIOVWriter.outputDB.logconnect = cms.untracked.string('oracle://cms_orcon_prod/CMS_COND_31X_POPCONLOG')
0056     initIOVWriter.outputDB.logconnect = cms.untracked.string('sqlite_file:l1o2o-log.db')
0057     process.L1CondDBIOVWriter.logTransactions = True
0058 
0059 process.maxEvents = cms.untracked.PSet(
0060     input = cms.untracked.int32(1)
0061 )
0062 process.source = cms.Source("EmptyIOVSource",
0063     timetype = cms.string('runnumber'),
0064     firstValue = cms.uint64(options.runNumber),
0065     lastValue = cms.uint64(options.runNumber),
0066     interval = cms.uint64(1)
0067 )
0068 
0069 process.outputDB = cms.ESSource("PoolDBESSource",
0070                                 process.CondDBCommon,
0071                                 toGet = cms.VPSet(cms.PSet(
0072     record = cms.string('L1TriggerKeyListRcd'),
0073     tag = cms.string('L1TriggerKeyList_' + initL1O2OTags.tagBaseVec[ L1CondEnum.L1TriggerKeyList ])
0074     )),
0075                                 RefreshEachRun=cms.untracked.bool(True)
0076                                 )
0077 process.outputDB.connect = cms.string(options.outputDBConnect)
0078 process.outputDB.DBParameters.authenticationPath = options.outputDBAuth
0079 
0080 # CORAL debugging
0081 process.outputDB.DBParameters.messageLevel = cms.untracked.int32(3)
0082 
0083 process.p = cms.Path(process.L1CondDBIOVWriter)