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("L1ConfigValidation")
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                  4294967295, #default value
0013                  VarParsing.VarParsing.multiplicity.singleton,
0014                  VarParsing.VarParsing.varType.int,
0015                  "Run number; default gives latest IOV")
0016 options.register('inputDBConnect',
0017                  'sqlite_file:l1config.db', #default value
0018                  VarParsing.VarParsing.multiplicity.singleton,
0019                  VarParsing.VarParsing.varType.string,
0020                  "Connection string for input DB")
0021 options.register('inputDBAuth',
0022                  '.', #default value
0023                  VarParsing.VarParsing.multiplicity.singleton,
0024                  VarParsing.VarParsing.varType.string,
0025                  "Authentication path for input DB")
0026 options.register('printL1TriggerKeyList',
0027                  0, #default value
0028                  VarParsing.VarParsing.multiplicity.singleton,
0029                  VarParsing.VarParsing.varType.int,
0030                  "Print all object keys in CondDB")
0031 options.register('printL1TriggerKey',
0032                  0, #default value
0033                  VarParsing.VarParsing.multiplicity.singleton,
0034                  VarParsing.VarParsing.varType.int,
0035                  "Print TSC key, subsystem keys, and object keys")
0036 options.register('printRSKeys',
0037                  0, #default value
0038                  VarParsing.VarParsing.multiplicity.singleton,
0039                  VarParsing.VarParsing.varType.int,
0040                  "Print Run Settings keys")
0041 options.register('printPayloadTokens',
0042                  0, #default value
0043                  VarParsing.VarParsing.multiplicity.singleton,
0044                  VarParsing.VarParsing.varType.int,
0045                  "Print payload tokens (long)")
0046 options.parseArguments()
0047 
0048 # Define CondDB tags
0049 from CondTools.L1Trigger.L1CondEnum_cfi import L1CondEnum
0050 from CondTools.L1Trigger.L1O2OTags_cfi import initL1O2OTags
0051 initL1O2OTags()
0052 
0053 # Input DB
0054 from CondTools.L1Trigger.L1CondDBSource_cff import initCondDBSource
0055 initCondDBSource( process,
0056                   inputDBConnect = options.inputDBConnect,
0057                   inputDBAuth = options.inputDBAuth,
0058                   tagBaseVec = initL1O2OTags.tagBaseVec,
0059                   includeRSTags = options.printRSKeys )
0060 
0061 from CondCore.DBCommon.CondDBSetup_cfi import CondDBSetup
0062 outputDB = cms.Service("PoolDBOutputService",
0063                        CondDBSetup,
0064                        # BlobStreamerName = cms.untracked.string('TBufferBlobStreamingService'),
0065                        connect = cms.string(options.inputDBConnect),
0066                        toPut = cms.VPSet(cms.PSet(
0067     record = cms.string("L1TriggerKeyRcd"),
0068     tag = cms.string("L1TriggerKey_" + initL1O2OTags.tagBaseVec[ L1CondEnum.L1TriggerKey ])),
0069                                          cms.PSet(
0070     record = cms.string("L1TriggerKeyListRcd"),
0071     tag = cms.string("L1TriggerKeyList_" + initL1O2OTags.tagBaseVec[ L1CondEnum.L1TriggerKeyList ]))
0072                                          ))
0073 outputDB.DBParameters.authenticationPath = options.inputDBAuth
0074 
0075 # PoolDBOutputService for printing out ESRecords
0076 if options.printRSKeys == 1:
0077     from CondTools.L1Trigger.L1RSSubsystemParams_cfi import initL1RSSubsystems
0078     initL1RSSubsystems( tagBaseVec = initL1O2OTags.tagBaseVec )
0079     outputDB.toPut.extend(initL1RSSubsystems.params.recordInfo)
0080 
0081 process.add_(outputDB)
0082     
0083 # Source of events
0084 process.maxEvents = cms.untracked.PSet(
0085     input = cms.untracked.int32(1)
0086 )
0087 process.source = cms.Source("EmptyIOVSource",
0088     timetype = cms.string('runnumber'),
0089     firstValue = cms.uint64(options.runNumber),
0090     lastValue = cms.uint64(options.runNumber),
0091     interval = cms.uint64(1)
0092 )
0093 
0094 # Validation modules
0095 process.load('CondTools.L1Trigger.L1O2OTestAnalyzer_cfi')
0096 process.L1O2OTestAnalyzer.printPayloadTokens = False
0097 
0098 if options.printL1TriggerKey == 1:
0099     process.L1O2OTestAnalyzer.printL1TriggerKey = True
0100 else:
0101     process.L1O2OTestAnalyzer.printL1TriggerKey = False
0102 
0103 if options.printL1TriggerKeyList == 1:
0104     process.L1O2OTestAnalyzer.printL1TriggerKeyList = True
0105 else:
0106     process.L1O2OTestAnalyzer.printL1TriggerKeyList = False
0107 
0108 if options.printRSKeys == 1:
0109     process.L1O2OTestAnalyzer.printESRecords = True
0110 else:
0111     process.L1O2OTestAnalyzer.printESRecords = False
0112 
0113 if options.printPayloadTokens == 1:
0114     process.L1O2OTestAnalyzer.printPayloadTokens = True
0115 else:
0116     process.L1O2OTestAnalyzer.printPayloadTokens = False
0117 
0118 process.p = cms.Path(process.L1O2OTestAnalyzer)