File indexing completed on 2024-04-06 12:03:13
0001 import FWCore.ParameterSet.Config as cms
0002
0003 process = cms.Process("L1ConfigWriteRSPayloadOnline")
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('outputDBConnect',
0012 'sqlite_file:l1config.db',
0013 VarParsing.VarParsing.multiplicity.singleton,
0014 VarParsing.VarParsing.varType.string,
0015 "Connection string for output DB")
0016 options.register('outputDBAuth',
0017 '.',
0018 VarParsing.VarParsing.multiplicity.singleton,
0019 VarParsing.VarParsing.varType.string,
0020 "Authentication path for outputDB")
0021 options.register('keysFromDB',
0022 1,
0023 VarParsing.VarParsing.multiplicity.singleton,
0024 VarParsing.VarParsing.varType.int,
0025 "1 = read keys from OMDS, 0 = read keys from command line")
0026 options.register('overwriteKeys',
0027 0,
0028 VarParsing.VarParsing.multiplicity.singleton,
0029 VarParsing.VarParsing.varType.int,
0030 "Overwrite existing keys")
0031 options.register('logTransactions',
0032 1,
0033 VarParsing.VarParsing.multiplicity.singleton,
0034 VarParsing.VarParsing.varType.int,
0035 "Record transactions in log DB")
0036
0037
0038 options.register('runNumber',
0039 0,
0040 VarParsing.VarParsing.multiplicity.singleton,
0041 VarParsing.VarParsing.varType.int,
0042 "Dummy argument")
0043 options.register('L1MuDTTFMasksRcdKey',
0044 'dummy',
0045 VarParsing.VarParsing.multiplicity.singleton,
0046 VarParsing.VarParsing.varType.string,
0047 "Object key")
0048 options.register('L1MuGMTChannelMaskRcdKey',
0049 'dummy',
0050 VarParsing.VarParsing.multiplicity.singleton,
0051 VarParsing.VarParsing.varType.string,
0052 "Object key")
0053 options.register('L1RCTChannelMaskRcdKey',
0054 'dummy',
0055 VarParsing.VarParsing.multiplicity.singleton,
0056 VarParsing.VarParsing.varType.string,
0057 "Object key")
0058 options.register('L1GctChannelMaskRcdKey',
0059 'dummy',
0060 VarParsing.VarParsing.multiplicity.singleton,
0061 VarParsing.VarParsing.varType.string,
0062 "Object key")
0063 options.register('L1GtPrescaleFactorsAlgoTrigRcdKey',
0064 'dummy',
0065 VarParsing.VarParsing.multiplicity.singleton,
0066 VarParsing.VarParsing.varType.string,
0067 "Object key")
0068 options.register('L1GtPrescaleFactorsTechTrigRcdKey',
0069 'dummy',
0070 VarParsing.VarParsing.multiplicity.singleton,
0071 VarParsing.VarParsing.varType.string,
0072 "Object key")
0073 options.register('L1GtTriggerMaskAlgoTrigRcdKey',
0074 'dummy',
0075 VarParsing.VarParsing.multiplicity.singleton,
0076 VarParsing.VarParsing.varType.string,
0077 "Object key")
0078 options.register('L1GtTriggerMaskTechTrigRcdKey',
0079 'dummy',
0080 VarParsing.VarParsing.multiplicity.singleton,
0081 VarParsing.VarParsing.varType.string,
0082 "Object key")
0083 options.register('L1GtTriggerMaskVetoTechTrigRcdKey',
0084 'dummy',
0085 VarParsing.VarParsing.multiplicity.singleton,
0086 VarParsing.VarParsing.varType.string,
0087 "Object key")
0088
0089 options.parseArguments()
0090
0091
0092 from CondTools.L1Trigger.L1CondEnum_cfi import L1CondEnum
0093 from CondTools.L1Trigger.L1O2OTags_cfi import initL1O2OTags
0094 initL1O2OTags()
0095
0096 if options.keysFromDB == 1:
0097 process.load("CondTools.L1Trigger.L1ConfigRSKeys_cff")
0098 else:
0099 process.load("CondTools.L1Trigger.L1TriggerKeyDummy_cff")
0100 from CondTools.L1Trigger.L1RSSubsystemParams_cfi import initL1RSSubsystems
0101 initL1RSSubsystems( tagBaseVec = initL1O2OTags.tagBaseVec,
0102 L1MuDTTFMasksRcdKey = options.L1MuDTTFMasksRcdKey,
0103 L1MuGMTChannelMaskRcdKey = options.L1MuGMTChannelMaskRcdKey,
0104 L1RCTChannelMaskRcdKey = options.L1RCTChannelMaskRcdKey,
0105 L1GctChannelMaskRcdKey = options.L1GctChannelMaskRcdKey,
0106 L1GtPrescaleFactorsAlgoTrigRcdKey = options.L1GtPrescaleFactorsAlgoTrigRcdKey,
0107 L1GtPrescaleFactorsTechTrigRcdKey = options.L1GtPrescaleFactorsTechTrigRcdKey,
0108 L1GtTriggerMaskAlgoTrigRcdKey = options.L1GtTriggerMaskAlgoTrigRcdKey,
0109 L1GtTriggerMaskTechTrigRcdKey = options.L1GtTriggerMaskTechTrigRcdKey,
0110 L1GtTriggerMaskVetoTechTrigRcdKey = options.L1GtTriggerMaskVetoTechTrigRcdKey )
0111 process.L1TriggerKeyDummy.objectKeys = initL1RSSubsystems.params.recordInfo
0112
0113
0114 process.load("CondCore.DBCommon.CondDBCommon_cfi")
0115 process.outputDB = cms.ESSource("PoolDBESSource",
0116 process.CondDBCommon,
0117 toGet = cms.VPSet(cms.PSet(
0118 record = cms.string('L1TriggerKeyListRcd'),
0119 tag = cms.string('L1TriggerKeyList_' + initL1O2OTags.tagBaseVec[ L1CondEnum.L1TriggerKeyList ] )
0120 ))
0121 )
0122
0123 process.outputDB.connect = options.outputDBConnect
0124 process.outputDB.DBParameters.authenticationPath = options.outputDBAuth
0125
0126
0127 process.load("CondTools.L1Trigger.L1ConfigRSPayloads_cff")
0128
0129
0130 from CondTools.L1Trigger.L1CondDBPayloadWriter_cff import initPayloadWriter
0131 initPayloadWriter( process,
0132 outputDBConnect = options.outputDBConnect,
0133 outputDBAuth = options.outputDBAuth,
0134 tagBaseVec = initL1O2OTags.tagBaseVec,
0135 process.L1CondDBPayloadWriter.writeL1TriggerKey = cms.bool(False)
0136
0137 if options.logTransactions == 1:
0138 initPayloadWriter.outputDB.logconnect = cms.untracked.string('oracle://cms_orcon_prod/CMS_COND_31X_POPCONLOG')
0139 process.L1CondDBPayloadWriter.logTransactions = True
0140
0141 if options.overwriteKeys == 0:
0142 process.L1CondDBPayloadWriter.overwriteKeys = False
0143 else:
0144 process.L1CondDBPayloadWriter.overwriteKeys = True
0145
0146 process.maxEvents = cms.untracked.PSet(
0147 input = cms.untracked.int32(1)
0148 )
0149 process.source = cms.Source("EmptySource")
0150
0151 process.p = cms.Path(process.L1CondDBPayloadWriter)