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