From 93ae8566115bb521b04a7f1ec29bbf4077405ab0 Mon Sep 17 00:00:00 2001 From: jean-roch Date: Sun, 15 Dec 2024 12:21:15 +0100 Subject: [PATCH] add two options to set a flat mixing, and the bunchspace --- Configuration/StandardSequences/python/Mixing.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Configuration/StandardSequences/python/Mixing.py b/Configuration/StandardSequences/python/Mixing.py index 04f3658249ebe..55b29162084b2 100644 --- a/Configuration/StandardSequences/python/Mixing.py +++ b/Configuration/StandardSequences/python/Mixing.py @@ -223,4 +223,18 @@ def defineMixing(dict): if 'F' in dict: commands.append('process.mix.input.fileNames = cms.untracked.vstring(%s)'%(repr(dict['F']))) dict.pop('F') + if 'BS' in dict: + bunch_space = dict['BS'] + commands.append(f'process.mix.bunchspace = cms.int32({bunch_space})') + dict.pop('BS') + if 'Flat' in dict: + pu_min,pu_max=dict['Flat'] + pu_x = list(range(pu_max+1)) + pu_y = [0]*(pu_max+1) + prob=1./(pu_max+1-pu_min) + for pu in range(pu_min,pu_max+1): + pu_y[pu]=prob + commands.append(f'process.mix.input.nbPileupEvents.probFunctionVariable = cms.vint32({pu_x})') + commands.append(f'process.mix.input.nbPileupEvents.probValue = cms.vdouble({pu_y})') + dict.pop('Flat') return commands