def customiseForAgeing(process, pathName, segmentAgeing, triggerAgeing): if segmentAgeing or triggerAgeing: if hasattr(process, "dt1DRecHits"): print "[customiseForAgeing]: prepending ageing before dt1DRecHits and adding ageing to RandomNumberGeneratorService" from SimMuon.DTDigitizer.dtChamberMasker_cfi import dtChamberMasker as _dtChamberMasker process.agedDtDigis = _dtChamberMasker.clone() getattr(process, pathName).replace( process.dt1DRecHits, process.agedDtDigis + process.dt1DRecHits) if hasattr(process, "RandomNumberGeneratorService"): process.RandomNumberGeneratorService.agedDtDigis = cms.PSet( initialSeed=cms.untracked.uint32(789342), engineName=cms.untracked.string('TRandom3')) else: process.RandomNumberGeneratorService = cms.Service( "RandomNumberGeneratorService", agedDtDigiss=cms.PSet( initialSeed=cms.untracked.uint32(789342), engineName=cms.untracked.string('TRandom3'))) if segmentAgeing: print "[customiseForAgeing]: switching dt1DRecHits input to agedDtDigis" process.dt1DRecHits.dtDigiLabel = "agedDtDigis" if triggerAgeing: print "[customiseForAgeing]: switching emulatros input to agedDtDigis" process.CalibratedDigis.dtDigiTag = "agedDtDigis" return process
def appendDTChamberMaskerAtUnpacking(process): if hasattr(process, 'muonDTDigis') and hasattr(process, 'RawToDigi'): sys.stderr.write( "[appendDTChamberMasker] : Found muonDTDigis, applying filter\n") process.preDtDigis = process.muonDTDigis.clone() process.muonDTDigis = _dtChamberMasker.clone() process.muonDTDigis.digiTag = cms.InputTag('preDtDigis') process.RawToDigiTask.add(process.preDtDigis) if hasattr(process, "dtTriggerEfficiencyMonitor"): process.dtTriggerEfficiencyMonitor.inputTagDDU = 'preDtDigis' if hasattr(process, "RandomNumberGeneratorService"): process.RandomNumberGeneratorService.muonDTDigis = cms.PSet( initialSeed=cms.untracked.uint32(789342)) else: process.RandomNumberGeneratorService = cms.Service( "RandomNumberGeneratorService", muonDTDigis=cms.PSet(initialSeed=cms.untracked.uint32(789342))) return process
def appendDTChamberAgingAtL1Trigger(process): # ############################################################################# # This function adds aging producers for DT TPs # by appending DTChamberMasker and the corresponding dtTriggerPrimitiveDigies # ############################################################################# from SimMuon.DTDigitizer.dtChamberMasker_cfi import dtChamberMasker as _dtChamberMasker from L1Trigger.DTTrigger.dtTriggerPrimitiveDigis_cfi import dtTriggerPrimitiveDigis as _dtTriggerPrimitiveDigis if hasattr(process,'simDtTriggerPrimitiveDigis') and hasattr(process,'SimL1TMuonCommon') : sys.stderr.write("[appendDTChamberMasker] : Found simDtTriggerPrimitivesDigis, appending producer for aged DTs and corresponding TriggerPrimitives producer\n") process.simAgedDtTriggerDigis = _dtChamberMasker.clone() process.simDtTriggerPrimitiveDigis = _dtTriggerPrimitiveDigis.clone() process.simDtTriggerPrimitiveDigis.digiTag = "simAgedDtTriggerDigis" process.withAgedDtTriggerSequence = cms.Sequence(process.simAgedDtTriggerDigis + process.simDtTriggerPrimitiveDigis) process.SimL1TMuonCommon.replace(process.simDtTriggerPrimitiveDigis, process.withAgedDtTriggerSequence) if hasattr(process,"RandomNumberGeneratorService") : process.RandomNumberGeneratorService.simAgedDtTriggerDigis = cms.PSet( initialSeed = cms.untracked.uint32(789342), engineName = cms.untracked.string('TRandom3') ) else : process.RandomNumberGeneratorService = cms.Service( "RandomNumberGeneratorService", simAgedDtTriggerDigis = cms.PSet(initialSeed = cms.untracked.uint32(789342)) ) return process
def appendDTChamberMaskerAtUnpacking(process): if hasattr(process,'muonDTDigis') and hasattr(process,'RawToDigi'): sys.stderr.write("[appendDTChamberMasker] : Found muonDTDigis, applying filter\n") process.preDtDigis = process.muonDTDigis.clone() process.muonDTDigis = _dtChamberMasker.clone() process.muonDTDigis.digiTag = cms.InputTag('preDtDigis') process.filteredDtDigiSequence = cms.Sequence(process.preDtDigis + process.muonDTDigis) process.RawToDigi.replace(process.muonDTDigis, process.filteredDtDigiSequence) if hasattr(process,"dtTriggerEfficiencyMonitor") : process.dtTriggerEfficiencyMonitor.inputTagDDU = 'preDtDigis' if hasattr(process,"RandomNumberGeneratorService") : process.RandomNumberGeneratorService.muonDTDigis = cms.PSet( initialSeed = cms.untracked.uint32(789342) ) else : process.RandomNumberGeneratorService = cms.Service( "RandomNumberGeneratorService", muonDTDigis = cms.PSet(initialSeed = cms.untracked.uint32(789342)) ) return process
def appendDTChamberMaskerAtHLT(process): if hasattr(process,'hltMuonDTDigis') and \ ( hasattr(process,'HLTMuonLocalRecoSequence') or \ hasattr(process,'HLTMuonLocalRecoMeanTimerSequence')) : sys.stderr.write("[appendDTChamberMasker] : Found hltMuonDTDigis, applying filter\n") process.preHltDtDigis = process.hltMuonDTDigis.clone() process.hltMuonDTDigis = _dtChamberMasker.clone() process.hltMuonDTDigis.digiTag = "preHltDtDigis" process.filteredHltDtDigiSequence = cms.Sequence(process.preHltDtDigis + process.hltMuonDTDigis) if hasattr(process,'HLTMuonLocalRecoSequence') : print "1" process.HLTMuonLocalRecoSequence.replace(process.hltMuonDTDigis, process.filteredHltDtDigiSequence) if hasattr(process,'HLTMuonLocalRecoMeanTimerSequence') : print "2" process.HLTMuonLocalRecoMeanTimerSequence.replace(process.hltMuonDTDigis, process.filteredHltDtDigiSequence) process.globalReplace("hltMuonDTDigis",filteredHltDtDigiSequence) if hasattr(process,"RandomNumberGeneratorService") : process.RandomNumberGeneratorService.hltMuonDTDigis = cms.PSet( initialSeed = cms.untracked.uint32(789342) ) else : process.RandomNumberGeneratorService = cms.Service( "RandomNumberGeneratorService", hltMuonDTDigis = cms.PSet(initialSeed = cms.untracked.uint32(789342)) ) return process
def appendDTChamberMaskerBeforeL1Trigger(process): if hasattr(process,'simDtTriggerPrimitiveDigis') and hasattr(process,'SimL1TMuonCommon') : sys.stderr.write("[appendDTChamberMasker] : Found simMuonDtTriggerPrimitivesDigis, applying filter\n") process.preSimDtTriggerDigis = _dtChamberMasker.clone() process.simDtTriggerPrimitiveDigis.digiTag = "preSimDtDigis" process.filteredSimDtTriggerSequence = cms.Sequence(process.preSimDtTriggerDigis + process.simDtTriggerPrimitiveDigis) process.SimL1TMuonCommon.replace(process.simMuonDTDigis, process.filteredSimDtTriggerSequence) if hasattr(process,"RandomNumberGeneratorService") : process.RandomNumberGeneratorService.simMuonDTDigis = cms.PSet( initialSeed = cms.untracked.uint32(789342) ) else : process.RandomNumberGeneratorService = cms.Service( "RandomNumberGeneratorService", simMuonDTDigis = cms.PSet(initialSeed = cms.untracked.uint32(789342)) ) return process
def customiseForAgeing(process, pathName, segmentAgeing, triggerAgeing, rpcAgeing): if segmentAgeing or triggerAgeing: if hasattr(process, "dt1DRecHits"): print( "[customiseForAgeing]: prepending ageing before dt1DRecHits and adding ageing to RandomNumberGeneratorService" ) from SimMuon.DTDigitizer.dtChamberMasker_cfi import dtChamberMasker as _dtChamberMasker process.agedDtDigis = _dtChamberMasker.clone() getattr(process, pathName).replace( process.dt1DRecHits, process.agedDtDigis + process.dt1DRecHits) if hasattr(process, "bkgDtDigis"): print( "[customiseForAgeing]: configuring agedDtDigis to use bkgDtDigis" ) process.agedDtDigis.digiTag = "bkgDtDigis" if segmentAgeing: print( "[customiseForAgeing]: trying to age segments and generate random digi noise, option non supported. quitting." ) sys.exit(999) if hasattr(process, "RandomNumberGeneratorService"): process.RandomNumberGeneratorService.agedDtDigis = cms.PSet( initialSeed=cms.untracked.uint32(789342), engineName=cms.untracked.string('TRandom3')) else: process.RandomNumberGeneratorService = cms.Service( "RandomNumberGeneratorService", agedDtDigis=cms.PSet( initialSeed=cms.untracked.uint32(789342), engineName=cms.untracked.string('TRandom3'))) if segmentAgeing: print( "[customiseForAgeing]: switching dt1DRecHits input to agedDtDigis") process.dt1DRecHits.dtDigiLabel = "agedDtDigis" if triggerAgeing: print("[customiseForAgeing]: switching emulatros input to agedDtDigis") process.CalibratedDigis.dtDigiTag = "agedDtDigis" if hasattr(process, "dtTriggerPhase2HbPrimitiveDigis"): process.dtTriggerPhase2HbPrimitiveDigis.dtDigiLabel = "agedDtDigis" if rpcAgeing: if hasattr(process, "rpcRecHits"): print( "[customiseForAgeing]: prepending ageing before rpcRecHits and adding ageing to RandomNumberGeneratorService" ) from SimMuon.RPCDigitizer.rpcChamberMasker_cfi import rpcChamberMasker as _rpcChamberMasker process.agedRpcDigis = _rpcChamberMasker.clone() process.agedRpcDigis.digiTag = "simMuonRPCDigis" getattr(process, pathName).replace( process.rpcRecHits, process.agedRpcDigis + process.rpcRecHits) if hasattr(process, "RandomNumberGeneratorService"): process.RandomNumberGeneratorService.agedRpcDigis = cms.PSet( initialSeed=cms.untracked.uint32(789342), engineName=cms.untracked.string('TRandom3')) else: process.RandomNumberGeneratorService = cms.Service( "RandomNumberGeneratorService", agedRpcDigis=cms.PSet( initialSeed=cms.untracked.uint32(789342), engineName=cms.untracked.string('TRandom3'))) print( "[customiseForAgeing]: switching rpcRecHits input to agedRpcDigis" ) process.rpcRecHits.rpcDigiLabel = "agedRpcDigis" return process