Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:30:43

0001 from __future__ import print_function
0002 import FWCore.ParameterSet.Config as cms
0003 import sys
0004 
0005 from SimMuon.DTDigitizer.dtChamberMasker_cfi import dtChamberMasker as _dtChamberMasker
0006 
0007 def appendDTChamberMaskerAtUnpacking(process):
0008 
0009     if hasattr(process,'muonDTDigis') and hasattr(process,'RawToDigi'):
0010         
0011         sys.stderr.write("[appendDTChamberMasker] : Found muonDTDigis, applying filter\n")
0012 
0013         process.preDtDigis = process.muonDTDigis.clone()
0014         process.muonDTDigis = _dtChamberMasker.clone()
0015 
0016         process.muonDTDigis.digiTag = cms.InputTag('preDtDigis') 
0017 
0018         process.RawToDigiTask.add(process.preDtDigis)
0019 
0020         if hasattr(process,"dtTriggerEfficiencyMonitor") :
0021             process.dtTriggerEfficiencyMonitor.inputTagDDU = 'preDtDigis'
0022 
0023         if hasattr(process,"RandomNumberGeneratorService") :
0024             process.RandomNumberGeneratorService.muonDTDigis = cms.PSet(
0025                 initialSeed = cms.untracked.uint32(789342)
0026                 )
0027         else :
0028             process.RandomNumberGeneratorService = cms.Service(
0029                 "RandomNumberGeneratorService",
0030                 muonDTDigis = cms.PSet(initialSeed = cms.untracked.uint32(789342))
0031                 )
0032 
0033     return process
0034 
0035 def appendDTChamberMaskerAtHLT(process):
0036 
0037     if hasattr(process,'hltMuonDTDigis') and \
0038        ( hasattr(process,'HLTMuonLocalRecoSequence') or \
0039          hasattr(process,'HLTMuonLocalRecoMeanTimerSequence')) :
0040 
0041         sys.stderr.write("[appendDTChamberMasker] : Found hltMuonDTDigis, applying filter\n")
0042 
0043         process.preHltDtDigis = process.hltMuonDTDigis.clone()
0044         process.hltMuonDTDigis = _dtChamberMasker.clone()
0045 
0046         process.hltMuonDTDigis.digiTag = "preHltDtDigis"
0047 
0048         process.filteredHltDtDigiSequence = cms.Sequence(process.preHltDtDigis + process.hltMuonDTDigis)
0049         if hasattr(process,'HLTMuonLocalRecoSequence') :
0050             print("1")
0051             process.HLTMuonLocalRecoSequence.replace(process.hltMuonDTDigis, process.filteredHltDtDigiSequence)
0052         if hasattr(process,'HLTMuonLocalRecoMeanTimerSequence') :
0053             print("2")
0054             process.HLTMuonLocalRecoMeanTimerSequence.replace(process.hltMuonDTDigis, process.filteredHltDtDigiSequence)
0055 
0056         process.globalReplace("hltMuonDTDigis",filteredHltDtDigiSequence)
0057 
0058         if hasattr(process,"RandomNumberGeneratorService") :
0059             process.RandomNumberGeneratorService.hltMuonDTDigis = cms.PSet(
0060                 initialSeed = cms.untracked.uint32(789342)
0061                 )
0062         else :
0063             process.RandomNumberGeneratorService = cms.Service(
0064                 "RandomNumberGeneratorService",
0065                 hltMuonDTDigis = cms.PSet(initialSeed = cms.untracked.uint32(789342))
0066                 )
0067             
0068     return process
0069 
0070 def appendDTChamberMaskerBeforeL1Trigger(process):
0071 
0072     if hasattr(process,'simDtTriggerPrimitiveDigis') and hasattr(process,'SimL1TMuonCommon') :
0073 
0074         sys.stderr.write("[appendDTChamberMasker] : Found simMuonDtTriggerPrimitivesDigis, applying filter\n")
0075 
0076         process.preSimDtTriggerDigis = _dtChamberMasker.clone()
0077 
0078         process.simDtTriggerPrimitiveDigis.digiTag = "preSimDtDigis"
0079 
0080         process.filteredSimDtTriggerSequence = cms.Sequence(process.preSimDtTriggerDigis + process.simDtTriggerPrimitiveDigis)
0081         process.SimL1TMuonCommon.replace(process.simMuonDTDigis, process.filteredSimDtTriggerSequence)
0082 
0083         if hasattr(process,"RandomNumberGeneratorService") :
0084             process.RandomNumberGeneratorService.simMuonDTDigis = cms.PSet(
0085                 initialSeed = cms.untracked.uint32(789342)
0086                 )
0087         else :
0088             process.RandomNumberGeneratorService = cms.Service(
0089                 "RandomNumberGeneratorService",
0090                 simMuonDTDigis = cms.PSet(initialSeed = cms.untracked.uint32(789342))
0091                 )
0092             
0093     return process