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  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 # MC customisation
56  if not _realData:
57  from HLTrigger.Configuration.customizeHLTforMC import customizeHLTforMC
58  process = customizeHLTforMC(process)
59  if _customInfo['menuType'] == "HIon":
60  from HLTrigger.Configuration.CustomConfigs import MassReplaceInputTag
61  process = MassReplaceInputTag(process,"rawDataRepacker","rawDataCollector")
62  else:
63  pass
64 
65 # CMSSW version customisation
66  from HLTrigger.Configuration.customizeHLTforCMSSW import customiseHLTforCMSSW
67  process = customiseHLTforCMSSW(process)
68 
69  return process