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 options.parseArguments()
44 
45 # Fix to allow scram to compile
46 #if len(sys.argv) > 1:
47 # options.parseArguments()
48 
49 runType = RunType()
50 if not options.runkey.strip():
51  options.runkey = 'pp_run'
52 
53 runType.setRunType(options.runkey.strip())
54 
55 # Input source
56 nextLumiTimeoutMillis = 120000
57 endOfRunKills = True
58 
59 if options.scanOnce:
60  endOfRunKills = False
61  nextLumiTimeoutMillis = 0
62 
63 source = cms.Source("DQMProtobufReader",
64  runNumber = cms.untracked.uint32(options.runNumber),
65  runInputDir = cms.untracked.string(options.runInputDir),
66 
67  streamLabel = cms.untracked.string('streamDQMHistograms'),
68  scanOnce = cms.untracked.bool(options.scanOnce),
69 
70  delayMillis = cms.untracked.uint32(500),
71  nextLumiTimeoutMillis = cms.untracked.int32(nextLumiTimeoutMillis),
72  skipFirstLumis = cms.untracked.bool(options.skipFirstLumis),
73  deleteDatFiles = cms.untracked.bool(False),
74  loadFiles = cms.untracked.bool(True),
75  endOfRunKills = cms.untracked.bool(endOfRunKills),
76 )
77 
78 print("Source:", source)
dqmPythonTypes.RunType
Definition: dqmPythonTypes.py:4
edm::print
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
VarParsing.VarParsing
Definition: VarParsing.py:10