In [7]:
import dmdd
import numpy as np
%matplotlib inline

In [2]:
# Testing the object Experiment
# Pass efficiency function
xe = dmdd.Experiment('1xe', 'xenon', 5, 100, 2000, dmdd.eff.efficiency_unit)

print 'experiment: {} ({:.0f} kg-yr)'.format(xe.name, xe.exposure)

# The minimum detectable WIMP mass (head-on collision, transfers all of momentum)
# With AM the v_lag will be changing with time
minimum_mx = xe.find_min_mass(v_esc=540., v_lag=220., mx_guess=1.) 
print 'minimum detectable WIMP mass: {:.1f} GeV'.format(minimum_mx)

# The exclusion curve or maximum exclusion at 50 GeV (mass), assuming 4 background events (Nbackground)
sigma_exp = xe.sigma_limit(sigma_name='sigma_si', fnfp_name='fnfp_si', fnfp_val=-1.1,
                                mass=50, Nbackground=4, sigma_guess = 1e10, mx_guess=1.,
                                v_esc=540., v_lag=220., v_rms=220., rho_x=0.3)
anapole_exp = xe.sigma_limit(sigma_name='sigma_anapole', fnfp_name='fnfp_anapole', fnfp_val=-1.1,
                            mass=50, Nbackground=4, sigma_guess=1e10, mx_guess=1.,
                            v_esc=540., v_lag=220., v_rms=220., rho_x=0.3)

sigma_normalized = sigma_exp * dmdd.PAR_NORMS['sigma_si']
anapole_normalized = anapole_exp * dmdd.PAR_NORMS['sigma_anapole']

print 'projected exclusion for SI scattering @ 50 GeV: sigma_p = {:.2e} cm^2'.format(sigma_normalized)
print 'projected exclusion for Anapole scattering @ 50 GeV: sigma_p = {:.2e} cm^2'.format(anapole_normalized)


experiment: 1xe (2000 kg-yr)
minimum detectable WIMP mass: 7.3 GeV
projected exclusion for SI scattering @ 50 GeV: sigma_p = 1.93e-46 cm^2
projected exclusion for Anapole scattering @ 50 GeV: sigma_p = 5.28e-41 cm^2

In [3]:
# Testing the object Model


# shortcut for scattering models corresponding to rates coded in rate_UV:
anapole_model = dmdd.UV_Model('Anapole', ['mass','sigma_anapole'])
SI_model = dmdd.UV_Model('SI', ['mass','sigma_si'])

print 'model: {}, parameters: {}.'.format(anapole_model.name, anapole_model.param_names)
print 'model: {}, parameters: {}.'.format(SI_model.name, SI_model.param_names)


model: Anapole, parameters: ['mass', 'sigma_anapole'].
model: SI, parameters: ['mass', 'sigma_si'].

In [4]:
# Testing the object Simulation

# intialize an Experiment with XENON target, to be passed to Simulation:
# (this is the same as the experiment test above)
xe = dmdd.Experiment('1xe', 'xenon', 5, 100, 1000, dmdd.eff.efficiency_unit, energy_resolution=True)


# initialize a simulation with xe, for SI and Anapole models defined above,
# for 50 GeV WIMP, for sigma_si = 70*PAR_NORMS['sigma_si'] and PAR_NORMS['sigma_anapole'] 
test_A = dmdd.Simulation('xesim_anapole', xe, anapole_model, {'mass':50.,'sigma_anapole':40.})

test_si = dmdd.Simulation('xesim_si', xe, SI_model, {'mass':50.,'sigma_si':72.})


dmdd.Simulation.plot_data(test_A)
dmdd.Simulation.plot_data(test_si)



# print '\n List of energies generated in {} is: \n\n'.format(test.name),test.Q


simulation had 161 events (expected 152).
simulation had 160 events (expected 161).

In [5]:
test_A.param_values


Out[5]:
[50.0, 40.0]

In [6]:
dmdd.SIM_PATH


Out[6]:
'/Users/katelynneese/.dmdd/simulations_uv/'

In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]: