CMS 3D CMS Logo

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