CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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('runInputDir',
18  '/tmp',
19  VarParsing.VarParsing.multiplicity.singleton,
20  VarParsing.VarParsing.varType.string,
21  "Directory where the DQM files will appear.")
22 
23 options.register('scanOnce',
24  False, # default value
25  VarParsing.VarParsing.multiplicity.singleton,
26  VarParsing.VarParsing.varType.bool,
27  "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'.")
28 
29 options.register('skipFirstLumis',
30  False, # default value
31  VarParsing.VarParsing.multiplicity.singleton,
32  VarParsing.VarParsing.varType.bool,
33  "Skip (and ignore the minEventsPerLumi parameter) for the files which have been available at the begining of the processing. ")
34 
35 options.register('BeamSplashRun',
36  False, # default value
37  VarParsing.VarParsing.multiplicity.singleton,
38  VarParsing.VarParsing.varType.bool,
39  "Set client source settings for beam SPLASH run")
40 
41 # Parameters for runType
42 
43 options.register ('runkey',
44  'pp_run',
45  VarParsing.VarParsing.multiplicity.singleton,
46  VarParsing.VarParsing.varType.string,
47  "Run Keys of CMS")
48 
49 # Parameter for frontierKey
50 
51 options.register ('runUniqueKey',
52  'InValid',
53  VarParsing.VarParsing.multiplicity.singleton,
54  VarParsing.VarParsing.varType.string,
55  "Unique run key from RCMS for Frontier")
56 
57 options.parseArguments()
58 
59 # Fix to allow scram to compile
60 #if len(sys.argv) > 1:
61 # options.parseArguments()
62 
63 runType = RunType()
64 if not options.runkey.strip():
65  options.runkey = 'pp_run'
66 
67 runType.setRunType(options.runkey.strip())
68 
69 # Input source
70 nextLumiTimeoutMillis = 120000
71 endOfRunKills = True
72 
73 if options.scanOnce:
74  endOfRunKills = False
75  nextLumiTimeoutMillis = 0
76 
77 source = cms.Source("DQMProtobufReader",
78  runNumber = cms.untracked.uint32(options.runNumber),
79  runInputDir = cms.untracked.string(options.runInputDir),
80 
81  streamLabel = cms.untracked.string('streamDQMHistograms'),
82  scanOnce = cms.untracked.bool(options.scanOnce),
83 
84  delayMillis = cms.untracked.uint32(500),
85  nextLumiTimeoutMillis = cms.untracked.int32(nextLumiTimeoutMillis),
86  skipFirstLumis = cms.untracked.bool(options.skipFirstLumis),
87  deleteDatFiles = cms.untracked.bool(False),
88  loadFiles = cms.untracked.bool(True),
89  endOfRunKills = cms.untracked.bool(endOfRunKills),
90 )
91 
92 # https://twiki.cern.ch/twiki/bin/viewauth/CMS/CMSBeamSplash2017
94  # source.minEventsPerLumi = 1000000
95  source.nextLumiTimeoutMillis = 15000
96 
97 if options.BeamSplashRun : set_BeamSplashRun_settings( source )
98 
99 print("Initial Source settings:", source)
100 
101 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def set_BeamSplashRun_settings
Definition: pbsource_cfi.py:93