Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:03:14

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('tagUpdate',
0022                  '', #default value
0023                  VarParsing.VarParsing.multiplicity.singleton,
0024                  VarParsing.VarParsing.varType.string,
0025                  "Comma-separated list of column-separated pairs relating type to a new tagBase")
0026 options.register('inputDBAuth',
0027                  '.', #default value
0028                  VarParsing.VarParsing.multiplicity.singleton,
0029                  VarParsing.VarParsing.varType.string,
0030                  "Authentication path for input DB")
0031 options.register('printL1TriggerKeyListExt',
0032                  0, #default value
0033                  VarParsing.VarParsing.multiplicity.singleton,
0034                  VarParsing.VarParsing.varType.int,
0035                  "Print all object keys in CondDB")
0036 options.register('printL1TriggerKeyExt',
0037                  0, #default value
0038                  VarParsing.VarParsing.multiplicity.singleton,
0039                  VarParsing.VarParsing.varType.int,
0040                  "Print TSC key, subsystem keys, and object keys")
0041 options.register('printRSKeys',
0042                  0, #default value
0043                  VarParsing.VarParsing.multiplicity.singleton,
0044                  VarParsing.VarParsing.varType.int,
0045                  "Print Run Settings keys")
0046 options.register('printPayloadTokens',
0047                  0, #default value
0048                  VarParsing.VarParsing.multiplicity.singleton,
0049                  VarParsing.VarParsing.varType.int,
0050                  "Print payload tokens (long)")
0051 options.parseArguments()
0052 
0053 # Define CondDB tags
0054 from CondTools.L1TriggerExt.L1CondEnumExt_cfi import L1CondEnumExt
0055 from CondTools.L1TriggerExt.L1O2OTagsExt_cfi import initL1O2OTagsExt
0056 initL1O2OTagsExt()
0057 
0058 # Override the tag bases if instructed to do so
0059 if options.tagUpdate :
0060     for type2tagBase in options.tagUpdate.split(',') :
0061         (t,tagBase) = type2tagBase.split(':')
0062         index = L1CondEnumExt.__dict__[t]
0063         initL1O2OTagsExt.tagBaseVec[index] = tagBase
0064 
0065 # Input DB
0066 from CondTools.L1TriggerExt.L1CondDBSourceExt_cff import initCondDBSourceExt
0067 initCondDBSourceExt( process,
0068                   inputDBConnect = options.inputDBConnect,
0069                   inputDBAuth = options.inputDBAuth,
0070                   tagBaseVec = initL1O2OTagsExt.tagBaseVec,
0071                   includeRSTags = options.printRSKeys )
0072 
0073 from CondCore.CondDB.CondDB_cfi import CondDB
0074 CondDB.connect = cms.string(options.inputDBConnect)
0075 outputDB = cms.Service("PoolDBOutputService",
0076                        CondDB,
0077                        # BlobStreamerName = cms.untracked.string('TBufferBlobStreamingService'),
0078                        toPut = cms.VPSet(cms.PSet(
0079     record = cms.string("L1TriggerKeyExtRcd"),
0080     tag = cms.string("L1TriggerKeyExt_" + initL1O2OTagsExt.tagBaseVec[ L1CondEnumExt.L1TriggerKeyExt ])),
0081                                          cms.PSet(
0082     record = cms.string("L1TriggerKeyListExtRcd"),
0083     tag = cms.string("L1TriggerKeyListExt_" + initL1O2OTagsExt.tagBaseVec[ L1CondEnumExt.L1TriggerKeyListExt ]))
0084                                          ))
0085 outputDB.DBParameters.authenticationPath = options.inputDBAuth
0086 
0087 # PoolDBOutputService for printing out ESRecords
0088 if options.printRSKeys == 1:
0089     from CondTools.L1TriggerExt.L1RSSubsystemParamsExt_cfi import initL1RSSubsystemsExt
0090     initL1RSSubsystemsExt( tagBaseVec = initL1O2OTagsExt.tagBaseVec )
0091     outputDB.toPut.extend(initL1RSSubsystemsExt.params.recordInfo)
0092 
0093 process.add_(outputDB)
0094     
0095 # Source of events
0096 process.maxEvents = cms.untracked.PSet(
0097     input = cms.untracked.int32(1)
0098 )
0099 process.source = cms.Source("EmptyIOVSource",
0100     timetype = cms.string('runnumber'),
0101     firstValue = cms.uint64(options.runNumber),
0102     lastValue = cms.uint64(options.runNumber),
0103     interval = cms.uint64(1)
0104 )
0105 
0106 # Validation modules
0107 process.load('CondTools.L1TriggerExt.L1O2OTestAnalyzerExt_cfi')
0108 process.L1O2OTestAnalyzerExt.printPayloadTokens = False
0109 
0110 if options.printL1TriggerKeyExt == 1:
0111     process.L1O2OTestAnalyzerExt.printL1TriggerKeyExt = True
0112 else:
0113     process.L1O2OTestAnalyzerExt.printL1TriggerKeyExt = False
0114 
0115 if options.printL1TriggerKeyListExt == 1:
0116     process.L1O2OTestAnalyzerExt.printL1TriggerKeyListExt = True
0117 else:
0118     process.L1O2OTestAnalyzerExt.printL1TriggerKeyListExt = False
0119 
0120 if options.printRSKeys == 1:
0121     process.L1O2OTestAnalyzerExt.printESRecords = True
0122 else:
0123     process.L1O2OTestAnalyzerExt.printESRecords = False
0124 
0125 if options.printPayloadTokens == 1:
0126     process.L1O2OTestAnalyzerExt.printPayloadTokens = True
0127 else:
0128     process.L1O2OTestAnalyzerExt.printPayloadTokens = False
0129 
0130 #print process.dumpPython()
0131 
0132 process.p = cms.Path(process.L1O2OTestAnalyzerExt)