CMS 3D CMS Logo

pbsource_cfi.py
Go to the documentation of this file.
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
5 
6 import sys
7 from .dqmPythonTypes import *
8 
9 options = VarParsing.VarParsing('analysis')
10 
11 options.register('runNumber',
12  111,
13  VarParsing.VarParsing.multiplicity.singleton,
14  VarParsing.VarParsing.varType.int,
15  "Run number.")
16 
17 options.register('datafnPosition',
18  3, # default value
19  VarParsing.VarParsing.multiplicity.singleton,
20  VarParsing.VarParsing.varType.int,
21  "Data filename position in the positional arguments array 'data' in json file.")
22 
23 options.register('runInputDir',
24  '/tmp',
25  VarParsing.VarParsing.multiplicity.singleton,
26  VarParsing.VarParsing.varType.string,
27  "Directory where the DQM files will appear.")
28 
29 options.register('scanOnce',
30  False, # default value
31  VarParsing.VarParsing.multiplicity.singleton,
32  VarParsing.VarParsing.varType.bool,
33  "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'.")
34 
35 options.register('skipFirstLumis',
36  False, # default value
37  VarParsing.VarParsing.multiplicity.singleton,
38  VarParsing.VarParsing.varType.bool,
39  "Skip (and ignore the minEventsPerLumi parameter) for the files which have been available at the beginning of the processing.")
40 
41 options.register('BeamSplashRun',
42  False, # default value
43  VarParsing.VarParsing.multiplicity.singleton,
44  VarParsing.VarParsing.varType.bool,
45  "Set client source settings for beam SPLASH run")
46 
47 # Parameters for runType
48 
49 options.register('runkey',
50  'pp_run',
51  VarParsing.VarParsing.multiplicity.singleton,
52  VarParsing.VarParsing.varType.string,
53  "Run Keys of CMS")
54 
55 # Parameter for frontierKey
56 
57 options.register('runUniqueKey',
58  'InValid',
59  VarParsing.VarParsing.multiplicity.singleton,
60  VarParsing.VarParsing.varType.string,
61  "Unique run key from RCMS for Frontier")
62 
63 # Parameter for output directory of the event display clients
64 # visualization-live and visualization-live-secondInstance
65 # this additional input argument was added in the hltd framework
66 # only for the visualization clients
67 # Note, the other clients do not use this input parameter
68 
69 options.register('outputBaseDir',
70  '/fff/BU0/output',
71  VarParsing.VarParsing.multiplicity.singleton,
72  VarParsing.VarParsing.varType.string,
73  "Directory where the visualization output files will appear.")
74 
75 
76 options.parseArguments()
77 
78 # Fix to allow scram to compile
79 #if len(sys.argv) > 1:
80 # options.parseArguments()
81 
82 runType = RunType()
83 if not options.runkey.strip():
84  options.runkey = 'pp_run'
85 
86 runType.setRunType(options.runkey.strip())
87 
88 # Input source
89 nextLumiTimeoutMillis = 120000
90 endOfRunKills = True
91 
92 if options.scanOnce:
93  endOfRunKills = False
94  nextLumiTimeoutMillis = 0
95 
96 source = cms.Source("DQMProtobufReader",
97  runNumber = cms.untracked.uint32(options.runNumber),
98  runInputDir = cms.untracked.string(options.runInputDir),
99  streamLabel = cms.untracked.string('streamDQMHistograms'),
100  scanOnce = cms.untracked.bool(options.scanOnce),
101  datafnPosition = cms.untracked.uint32(options.datafnPosition),
102  delayMillis = cms.untracked.uint32(500),
103  nextLumiTimeoutMillis = cms.untracked.int32(nextLumiTimeoutMillis),
104  skipFirstLumis = cms.untracked.bool(options.skipFirstLumis),
105  deleteDatFiles = cms.untracked.bool(False),
106  loadFiles = cms.untracked.bool(True),
107  endOfRunKills = cms.untracked.bool(endOfRunKills),
108 )
109 
110 # https://twiki.cern.ch/twiki/bin/viewauth/CMS/CMSBeamSplash2017
112  # source.minEventsPerLumi = 1000000
113  source.nextLumiTimeoutMillis = 15000
114 
115 if options.BeamSplashRun : set_BeamSplashRun_settings( source )
116 
117 print("Initial Source settings:", source)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def set_BeamSplashRun_settings(source)