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("L1ConfigWriteRSIOVOnline")
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('runNumber',
0012                  0, #default value
0013                  VarParsing.VarParsing.multiplicity.singleton,
0014                  VarParsing.VarParsing.varType.int,
0015                  "Run number")
0016 options.register('outputDBConnect',
0017                  'sqlite_file:l1config.db', #default value
0018                  VarParsing.VarParsing.multiplicity.singleton,
0019                  VarParsing.VarParsing.varType.string,
0020                  "Connection string for output DB")
0021 options.register('outputDBAuth',
0022                  '.', #default value
0023                  VarParsing.VarParsing.multiplicity.singleton,
0024                  VarParsing.VarParsing.varType.string,
0025                  "Authentication path for outputDB")
0026 options.register('keysFromDB',
0027                  1, #default value
0028                  VarParsing.VarParsing.multiplicity.singleton,
0029                  VarParsing.VarParsing.varType.int,
0030                  "1 = read keys from OMDS, 0 = read keys from command line")
0031 options.register('logTransactions',
0032                  1, #default value
0033                  VarParsing.VarParsing.multiplicity.singleton,
0034                  VarParsing.VarParsing.varType.int,
0035                  "Record transactions in log DB")
0036 
0037 options.parseArguments()
0038 
0039 # Define CondDB tags
0040 from CondTools.L1TriggerExt.L1CondEnumExt_cfi import L1CondEnumExt
0041 from CondTools.L1TriggerExt.L1O2OTagsExt_cfi import initL1O2OTagsExt
0042 initL1O2OTagsExt()
0043 
0044 if options.keysFromDB == 1:
0045     process.load("CondTools.L1TriggerExt.L1ConfigRSKeysExt_cff")
0046 else:
0047     process.load("CondTools.L1TriggerExt.L1TriggerKeyDummyExt_cff")
0048     from CondTools.L1TriggerExt.L1RSSubsystemParamsExt_cfi import initL1RSSubsystemsExt
0049     initL1RSSubsystemsExt( tagBaseVec = initL1O2OTagsExt.tagBaseVec )
0050     process.L1TriggerKeyDummyExt.objectKeys = initL1RSSubsystemsExt.params.recordInfo
0051 
0052 # Get L1TriggerKeyListExt from DB
0053 process.load("CondCore.CondDB.CondDB_cfi")
0054 process.CondDB.connect = options.outputDBConnect
0055 
0056 process.outputDB = cms.ESSource("PoolDBESSource",
0057                                 process.CondDB,
0058                                 toGet = cms.VPSet(cms.PSet(
0059     record = cms.string('L1TriggerKeyListExtRcd'),
0060     tag = cms.string('L1TriggerKeyListExt_' + initL1O2OTagsExt.tagBaseVec[ L1CondEnumExt.L1TriggerKeyListExt ] )
0061     ))
0062                                 )
0063 process.outputDB.DBParameters.authenticationPath = options.outputDBAuth
0064 
0065 # writer modules
0066 from CondTools.L1TriggerExt.L1CondDBIOVWriterExt_cff import initIOVWriterExt
0067 initIOVWriterExt( process,
0068                outputDBConnect = options.outputDBConnect,
0069                outputDBAuth = options.outputDBAuth,
0070                tagBaseVec = initL1O2OTagsExt.tagBaseVec,
0071                tscKey = '' )
0072 process.L1CondDBIOVWriterExt.logKeys = True
0073 
0074 if options.logTransactions == 1:
0075     initIOVWriterExt.outputDB.logconnect = cms.untracked.string('oracle://cms_orcon_prod/CMS_COND_31X_POPCONLOG')
0076     process.L1CondDBIOVWriterExt.logTransactions = True
0077 
0078 process.maxEvents = cms.untracked.PSet(
0079     input = cms.untracked.int32(1)
0080 )
0081 process.source = cms.Source("EmptyIOVSource",
0082     timetype = cms.string('runnumber'),
0083     firstValue = cms.uint64(options.runNumber),
0084     lastValue = cms.uint64(options.runNumber),
0085     interval = cms.uint64(1)
0086 )
0087 
0088 process.p = cms.Path(process.L1CondDBIOVWriterExt)