.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples_gallery/plot_direct_detection.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_gallery_plot_direct_detection.py: Direct detection ================ Calculate various direct detection observables. .. GENERATED FROM PYTHON SOURCE LINES 7-13 .. code-block:: default import matplotlib.pyplot as plt import numpy as np from scipy.interpolate import interp1d from singletscalar_dm import * .. GENERATED FROM PYTHON SOURCE LINES 14-17 The direct detection part is calculated using the function `SI_noomega`. This function performs the calculation of the spin independent cross section analytically assuming that :math:`f_N=0.297`. In the following, we sho the calculation of the spin independent cross section for a specific value of DM mass and coupling. .. GENERATED FROM PYTHON SOURCE LINES 17-22 .. code-block:: default mS = 70 # GeV lambda_hs = 0.01 SI_noomega(mS,lambda_hs) .. rst-class:: sphx-glr-script-out .. code-block:: none 1.7814254243590454e-46 .. GENERATED FROM PYTHON SOURCE LINES 23-25 Instead, in order to find the upper limits for :math:`\lambda_{HS}`, you can use the function `GetUL_DD_Mine_nomega`. The example below calculates the upper limits for :math:`\lambda_{HS}` for the LZ and future DARWIN experiments. .. GENERATED FROM PYTHON SOURCE LINES 25-33 .. code-block:: default DMmassDD_vec = np.logspace(np.log10(2.),4.,100) LambdaDD_LZ_HS_vec = np.zeros(len(DMmassDD_vec)) LambdaDD_Darwin_HS_vec = np.zeros(len(DMmassDD_vec)) for t in range(len(DMmassDD_vec)): LambdaDD_LZ_HS_vec[t] = GetUL_DD_nomega(DMmassDD_vec[t],'LZ') LambdaDD_Darwin_HS_vec[t] = GetUL_DD_nomega(DMmassDD_vec[t],'DARWIN') .. GENERATED FROM PYTHON SOURCE LINES 34-54 .. code-block:: default fig = plt.figure(figsize=(8,6)) plt.plot(DMmassDD_vec[18:],LambdaDD_LZ_HS_vec[18:],lw=3.0,ls='--',color='black',label=r'DD, LZ+2022') plt.fill_between(DMmassDD_vec[18:],(0.3/0.2)*LambdaDD_LZ_HS_vec[18:],(0.3/0.6)*LambdaDD_LZ_HS_vec[18:],alpha=0.5,color='grey') plt.plot(DMmassDD_vec[18:],1e-10*(0.3/0.2)*LambdaDD_LZ_HS_vec[18:],lw=5.0,alpha=0.5,color='grey',label=r'LZ, $\rho_{\odot}=[0.2,0.6]$ GeV/cm$^3$') plt.plot(DMmassDD_vec[11:],LambdaDD_Darwin_HS_vec[11:],lw=3.0,ls='--',color='red',label=r'DD, DARWIN proj.') plt.xlabel(r'$m_S$ [GeV]', fontsize=20) plt.ylabel(r'$\lambda_{\rm{HS}}$', fontsize=20) plt.axis([5,1e4,1e-4,1e1]) plt.xticks(fontsize=20) plt.yticks(fontsize=20) plt.tick_params('both', length=8, width=3, which='major') plt.tick_params('both', length=6, width=3, which='minor') plt.grid(True) plt.yscale('log') plt.xscale('log') plt.legend(loc=2,prop={'size':16},numpoints=1, scatterpoints=1, ncol=1) fig.tight_layout(pad=0.5) plt.show() .. image-sg:: /examples_gallery/images/sphx_glr_plot_direct_detection_001.png :alt: plot direct detection :srcset: /examples_gallery/images/sphx_glr_plot_direct_detection_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 55-57 It is also possible to calculate the direct detection constraints including the rescaling due to the density of dark matter of the :math:`S` particles. First, we calculate the :math:`\xi` term which is the relative ratio of :math:`S` particle density over the total dark matter one. .. GENERATED FROM PYTHON SOURCE LINES 57-78 .. code-block:: default Omegah2_best = 0.120 table = np.loadtxt(import_data_file('Omega_MICROMEGAs_zoom_paper.dat')) Lambda_vec = np.logspace(-5,1,500) csi_vec = np.zeros(len(MassDD_vec)*len(Lambda_vec)) cont = 0 for t in range(len(MassDD_vec)): for u in range(len(Lambda_vec)): if table[cont,2]<0.: table[cont,2] = 1e6 csi_vec[cont] = table[cont,2]/Omegah2_best cont = cont + 1 print(csi_vec) val = GetUL_DD_withomega(60,Lambda_vec,MassDD_vec,csi_vec,'LZ') print(val) .. rst-class:: sphx-glr-script-out .. code-block:: none [1.24166667e+06 1.21250000e+06 1.18416667e+06 ... 2.54083333e-05 2.40916667e-05 2.28333333e-05] Optimization terminated successfully. Current function value: 0.000000 Iterations: 31 Function evaluations: 62 0.13446874237060566 .. GENERATED FROM PYTHON SOURCE LINES 79-80 The we use the function `GetUL_DD` to get the upper limits including also the relic density of :math:`S`. .. GENERATED FROM PYTHON SOURCE LINES 80-87 .. code-block:: default LambdaDD_LZ_HS_vec = np.zeros(len(MassDD_vec)) LambdaDD_Darwin_HS_vec = np.zeros(len(MassDD_vec)) for t in range(len(MassDD_vec)): LambdaDD_LZ_HS_vec[t] = GetUL_DD_withomega(MassDD_vec[t],Lambda_vec,MassDD_vec,csi_vec,'LZ') LambdaDD_Darwin_HS_vec[t] = GetUL_DD_withomega(MassDD_vec[t],Lambda_vec,MassDD_vec,csi_vec,'Darwin') .. rst-class:: sphx-glr-script-out .. code-block:: none Optimization terminated successfully. Current function value: 0.000000 Iterations: 24 Function evaluations: 66 Optimization terminated successfully. Current function value: 0.000000 Iterations: 31 Function evaluations: 87 Optimization terminated successfully. Current function value: 0.000000 Iterations: 19 Function evaluations: 39 Optimization terminated successfully. Current function value: 0.000000 Iterations: 24 Function evaluations: 66 Optimization terminated successfully. Current function value: 0.000000 Iterations: 31 Function evaluations: 87 Optimization terminated successfully. Current function value: 0.000000 Iterations: 15 Function evaluations: 30 Optimization terminated successfully. Current function value: 0.000000 Iterations: 24 Function evaluations: 66 Optimization terminated successfully. Current function value: 0.000000 Iterations: 31 Function evaluations: 87 Optimization terminated successfully. Current function value: 0.000000 Iterations: 17 Function evaluations: 34 Optimization terminated successfully. Current function value: 0.000000 Iterations: 23 Function evaluations: 46 Optimization terminated successfully. Current function value: 0.000000 Iterations: 26 Function evaluations: 52 Optimization terminated successfully. Current function value: 0.000000 Iterations: 31 Function evaluations: 62 Optimization terminated successfully. Current function value: 0.000000 Iterations: 33 Function evaluations: 66 Optimization terminated successfully. Current function value: 0.000000 Iterations: 24 Function evaluations: 66 Optimization terminated successfully. Current function value: 0.000000 Iterations: 31 Function evaluations: 87 Optimization terminated successfully. Current function value: 0.000000 Iterations: 14 Function evaluations: 28 Optimization terminated successfully. Current function value: 0.000000 Iterations: 34 Function evaluations: 68 Optimization terminated successfully. Current function value: 0.000000 Iterations: 21 Function evaluations: 42 Optimization terminated successfully. Current function value: 0.000000 Iterations: 35 Function evaluations: 70 Optimization terminated successfully. Current function value: 0.000000 Iterations: 27 Function evaluations: 54 Optimization terminated successfully. Current function value: 0.000000 Iterations: 36 Function evaluations: 72 Optimization terminated successfully. Current function value: 0.000000 Iterations: 28 Function evaluations: 56 Optimization terminated successfully. Current function value: 0.000000 Iterations: 36 Function evaluations: 72 Optimization terminated successfully. Current function value: 0.000000 Iterations: 30 Function evaluations: 60 Optimization terminated successfully. Current function value: 0.000000 Iterations: 37 Function evaluations: 74 Optimization terminated successfully. Current function value: 0.000000 Iterations: 31 Function evaluations: 62 Optimization terminated successfully. Current function value: 0.000000 Iterations: 37 Function evaluations: 74 Optimization terminated successfully. Current function value: 0.000000 Iterations: 31 Function evaluations: 62 Optimization terminated successfully. Current function value: 0.000000 Iterations: 38 Function evaluations: 76 Optimization terminated successfully. Current function value: 0.000000 Iterations: 32 Function evaluations: 64 Optimization terminated successfully. Current function value: 0.000000 Iterations: 37 Function evaluations: 74 Optimization terminated successfully. Current function value: 0.000000 Iterations: 32 Function evaluations: 64 Optimization terminated successfully. Current function value: 0.000000 Iterations: 38 Function evaluations: 76 Optimization terminated successfully. Current function value: 0.000000 Iterations: 32 Function evaluations: 64 Optimization terminated successfully. Current function value: 0.000000 Iterations: 38 Function evaluations: 76 Optimization terminated successfully. Current function value: 0.000000 Iterations: 32 Function evaluations: 64 Optimization terminated successfully. Current function value: 0.000000 Iterations: 38 Function evaluations: 76 Optimization terminated successfully. Current function value: 0.000000 Iterations: 33 Function evaluations: 66 Optimization terminated successfully. Current function value: 0.000000 Iterations: 38 Function evaluations: 76 Optimization terminated successfully. Current function value: 0.000000 Iterations: 33 Function evaluations: 66 Optimization terminated successfully. Current function value: 0.000000 Iterations: 38 Function evaluations: 76 Optimization terminated successfully. Current function value: 0.000000 Iterations: 33 Function evaluations: 66 Optimization terminated successfully. Current function value: 0.000000 Iterations: 38 Function evaluations: 76 Optimization terminated successfully. Current function value: 0.000000 Iterations: 33 Function evaluations: 66 Optimization terminated successfully. Current function value: 0.000000 Iterations: 39 Function evaluations: 78 Optimization terminated successfully. Current function value: 0.000000 Iterations: 33 Function evaluations: 66 Optimization terminated successfully. Current function value: 0.000000 Iterations: 39 Function evaluations: 78 Optimization terminated successfully. Current function value: 0.000000 Iterations: 33 Function evaluations: 66 Optimization terminated successfully. Current function value: 0.000000 Iterations: 39 Function evaluations: 78 Optimization terminated successfully. Current function value: 0.000000 Iterations: 33 Function evaluations: 66 Optimization terminated successfully. Current function value: 0.000000 Iterations: 17 Function evaluations: 36 Optimization terminated successfully. Current function value: 0.000000 Iterations: 32 Function evaluations: 64 Optimization terminated successfully. Current function value: 0.000000 Iterations: 17 Function evaluations: 36 Optimization terminated successfully. Current function value: 0.000000 Iterations: 40 Function evaluations: 80 Optimization terminated successfully. Current function value: 0.000000 Iterations: 33 Function evaluations: 66 Optimization terminated successfully. Current function value: 0.000000 Iterations: 40 Function evaluations: 80 Optimization terminated successfully. Current function value: 0.000000 Iterations: 33 Function evaluations: 66 Optimization terminated successfully. Current function value: 0.000000 Iterations: 18 Function evaluations: 37 Optimization terminated successfully. Current function value: 0.000000 Iterations: 26 Function evaluations: 56 Optimization terminated successfully. Current function value: 0.000000 Iterations: 11 Function evaluations: 23 Optimization terminated successfully. Current function value: 0.000000 Iterations: 28 Function evaluations: 63 Optimization terminated successfully. Current function value: 0.000000 Iterations: 18 Function evaluations: 37 Optimization terminated successfully. Current function value: 0.000000 Iterations: 17 Function evaluations: 34 Optimization terminated successfully. Current function value: 0.000000 Iterations: 25 Function evaluations: 55 Optimization terminated successfully. Current function value: 0.000000 Iterations: 12 Function evaluations: 24 Optimization terminated successfully. Current function value: 0.000000 Iterations: 28 Function evaluations: 63 Optimization terminated successfully. Current function value: 0.000000 Iterations: 18 Function evaluations: 37 Optimization terminated successfully. Current function value: 0.000000 Iterations: 40 Function evaluations: 88 Optimization terminated successfully. Current function value: 0.000000 Iterations: 12 Function evaluations: 25 Optimization terminated successfully. Current function value: 0.000000 Iterations: 28 Function evaluations: 61 Optimization terminated successfully. Current function value: 0.000000 Iterations: 27 Function evaluations: 56 Optimization terminated successfully. Current function value: 0.000000 Iterations: 39 Function evaluations: 86 Optimization terminated successfully. Current function value: 0.000000 Iterations: 13 Function evaluations: 27 Optimization terminated successfully. Current function value: 0.000000 Iterations: 28 Function evaluations: 61 Optimization terminated successfully. Current function value: 0.000000 Iterations: 26 Function evaluations: 53 Optimization terminated successfully. Current function value: 0.000000 Iterations: 34 Function evaluations: 72 Optimization terminated successfully. Current function value: 0.000000 Iterations: 15 Function evaluations: 31 Optimization terminated successfully. Current function value: 0.000000 Iterations: 28 Function evaluations: 60 Optimization terminated successfully. Current function value: 0.000000 Iterations: 27 Function evaluations: 55 Optimization terminated successfully. Current function value: 0.000000 Iterations: 25 Function evaluations: 52 Optimization terminated successfully. Current function value: 0.000000 Iterations: 10 Function evaluations: 20 Optimization terminated successfully. Current function value: 0.000000 Iterations: 28 Function evaluations: 60 Optimization terminated successfully. Current function value: 0.000000 Iterations: 18 Function evaluations: 37 Optimization terminated successfully. Current function value: 0.000000 Iterations: 40 Function evaluations: 88 Optimization terminated successfully. Current function value: 0.000000 Iterations: 16 Function evaluations: 34 Optimization terminated successfully. Current function value: 0.000000 Iterations: 29 Function evaluations: 61 Optimization terminated successfully. Current function value: 0.000000 Iterations: 18 Function evaluations: 38 Optimization terminated successfully. Current function value: 0.000000 Iterations: 37 Function evaluations: 102 Optimization terminated successfully. Current function value: 0.000000 Iterations: 51 Function evaluations: 108 Optimization terminated successfully. Current function value: 0.000000 Iterations: 28 Function evaluations: 62 Optimization terminated successfully. Current function value: 0.000000 Iterations: 44 Function evaluations: 116 Optimization terminated successfully. Current function value: 0.000000 Iterations: 44 Function evaluations: 116 Optimization terminated successfully. Current function value: 0.000000 Iterations: 44 Function evaluations: 116 Optimization terminated successfully. Current function value: 0.000000 Iterations: 44 Function evaluations: 116 Optimization terminated successfully. Current function value: 0.000000 Iterations: 31 Function evaluations: 64 .. GENERATED FROM PYTHON SOURCE LINES 88-100 .. code-block:: default table_RD_FB = np.loadtxt(import_data_file('DRAKE_omega_fBE_QCDB_paper.dat')) mass_RD_FBQCDB = table_RD_FB[:,0] lambda_RD_FBQCDB = table_RD_FB[:,1] funcint_RD = interp1d(mass_RD_FBQCDB,lambda_RD_FBQCDB) for t in range(len(MassDD_vec)): if funcint_RD(MassDD_vec[t])>LambdaDD_LZ_HS_vec[t]: LambdaDD_LZ_HS_vec[t]=funcint_RD(MassDD_vec[t]) if funcint_RD(MassDD_vec[t])>LambdaDD_Darwin_HS_vec[t]: LambdaDD_Darwin_HS_vec[t]=funcint_RD(MassDD_vec[t]) .. GENERATED FROM PYTHON SOURCE LINES 101-124 .. code-block:: default fig = plt.figure(figsize=(8,6)) plt.fill_between(mass_RD_FBQCDB,lambda_RD_FBQCDB*1e-6,lambda_RD_FBQCDB*1.05,color='grey') plt.fill_between(MassDD_vec,funcint_RD(MassDD_vec),LambdaDD_LZ_HS_vec,lw=2.0,alpha=0.5,color='green') plt.fill_between(MassDD_vec,funcint_RD(MassDD_vec),LambdaDD_Darwin_HS_vec,lw=2.0,alpha=0.2,color='orange') plt.plot(MassDD_vec,LambdaDD_LZ_HS_vec,lw=3.0,ls='-',color='darkgreen',label=r'LZ+2022') plt.plot(MassDD_vec,LambdaDD_Darwin_HS_vec,lw=2.0,ls='-.',color='red',label=r'DARWIN PROJ.') plt.plot(mass_RD_FBQCDB,lambda_RD_FBQCDB,lw=2.0,ls=':',color='blue', label=r'$\Omega_{S}h^2=0.12}$') plt.text(54.2,0.05,r'$\Omega_{S}h^2<0.12}$',color='blue', fontsize=16) plt.text(54.2,0.003,r'$\Omega_{S}h^2>0.12}$',color='blue', fontsize=16) plt.xlabel(r'$m_{\rm{S}}$ [GeV]', fontsize=20) plt.ylabel(r'$\lambda_{\rm{HS}}$', fontsize=20) plt.axis([54,64,1e-4,1e1]) plt.xticks(fontsize=20) plt.yticks(fontsize=20) plt.tick_params('both', length=8, width=3, which='major') plt.tick_params('both', length=6, width=3, which='minor') plt.grid(True) plt.yscale('log') plt.xscale('linear') plt.legend(loc=2,prop={'size':16},numpoints=1, scatterpoints=1, ncol=1) fig.tight_layout(pad=0.5) plt.show() .. image-sg:: /examples_gallery/images/sphx_glr_plot_direct_detection_002.png :alt: plot direct detection :srcset: /examples_gallery/images/sphx_glr_plot_direct_detection_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 12.147 seconds) .. _sphx_glr_download_examples_gallery_plot_direct_detection.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_direct_detection.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_direct_detection.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_