CMS 3D CMS Logo

pbsource_cfi.py
Go to the documentation of this file.
1 from __future__ import print_function
2 import FWCore.ParameterSet.Config as cms
3 import FWCore.ParameterSet.VarParsing as VarParsing
4 
5 import sys
6 from dqmPythonTypes import *
7 
8 options = VarParsing.VarParsing('analysis')
9 
10 options.register('runNumber',
11  111,
12  VarParsing.VarParsing.multiplicity.singleton,
13  VarParsing.VarParsing.varType.int,
14  "Run number.")
15 
16 options.register('runInputDir',
17  '/tmp',
18  VarParsing.VarParsing.multiplicity.singleton,
19  VarParsing.VarParsing.varType.string,
20  "Directory where the DQM files will appear.")
21 
22 options.register('scanOnce',
23  False, # default value
24  VarParsing.VarParsing.multiplicity.singleton,
25  VarParsing.VarParsing.varType.bool,
26  "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'.")
27 
28 options.register('skipFirstLumis',
29  False, # default value
30  VarParsing.VarParsing.multiplicity.singleton,
31  VarParsing.VarParsing.varType.bool,
32  "Skip (and ignore the minEventsPerLumi parameter) for the files which have been available at the begining of the processing. ")
33 
34 # Parameters for runType
35 
36 options.register ('runkey',
37  'pp_run',
38  VarParsing.VarParsing.multiplicity.singleton,
39  VarParsing.VarParsing.varType.string,
40  "Run Keys of CMS")
41 
42 options.parseArguments()
43 
44 # Fix to allow scram to compile
45 #if len(sys.argv) > 1:
46 # options.parseArguments()
47 
48 runType = RunType()
49 if not options.runkey.strip():
50  options.runkey = 'pp_run'
51 
52 runType.setRunType(options.runkey.strip())
53 
54 # Input source
55 nextLumiTimeoutMillis = 120000
56 endOfRunKills = True
57 
58 if options.scanOnce:
59  endOfRunKills = False
60  nextLumiTimeoutMillis = 0
61 
62 source = cms.Source("DQMProtobufReader",
63  runNumber = cms.untracked.uint32(options.runNumber),
64  runInputDir = cms.untracked.string(options.runInputDir),
65 
66  streamLabel = cms.untracked.string('streamDQMHistograms'),
67  scanOnce = cms.untracked.bool(options.scanOnce),
68 
69  delayMillis = cms.untracked.uint32(500),
70  nextLumiTimeoutMillis = cms.untracked.int32(nextLumiTimeoutMillis),
71  skipFirstLumis = cms.untracked.bool(options.skipFirstLumis),
72  deleteDatFiles = cms.untracked.bool(False),
73  loadFiles = cms.untracked.bool(True),
74  endOfRunKills = cms.untracked.bool(endOfRunKills),
75 )
76 
77 print("Source:", source)
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66