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.muonDigi = cms.Sequence(process.simMuonCSCDigis + process.simMuonDTDigis + process.simMuonRPCDigis + process.simMuonGEMDigis + process.simMuonGEMCSCPadDigis)
96  process.doAllDigi = cms.Sequence(process.trDigi + process.calDigi + process.muonDigi)
97  process.pdigi = cms.Sequence(
98  cms.SequencePlaceholder("randomEngineStateProducer")*
99  cms.SequencePlaceholder("mix")*
100  process.doAllDigi*
101  process.trackingParticles*
102  process.addPileupInfo )
103  return process
104 
105 
106 # customize the digitization sequence pdigi to only digitize DT+CSC+RPC+GEM
108  process = customize_random_GEMDigi(process)
109  process = customize_mix_addGEM_muon_only(process)
110  process.muonDigi = cms.Sequence(process.simMuonCSCDigis + process.simMuonDTDigis + process.simMuonRPCDigis + process.simMuonGEMDigis + process.simMuonGEMCSCPadDigis)
111  process.pdigi = cms.Sequence(
112  cms.SequencePlaceholder("randomEngineStateProducer")*
113  cms.SequencePlaceholder("mix")*
114  process.muonDigi )
115  return process
116 
117 
118 # customize the digitization sequence pdigi to only digitize GEM
120  process = customize_random_GEMDigi(process)
121  process = customize_mix_addGEM_muon_only(process)
122  process.muonDigi = cms.Sequence(process.simMuonCSCDigis + process.simMuonDTDigis + process.simMuonRPCDigis + process.simMuonGEMDigis + process.simMuonGEMCSCPadDigis)
123  process.pdigi = cms.Sequence(
124  cms.SequencePlaceholder("randomEngineStateProducer")*
125  cms.SequencePlaceholder("mix")*
126  process.simMuonGEMDigis*
127  process.simMuonGEMCSCPadDigis )
128  return process
129 
def customize_mix_addGEM_muon_only