def estimate(self): """ returns the health state of user("A"/"B","C","D") """ estimator = estimation(self.user_dict) state, prefer = estimator.estimate() self.prefer = prefer return state
nBin = 500 Emin = 0. Emax = 3. mass = 5.81 #masa de Xe purity = 0.91 #pureza trun = 100. #dias BgrRej = 1. SigEff = 1. rand = rt.TRandom3(0) Nbb2n = rand.Poisson((round(st.estimation(mass,purity,trun)*.695197*SigEff))) # texp = trun * 24 * 3600 #s # Ratio act (mBq) esperado ={60: {0 : int(round(3.935333e-2 * 0 /1000. *texp * BgrRej)), 1 : int(round(1.781900e-2 * 2.32e-1 /1000. *texp * BgrRej)), 2 : int(round(2.663240e-3 * 8.82 /1000. *texp * BgrRej)), 3 : int(round(6.060000e-5 * 8.4e-1 /1000. *texp * BgrRej)), 4 : int(round(3.945800e-2 * 2.27e-1 /1000. *texp * BgrRej)), 5 : int(round(4.147233e-2 * 9.66e-1 /1000. *texp * BgrRej)), 6 : int(round(1.525725e-3 * 2.02 /1000. *texp * BgrRej)), 7 : int(round(1.616075e-2 * 0 /1000. *texp * BgrRej)), 8 : int(round(8.496444e-3 * 2.52e1 /1000. *texp * BgrRej)), 9 : int(round(1.553625e-2 * 1.16e-1 /1000. *texp * BgrRej)),
from math import e from random import random from estimation import estimation, probability def get_max(): s=random() n=1 while s>=e**(-3): s*=random() n+=1 return n-1 N=[10*2,10**3,10**4,10**5,10**6] print "PARTE A)\r\n" for i in N: print estimation(i,get_max) print "\r\nPARTE B)\r\n" for i in range(0,7): print probability(i,10**6,get_max)
import estimation as st rt.gStyle.SetOptStat(1111); rt.gStyle.SetOptFit(1111111); nBin = 500 Emin = 0. Emax = 3. mass = 5.81 #masa de Xe purity = 0.91 #pureza trun = 100. #dias Nbb2n = int(st.estimation(mass,purity,trun)*.695197) texp = trun * 24 * 3600 #s elementdic = {60: 'Co60', 208: 'Tl208', 214: 'Bi214', 40: 'K40'} filedic = {0 :'ANODE_QUARTZ ', 1 :'CARRIER_PLATE ', 2 :'DICE_BOARD ', 3 :'ENCLOSURE_BODY ', 4 :'ICS ', 5 :'PEDESTAL ',
from random import random from tabulate import tabulate from estimation import estimation def get_min(): s=0.0 n=0 while s<1.0: s+=random() n+=1 return n N=[10**2,10**3,10**4,10**5,10**6] table=[] k=0 headers=['N', 'E(N)'] for n in N: table.append([n]) for i in N: table[k].append(estimation(i,get_min)) k +=1 print tabulate(table, headers, tablefmt="orgtbl")
nBin = 500 Emin = 0. Emax = 3. mass = 5.81 # Xe mass in kg purity = 0.91 # Ratio of 136Xe trun = 800. # Data taking time in days BgrRej = 1.0#0.2 # Background rejection factor SigEff = 1.0#0.8 # Signal efficiency factor rand = rt.TRandom3(0) # Double beta efficiency and expected number of events BBeff = 0.695197 Nbb2n = int( round( estimation(mass,purity,trun) * BBeff * SigEff ) ) if poissonize: Nbb2n = rand.Poisson(Nbb2n) texp = trun * 24 * 3600 # Exposition time in s # "element" branch map elementdic = { 60 : 'Co60', 208 : 'Tl208', 214 : 'Bi214', 40 : 'K40'} # "part" branch map partdic = { 0 :'ANODE_QUARTZ ', 1 :'CARRIER_PLATE ', 2 :'DICE_BOARD ',