CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
customizeHLTforALL.py
Go to the documentation of this file.
2 
3 def customizeHLTforAll(process, _customInfo = None):
4 
5  if (_customInfo is not None):
6 
7  _maxEvents = _customInfo['maxEvents']
8  _globalTag = _customInfo['globalTag']
9  _inputFile = _customInfo['inputFile']
10  _realData = _customInfo['realData']
11  _fastSim = _customInfo['fastSim']
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  cmsRunOptions.register('fastSim' ,_fastSim ,cmsRunOptions.multiplicity.singleton,cmsRunOptions.varType.bool,"Fast Sim ?")
21 
22  cmsRunOptions.parseArguments()
23 
24 # report in log file
25  print cmsRunOptions
26 
27  _maxEvents = cmsRunOptions.maxEvents
28  _globalTag = cmsRunOptions.globalTag
29  _inputFile = cmsRunOptions.inputFiles
30  _realData = cmsRunOptions.realData
31  _fastSim = cmsRunOptions.fastSim
32 
33 # maxEvents
34  if _maxEvents != -2:
35  _maxEvents = cms.untracked.int32( _maxEvents )
36  if hasattr(process,'maxEvents'):
37  process.maxEvents.input = _maxEvents
38  else:
39  process.maxEvents = cms.untracked.PSet( input = _maxEvents )
40 
41 # GlobalTag
42  if _globalTag == "@":
43  _globalTag = _customInfo['globalTags'][_realData]
44  if _globalTag != "":
45  if hasattr(process,'GlobalTag'):
46  from Configuration.AlCa.GlobalTag_condDBv2 import GlobalTag
47  process.GlobalTag = GlobalTag(process.GlobalTag, _globalTag, '')
48 
49 # inputFile
50  if _inputFile[0] == "@":
51  _inputFile[0] = _customInfo['inputFiles'][_realData]
52  if _inputFile != "":
53  if hasattr(process,'source'):
54  process.source.fileNames = cms.untracked.vstring( _inputFile )
55 
56 # MC customisation
57  if not _realData:
58  from HLTrigger.Configuration.customizeHLTforMC import customizeHLTforMC
59  process = customizeHLTforMC(process,_fastSim)
60  if _customInfo['menuType'] == "HIon":
61  from HLTrigger.Configuration.CustomConfigs import MassReplaceInputTag
62  process = MassReplaceInputTag(process,"rawDataRepacker","rawDataCollector")
63  else:
64  pass
65 
66 # CMSSW version customisation
67  from HLTrigger.Configuration.customizeHLTforCMSSW import customiseHLTforCMSSW
68  process = customiseHLTforCMSSW(process)
69 
70  return process