00001 from FWCore.ParameterSet import Config, Mixins
00002
00003 def switchToSimGtDigis(process):
00004 """patch the process to use 'sim*Digis' from the L1 emulator instead of 'hlt*Digis' from the RAW data"""
00005
00006
00007 process.hltL1GtObjectMap.GmtInputTag = Config.InputTag( 'simGmtDigis' )
00008 process.hltL1GtObjectMap.GctInputTag = Config.InputTag( 'simGctDigis' )
00009 process.hltL1extraParticles.muonSource = Config.InputTag( 'simGmtDigis' )
00010 process.hltL1extraParticles.isolatedEmSource = Config.InputTag( 'simGctDigis','isoEm' )
00011 process.hltL1extraParticles.nonIsolatedEmSource = Config.InputTag( 'simGctDigis','nonIsoEm' )
00012 process.hltL1extraParticles.centralJetSource = Config.InputTag( 'simGctDigis','cenJets' )
00013 process.hltL1extraParticles.forwardJetSource = Config.InputTag( 'simGctDigis','forJets' )
00014 process.hltL1extraParticles.tauJetSource = Config.InputTag( 'simGctDigis','tauJets' )
00015 process.hltL1extraParticles.etTotalSource = Config.InputTag( 'simGctDigis' )
00016 process.hltL1extraParticles.etHadSource = Config.InputTag( 'simGctDigis' )
00017 process.hltL1extraParticles.etMissSource = Config.InputTag( 'simGctDigis' )
00018 process.hltL2MuonSeeds.GMTReadoutCollection = Config.InputTag( 'simGmtDigis' )
00019
00020
00021 for module in process.__dict__.itervalues():
00022 if isinstance(module, Mixins._Parameterizable):
00023 for parameter in module.__dict__.itervalues():
00024 if isinstance(parameter, Config.InputTag):
00025 if parameter.moduleLabel == 'hltGtDigis':
00026 parameter.moduleLabel = 'simGtDigis'
00027 elif parameter.moduleLabel == 'hltGmtDigis':
00028 parameter.moduleLabel = 'simGmtDigis'
00029 elif parameter.moduleLabel == 'hltGctDigis':
00030 parameter.moduleLabel = 'simGctDigis'
00031
00032
00033 hasGtDigis = 'hltGtDigis' in process.producers
00034 hasGmtDigis = 'hltGmtDigis' in process.producers
00035 hasGctDigis = 'hltGctDigis' in process.producers
00036
00037
00038 for iterable in process.sequences.itervalues():
00039 if hasGtDigis: iterable.remove( process.hltGtDigis )
00040 if hasGmtDigis: iterable.remove( process.hltGmtDigis )
00041 if hasGctDigis: iterable.remove( process.hltGctDigis )
00042
00043 for iterable in process.paths.itervalues():
00044 if hasGtDigis: iterable.remove( process.hltGtDigis )
00045 if hasGmtDigis: iterable.remove( process.hltGmtDigis )
00046 if hasGctDigis: iterable.remove( process.hltGctDigis )
00047
00048 for iterable in process.endpaths.itervalues():
00049 if hasGtDigis: iterable.remove( process.hltGtDigis )
00050 if hasGmtDigis: iterable.remove( process.hltGmtDigis )
00051 if hasGctDigis: iterable.remove( process.hltGctDigis )
00052