Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:52:22

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 # This is to write a single payload of L1RPCConfig to the DB using the L1 O2O.
0004 # CondTools/L1Trigger/test/init_cfg.py must be run first to initialize the
0005 # L1TriggerKeyList in the DB, then L1RPCConfig payloads can be written one by one.
0006 
0007 process = cms.Process("L1ConfigWritePayloadDummy")
0008 process.load("FWCore.MessageLogger.MessageLogger_cfi")
0009 process.MessageLogger.cout.enable = cms.untracked.bool(True)
0010 process.MessageLogger.cout.threshold = cms.untracked.string('DEBUG')
0011 process.MessageLogger.debugModules = cms.untracked.vstring('*')
0012 
0013 # Generate L1TriggerKey - here define the RPC key
0014 process.load("CondTools.L1Trigger.L1TriggerKeyDummy_cff")
0015 process.L1TriggerKeyDummy.objectKeys = cms.VPSet(cms.PSet(
0016     record = cms.string('L1RPCConfigRcd'),
0017     type = cms.string('L1RPCConfig'),
0018     key = cms.string('DEFAULT')
0019 #    key = cms.string('COSMIC')
0020 ))
0021 
0022 # Get L1TriggerKeyList from DB
0023 process.load("CondCore.DBCommon.CondDBCommon_cfi")
0024 process.orcon = cms.ESSource("PoolDBESSource",
0025     process.CondDBCommon,
0026     toGet = cms.VPSet(cms.PSet(
0027         record = cms.string('L1TriggerKeyListRcd'),
0028         tag = cms.string('L1TriggerKeyList_IDEAL')
0029     ))
0030 )
0031 process.es_prefer_orcon = cms.ESPrefer("PoolDBESSource","orcon")
0032 process.orcon.connect = cms.string('sqlite_file:l1config.db')
0033 process.orcon.DBParameters.authenticationPath = cms.untracked.string('.')
0034 
0035 # Generate L1RPCConfig object - here define the payload associated to the RPC key
0036 process.rpcconf = cms.ESProducer("RPCTriggerConfig",
0037 #    filedir = cms.untracked.string('L1Trigger/RPCTrigger/data/Eff90PPT12/'),
0038 #    filedir = cms.untracked.string('L1Trigger/RPCTrigger/data/CosmicPats6/'),
0039     filedir = cms.untracked.string('../../CR0T/CosmicPats6/'),
0040 #    PACsPerTower = cms.untracked.int32(12)
0041     PACsPerTower = cms.untracked.int32(1)
0042 )
0043 process.rpcconfsrc = cms.ESSource("EmptyESSource",
0044     recordName = cms.string('L1RPCConfigRcd'),
0045     iovIsRunNotTime = cms.bool(True),
0046     firstValid = cms.vuint32(1)
0047 )
0048 
0049 # writer modules
0050 process.load("CondTools.L1Trigger.L1CondDBPayloadWriter_cff")
0051 process.L1CondDBPayloadWriter.writeL1TriggerKey = cms.bool(False)
0052 process.L1CondDBPayloadWriter.L1TriggerKeyListTag = cms.string('L1TriggerKeyList_IDEAL')
0053 process.L1CondDBPayloadWriter.offlineDB = cms.string('sqlite_file:l1config.db')
0054 process.L1CondDBPayloadWriter.offlineAuthentication = cms.string('.')
0055 
0056 # Use highest possible run number so we always get the latest version
0057 # of L1TriggerKeyList.
0058 process.maxEvents = cms.untracked.PSet(
0059     input = cms.untracked.int32(1)
0060 )
0061 process.source = cms.Source("EmptyIOVSource",
0062     timetype = cms.string('runnumber'),
0063     firstValue = cms.uint64(4294967295),
0064     lastValue = cms.uint64(4294967295),
0065     interval = cms.uint64(1)
0066 )
0067 
0068 process.p = cms.Path(process.L1CondDBPayloadWriter)
0069