CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
customizeHLTforALL Namespace Reference

Functions

def customizeHLTforAll
 

Function Documentation

def customizeHLTforALL.customizeHLTforAll (   process,
  _customInfo = None 
)

Definition at line 3 of file customizeHLTforALL.py.

References customizeHLTforCMSSW.customiseHLTforCMSSW(), and ConfigBuilder.MassReplaceInputTag().

3 
4 def customizeHLTforAll(process, _customInfo = None):
5 
6  if (_customInfo is not None):
7 
8  _maxEvents = _customInfo['maxEvents']
9  _globalTag = _customInfo['globalTag']
10  _inputFile = _customInfo['inputFile']
11  _realData = _customInfo['realData']
12 
13  import FWCore.ParameterSet.VarParsing as VarParsing
14  cmsRunOptions = VarParsing.VarParsing('python')
15 
16  cmsRunOptions.maxEvents = _maxEvents
17  cmsRunOptions.register('globalTag',_globalTag,cmsRunOptions.multiplicity.singleton,cmsRunOptions.varType.string,"GlobalTag")
18  cmsRunOptions.inputFiles = _inputFile
19  cmsRunOptions.register('realData',_realData,cmsRunOptions.multiplicity.singleton,cmsRunOptions.varType.bool,"Real Data?")
20 
21  cmsRunOptions.parseArguments()
22 
23 # report in log file
24 # print cmsRunOptions
25 
26  _maxEvents = cmsRunOptions.maxEvents
27  _globalTag = cmsRunOptions.globalTag
28  _inputFile = cmsRunOptions.inputFiles
29  _realData = cmsRunOptions.realData
30 
31 # maxEvents
32  if _maxEvents != -2:
33  _maxEvents = cms.untracked.int32( _maxEvents )
34  if hasattr(process,'maxEvents'):
35  process.maxEvents.input = _maxEvents
36  else:
37  process.maxEvents = cms.untracked.PSet( input = _maxEvents )
38 
39 # GlobalTag
40  if _globalTag == "@":
41  _globalTag = _customInfo['globalTags'][_realData]
42  if _globalTag != "":
43  if hasattr(process,'GlobalTag'):
44  from Configuration.AlCa.GlobalTag_condDBv2 import GlobalTag
45  process.GlobalTag = GlobalTag(process.GlobalTag, _globalTag, '')
46 
47 # inputFile
48  if _inputFile[0] == "@":
49  _inputFile[0] = _customInfo['inputFiles'][_realData]
50  if _inputFile != "":
51  if hasattr(process,'source'):
52  process.source.fileNames = cms.untracked.vstring( _inputFile )
53 
54 # MC customisation
55  if not _realData:
56  from HLTrigger.Configuration.customizeHLTforMC import customizeHLTforMC
57  process = customizeHLTforMC(process)
58  if _customInfo['menuType'] == "HIon":
59  from HLTrigger.Configuration.CustomConfigs import MassReplaceInputTag
60  process = MassReplaceInputTag(process,"rawDataRepacker","rawDataCollector")
61  else:
62  pass
63 
64 # CMSSW version customisation
65  from HLTrigger.Configuration.customizeHLTforCMSSW import customiseHLTforCMSSW
66  process = customiseHLTforCMSSW(process)
67 
68  return process