-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11083 from wulsin/addGenPlusSimParticles76X
Add customize configuration file to produce/keep a collection of part…
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|