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("L1ConfigWritePayloadOnline")
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 process.load("CondCore.DBCommon.CondDBCommon_cfi")
0010 
0011 import FWCore.ParameterSet.VarParsing as VarParsing
0012 options = VarParsing.VarParsing()
0013 options.register('tscKey',
0014                  '', #default value
0015                  VarParsing.VarParsing.multiplicity.singleton,
0016                  VarParsing.VarParsing.varType.string,
0017                  "TSC key")
0018 options.register('outputDBConnect',
0019                  'sqlite_file:l1config.db', #default value
0020                  VarParsing.VarParsing.multiplicity.singleton,
0021                  VarParsing.VarParsing.varType.string,
0022                  "Connection string for output DB")
0023 options.register('outputDBAuth',
0024                  '.', #default value
0025                  VarParsing.VarParsing.multiplicity.singleton,
0026                  VarParsing.VarParsing.varType.string,
0027                  "Authentication path for output DB")
0028 options.register('overwriteKeys',
0029                  0, #default value
0030                  VarParsing.VarParsing.multiplicity.singleton,
0031                  VarParsing.VarParsing.varType.int,
0032                  "Overwrite existing keys")
0033 options.register('logTransactions',
0034                  1, #default value
0035                  VarParsing.VarParsing.multiplicity.singleton,
0036                  VarParsing.VarParsing.varType.int,
0037                  "Record transactions in log DB")
0038 options.register('copyNonO2OPayloads',
0039                  0, #default value
0040                  VarParsing.VarParsing.multiplicity.singleton,
0041                  VarParsing.VarParsing.varType.int,
0042                  "Copy DTTF TSC payloads from ORCON")
0043 options.register('copyDBConnect',
0044                  'sqlite_file:l1config.db', #default value
0045                  VarParsing.VarParsing.multiplicity.singleton,
0046                  VarParsing.VarParsing.varType.string,
0047                  "Connection string for copy DB")
0048 options.register('copyDBAuth',
0049                  '.', #default value
0050                  VarParsing.VarParsing.multiplicity.singleton,
0051                  VarParsing.VarParsing.varType.string,
0052                  "Authentication path for copy DB")
0053 options.parseArguments()
0054 
0055 # Generate L1TriggerKey from OMDS
0056 process.load("CondTools.L1Trigger.L1SubsystemKeysOnline_cfi")
0057 process.L1SubsystemKeysOnline.tscKey = cms.string( options.tscKey )
0058 process.load("CondTools.L1Trigger.L1ConfigTSCKeys_cff")
0059 process.load("CondTools.L1Trigger.L1TriggerKeyOnline_cfi")
0060 process.L1TriggerKeyOnline.subsystemLabels = cms.vstring( 'CSCTF',
0061                                                           'DTTF',
0062                                                           'RPC',
0063                                                           'GMT',
0064                                                           'GMTScales',
0065                                                           'RCT',
0066                                                           'GCT',
0067                                                           'GT' )
0068 
0069 # Generate configuration data from OMDS
0070 process.load("CondTools.L1Trigger.L1ConfigTSCPayloads_cff")
0071 
0072 if options.copyNonO2OPayloads == 1:
0073     process.L1MuDTEtaPatternLutOnline.copyFromCondDB = cms.bool( True )
0074     process.L1MuDTEtaPatternLutOnline.onlineDB = options.copyDBConnect
0075     process.L1MuDTEtaPatternLutOnline.onlineAuthentication = options.copyDBAuth
0076     process.L1MuDTExtLutOnline.copyFromCondDB = cms.bool( True )
0077     process.L1MuDTExtLutOnline.onlineDB = options.copyDBConnect
0078     process.L1MuDTExtLutOnline.onlineAuthentication = options.copyDBAuth
0079     process.L1MuDTPhiLutOnline.copyFromCondDB = cms.bool( True )
0080     process.L1MuDTPhiLutOnline.onlineDB = options.copyDBConnect
0081     process.L1MuDTPhiLutOnline.onlineAuthentication = options.copyDBAuth
0082     process.L1MuDTPtaLutOnline.copyFromCondDB = cms.bool( True )
0083     process.L1MuDTPtaLutOnline.onlineDB = options.copyDBConnect
0084     process.L1MuDTPtaLutOnline.onlineAuthentication = options.copyDBAuth
0085     process.L1MuDTQualPatternLutOnline.copyFromCondDB = cms.bool( True )
0086     process.L1MuDTQualPatternLutOnline.onlineDB = options.copyDBConnect
0087     process.L1MuDTQualPatternLutOnline.onlineAuthentication = options.copyDBAuth
0088     process.L1RPCConfigOnline.copyFromCondDB = cms.bool( True )
0089     process.L1RPCConfigOnline.onlineDB = options.copyDBConnect
0090     process.L1RPCConfigOnline.onlineAuthentication = options.copyDBAuth
0091     process.L1RPCConeDefinitionOnline.copyFromCondDB = cms.bool( True )
0092     process.L1RPCConeDefinitionOnline.onlineDB = options.copyDBConnect
0093     process.L1RPCConeDefinitionOnline.onlineAuthentication = options.copyDBAuth
0094     process.L1RPCHsbConfigOnline.copyFromCondDB = cms.bool( True )
0095     process.L1RPCHsbConfigOnline.onlineDB = options.copyDBConnect
0096     process.L1RPCHsbConfigOnline.onlineAuthentication = options.copyDBAuth
0097     process.L1RPCBxOrConfigOnline.copyFromCondDB = cms.bool( True )
0098     process.L1RPCBxOrConfigOnline.onlineDB = options.copyDBConnect
0099     process.L1RPCBxOrConfigOnline.onlineAuthentication = options.copyDBAuth
0100 
0101 # Define CondDB tags
0102 from CondTools.L1Trigger.L1CondEnum_cfi import L1CondEnum
0103 from CondTools.L1Trigger.L1O2OTags_cfi import initL1O2OTags
0104 initL1O2OTags()
0105 
0106 # writer modules
0107 from CondTools.L1Trigger.L1CondDBPayloadWriter_cff import initPayloadWriter
0108 initPayloadWriter( process,
0109                    outputDBConnect = options.outputDBConnect,
0110                    outputDBAuth = options.outputDBAuth,
0111                    tagBaseVec = initL1O2OTags.tagBaseVec )
0112 
0113 if options.logTransactions == 1:
0114 #    initPayloadWriter.outputDB.logconnect = cms.untracked.string('oracle://cms_orcon_prod/CMS_COND_31X_POPCONLOG')
0115     initPayloadWriter.outputDB.logconnect = cms.untracked.string('sqlite_file:l1o2o-log.db')
0116     process.L1CondDBPayloadWriter.logTransactions = True
0117 
0118 if options.overwriteKeys == 0:
0119     process.L1CondDBPayloadWriter.overwriteKeys = False
0120 else:
0121     process.L1CondDBPayloadWriter.overwriteKeys = True
0122                 
0123 process.maxEvents = cms.untracked.PSet(
0124     input = cms.untracked.int32(1)
0125 )
0126 
0127 # Suppress warnings, not actually used, except for copyNonO2OPayloads
0128 process.outputDB = cms.ESSource("PoolDBESSource",
0129                                 process.CondDBCommon,
0130                                 toGet = cms.VPSet(cms.PSet(
0131     record = cms.string('L1TriggerKeyListRcd'),
0132     tag = cms.string( "L1TriggerKeyList_" + initL1O2OTags.tagBaseVec[ L1CondEnum.L1TriggerKeyList ] )
0133     ),
0134                                                   cms.PSet(
0135     record = cms.string('L1GtStableParametersRcd'),
0136     tag = cms.string( "L1GtStableParameters_" + initL1O2OTags.tagBaseVec[ L1CondEnum.L1GtStableParameters ] )
0137     ),
0138                                                   cms.PSet(
0139     record = cms.string('L1CaloGeometryRecord'),
0140     tag = cms.string( "L1CaloGeometry_" + initL1O2OTags.tagBaseVec[ L1CondEnum.L1CaloGeometry ] )
0141     )),
0142                                 RefreshEachRun=cms.untracked.bool(True)
0143                                 )
0144 
0145 if options.copyNonO2OPayloads == 0:
0146     process.outputDB.connect = options.outputDBConnect
0147     process.outputDB.DBParameters.authenticationPath = options.outputDBAuth
0148     process.source = cms.Source("EmptySource")
0149 else:
0150     process.outputDB.connect = options.copyDBConnect
0151     process.outputDB.DBParameters.authenticationPath = options.copyDBAuth
0152     process.source = cms.Source("EmptyIOVSource",
0153                                 timetype = cms.string('runnumber'),
0154                                 firstValue = cms.uint64(4294967295),
0155                                 lastValue = cms.uint64(4294967295),
0156                                 interval = cms.uint64(1) )
0157                             
0158 process.p = cms.Path(process.L1CondDBPayloadWriter)