CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
customizeGEMDigi.py
Go to the documentation of this file.
2 
3 
4 # PSet of mixObjects that only keeps muon collections (and SimTracks with SimVertices)
5 mixObjects_dt_csc_rpc = cms.PSet(
6  mixCH = cms.PSet(
7  crossingFrames = cms.untracked.vstring(),
8  input = cms.VInputTag(),
9  type = cms.string('PCaloHit'),
10  subdets = cms.vstring()
11  ),
12  mixHepMC = cms.PSet(
13  input = cms.VInputTag(cms.InputTag("generator")),
14  makeCrossingFrame = cms.untracked.bool(True),
15  type = cms.string('HepMCProduct')
16  ),
17  mixVertices = cms.PSet(
18  input = cms.VInputTag(cms.InputTag("g4SimHits")),
19  makeCrossingFrame = cms.untracked.bool(True),
20  type = cms.string('SimVertex')
21  ),
22  mixSH = cms.PSet(
23  crossingFrames = cms.untracked.vstring(
24  'MuonCSCHits',
25  'MuonDTHits',
26  'MuonRPCHits'
27  ),
28  input = cms.VInputTag(
29  cms.InputTag("g4SimHits","MuonCSCHits"),
30  cms.InputTag("g4SimHits","MuonDTHits"),
31  cms.InputTag("g4SimHits","MuonRPCHits")),
32  type = cms.string('PSimHit'),
33  subdets = cms.vstring(
34  'MuonCSCHits',
35  'MuonDTHits',
36  'MuonRPCHits'
37  )
38  ),
39  mixTracks = cms.PSet(
40  input = cms.VInputTag(cms.InputTag("g4SimHits")),
41  makeCrossingFrame = cms.untracked.bool(True),
42  type = cms.string('SimTrack')
43  )
44 )
45 
46 
47 # Customize process.mix to be used for running muon (DT, CSC, RPC) digi only.
48 # - remove non-muon digitizers that are now run as part of mixing process
49 # - delete all the digitizers' aliases.
50 # - drop unnecessary mixObjects
52  process.mix.digitizers = digitizers = cms.PSet()
53  digi_aliases = filter(lambda n: 'Digi' in n, process.aliases.keys())
54  for a in digi_aliases: process.__delattr__(a)
55  process.mix.mixObjects = mixObjects_dt_csc_rpc
56  return process
57 
58 
59 # a modifier to append GEM SimHit collection definitions to mixObjects.mixSH
60 def mixObjects_addGEM(mixSH):
61  mixSH.crossingFrames.append('MuonGEMHits')
62  mixSH.input.append(cms.InputTag("g4SimHits","MuonGEMHits"))
63  mixSH.subdets.append('MuonGEMHits')
64  return mixSH
65 
66 
67 # customize process.mix by appending GEM SimHit collection definitions to mix.mixObjects.mixSH
68 def customize_mix_addGEM(process):
69  mixObjects_addGEM(process.mix.mixObjects.mixSH)
70  return process
71 
72 
73 # Customize process.mix to be used for running muon (DT, CSC, RPC + GEM) digi only.
74 # - first do such customization for (DT, CSC, RPC)
75 # - append GEM SimHit collection definitions to mix.mixObjects.mixSH
77  process = customize_mix_muon_only(process)
78  mixObjects_addGEM(process.mix.mixObjects.mixSH)
79  return process
80 
81 
82 # Add simMuonGEMDigis to the list of modules served by RandomNumberGeneratorService
84  process.RandomNumberGeneratorService.simMuonGEMDigis = cms.PSet(
85  initialSeed = cms.untracked.uint32(1234567),
86  engineName = cms.untracked.string('HepJamesRandom')
87  )
88  return process
89 
90 
91 # customize the full digitization sequence pdigi by adding GEMs
92 def customize_digi_addGEM(process):
93  process = customize_random_GEMDigi(process)
94  process = customize_mix_addGEM(process)
95  process.doAllDigi = cms.Sequence(process.trDigi + process.calDigi + process.muonDigi)
96  process.pdigi = cms.Sequence(
97  cms.SequencePlaceholder("randomEngineStateProducer")*
98  cms.SequencePlaceholder("mix")*
99  process.doAllDigi*
100  process.trackingParticles*
101  process.addPileupInfo )
102  return process
103 
104 
105 # customize the digitization sequence pdigi to only digitize DT+CSC+RPC+GEM
107  process = customize_random_GEMDigi(process)
108  process = customize_mix_addGEM_muon_only(process)
109  process.muonDigi = cms.Sequence(process.simMuonCSCDigis + process.simMuonDTDigis + process.simMuonRPCDigis + process.simMuonGEMDigis + process.simMuonGEMPadDigis)
110  process.pdigi = cms.Sequence(
111  cms.SequencePlaceholder("randomEngineStateProducer")*
112  cms.SequencePlaceholder("mix")*
113  process.muonDigi )
114  return process
115 
116 
117 # customize the digitization sequence pdigi to only digitize GEM
119  process = customize_random_GEMDigi(process)
120  process = customize_mix_addGEM_muon_only(process)
121  process.muonDigi = cms.Sequence(process.simMuonCSCDigis + process.simMuonDTDigis + process.simMuonRPCDigis + process.simMuonGEMDigis + process.simMuonGEMPadDigis)
122  process.pdigi = cms.Sequence(
123  cms.SequencePlaceholder("randomEngineStateProducer")*
124  cms.SequencePlaceholder("mix")*
125  process.simMuonGEMDigis*
126  process.simMuonGEMPadDigis )
127  return process
128 
def customize_mix_addGEM_muon_only