Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-10-06 02:53:44

0001 from __future__ import print_function
0002 import FWCore.ParameterSet.Config as cms
0003 from FWCore.ParameterSet.VarParsing import VarParsing
0004 
0005 process = cms.Process('XMLFILERETRIEVER')
0006 
0007 ####################################################################
0008 # Set the options
0009 ####################################################################
0010 options = VarParsing('analysis')
0011 options.register('unitTest',
0012                  False,
0013                  VarParsing.multiplicity.singleton,
0014                  VarParsing.varType.bool,
0015                  'Run the unit test',
0016                  )
0017 
0018 options.parseArguments()
0019 
0020 ####################################################################
0021 # Get the GlobalTag
0022 ####################################################################
0023 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0024 from Configuration.AlCa.GlobalTag import GlobalTag
0025 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run3_data_prompt', '')
0026 #process.GlobalTag.DumpStat = cms.untracked.bool(True)  # optional if you want it to be verbose
0027 
0028 # import of standard configurations
0029 process.load("DQMServices.Core.DQMStore_cfg")
0030 process.DQMStore.verbose   = cms.untracked.int32(1)
0031 process.DQMStore.verboseQT = cms.untracked.int32(0)
0032 
0033 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(-1))
0034 
0035 # Input source
0036 process.source = cms.Source("EmptyIOVSource",
0037                             timetype = cms.string('runnumber'),
0038                             firstValue = cms.uint64(1),
0039                             lastValue = cms.uint64(1),
0040                             interval = cms.uint64(1)
0041                             )
0042 
0043 if options.unitTest:
0044     print("running configuration in UnitTest Mode")
0045     process.load("CondCore.CondDB.CondDB_cfi")
0046     process.CondDB.connect = "sqlite_file:./testXML.db"
0047 
0048     process.XmlRetrieval_1 = cms.ESSource("PoolDBESSource",
0049                                           process.CondDB,
0050                                           BlobStreamerName = cms.untracked.string('TBufferBlobStreamingService'),
0051                                           messageLevel = cms.untracked.int32(1),
0052                                           timetype = cms.string('runnumber'),
0053                                           toGet = cms.VPSet(cms.PSet(record = cms.string('DQMXMLFileRcd'),
0054                                                                      tag = cms.string('XML_test'),
0055                                                                      label=cms.untracked.string('XML_label')
0056                                                                  )
0057                                                         )
0058                                       )
0059 
0060     process.RecordDataGetter = cms.EDAnalyzer("EventSetupRecordDataGetter",
0061                                               toGet = cms.VPSet(cms.PSet(record = cms.string('DQMXMLFileRcd'),
0062                                                                          data = cms.vstring('FileBlob/XML_label'))),
0063                                               verbose = cms.untracked.bool(True)
0064                                               )
0065 
0066                                       
0067 process.load('CondTools.DQM.DQMXMLFileEventSetupAnalyzer_cfi')
0068 if(options.unitTest):
0069     process.dqmXMLFileGetter.labelToGet = cms.string('XML_label')
0070     process.path = cms.Path(process.RecordDataGetter+process.dqmXMLFileGetter)
0071 
0072 else:
0073     process.dqmXMLFileGetter.labelToGet = cms.string('SiPixelDQMQTests')
0074     process.path = cms.Path(process.dqmXMLFileGetter)
0075