Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 import FWCore.ParameterSet.Config as cms
0002 import sys
0003 
0004 from SimMuon.RPCDigitizer.rpcChamberMasker_cfi import rpcChamberMasker as _rpcChamberMasker
0005 from Configuration.Eras.Modifier_phase2_muon_cff import phase2_muon
0006 
0007 def appendRPCChamberMaskerAtReco(process):
0008 
0009     phase2_muon.toModify(process, appendRPCChamberMaskerBeforeRecHits)
0010     (~phase2_muon).toModify(process, appendRPCChamberMaskerAtUnpacking)
0011 
0012     return process
0013 
0014 
0015 # To be used for PhaseII
0016 # no packin/unpacking is available for RE3/1 RE4/1
0017 # must start from sim digis  
0018 def appendRPCChamberMaskerBeforeRecHits(process):
0019 
0020     if hasattr(process,'rpcRecHits') :
0021 
0022         sys.stderr.write("[appendRPCChamberMasker] : Found rpcRecHits, applying filter\n")
0023 
0024         process.rpcAgedDigis = _rpcChamberMasker.clone()
0025         process.rpcAgedDigis.digiTag = cms.InputTag('simMuonRPCDigis')
0026 
0027         process.rpcRecHits = process.rpcRecHits.clone()
0028         process.rpcRecHits.rpcDigiLabel = cms.InputTag('rpcAgedDigis')
0029 
0030         process.filteredRpcDigiSequence = cms.Sequence(process.rpcAgedDigis \
0031                                                        + process.rpcRecHits)
0032 
0033         process.reconstruction.replace(process.rpcRecHits, \
0034                                        process.filteredRpcDigiSequence)
0035 
0036         if hasattr(process,"RandomNumberGeneratorService") :
0037             process.RandomNumberGeneratorService.rpcAgedDigis = cms.PSet(
0038                 initialSeed = cms.untracked.uint32(789342)
0039                 )
0040         else :
0041             process.RandomNumberGeneratorService = cms.Service(
0042                 "RandomNumberGeneratorService",
0043                 rpcAgedDigis = cms.PSet(initialSeed = cms.untracked.uint32(789342))
0044                 )
0045 
0046         return process
0047 
0048 
0049 # To be used for PhaseII
0050 # exploit unpacking of digis  
0051 def appendRPCChamberMaskerAtUnpacking(process):
0052 
0053     if hasattr(process,'muonRPCDigis') :
0054 
0055         sys.stderr.write("[appendRPCChamberMasker] : Found muonRPCDigis, applying filter\n")
0056 
0057         process.preRPCDigis = process.muonRPCDigis.clone()
0058         process.muonRPCDigis = _rpcChamberMasker.clone()
0059 
0060         if hasattr(process,"RandomNumberGeneratorService") :
0061             process.RandomNumberGeneratorService.muonRPCDigis = cms.PSet(
0062                 initialSeed = cms.untracked.uint32(789342)
0063                 )
0064         else :
0065             process.RandomNumberGeneratorService = cms.Service(
0066                 "RandomNumberGeneratorService",
0067                 muonRPCDigis = cms.PSet(initialSeed = cms.untracked.uint32(789342))
0068                 )
0069 
0070         process.RawToDigiTask.add(process.preRPCDigis)
0071 
0072     return process