Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-09-21 04:25:30

0001 from __future__ import print_function
0002 from __future__ import absolute_import
0003 import FWCore.ParameterSet.Config as cms
0004 import FWCore.ParameterSet.VarParsing as VarParsing
0005 
0006 import sys
0007 from .dqmPythonTypes import *
0008 
0009 options = VarParsing.VarParsing('analysis')
0010 
0011 options.register('runNumber',
0012                  111,
0013                  VarParsing.VarParsing.multiplicity.singleton,
0014                  VarParsing.VarParsing.varType.int,
0015                  "Run number.")
0016 
0017 options.register('runInputDir',
0018                  '/tmp',
0019                  VarParsing.VarParsing.multiplicity.singleton,
0020                  VarParsing.VarParsing.varType.string,
0021                  "Directory where the DQM files will appear.")
0022 
0023 options.register('scanOnce',
0024                  False, # default value
0025                  VarParsing.VarParsing.multiplicity.singleton,
0026                  VarParsing.VarParsing.varType.bool,
0027                  "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'.")
0028 
0029 options.register('skipFirstLumis',
0030                  False, # default value
0031                  VarParsing.VarParsing.multiplicity.singleton,
0032                  VarParsing.VarParsing.varType.bool,
0033                  "Skip (and ignore the minEventsPerLumi parameter) for the files which have been available at the begining of the processing. ")
0034 
0035 options.register('BeamSplashRun',
0036                  False, # default value
0037                  VarParsing.VarParsing.multiplicity.singleton,
0038                  VarParsing.VarParsing.varType.bool,
0039                  "Set client source settings for beam SPLASH run")
0040 
0041 # Parameters for runType
0042 
0043 options.register ('runkey',
0044           'pp_run',
0045           VarParsing.VarParsing.multiplicity.singleton,
0046           VarParsing.VarParsing.varType.string,
0047           "Run Keys of CMS")
0048 
0049 # Parameter for frontierKey
0050 
0051 options.register ('runUniqueKey',
0052           'InValid',
0053           VarParsing.VarParsing.multiplicity.singleton,
0054           VarParsing.VarParsing.varType.string,
0055           "Unique run key from RCMS for Frontier")
0056 
0057 options.parseArguments()
0058 
0059 # Fix to allow scram to compile
0060 #if len(sys.argv) > 1:
0061 #  options.parseArguments()
0062 
0063 runType = RunType()
0064 if not options.runkey.strip():
0065   options.runkey = 'pp_run'
0066 
0067 runType.setRunType(options.runkey.strip())
0068 
0069 # Input source
0070 nextLumiTimeoutMillis = 120000
0071 endOfRunKills = True
0072 
0073 if options.scanOnce:
0074     endOfRunKills = False
0075     nextLumiTimeoutMillis = 0
0076 
0077 source = cms.Source("DQMProtobufReader",
0078     runNumber = cms.untracked.uint32(options.runNumber),
0079     runInputDir = cms.untracked.string(options.runInputDir),
0080 
0081     streamLabel = cms.untracked.string('streamDQMHistograms'),
0082     scanOnce = cms.untracked.bool(options.scanOnce),
0083 
0084     delayMillis = cms.untracked.uint32(500),
0085     nextLumiTimeoutMillis = cms.untracked.int32(nextLumiTimeoutMillis),
0086     skipFirstLumis = cms.untracked.bool(options.skipFirstLumis),
0087     deleteDatFiles = cms.untracked.bool(False),
0088     loadFiles = cms.untracked.bool(True),
0089     endOfRunKills  = cms.untracked.bool(endOfRunKills),
0090 )
0091 
0092 # https://twiki.cern.ch/twiki/bin/viewauth/CMS/CMSBeamSplash2017
0093 def set_BeamSplashRun_settings( source ):
0094   # source.minEventsPerLumi      = 1000000
0095   source.nextLumiTimeoutMillis = 15000
0096 
0097 if options.BeamSplashRun : set_BeamSplashRun_settings( source )
0098 
0099 print("Initial Source settings:", source)
0100 
0101