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('datafnPosition',
35  3, # default value
36  VarParsing.VarParsing.multiplicity.singleton,
37  VarParsing.VarParsing.varType.int,
38  "Data filename position in the positional arguments array 'data' in json file.")
39 
40 options.register('streamLabel',
41  'streamDQM', # default DQM stream value
42  VarParsing.VarParsing.multiplicity.singleton,
43  VarParsing.VarParsing.varType.string,
44  "Name of the stream")
45 
46 options.register('noDB',
47  True, # default value
48  VarParsing.VarParsing.multiplicity.singleton,
49  VarParsing.VarParsing.varType.bool,
50  "Don't upload the BeamSpot conditions to the DB")
51 
52 options.register('scanOnce',
53  True, # default value
54  VarParsing.VarParsing.multiplicity.singleton,
55  VarParsing.VarParsing.varType.bool,
56  "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'.")
57 
58 options.register('skipFirstLumis',
59  False, # default value
60  VarParsing.VarParsing.multiplicity.singleton,
61  VarParsing.VarParsing.varType.bool,
62  "Skip (and ignore the minEventsPerLumi parameter) for the files which have been available at the beginning of the processing.")
63 
64 options.register('BeamSplashRun',
65  False, # default value
66  VarParsing.VarParsing.multiplicity.singleton,
67  VarParsing.VarParsing.varType.bool,
68  "Set client source settings for beam SPLASH run")
69 
70 # This is used only by the online clients themselves.
71 # We need to register it here because otherwise an error occurs saying that there is an unidentified option.
72 options.register('unitTest',
73  True,
74  VarParsing.VarParsing.multiplicity.singleton,
75  VarParsing.VarParsing.varType.bool,
76  "Required to avoid the error.")
77 
78 options.parseArguments()
79 
80 # Read streamer files from https://github.com/cms-data/DQM-Integration
81 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]
82 print("Reading streamer files from:\n ", dqm_integration_data)
83 
84 # Set the process source
85 source = cms.Source("DQMStreamerReader",
86  runNumber = cms.untracked.uint32(options.runNumber),
87  runInputDir = cms.untracked.string(dqm_integration_data),
88  SelectEvents = cms.untracked.vstring('*'),
89  streamLabel = cms.untracked.string(options.streamLabel),
90  scanOnce = cms.untracked.bool(options.scanOnce),
91  datafnPosition = cms.untracked.uint32(options.datafnPosition),
92  minEventsPerLumi = cms.untracked.int32(1000),
93  delayMillis = cms.untracked.uint32(500),
94  nextLumiTimeoutMillis = cms.untracked.int32(0),
95  skipFirstLumis = cms.untracked.bool(options.skipFirstLumis),
96  deleteDatFiles = cms.untracked.bool(False),
97  endOfRunKills = cms.untracked.bool(False),
98  inputFileTransitionsEachEvent = cms.untracked.bool(False)
99 )
100 
101 maxEvents = cms.untracked.PSet(
102  input = cms.untracked.int32(-1)
103 )
104 
105 runType = RunType()
106 if not options.runkey.strip():
107  options.runkey = "pp_run"
108 
109 runType.setRunType(options.runkey.strip())
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47