def check_min_mass(element='fluorine', Qmin=1., v_esc=544., v_lag=220., mx_guess=1.): experiment = dmdd.Experiment('test', element, Qmin, 40., 100., eff.efficiency_unit) res = experiment.find_min_mass(v_esc=v_esc, v_lag=v_lag, mx_guess=mx_guess) print res, 'GeV' if res < 0: print 'Problem: try another mx_guess...'
SI_Higgs, millicharge, SD_flavoruniversal, SD_Zmediated, SD_Moira, anapole, magdip_heavy, magdip_0, elecdip_heavy, elecdip_0, f1, f2_Higgs, f2_flavoruniversal, f3_Higgs, f3_flavoruniversal ] MODELS1 = [SI_Higgs, anapole] SIMMODELS = [anapole] #[SI_Higgs,elecdip_heavy,elecdip_0] FITMODELS = MODELS1 ##get upper limits for a given mass: pandax = dmdd.Experiment('PandaX', 'xenon', 4., 30., 188., dmdd.eff.efficiency_Xe, 0., 1., energy_resolution=True) lux = dmdd.Experiment('LUX', 'xenon', 5., 50., 70., dmdd.eff.efficiency_Xe, 0., 1., energy_resolution=True) cdmslite = dmdd.Experiment('CDMSlite', 'germanium',
elif args.timeonly == 'F': timeonly = False if args.GF == 'T': GF = True elif args.GF == 'F': GF = False experiments = [] for i, experiment in enumerate(args.exps): efficiency = dmdd.eff.efficiency_Xe experiments.append( dmdd.Experiment(experiment, Target[experiment], Qmin[experiment], Qmax[experiment], Exposure[experiment], efficiency, Start[experiment], End[experiment], energy_resolution=EnergyResolution[experiment])) fixedsim_params = {} for i, par in enumerate(args.fixedsimnames): fixedsim_params[par] = args.fixedsimvals[i] fixedfit_params = {} for i, par in enumerate(args.fixedfitnames): fixedfit_params[par] = args.fixedfitvals[i] simmodel = dmdd.UV_Model(args.simmodelname, args.simpars,
def make_experiments(return_experiments=False): xe = dmdd.Experiment('Xe', 'xenon', 5., 40., 100., eff.efficiency_unit) ge = dmdd.Experiment('Ge', 'germanium', 0.4, 100., 100., eff.efficiency_unit) if return_experiments: return [xe, ge]
def test_UVrate(): experiment = dmdd.Experiment('Xe', 'xenon', 5., 40., 10000., eff.efficiency_unit) models = make_UVmodels(return_models=True) mass = 40. qs = np.array([15.]) v_lag = 200. v_rms = 100. v_esc = 600. rho_x = 0.4 sigma_names = {} fnfp_names = {} fnfp_vals = {} for m in models: sigma_names[m.name] = m.param_names[1] if len(m.fixed_params) > 0: fnfp_names[m.name] = m.fixed_params.keys()[0] fnfp_vals[m.name] = m.fixed_params.values()[0] else: fnfp_names[m.name] = None fnfp_vals[m.name] = None dRdQs = np.zeros(len(models)) Rs = np.zeros(len(models)) for i, m in enumerate(models): kwargs = {sigma_names[m.name]: 1.} if fnfp_names[m.name] is not None: kwargs[fnfp_names[m.name]] = fnfp_vals[m.name] dRdQs[i] = dmdd.rate_UV.dRdQ(qs, mass=mass, element=experiment.element, v_lag=v_lag, v_rms=v_rms, v_esc=v_esc, rho_x=rho_x, **kwargs) Rs[i] = dmdd.rate_UV.R(eff.efficiency_unit, mass=mass, element=experiment.element, Qmin=experiment.Qmin, Qmax=experiment.Qmax, v_lag=v_lag, v_rms=v_rms, v_esc=v_esc, rho_x=rho_x, **kwargs) #print 'dRdQs = {}\n'.format(dRdQs) #print 'Rs = {}\n'.format(Rs) dRdQs_correct = [ 1.27974652e-12, 1.67031585e-13, 6.28936205e-13, 7.76864477e-13, 7.71724584e-13, 5.66164037e-13, 8.40579288e-13, 6.16678247e-13, 4.72480605e-13, 2.59857470e-16, 9.59390104e-16, 1.14295679e-13 ] Rs_correct = [ 6.15358778e-11, 3.10857259e-11, 3.14982315e-11, 4.14119198e-11, 1.82181891e-11, 3.84877268e-11, 2.35638282e-11, 5.50063883e-11, 1.34702925e-11, 5.82472177e-15, 1.64213483e-14, 2.26028126e-12 ] assert np.allclose(dRdQs_correct, dRdQs) assert np.allclose(Rs_correct, Rs) ### qs = np.array([8.3, 15.7]) logtest1 = dmdd.rate_UV.loglikelihood(qs, eff.efficiency_unit, mass=mass, sigma_si=1., fnfp_si=1., element=experiment.element, Qmin=experiment.Qmin, Qmax=experiment.Qmax, exposure=experiment.exposure, energy_resolution=True, v_lag=v_lag, v_rms=v_rms, v_esc=v_esc, rho_x=rho_x) logtest2 = dmdd.rate_UV.loglikelihood(qs, eff.efficiency_unit, mass=mass, sigma_si=1., fnfp_si=1., element=experiment.element, Qmin=experiment.Qmin, Qmax=experiment.Qmax, exposure=experiment.exposure, energy_resolution=False, v_lag=v_lag, v_rms=v_rms, v_esc=v_esc, rho_x=rho_x) #print 'logtest1_correct={}'.format(logtest1) #print 'logtest2_correct={}'.format(logtest2) logtest1_correct = -19.6890210901 logtest2_correct = -13.4627188661 print('correct={} got={}\n'.format(logtest1_correct, logtest1)) print('correct={} got={}\n'.format(logtest2_correct, logtest2)) assert np.isclose(logtest1_correct, logtest1) assert np.isclose(logtest2_correct, logtest2)