Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
#####################################
# a bunch of handy customisation functions
# author: Lukas Vanelderen
# date:   Jan 21 2015
#####################################

import FWCore.ParameterSet.Config as cms

def disableOOTPU(process):
    process.mix.maxBunch = cms.int32(0)
    process.mix.minBunch = cms.int32(0)
    # set the bunch spacing
    # bunch spacing matters for calorimeter calibration
    # by convention bunchspace is set to 450 in case of no oot pu
    process.mix.bunchspace = 450
    return process

# run this customisation function during the digi-step
# when processing a gen-sim sample that was generated with the HCALECAL geometry
def fakeSimHits_for_geometry_ECALHCAL(process):
    import FastSimulation.Validation.EmptySimHits_cfi
    process.g4SimHits = FastSimulation.Validation.EmptySimHits_cfi.emptySimHits.clone(
        pCaloHitInstanceLabels = ["CastorFI"],
        pSimHitInstanceLabels = []
        )
    for _entry  in process.mix.mixObjects.mixSH.input:
        process.g4SimHits.pSimHitInstanceLabels.append(_entry.getProductInstanceLabel())
    process.emptySimHits_step = cms.Path(process.g4SimHits)
    process.schedule.insert(0,process.emptySimHits_step)
    return process

def disableMaterialInteractionsTracker(process):
    for layer in process.fastSimProducer.detectorDefinition.BarrelLayers: 
        layer.interactionModels = cms.untracked.vstring("trackerSimHits")
    for layer in process.fastSimProducer.detectorDefinition.ForwardLayers: 
        layer.interactionModels = cms.untracked.vstring("trackerSimHits")
    return process