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,
  menuType = "GRun",
  _customInfo = None 
)

Definition at line 3 of file customizeHLTforALL.py.

References ConfigBuilder.MassReplaceInputTag().

3 
4 def customizeHLTforAll(process, menuType = "GRun", _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 # process.GlobalTag.snapshotTime = cms.string("9999-12-31 23:59:59.000")
47 
48 # inputFile
49  if _inputFile[0] == "@":
50  _inputFile[0] = _customInfo['inputFiles'][_realData]
51  if _inputFile != "":
52  if hasattr(process,'source'):
53  process.source.fileNames = cms.untracked.vstring( _inputFile )
54 
55  if _realData:
56 # Real-Data customisation
57  if menuType == "HIon":
58 # fix "Unrunnable schedule" exception
59  from HLTrigger.Configuration.CustomConfigs import MassReplaceInputTag
60  process = MassReplaceInputTag(process,"rawDataRepacker","rawDataCollector") #,"rawDataRepacker::@skipCurrentProcess")
61  else:
62 # Monte-Carlo customisation
63  from HLTrigger.Configuration.customizeHLTforMC import customizeHLTforMC
64  process = customizeHLTforMC(process)
65  if menuType == "HIon":
66  from HLTrigger.Configuration.CustomConfigs import MassReplaceInputTag
67  process = MassReplaceInputTag(process,"rawDataRepacker","rawDataCollector")
68 
69  else:
70  pass
71 
72  return process