Exemplo n.º 1
0
def getShotNoise(myeff, effbins, samples, samplesize):
    effs = numpy.zeros(effbins)
    for _ in range(samples):
        rnds = numpy.random.random(samplesize)
        accs = (rnds < myeff).sum()
        eff = efficiencyDeltaFix((accs / samplesize,))
        ndx = genEffIndex(eff[0], effbins)
        effs[ndx] += 1 / samples
    return effs
Exemplo n.º 2
0
 def testEfficiencyIndexForEff1(self):
     self.assertEqual(genEffIndex(1., 10), 9)