1 from __future__
import print_function
2 from __future__
import absolute_import
3 from builtins
import range
5 import FWCore.ParameterSet.Config
as cms
8 import FWCore.ParameterSet.VarParsing
as VarParsing
9 from .dqmPythonTypes
import *
12 check that the input directory exists and there are files in it 15 if not (os.path.exists(streamer_folder)
and os.path.isdir(os.path.join(streamer_folder))):
16 raise IOError(
"Input folder '%s' does not exist in CMSSW_SEARCH_PATH" % streamer_folder)
18 items = os.listdir(dqm_streamer_folder)
20 raise IOError(
"Input folder '%s' does not contain any file" % streamer_folder)
26 options.register(
'runkey',
28 VarParsing.VarParsing.multiplicity.singleton,
29 VarParsing.VarParsing.varType.string,
33 options.register(
'runUniqueKey',
35 VarParsing.VarParsing.multiplicity.singleton,
36 VarParsing.VarParsing.varType.string,
37 "Unique run key from RCMS for Frontier")
39 options.register(
'runNumber',
41 VarParsing.VarParsing.multiplicity.singleton,
42 VarParsing.VarParsing.varType.int,
43 "Run number. This run number has to be present in https://github.com/cms-data/DQM-Integration")
45 options.register(
'datafnPosition',
47 VarParsing.VarParsing.multiplicity.singleton,
48 VarParsing.VarParsing.varType.int,
49 "Data filename position in the positional arguments array 'data' in json file.")
51 options.register(
'streamLabel',
53 VarParsing.VarParsing.multiplicity.singleton,
54 VarParsing.VarParsing.varType.string,
57 options.register(
'noDB',
59 VarParsing.VarParsing.multiplicity.singleton,
60 VarParsing.VarParsing.varType.bool,
61 "Don't upload the BeamSpot conditions to the DB")
63 options.register(
'scanOnce',
65 VarParsing.VarParsing.multiplicity.singleton,
66 VarParsing.VarParsing.varType.bool,
67 "Don't repeat file scans: use what was found during the initial scan. EOR file is ignored and the state is set to 'past end of run'.")
69 options.register(
'skipFirstLumis',
71 VarParsing.VarParsing.multiplicity.singleton,
72 VarParsing.VarParsing.varType.bool,
73 "Skip (and ignore the minEventsPerLumi parameter) for the files which have been available at the beginning of the processing.")
75 options.register(
'BeamSplashRun',
77 VarParsing.VarParsing.multiplicity.singleton,
78 VarParsing.VarParsing.varType.bool,
79 "Set client source settings for beam SPLASH run")
83 options.register(
'unitTest',
85 VarParsing.VarParsing.multiplicity.singleton,
86 VarParsing.VarParsing.varType.bool,
87 "Required to avoid the error.")
89 options.parseArguments()
92 dqm_integration_data = [os.path.join(dir,
'DQM/Integration/data')
for dir
in os.getenv(
'CMSSW_SEARCH_PATH',
'').
split(
":")
if os.path.exists(os.path.join(dir,
'DQM/Integration/data'))][0]
93 dqm_streamer_folder = os.path.join(dqm_integration_data,
'run'+
str(options.runNumber))
94 print(
"Reading streamer files from:\n ",dqm_streamer_folder)
97 maxEvents = cms.untracked.PSet(
98 input = cms.untracked.int32(-1)
102 if not options.runkey.strip():
103 options.runkey =
"pp_run" 105 runType.setRunType(options.runkey.strip())
110 streamLabel = options.streamLabel
111 if streamLabel ==
'':
112 if runType.getRunType() == runType.hi_run:
113 streamLabel =
'streamHIDQM' 115 streamLabel =
'streamDQM' 118 source = cms.Source(
"DQMStreamerReader",
119 runNumber = cms.untracked.uint32(options.runNumber),
120 runInputDir = cms.untracked.string(dqm_integration_data),
121 SelectEvents = cms.untracked.vstring(
'*'),
122 streamLabel = cms.untracked.string(streamLabel),
123 scanOnce = cms.untracked.bool(options.scanOnce),
124 datafnPosition = cms.untracked.uint32(options.datafnPosition),
125 minEventsPerLumi = cms.untracked.int32(1000),
126 delayMillis = cms.untracked.uint32(500),
127 nextLumiTimeoutMillis = cms.untracked.int32(0),
128 skipFirstLumis = cms.untracked.bool(options.skipFirstLumis),
129 deleteDatFiles = cms.untracked.bool(
False),
130 endOfRunKills = cms.untracked.bool(
False),
131 inputFileTransitionsEachEvent = cms.untracked.bool(
False)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
def split(sequence, size)