Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:15:59

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 def customizeHLTforAll(process, menuType = "GRun", _customInfo = None):
0004 
0005     if (_customInfo is not None):
0006 
0007         _maxEvents = _customInfo['maxEvents']
0008         _globalTag = _customInfo['globalTag']
0009         _inputFile = _customInfo['inputFile']
0010         _realData  = _customInfo['realData']
0011         
0012         import FWCore.ParameterSet.VarParsing as VarParsing
0013         cmsRunOptions = VarParsing.VarParsing('python')
0014 
0015         cmsRunOptions.maxEvents  = _maxEvents
0016         cmsRunOptions.register('globalTag',_globalTag,cmsRunOptions.multiplicity.singleton,cmsRunOptions.varType.string,"GlobalTag")
0017         cmsRunOptions.inputFiles = _inputFile
0018         cmsRunOptions.register('realData',_realData,cmsRunOptions.multiplicity.singleton,cmsRunOptions.varType.bool,"Real Data?")
0019 
0020         cmsRunOptions.parseArguments()
0021 
0022 # report in log file
0023 #       print cmsRunOptions
0024 
0025         _maxEvents = cmsRunOptions.maxEvents
0026         _globalTag = cmsRunOptions.globalTag
0027         _inputFile = cmsRunOptions.inputFiles
0028         _realData  = cmsRunOptions.realData
0029 
0030 # maxEvents
0031         if _maxEvents != -2:
0032             _maxEvents = cms.untracked.int32( _maxEvents )
0033             if hasattr(process,'maxEvents'):
0034                 process.maxEvents.input = _maxEvents
0035             else:
0036                 process.maxEvents = cms.untracked.PSet( input = _maxEvents )
0037 
0038 # GlobalTag
0039         if _globalTag == "@":
0040             _globalTag = _customInfo['globalTags'][_realData]
0041         if _globalTag != "":
0042             if hasattr(process,'GlobalTag'):
0043                 from Configuration.AlCa.GlobalTag import GlobalTag
0044                 process.GlobalTag = GlobalTag(process.GlobalTag, _globalTag, '')
0045 #               process.GlobalTag.snapshotTime = cms.string("9999-12-31 23:59:59.000")
0046 
0047 # inputFile
0048         if _inputFile[0] == "@":
0049             _inputFile[0] = _customInfo['inputFiles'][_realData]
0050         if _inputFile != "":
0051             if hasattr(process,'source'):
0052                 process.source.fileNames = cms.untracked.vstring( _inputFile )
0053 
0054         if not _realData:
0055             from HLTrigger.Configuration.customizeHLTforMC import customizeHLTforMC
0056             process = customizeHLTforMC(process)
0057 
0058     return process