Skip to content

Commit b205513

Browse files
authored
Merge pull request #46948 from vlimant/mixing_flat_cmsDriver
simplify flat mixing configuration
2 parents 198a1e2 + ba7c1fd commit b205513

File tree

1 file changed

+14
-0
lines changed
  • Configuration/StandardSequences/python

1 file changed

+14
-0
lines changed

Configuration/StandardSequences/python/Mixing.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,4 +222,18 @@ def defineMixing(dict):
222222
if 'F' in dict:
223223
commands.append('process.mix.input.fileNames = cms.untracked.vstring(%s)'%(repr(dict['F'])))
224224
dict.pop('F')
225+
if 'BS' in dict:
226+
bunch_space = dict['BS']
227+
commands.append(f'process.mix.bunchspace = cms.int32({bunch_space})')
228+
dict.pop('BS')
229+
if 'Flat' in dict:
230+
pu_min,pu_max=dict['Flat']
231+
pu_x = list(range(pu_max+1))
232+
pu_y = [0]*(pu_max+1)
233+
prob=1./(pu_max+1-pu_min)
234+
for pu in range(pu_min,pu_max+1):
235+
pu_y[pu]=prob
236+
commands.append(f'process.mix.input.nbPileupEvents.probFunctionVariable = cms.vint32({pu_x})')
237+
commands.append(f'process.mix.input.nbPileupEvents.probValue = cms.vdouble({pu_y})')
238+
dict.pop('Flat')
225239
return commands

0 commit comments

Comments
 (0)