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 options.parseArguments()
64 
65 # Fix to allow scram to compile
66 #if len(sys.argv) > 1:
67 # options.parseArguments()
68 
69 runType = RunType()
70 if not options.runkey.strip():
71  options.runkey = 'pp_run'
72 
73 runType.setRunType(options.runkey.strip())
74 
75 # Input source
76 nextLumiTimeoutMillis = 120000
77 endOfRunKills = True
78 
79 if options.scanOnce:
80  endOfRunKills = False
81  nextLumiTimeoutMillis = 0
82 
83 source = cms.Source("DQMProtobufReader",
84  runNumber = cms.untracked.uint32(options.runNumber),
85  runInputDir = cms.untracked.string(options.runInputDir),
86  streamLabel = cms.untracked.string('streamDQMHistograms'),
87  scanOnce = cms.untracked.bool(options.scanOnce),
88  datafnPosition = cms.untracked.uint32(options.datafnPosition),
89  delayMillis = cms.untracked.uint32(500),
90  nextLumiTimeoutMillis = cms.untracked.int32(nextLumiTimeoutMillis),
91  skipFirstLumis = cms.untracked.bool(options.skipFirstLumis),
92  deleteDatFiles = cms.untracked.bool(False),
93  loadFiles = cms.untracked.bool(True),
94  endOfRunKills = cms.untracked.bool(endOfRunKills),
95 )
96 
97 # https://twiki.cern.ch/twiki/bin/viewauth/CMS/CMSBeamSplash2017
99  # source.minEventsPerLumi = 1000000
100  source.nextLumiTimeoutMillis = 15000
101 
102 if options.BeamSplashRun : set_BeamSplashRun_settings( source )
103 
104 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)
Definition: pbsource_cfi.py:98