CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
rpcChamberMasker_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 import sys
3 
4 from SimMuon.RPCDigitizer.rpcChamberMasker_cfi import rpcChamberMasker as _rpcChamberMasker
5 from Configuration.Eras.Modifier_phase2_muon_cff import phase2_muon
6 
8 
9  phase2_muon.toModify(process, appendRPCChamberMaskerBeforeRecHits)
10  (~phase2_muon).toModify(process, appendRPCChamberMaskerAtUnpacking)
11 
12  return process
13 
14 
15 # To be used for PhaseII
16 # no packin/unpacking is available for RE3/1 RE4/1
17 # must start from sim digis
19 
20  if hasattr(process,'rpcRecHits') :
21 
22  sys.stderr.write("[appendRPCChamberMasker] : Found rpcRecHits, applying filter\n")
23 
24  process.rpcAgedDigis = _rpcChamberMasker.clone()
25  process.rpcAgedDigis.digiTag = cms.InputTag('simMuonRPCDigis')
26 
27  process.rpcRecHits = process.rpcRecHits.clone()
28  process.rpcRecHits.rpcDigiLabel = cms.InputTag('rpcAgedDigis')
29 
30  process.filteredRpcDigiSequence = cms.Sequence(process.rpcAgedDigis \
31  + process.rpcRecHits)
32 
33  process.reconstruction.replace(process.rpcRecHits, \
34  process.filteredRpcDigiSequence)
35 
36  if hasattr(process,"RandomNumberGeneratorService") :
37  process.RandomNumberGeneratorService.rpcAgedDigis = cms.PSet(
38  initialSeed = cms.untracked.uint32(789342)
39  )
40  else :
41  process.RandomNumberGeneratorService = cms.Service(
42  "RandomNumberGeneratorService",
43  rpcAgedDigis = cms.PSet(initialSeed = cms.untracked.uint32(789342))
44  )
45 
46  return process
47 
48 
49 # To be used for PhaseII
50 # exploit unpacking of digis
52 
53  if hasattr(process,'muonRPCDigis') :
54 
55  sys.stderr.write("[appendRPCChamberMasker] : Found muonRPCDigis, applying filter\n")
56 
57  process.preRPCDigis = process.muonRPCDigis.clone()
58  process.muonRPCDigis = _rpcChamberMasker.clone()
59 
60  if hasattr(process,"RandomNumberGeneratorService") :
61  process.RandomNumberGeneratorService.muonRPCDigis = cms.PSet(
62  initialSeed = cms.untracked.uint32(789342)
63  )
64  else :
65  process.RandomNumberGeneratorService = cms.Service(
66  "RandomNumberGeneratorService",
67  muonRPCDigis = cms.PSet(initialSeed = cms.untracked.uint32(789342))
68  )
69 
70  process.RawToDigiTask.add(process.preRPCDigis)
71 
72  return process