Pass a list of tuple pairs, with the first item of the pair a run number
and the second number of the pair a weight. The function will normalize the
weights so you do not have to worry about that. The pairs will be used to randomly choose what Run
should be assigned to the job.
Definition at line 6 of file ThrowAndSetRandomRun.py.
Referenced by ConfigBuilder.ConfigBuilder.filesFromOption().
7 """Pass a list of tuple pairs, with the first item of the pair a run number 8 and the second number of the pair a weight. The function will normalize the 9 weights so you do not have to worry about that. The pairs will be used to randomly choose what Run 10 should be assigned to the job. 12 from random
import SystemRandom
14 for r,p
in runsAndProbs:
17 random = SystemRandom()
18 runProb = random.uniform(0,totalProb)
21 for r,p
in runsAndProbs:
23 if sumProb >= runProb:
26 print 'setting runNumber to: ',runNumber
27 if source.type_() ==
"PoolSource":
28 source.setRunNumber = cms.untracked.uint32(runNumber)
31 source.firstRun = cms.untracked.uint32(runNumber)
34 def throwAndSetRandomRun(source, runsAndProbs)