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('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 # Parameters for runType
36 
37 options.register ('runkey',
38  'pp_run',
39  VarParsing.VarParsing.multiplicity.singleton,
40  VarParsing.VarParsing.varType.string,
41  "Run Keys of CMS")
42 
43 # Parameter for frontierKey
44 
45 options.register ('runUniqueKey',
46  'InValid',
47  VarParsing.VarParsing.multiplicity.singleton,
48  VarParsing.VarParsing.varType.string,
49  "Unique run key from RCMS for Frontier")
50 
51 options.parseArguments()
52 
53 # Fix to allow scram to compile
54 #if len(sys.argv) > 1:
55 # options.parseArguments()
56 
57 runType = RunType()
58 if not options.runkey.strip():
59  options.runkey = 'pp_run'
60 
61 runType.setRunType(options.runkey.strip())
62 
63 # Input source
64 nextLumiTimeoutMillis = 120000
65 endOfRunKills = True
66 
67 if options.scanOnce:
68  endOfRunKills = False
69  nextLumiTimeoutMillis = 0
70 
71 source = cms.Source("DQMProtobufReader",
72  runNumber = cms.untracked.uint32(options.runNumber),
73  runInputDir = cms.untracked.string(options.runInputDir),
74 
75  streamLabel = cms.untracked.string('streamDQMHistograms'),
76  scanOnce = cms.untracked.bool(options.scanOnce),
77 
78  delayMillis = cms.untracked.uint32(500),
79  nextLumiTimeoutMillis = cms.untracked.int32(nextLumiTimeoutMillis),
80  skipFirstLumis = cms.untracked.bool(options.skipFirstLumis),
81  deleteDatFiles = cms.untracked.bool(False),
82  loadFiles = cms.untracked.bool(True),
83  endOfRunKills = cms.untracked.bool(endOfRunKills),
84 )
85 
86 print("Source:", source)
print
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:46
dqmPythonTypes.RunType
Definition: dqmPythonTypes.py:4
VarParsing.VarParsing
Definition: VarParsing.py:10