Exemplo n.º 1
0
operators = [1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
with open("operators.txt") as f: operatorsymbols = f.readlines()

for opi, operator in enumerate(operators):
    print("Operator-%i"%operator)
    control_dict = {"OPERATOR" : operator}
    first=True
    plt.figure(1)
    plt.clf()
    plt.figure(2)
    plt.clf()
    for dresfile in dresfiles:
        input_dict = {"DRESFILE" : dresfile[:-5]} # remove .dres extension
        
        E, R = dm.runTemplates(exec_name, input_template, control_template, input_dict,
            control_dict, workdir='./', label='runCustom',
            resultfile='eventrate_spectra.dat')
        if (first):
            first=False
            R0 = R
        plt.figure(1)
        plt.plot(E,R,label=dresfile[:-5])
        plt.figure(2)
        plt.plot(E,abs(R - R0)/R0,label=dresfile[:-5])
    plt.figure(1) 
    plt.title("%s Xe-131, 500 GeV WIMP, $c^n_%s=$4.8E-4"%(operatorsymbols[opi],
        operator)) 
    plt.xlabel('$E_{recoil}$ (keV)')
    plt.ylabel('Events/MeV')
    plt.legend(loc=1)
    plt.xscale('log')
Exemplo n.º 2
0
angle = np.linspace(0, np.pi/2, 20)

fig = plt.figure()
ax = fig.add_subplot(111, projection="3d")

for i, a in enumerate(angle):

    r = 0.00048
    c3 = np.sin(a)
    c5 = np.cos(a)

    control_dict = {"c3" : c3, "c5" : c5}
    input_dict = {}

    Er, dRdE = dm.runTemplates(exec_name, input_template, control_template, input_dict,
        control_dict, workdir='./')

    theta = np.ones(len(Er)) * a

    #plt.plot(Er,dRdE,label=r"$\theta=%1.2f^{\circ}$"%(a*180/np.pi))
    print("min %s max %s"%(min(dRdE),max(dRdE)))
    ax.plot(theta, np.log(Er), np.log(dRdE),color='black')

#plt.title(r"$c_7 \mathcal{O}_7 + c_8 \mathcal{O}_8$")
#plt.text(10.,10**(-6),"%s %s with $c_7^2+c_8^2=1$"%(operatorsymbols[7-1],operatorsymbols[8-1]))

ax.set_xlabel(r"$\theta$")
ax.set_ylabel(r"$log(E_r)$ (keV)")
ax.set_zlabel(r"$log(dR_D/dE_r)$ (1/GeV)")

plt.show()
Exemplo n.º 3
0
    # should look for.
    resultfile = "eventrate_spectra.dat"
    g = open(filename_base + ".csv", "w+")
    g.write("# WIMP_mass, Recoil_energy, Event_rate\n")

    tzero = timeit.default_timer()
    for WIMPMASS in masses:

        print("m = %s" % WIMPMASS)

        input_dict = {}
        control_dict = {"WIMPMASS": WIMPMASS}

        tstart = timeit.default_timer()
        E, R = dm.runTemplates(exec_name, input_template, control_template,
                               input_dict, control_dict, workdir, label,
                               resultfile)
        exectime = timeit.default_timer() - tstart
        tcycle = timeit.default_timer()

        print("DMFortFactor exec time: %s s" % (exectime))
        print("Python exec time:       %s s" % (tcycle - tzero - exectime))
        tzero = tcycle

        f = open(str(WIMPMASS) + filename_base, "w+")
        f.write("# Event rate (events/GeV) for %s GeV WIMPs." % WIMPMASS)
        f.write("# Recoil energy (keV)                # event rate")
        for ii, energy in enumerate(E):
            f.write("%10.5f    %s\n" % (energy, R[ii]))
        f.close()