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. 10 unitTest =
'unitTest=True' in sys.argv
13 from DQM.Integration.config.unittestinputsource_cfi
import options, runType, source
15 from DQM.Integration.config.inputsource_cfi
import options, runType, source, set_BeamSplashRun_settings
20 scenarios = {
'pp_run':
'ppEra_Run3',
'cosmic_run':
'cosmicsEra_Run3',
'hi_run':
'ppEra_Run3_pp_on_PbPb_approxSiStripClusters',
'commissioning_run':
'cosmicsEra_Run3'}
22 if not runType.getRunTypeName()
in scenarios.keys():
23 msg =
"Error getting the scenario out of the 'runkey', no mapping for: %s\n"%runType.getRunTypeName()
24 raise RuntimeError(msg)
26 scenarioName = scenarios[runType.getRunTypeName()]
29 if options.BeamSplashRun :
30 scenarioName =
'ppEra_Run3' 33 print(
"Using scenario:",scenarioName)
37 except Exception
as ex:
38 msg =
"Error getting Scenario implementation for %s\n" % (
41 raise RuntimeError(msg)
45 from DQM.Integration.config.FrontierCondition_GT_autoExpress_cfi
import GlobalTag
47 'globalTag': GlobalTag.globaltag.value(),
48 'globalTagConnect': GlobalTag.connect.value(),
49 'beamSplashRun' :
":localreco+hcalOnlyGlobalRecoSequence+caloTowersRec" if options.BeamSplashRun
else "",
53 from EventFilter.RawDataCollector.rawDataMapperByLabel_cfi
import rawDataMapperByLabel
54 rawDataMapperByLabel.rawCollectionList = [
"rawDataRepacker"]
62 process = scenario.visualizationProcessing(writeTiers=[
'FEVT'], **kwds)
65 process.__dict__[
'_Process__name'] =
"RECONEW" 67 process.source = source
70 process.source.inputFileTransitionsEachEvent =
True 71 process.source.skipFirstLumis =
True 72 process.source.minEventsPerLumi = 0
73 process.source.nextLumiTimeoutMillis = 10000
75 if options.BeamSplashRun:
79 if runType.getRunType() == runType.hi_run:
80 process.source.streamLabel =
"streamHIDQMEventDisplay" 82 process.source.streamLabel =
"streamDQMEventDisplay" 84 m = re.search(
r"\((\w+)\)",
str(source.runNumber))
85 runno =
str(m.group(1))
86 outDir= options.outputBaseDir+
'/EvD/run'+runno+
'/streamEvDOutput2' 88 runno = options.runNumber
97 process.options = cms.untracked.PSet(
98 Rethrow = cms.untracked.vstring(
'ProductNotFound'),
99 wantSummary = cms.untracked.bool(
True),
100 numberOfThreads = cms.untracked.uint32(8),
101 numberOfStreams = cms.untracked.uint32(8)
104 process.maxEvents = cms.untracked.PSet(
105 input = cms.untracked.int32(-1)
107 oldo = process._Process__outputmodules[
"FEVToutput"]
108 del process._Process__outputmodules[
"FEVToutput"]
110 process.FEVToutput = cms.OutputModule(
"JsonWritingTimeoutPoolOutputModule",
111 splitLevel = oldo.splitLevel,
112 outputCommands = oldo.outputCommands,
113 fileName = oldo.fileName,
114 dataset = oldo.dataset,
115 runNumber = cms.untracked.uint32(
int(runno)),
116 streamLabel = cms.untracked.string(
"streamEvDOutput2_dqmcluster"),
118 outputPath = cms.untracked.string(outDir),
121 if hasattr(oldo,
'SelectEvents'):
122 process.FEVToutput.SelectEvents = oldo.SelectEvents
124 process.DQMMonitoringService = cms.Service(
"DQMMonitoringService")
128 psetFile = open(
"RunVisualizationProcessingCfg.py",
"w")
129 psetFile.write(process.dumpPython())
131 cmsRun =
"cmsRun -e RunVisualizationProcessingCfg.py" 132 print(
"Now do:\n%s" % cmsRun)
133 print(
"Final Source settings:", process.source)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
def getScenario(scenarioName)