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