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("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 # arguments for setting object keys by hand
0038 options.register('L1MuDTTFMasksRcdKey',
0039                  'dummy', #default value
0040                  VarParsing.VarParsing.multiplicity.singleton,
0041                  VarParsing.VarParsing.varType.string,
0042                  "Object key")
0043 options.register('L1MuGMTChannelMaskRcdKey',
0044                  'dummy', #default value
0045                  VarParsing.VarParsing.multiplicity.singleton,
0046                  VarParsing.VarParsing.varType.string,
0047                  "Object key")
0048 options.register('L1RCTChannelMaskRcdKey',
0049                  'dummy', #default value
0050                  VarParsing.VarParsing.multiplicity.singleton,
0051                  VarParsing.VarParsing.varType.string,
0052                  "Object key")
0053 options.register('L1GctChannelMaskRcdKey',
0054                  'dummy', #default value
0055                  VarParsing.VarParsing.multiplicity.singleton,
0056                  VarParsing.VarParsing.varType.string,
0057                  "Object key")
0058 options.register('L1GtPrescaleFactorsAlgoTrigRcdKey',
0059                  'dummy', #default value
0060                  VarParsing.VarParsing.multiplicity.singleton,
0061                  VarParsing.VarParsing.varType.string,
0062                  "Object key")
0063 options.register('L1GtPrescaleFactorsTechTrigRcdKey',
0064                  'dummy', #default value
0065                  VarParsing.VarParsing.multiplicity.singleton,
0066                  VarParsing.VarParsing.varType.string,
0067                  "Object key")
0068 options.register('L1GtTriggerMaskAlgoTrigRcdKey',
0069                  'dummy', #default value
0070                  VarParsing.VarParsing.multiplicity.singleton,
0071                  VarParsing.VarParsing.varType.string,
0072                  "Object key")
0073 options.register('L1GtTriggerMaskTechTrigRcdKey',
0074                  'dummy', #default value
0075                  VarParsing.VarParsing.multiplicity.singleton,
0076                  VarParsing.VarParsing.varType.string,
0077                  "Object key")
0078 options.register('L1GtTriggerMaskVetoTechTrigRcdKey',
0079                  'dummy', #default value
0080                  VarParsing.VarParsing.multiplicity.singleton,
0081                  VarParsing.VarParsing.varType.string,
0082                  "Object key")
0083 
0084 options.parseArguments()
0085 
0086 # Define CondDB tags
0087 from CondTools.L1Trigger.L1CondEnum_cfi import L1CondEnum
0088 from CondTools.L1Trigger.L1O2OTags_cfi import initL1O2OTags
0089 initL1O2OTags()
0090 
0091 if options.keysFromDB == 1:
0092     process.load("CondTools.L1Trigger.L1ConfigRSKeys_cff")
0093 else:
0094     process.load("CondTools.L1Trigger.L1TriggerKeyDummy_cff")
0095     from CondTools.L1Trigger.L1RSSubsystemParams_cfi import initL1RSSubsystems
0096     initL1RSSubsystems( tagBaseVec = initL1O2OTags.tagBaseVec,
0097                         L1MuDTTFMasksRcdKey = options.L1MuDTTFMasksRcdKey,
0098                         L1MuGMTChannelMaskRcdKey = options.L1MuGMTChannelMaskRcdKey,
0099                         L1RCTChannelMaskRcdKey = options.L1RCTChannelMaskRcdKey,
0100                         L1GctChannelMaskRcdKey = options.L1GctChannelMaskRcdKey,
0101                         L1GtPrescaleFactorsAlgoTrigRcdKey = options.L1GtPrescaleFactorsAlgoTrigRcdKey,
0102                         L1GtPrescaleFactorsTechTrigRcdKey = options.L1GtPrescaleFactorsTechTrigRcdKey,
0103                         L1GtTriggerMaskAlgoTrigRcdKey = options.L1GtTriggerMaskAlgoTrigRcdKey,
0104                         L1GtTriggerMaskTechTrigRcdKey = options.L1GtTriggerMaskTechTrigRcdKey,
0105                         L1GtTriggerMaskVetoTechTrigRcdKey = options.L1GtTriggerMaskVetoTechTrigRcdKey )
0106     process.L1TriggerKeyDummy.objectKeys = initL1RSSubsystems.params.recordInfo
0107 
0108 # Get L1TriggerKeyList from DB
0109 process.load("CondCore.DBCommon.CondDBCommon_cfi")
0110 process.outputDB = cms.ESSource("PoolDBESSource",
0111                                 process.CondDBCommon,
0112                                 toGet = cms.VPSet(cms.PSet(
0113     record = cms.string('L1TriggerKeyListRcd'),
0114     tag = cms.string('L1TriggerKeyList_' + initL1O2OTags.tagBaseVec[ L1CondEnum.L1TriggerKeyList ] )
0115     ))
0116                                 )
0117 process.outputDB.connect = options.outputDBConnect
0118 process.outputDB.DBParameters.authenticationPath = options.outputDBAuth
0119 
0120 # writer modules
0121 from CondTools.L1Trigger.L1CondDBIOVWriter_cff import initIOVWriter
0122 initIOVWriter( process,
0123                outputDBConnect = options.outputDBConnect,
0124                outputDBAuth = options.outputDBAuth,
0125                tagBaseVec = initL1O2OTags.tagBaseVec,
0126                tscKey = '' )
0127 process.L1CondDBIOVWriter.logKeys = True
0128 
0129 if options.logTransactions == 1:
0130     initIOVWriter.outputDB.logconnect = cms.untracked.string('oracle://cms_orcon_prod/CMS_COND_31X_POPCONLOG')
0131     process.L1CondDBIOVWriter.logTransactions = True
0132 
0133 process.maxEvents = cms.untracked.PSet(
0134     input = cms.untracked.int32(1)
0135 )
0136 process.source = cms.Source("EmptyIOVSource",
0137     timetype = cms.string('runnumber'),
0138     firstValue = cms.uint64(options.runNumber),
0139     lastValue = cms.uint64(options.runNumber),
0140     interval = cms.uint64(1)
0141 )
0142 
0143 process.p = cms.Path(process.L1CondDBIOVWriter)