Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GenPlusSimParticles_cfi.py. #11082

Merged
merged 2 commits into from Sep 16, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 31 additions & 0 deletions SimG4Core/CustomPhysics/python/GenPlusSimParticles_cfi.py
@@ -0,0 +1,31 @@
# These customize functions can be used to produce or keep a GenPlusSimParticleProducer collection,
# which contains particles from the generator (e.g. Pythia) and simulation (i.e., GEANT).
#
# Add to the cmsDriver.py command an argument such as:
# --customise SimG4Core/CustomPhysics/GenPlusSimParticles_cfi.customizeProduce,SimG4Core/CustomPhysics/GenPlusSimParticles_cfi.customizeKeep

import FWCore.ParameterSet.Config as cms

def customizeKeep (process):
outputTypes = ["RAWSIM", "RECOSIM", "AODSIM", "MINIAODSIM"]
for a in outputTypes:
b = a + "output"
if hasattr (process, b):
getattr (process, b).outputCommands.append ("keep *_genParticlePlusGeant_*_*")

return process


def customizeProduce (process):
process.genParticlePlusGeant = cms.EDProducer("GenPlusSimParticleProducer",
src = cms.InputTag("g4SimHits"), # use "famosSimHits" for FAMOS
setStatus = cms.int32(8), # set status = 8 for GEANT GPs
filter = cms.vstring("pt > 10.0"), # just for testing (optional)
genParticles = cms.InputTag("genParticles") # original genParticle list
)

if hasattr (process, "simulation_step") and hasattr(process, "psim"):
getattr(process, "simulation_step")._seq = getattr(process,"simulation_step")._seq * process.genParticlePlusGeant

return process