1 from __future__
import print_function
3 import FWCore.ParameterSet.Config
as cms
4 from Configuration.DataProcessing.GetScenario
import getScenario
7 Example configuration for online reconstruction meant for visualization clients. 9 from DQM.Integration.config.inputsource_cfi
import options,runType,source
14 scenarios = {
'pp_run':
'ppEra_Run2_2018',
'cosmic_run':
'cosmicsEra_Run2_2018',
'hi_run':
'ppEra_Run2_2018_pp_on_AA'}
16 if not runType.getRunTypeName()
in scenarios.keys():
17 msg =
"Error getting the scenario out of the 'runkey', no mapping for: %s\n"%runType.getRunTypeName()
18 raise RuntimeError(msg)
20 scenarioName = scenarios[runType.getRunTypeName()]
22 print(
"Using scenario:",scenarioName)
27 except Exception
as ex:
28 msg =
"Error getting Scenario implementation for %s\n" % (
31 raise RuntimeError(msg)
35 from DQM.Integration.config.FrontierCondition_GT_autoExpress_cfi
import GlobalTag
37 'globalTag': GlobalTag.globaltag.value(),
38 'globalTagConnect': GlobalTag.connect.value()
42 from EventFilter.RawDataCollector.rawDataMapperByLabel_cfi
import rawDataMapperByLabel
43 rawDataMapperByLabel.rawCollectionList = [cms.InputTag(
"rawDataRepacker")]
51 process = scenario.visualizationProcessing(writeTiers=[
'FEVT'], **kwds)
53 process.source = source
54 process.source.inputFileTransitionsEachEvent = cms.untracked.bool(
True)
55 process.source.skipFirstLumis = cms.untracked.bool(
True)
56 process.source.minEventsPerLumi = cms.untracked.int32(0)
57 process.source.nextLumiTimeoutMillis = cms.untracked.int32(10000)
58 process.source.streamLabel = cms.untracked.string(
'streamDQMEventDisplay')
60 m = re.search(
r"\((\w+)\)",
str(source.runNumber))
61 runno =
str(m.group(1))
62 outDir=
'/fff/BU0/output/EvD/run'+runno+
'/streamEvDOutput2' 70 process.options = cms.untracked.PSet(
71 Rethrow = cms.untracked.vstring(
'ProductNotFound'),
72 wantSummary = cms.untracked.bool(
True),
73 numberOfThreads = cms.untracked.uint32(8),
74 numberOfStreams = cms.untracked.uint32(8)
77 process.maxEvents = cms.untracked.PSet(
78 input = cms.untracked.int32(-1)
80 oldo = process._Process__outputmodules[
"FEVToutput"]
81 del process._Process__outputmodules[
"FEVToutput"]
83 process.FEVToutput = cms.OutputModule(
"JsonWritingTimeoutPoolOutputModule",
84 splitLevel = oldo.splitLevel,
85 outputCommands = oldo.outputCommands,
86 fileName = oldo.fileName,
87 dataset = oldo.dataset,
88 runNumber = cms.untracked.uint32(
int(runno)),
89 streamLabel = cms.untracked.string(
"streamEvDOutput2_dqmcluster"),
91 outputPath = cms.untracked.string(outDir),
94 if hasattr(oldo,
'SelectEvents'):
95 process.FEVToutput.SelectEvents = oldo.SelectEvents
97 process.DQMMonitoringService = cms.Service(
"DQMMonitoringService")
101 psetFile = open(
"RunVisualizationProcessingCfg.py",
"w")
102 psetFile.write(process.dumpPython())
104 cmsRun =
"cmsRun -e RunVisualizationProcessingCfg.py" 105 print(
"Now do:\n%s" % cmsRun)
S & print(S &os, JobReport::InputFile const &f)
def getScenario(scenarioName)