CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/HLTrigger/Configuration/python/customizeHLTforL1Emulator.py

Go to the documentation of this file.
00001 import FWCore.ParameterSet.Config as cms
00002 
00003 def switchToL1Emulator(process):
00004   """patch the process to run the RawToDigi and SimL1Emulator sequences instead of unpacking the hltGctDigis and hltGtDigis"""
00005   HLTL1UnpackerSequence = cms.Sequence( process.RawToDigi + process.SimL1Emulator + process.hltL1GtObjectMap + process.hltL1extraParticles )
00006 
00007   for iterable in process.sequences.itervalues():
00008       iterable.replace( process.HLTL1UnpackerSequence, HLTL1UnpackerSequence)
00009 
00010   for iterable in process.paths.itervalues():
00011       iterable.replace( process.HLTL1UnpackerSequence, HLTL1UnpackerSequence)
00012 
00013   for iterable in process.endpaths.itervalues():
00014       iterable.replace( process.HLTL1UnpackerSequence, HLTL1UnpackerSequence)
00015 
00016   process.HLTL1UnpackerSequence = HLTL1UnpackerSequence
00017 
00018   return process
00019 
00020 def switchToCustomL1Digis(process, customGmt, customGct, customGt):
00021   """patch the process to use custom GMT, GCT and GT results"""
00022 
00023   # explicit replacements to use "simGtDigis", "simGmtDigis" and "simGctDigis" instead of "hltGtDigis" or "hltGctDigis"
00024   if 'hltL1GtObjectMap' in process.__dict__:
00025     process.hltL1GtObjectMap.GmtInputTag = cms.InputTag( customGmt )
00026     process.hltL1GtObjectMap.GctInputTag = cms.InputTag( customGct )
00027   if 'hltL1extraParticles' in process.__dict__:
00028     process.hltL1extraParticles.muonSource          = cms.InputTag( customGmt )
00029     process.hltL1extraParticles.isolatedEmSource    = cms.InputTag( customGct, 'isoEm' )
00030     process.hltL1extraParticles.nonIsolatedEmSource = cms.InputTag( customGct, 'nonIsoEm' )
00031     process.hltL1extraParticles.centralJetSource    = cms.InputTag( customGct, 'cenJets' )
00032     process.hltL1extraParticles.forwardJetSource    = cms.InputTag( customGct, 'forJets' )
00033     process.hltL1extraParticles.tauJetSource        = cms.InputTag( customGct, 'tauJets' )
00034     process.hltL1extraParticles.etTotalSource       = cms.InputTag( customGct )
00035     process.hltL1extraParticles.etHadSource         = cms.InputTag( customGct )
00036     process.hltL1extraParticles.etMissSource        = cms.InputTag( customGct )
00037   if 'hltL2MuonSeeds' in process.__dict__:
00038     process.hltL2MuonSeeds.GMTReadoutCollection = cms.InputTag( customGmt )
00039 
00040   # automatic replacements to use "simGtDigis" and "simGctDigis" instead of "hltGtDigis" or "hltGctDigis"
00041   for module in process.__dict__.itervalues():
00042     if isinstance(module, cms._Parameterizable):
00043       for parameter in module.__dict__.itervalues():
00044         if isinstance(parameter, cms.InputTag):
00045           if parameter.moduleLabel == 'hltGtDigis':
00046             parameter.moduleLabel = customGt
00047           elif parameter.moduleLabel == 'hltGctDigis':
00048             parameter.moduleLabel = customGct
00049 
00050   # check if "hltGtDigis" and "hltGctDigis" are defined
00051   hasGtDigis  = 'hltGtDigis'  in process.producers
00052   hasGctDigis = 'hltGctDigis' in process.producers
00053 
00054   # remove "hltGtDigis" and "hltGctDigis" from all paths, endpaths and sequences
00055   for iterable in process.sequences.itervalues():
00056     if hasGtDigis:  iterable.remove( process.hltGtDigis )
00057     if hasGctDigis: iterable.remove( process.hltGctDigis )
00058 
00059   for iterable in process.paths.itervalues():
00060     if hasGtDigis:  iterable.remove( process.hltGtDigis )
00061     if hasGctDigis: iterable.remove( process.hltGctDigis )
00062 
00063   for iterable in process.endpaths.itervalues():
00064     if hasGtDigis:  iterable.remove( process.hltGtDigis )
00065     if hasGctDigis: iterable.remove( process.hltGctDigis )
00066 
00067   return process
00068 
00069 
00070 def switchToSimGtDigis(process):
00071   """patch the process to use newly emulated GMT, GCT and GT results"""
00072   return switchToCustomL1Digis(process, 'gtDigis', 'gctDigis', 'simGtDigis')
00073 
00074 
00075 def switchToSimGmtGctGtDigis(process):
00076   """patch the process to use newly emulated GMT, GCT and GT results"""
00077   return switchToCustomL1Digis(process, 'simGmtDigis', 'simGctDigis', 'simGtDigis')
00078 
00079 
00080 def switchToSimGctGtDigis(process):
00081   """patch the process to use gtDigis for GMT results, and newly emulated GCT and GT results"""
00082   return switchToCustomL1Digis(process, 'gtDigis', 'simGctDigis', 'simGtDigis')
00083 
00084 
00085 def switchToSimGmtGtDigis(process):
00086   """patch the process to use gctDigis for GCT results, and newly emulated GMT and GT results"""
00087   return switchToCustomL1Digis(process, 'simGmtDigis', 'gctDigis', 'simGtDigis')