CMS 3D CMS Logo

unitteststreamerinputsource_cfi.py
Go to the documentation of this file.
1 from __future__ import print_function
2 from __future__ import absolute_import
3 from builtins import range
4 import os
5 import FWCore.ParameterSet.Config as cms
6 
7 # Parameters for runType
8 import FWCore.ParameterSet.VarParsing as VarParsing
9 from .dqmPythonTypes import *
10 
11 # Dedine and register options
12 options = VarParsing.VarParsing("analysis")
13 
14 # Parameters for runType
15 options.register ('runkey',
16  'pp_run',
17  VarParsing.VarParsing.multiplicity.singleton,
18  VarParsing.VarParsing.varType.string,
19  "Run Keys of CMS")
20 
21 # Parameter for frontierKey
22 options.register('runUniqueKey',
23  'InValid',
24  VarParsing.VarParsing.multiplicity.singleton,
25  VarParsing.VarParsing.varType.string,
26  "Unique run key from RCMS for Frontier")
27 
28 options.register('runNumber',
29  356383,
30  VarParsing.VarParsing.multiplicity.singleton,
31  VarParsing.VarParsing.varType.int,
32  "Run number. This run number has to be present in https://github.com/cms-data/DQM-Integration")
33 
34 options.register('streamLabel',
35  'streamDQM', # default DQM stream value
36  VarParsing.VarParsing.multiplicity.singleton,
37  VarParsing.VarParsing.varType.string,
38  "Name of the stream")
39 
40 options.register('noDB',
41  True, # default value
42  VarParsing.VarParsing.multiplicity.singleton,
43  VarParsing.VarParsing.varType.bool,
44  "Don't upload the BeamSpot conditions to the DB")
45 
46 options.register('scanOnce',
47  True, # default value
48  VarParsing.VarParsing.multiplicity.singleton,
49  VarParsing.VarParsing.varType.bool,
50  "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'.")
51 
52 options.register('skipFirstLumis',
53  False, # default value
54  VarParsing.VarParsing.multiplicity.singleton,
55  VarParsing.VarParsing.varType.bool,
56  "Skip (and ignore the minEventsPerLumi parameter) for the files which have been available at the begining of the processing. ")
57 
58 options.register('BeamSplashRun',
59  False, # default value
60  VarParsing.VarParsing.multiplicity.singleton,
61  VarParsing.VarParsing.varType.bool,
62  "Set client source settings for beam SPLASH run")
63 
64 # This is used only by the online clients themselves.
65 # We need to register it here because otherwise an error occurs saying that there is an unidentified option.
66 options.register('unitTest',
67  True,
68  VarParsing.VarParsing.multiplicity.singleton,
69  VarParsing.VarParsing.varType.bool,
70  "Required to avoid the error.")
71 
72 options.parseArguments()
73 
74 # Read streamer files from https://github.com/cms-data/DQM-Integration
75 dqm_integration_data = [os.path.join(dir,'DQM/Integration/data') for dir in os.getenv('CMSSW_SEARCH_PATH','').split(":") if os.path.exists(os.path.join(dir,'DQM/Integration/data'))][0]
76 print("Reading streamer files from:\n ", dqm_integration_data)
77 
78 # Set the process source
79 source = cms.Source("DQMStreamerReader",
80  runNumber = cms.untracked.uint32(options.runNumber),
81  runInputDir = cms.untracked.string(dqm_integration_data),
82  SelectEvents = cms.untracked.vstring('*'),
83  streamLabel = cms.untracked.string(options.streamLabel),
84  scanOnce = cms.untracked.bool(options.scanOnce),
85  minEventsPerLumi = cms.untracked.int32(1000),
86  delayMillis = cms.untracked.uint32(500),
87  nextLumiTimeoutMillis = cms.untracked.int32(0),
88  skipFirstLumis = cms.untracked.bool(options.skipFirstLumis),
89  deleteDatFiles = cms.untracked.bool(False),
90  endOfRunKills = cms.untracked.bool(False),
91  inputFileTransitionsEachEvent = cms.untracked.bool(False)
92 )
93 
94 maxEvents = cms.untracked.PSet(
95  input = cms.untracked.int32(-1)
96 )
97 
98 runType = RunType()
99 if not options.runkey.strip():
100  options.runkey = "pp_run"
101 
102 runType.setRunType(options.runkey.strip())
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47