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. 11 if 'unitTest=True' in sys.argv:
15 from DQM.Integration.config.unittestinputsource_cfi
import options, runType, source
17 from DQM.Integration.config.inputsource_cfi
import options, runType, source, set_BeamSplashRun_settings
22 scenarios = {
'pp_run':
'ppEra_Run3',
'cosmic_run':
'cosmicsEra_Run3',
'hi_run':
'ppEra_Run3_pp_on_PbPb_approxSiStripClusters',
'commissioning_run':
'cosmicsEra_Run3'}
24 if not runType.getRunTypeName()
in scenarios.keys():
25 msg =
"Error getting the scenario out of the 'runkey', no mapping for: %s\n"%runType.getRunTypeName()
26 raise RuntimeError(msg)
28 scenarioName = scenarios[runType.getRunTypeName()]
31 if options.BeamSplashRun :
32 scenarioName =
'ppEra_Run3' 35 print(
"Using scenario:",scenarioName)
39 except Exception
as ex:
40 msg =
"Error getting Scenario implementation for %s\n" % (
43 raise RuntimeError(msg)
47 from DQM.Integration.config.FrontierCondition_GT_autoExpress_cfi
import GlobalTag
49 'globalTag': GlobalTag.globaltag.value(),
50 'globalTagConnect': GlobalTag.connect.value(),
51 'beamSplashRun' :
":localreco+hcalOnlyGlobalRecoSequence+caloTowersRec" if options.BeamSplashRun
else "",
55 from EventFilter.RawDataCollector.rawDataMapperByLabel_cfi
import rawDataMapperByLabel
56 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
74 if options.BeamSplashRun :
77 m = re.search(
r"\((\w+)\)",
str(source.runNumber))
78 runno =
str(m.group(1))
79 outDir= options.outputBaseDir+
'/EvD/run'+runno+
'/streamEvDOutput' 81 runno = options.runNumber
90 process.options = cms.untracked.PSet(
91 Rethrow = cms.untracked.vstring(
'ProductNotFound'),
92 wantSummary = cms.untracked.bool(
True),
93 numberOfThreads = cms.untracked.uint32(8),
94 numberOfStreams = cms.untracked.uint32(8)
97 process.maxEvents = cms.untracked.PSet(
98 input = cms.untracked.int32(-1)
100 oldo = process._Process__outputmodules[
"FEVToutput"]
101 del process._Process__outputmodules[
"FEVToutput"]
103 process.FEVToutput = cms.OutputModule(
"JsonWritingTimeoutPoolOutputModule",
104 splitLevel = oldo.splitLevel,
105 outputCommands = oldo.outputCommands,
106 fileName = oldo.fileName,
107 dataset = oldo.dataset,
108 runNumber = cms.untracked.uint32(
int(runno)),
109 streamLabel = cms.untracked.string(
"streamEvDOutput_dqmcluster"),
111 outputPath = cms.untracked.string(outDir),
114 process.DQMMonitoringService = cms.Service(
"DQMMonitoringService")
118 psetFile = open(
"RunVisualizationProcessingCfg.py",
"w")
119 psetFile.write(process.dumpPython())
121 cmsRun =
"cmsRun -e RunVisualizationProcessingCfg.py" 122 print(
"Now do:\n%s" % cmsRun)
123 print(
"Final Source settings:", process.source)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
def getScenario(scenarioName)