File indexing completed on 2024-11-27 03:17:58
0001
0002 import FWCore.ParameterSet.Config as cms
0003
0004 process = cms.Process("QWE")
0005 process.load("FWCore.MessageLogger.MessageLogger_cfi")
0006 process.MessageLogger.cout.enable = cms.untracked.bool(True)
0007 process.MessageLogger.cout.threshold = cms.untracked.string('INFO')
0008 process.MessageLogger.debugModules = cms.untracked.vstring('*')
0009
0010 import FWCore.ParameterSet.VarParsing as VarParsing
0011 options = VarParsing.VarParsing()
0012 options.register('topKey',
0013 '',
0014
0015 VarParsing.VarParsing.multiplicity.singleton,
0016 VarParsing.VarParsing.varType.string,
0017 "object key")
0018 options.register('systemKey',
0019
0020 'L1TMuonOverlapFwVersion_DUMMY',
0021 VarParsing.VarParsing.multiplicity.singleton,
0022 VarParsing.VarParsing.varType.string,
0023 "object key")
0024 options.register('outputDBConnect',
0025 'sqlite_file:./l1config.db',
0026 VarParsing.VarParsing.multiplicity.singleton,
0027 VarParsing.VarParsing.varType.string,
0028 "Connection string for output DB")
0029 options.register('DBConnect',
0030 'oracle://cms_omds_adg/CMS_TRG_R',
0031 VarParsing.VarParsing.multiplicity.singleton,
0032 VarParsing.VarParsing.varType.string,
0033 "OMDS connect string")
0034 options.register('DBAuth',
0035 '.',
0036 VarParsing.VarParsing.multiplicity.singleton,
0037 VarParsing.VarParsing.varType.string,
0038 "Authentication path for the DB")
0039 options.parseArguments()
0040
0041
0042 if ( len(options.topKey) and len(options.systemKey) ) or ( len(options.topKey)==0 and len(options.systemKey)==0 ) :
0043 print("Specify either the topKey (top-level tsc:rs key) or systemKey (system specific tsc:rs key), but not both")
0044 exit(1)
0045
0046
0047 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1) )
0048 process.source = cms.Source("EmptySource")
0049
0050
0051 process.load("CondTools.L1TriggerExt.L1TriggerKeyListDummyExt_cff")
0052
0053
0054 if len(options.topKey) :
0055
0056 process.load("CondTools.L1TriggerExt.L1TriggerKeyRcdSourceExt_cfi")
0057 process.load("CondTools.L1TriggerExt.L1SubsystemKeysOnlineExt_cfi")
0058 process.L1SubsystemKeysOnlineExt.tscKey = cms.string( options.topKey.split(':')[0] )
0059 process.L1SubsystemKeysOnlineExt.rsKey = cms.string( options.topKey.split(':')[1] )
0060 process.L1SubsystemKeysOnlineExt.onlineAuthentication = cms.string( options.DBAuth )
0061 process.L1SubsystemKeysOnlineExt.forceGeneration = cms.bool(True)
0062
0063 process.load("CondTools.L1TriggerExt.L1TriggerKeyOnlineExt_cfi")
0064 process.L1TriggerKeyOnlineExt.subsystemLabels = cms.vstring('OMTF')
0065
0066 process.load("L1TriggerConfig.L1TConfigProducers.L1TMuonOverlapObjectKeysOnline_cfi")
0067 process.L1TMuonOverlapObjectKeysOnline.onlineAuthentication = cms.string( options.DBAuth )
0068 process.L1TMuonOverlapObjectKeysOnline.onlineDB = cms.string( options.DBConnect )
0069 else :
0070
0071 process.load("CondTools.L1TriggerExt.L1TriggerKeyDummyExt_cff")
0072 process.L1TriggerKeyDummyExt.tscKey = cms.string('TSCKEY_DUMMY')
0073 process.L1TriggerKeyDummyExt.objectKeys = cms.VPSet(
0074 cms.PSet(
0075 record = cms.string('L1TMuonOverlapFwVersionO2ORcd'),
0076 type = cms.string('L1TMuonOverlapFwVersion'),
0077 key = cms.string(options.systemKey)
0078 )
0079 )
0080
0081
0082 process.load("L1TriggerConfig.L1TConfigProducers.L1TMuonOverlapFwVersionOnline_cfi")
0083
0084
0085
0086
0087 process.getter = cms.EDAnalyzer("EventSetupRecordDataGetter",
0088 toGet = cms.VPSet(cms.PSet(
0089 record = cms.string('L1TMuonOverlapFwVersionO2ORcd'),
0090
0091 data = cms.vstring('L1TMuonOverlapFwVersion')
0092 )),
0093 verbose = cms.untracked.bool(True)
0094 )
0095
0096 process.l1mow = cms.EDAnalyzer("L1TMuonOverlapFwVersionTester", writeToDB = cms.untracked.bool(True), isO2Opayload = cms.untracked.bool(False))
0097
0098 from CondCore.CondDB.CondDB_cfi import CondDB
0099 CondDB.connect = cms.string(options.outputDBConnect)
0100
0101 outputDB = cms.Service("PoolDBOutputService",
0102 CondDB,
0103 toPut = cms.VPSet(
0104 cms.PSet(
0105
0106 record = cms.string('L1TMuonOverlapFwVersionRcd'),
0107 tag = cms.string('L1TMuonOverlapFwVersion_Stage2v0_hlt')
0108 ),
0109 cms.PSet(
0110 record = cms.string("L1TriggerKeyListExtRcd"),
0111 tag = cms.string("L1TriggerKeyListExt_Stage2v0_hlt")
0112 )
0113 )
0114 )
0115
0116 outputDB.DBParameters.authenticationPath = options.DBAuth
0117 process.add_(outputDB)
0118
0119 process.p = cms.Path(process.getter + process.l1mow)
0120