1 from __future__
import print_function
2 from __future__
import absolute_import
3 import FWCore.ParameterSet.Config
as cms
4 import FWCore.ParameterSet.VarParsing
as VarParsing
7 from .dqmPythonTypes
import *
12 options.register(
'runNumber',
14 VarParsing.VarParsing.multiplicity.singleton,
15 VarParsing.VarParsing.varType.int,
18 options.register(
'datafnPosition',
20 VarParsing.VarParsing.multiplicity.singleton,
21 VarParsing.VarParsing.varType.int,
22 "Data filename position in the positional arguments array 'data' in json file.")
24 options.register(
'runInputDir',
26 VarParsing.VarParsing.multiplicity.singleton,
27 VarParsing.VarParsing.varType.string,
28 "Directory where the DQM files will appear.")
30 options.register(
'scanOnce',
32 VarParsing.VarParsing.multiplicity.singleton,
33 VarParsing.VarParsing.varType.bool,
34 "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'.")
36 options.register(
'skipFirstLumis',
38 VarParsing.VarParsing.multiplicity.singleton,
39 VarParsing.VarParsing.varType.bool,
40 "Skip (and ignore the minEventsPerLumi parameter) for the files which have been available at the beginning of the processing.")
42 options.register(
'noDB',
44 VarParsing.VarParsing.multiplicity.singleton,
45 VarParsing.VarParsing.varType.bool,
46 "Don't upload the BeamSpot conditions to the DB")
48 options.register(
'BeamSplashRun',
50 VarParsing.VarParsing.multiplicity.singleton,
51 VarParsing.VarParsing.varType.bool,
52 "Set client source settings for beam SPLASH run")
56 options.register(
'runkey',
58 VarParsing.VarParsing.multiplicity.singleton,
59 VarParsing.VarParsing.varType.string,
64 options.register(
'runUniqueKey',
66 VarParsing.VarParsing.multiplicity.singleton,
67 VarParsing.VarParsing.varType.string,
68 "Unique run key from RCMS for Frontier")
70 options.parseArguments()
77 if not options.runkey.strip():
78 options.runkey =
'pp_run' 80 runType.setRunType(options.runkey.strip())
82 if not options.inputFiles:
84 nextLumiTimeoutMillis = 240000
89 nextLumiTimeoutMillis = 0
91 source = cms.Source(
"DQMStreamerReader",
92 runNumber = cms.untracked.uint32(options.runNumber),
93 runInputDir = cms.untracked.string(options.runInputDir),
94 SelectEvents = cms.untracked.vstring(
'*'),
95 streamLabel = cms.untracked.string(
'streamDQM'),
96 scanOnce = cms.untracked.bool(options.scanOnce),
97 datafnPosition = cms.untracked.uint32(options.datafnPosition),
98 minEventsPerLumi = cms.untracked.int32(1),
99 delayMillis = cms.untracked.uint32(500),
100 nextLumiTimeoutMillis = cms.untracked.int32(nextLumiTimeoutMillis),
101 skipFirstLumis = cms.untracked.bool(options.skipFirstLumis),
102 deleteDatFiles = cms.untracked.bool(
False),
103 endOfRunKills = cms.untracked.bool(endOfRunKills),
104 inputFileTransitionsEachEvent = cms.untracked.bool(
False)
107 print(
"The list of input files is provided. Disabling discovery and running on everything.")
108 files = [
"file://" + x
for x
in options.inputFiles]
109 source = cms.Source(
"PoolSource",
110 fileNames = cms.untracked.vstring(files),
111 secondaryFileNames = cms.untracked.vstring()
123 source.minEventsPerLumi = 1000000
124 source.nextLumiTimeoutMillis = 15000
128 print(
"Initial Source settings:", source)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)