CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC4_patch1/src/SimMuon/GEMDigitizer/python/customizeGEMDigi.py

Go to the documentation of this file.
00001 import FWCore.ParameterSet.Config as cms
00002 
00003 
00004 # PSet of mixObjects that only keeps muon collections (and SimTracks with SimVertices)
00005 mixObjects_dt_csc_rpc =  cms.PSet(
00006     mixCH = cms.PSet(
00007         crossingFrames = cms.untracked.vstring(),
00008         input = cms.VInputTag(),
00009         type = cms.string('PCaloHit'),
00010         subdets = cms.vstring()
00011     ),
00012     mixHepMC = cms.PSet(
00013         input = cms.VInputTag(cms.InputTag("generator")),
00014         makeCrossingFrame = cms.untracked.bool(True),
00015         type = cms.string('HepMCProduct')
00016     ),
00017     mixVertices = cms.PSet(
00018         input = cms.VInputTag(cms.InputTag("g4SimHits")),
00019         makeCrossingFrame = cms.untracked.bool(True),
00020         type = cms.string('SimVertex')
00021     ),
00022     mixSH = cms.PSet(
00023         crossingFrames = cms.untracked.vstring(
00024             'MuonCSCHits',
00025             'MuonDTHits',
00026             'MuonRPCHits'
00027             ),
00028         input = cms.VInputTag(
00029             cms.InputTag("g4SimHits","MuonCSCHits"),
00030             cms.InputTag("g4SimHits","MuonDTHits"),
00031             cms.InputTag("g4SimHits","MuonRPCHits")),
00032         type = cms.string('PSimHit'),
00033         subdets = cms.vstring(
00034             'MuonCSCHits',
00035             'MuonDTHits',
00036             'MuonRPCHits'
00037             )
00038     ),
00039     mixTracks = cms.PSet(
00040         input = cms.VInputTag(cms.InputTag("g4SimHits")),
00041         makeCrossingFrame = cms.untracked.bool(True),
00042         type = cms.string('SimTrack')
00043     )
00044 )
00045 
00046 
00047 # Customize process.mix to be used for running muon (DT, CSC, RPC) digi only.
00048 #  - remove non-muon digitizers that are now run as part of mixing process
00049 #  - delete all the digitizers' aliases.
00050 #  - drop unnecessary mixObjects
00051 def customize_mix_muon_only(process):
00052     process.mix.digitizers = digitizers = cms.PSet()
00053     digi_aliases = filter(lambda n: 'Digi' in n, process.aliases.keys())
00054     for a in digi_aliases: process.__delattr__(a)
00055     process.mix.mixObjects = mixObjects_dt_csc_rpc
00056     return process
00057 
00058 
00059 # a modifier to append GEM SimHit collection definitions to mixObjects.mixSH
00060 def mixObjects_addGEM(mixSH):
00061     mixSH.crossingFrames.append('MuonGEMHits')
00062     mixSH.input.append(cms.InputTag("g4SimHits","MuonGEMHits"))
00063     mixSH.subdets.append('MuonGEMHits')
00064     return mixSH
00065 
00066 
00067 # customize process.mix by appending GEM SimHit collection definitions to mix.mixObjects.mixSH
00068 def customize_mix_addGEM(process):
00069     mixObjects_addGEM(process.mix.mixObjects.mixSH)
00070     return process
00071 
00072 
00073 # Customize process.mix to be used for running muon (DT, CSC, RPC + GEM) digi only.
00074 #  - first do such customization for (DT, CSC, RPC)
00075 #  - append GEM SimHit collection definitions to mix.mixObjects.mixSH
00076 def customize_mix_addGEM_muon_only(process):
00077     process = customize_mix_muon_only(process)
00078     mixObjects_addGEM(process.mix.mixObjects.mixSH)
00079     return process
00080 
00081 
00082 # Add simMuonGEMDigis to the list of modules served by RandomNumberGeneratorService
00083 def customize_random_GEMDigi(process):
00084     process.RandomNumberGeneratorService.simMuonGEMDigis = cms.PSet(
00085         initialSeed = cms.untracked.uint32(1234567),
00086         engineName = cms.untracked.string('HepJamesRandom')
00087     )
00088     return process
00089 
00090 
00091 # customize the full digitization sequence pdigi by adding GEMs
00092 def customize_digi_addGEM(process):
00093     process = customize_random_GEMDigi(process)
00094     process = customize_mix_addGEM(process)
00095     process.muonDigi = cms.Sequence(process.simMuonCSCDigis + process.simMuonDTDigis + process.simMuonRPCDigis + process.simMuonGEMDigis + process.simMuonGEMCSCPadDigis)
00096     process.doAllDigi = cms.Sequence(process.trDigi + process.calDigi + process.muonDigi)
00097     process.pdigi = cms.Sequence(
00098         cms.SequencePlaceholder("randomEngineStateProducer")*
00099         cms.SequencePlaceholder("mix")*
00100         process.doAllDigi*
00101         process.trackingParticles*
00102         process.addPileupInfo )
00103     return process
00104 
00105 
00106 # customize the digitization sequence pdigi to only digitize DT+CSC+RPC+GEM
00107 def customize_digi_addGEM_muon_only(process):
00108     process = customize_random_GEMDigi(process)
00109     process = customize_mix_addGEM_muon_only(process)
00110     process.muonDigi = cms.Sequence(process.simMuonCSCDigis + process.simMuonDTDigis + process.simMuonRPCDigis + process.simMuonGEMDigis + process.simMuonGEMCSCPadDigis)
00111     process.pdigi = cms.Sequence(
00112         cms.SequencePlaceholder("randomEngineStateProducer")*
00113         cms.SequencePlaceholder("mix")*
00114         process.muonDigi )
00115     return process
00116 
00117 
00118 # customize the digitization sequence pdigi to only digitize GEM
00119 def customize_digi_addGEM_gem_only(process):
00120     process = customize_random_GEMDigi(process)
00121     process = customize_mix_addGEM_muon_only(process)
00122     process.muonDigi = cms.Sequence(process.simMuonCSCDigis + process.simMuonDTDigis + process.simMuonRPCDigis + process.simMuonGEMDigis + process.simMuonGEMCSCPadDigis)
00123     process.pdigi = cms.Sequence(
00124         cms.SequencePlaceholder("randomEngineStateProducer")*
00125         cms.SequencePlaceholder("mix")*
00126         process.simMuonGEMDigis*
00127         process.simMuonGEMCSCPadDigis )
00128     return process
00129