AMIDAS-II: Upgrade of the AMIDAS Package and Website for Direct Dark Matter Detection Experiments and Phenomenology

In this paper, we give a detailed user's guide to the AMIDAS (A Model-Independent Data Analysis System) package and website, which is developed for online simulations and data analyses for direct Dark Matter detection experiments and phenomenology. Recently, the whole AMIDAS package and website system has been upgraded to the second phase: AMIDAS-II, for including the new developed Bayesian analysis technique. AMIDAS has the ability to do full Monte Carlo simulations as well as to analyze real/pseudo data sets either generated by another event generating programs or recorded in direct DM detection experiments. Moreover, the AMIDAS-II package can include several"user-defined"functions into the main code: the (fitting) one-dimensional WIMP velocity distribution function, the nuclear form factors for spin-independent and spin-dependent cross sections, artificial/experimental background spectrum for both of simulation and data analysis procedures, as well as different distribution functions needed in Bayesian analyses.

1 Introduction 1 Note that, since the AMIDAS code has been written in the C programming language, all user-defined functions to be included into the AMIDAS package must be given in the syntax of C. On the other hand, for drawing output plots, since the Gnuplot package has been used in AMIDAS, the uploaded files for drawing e.g. the (expected) spectrum of measured recoil energy, must be given in the syntax of Gnuplot [15]. More detailed descriptions will be given in Secs. 3 and 5 as well as in Appendix.
In this paper, we give a detailed user's guide to the AMIDAS (package and) website. In Sec. 2, we list the AMIDAS functions and different working (simulation and data analysis) modes for these functions. The use of intrinsically saved element data to set information of users' favorite target nuclei will be described in detail. In Sec. 3, we describe the meanings (and options) of all input parameters/factors for running Monte Carlo simulations. The preparation of uploaded files for defining the one-dimensional WIMP velocity distribution function, the elastic nuclear form factors for SI and SD WIMP-nucleus cross sections as well as artificial/experimental background spectrum will be particularly described. In Sec. 4, the preparation of the (real/pseudo-) data files and the uploading/analyzing procedure on the AMIDAS website will be given in Sec. 4. The new developed Bayesian analysis technique [5] will be talked separately in Sec. 5. We conclude in Sec. 6. Some technical detail in the AMIDAS package will be given in Appendix.

AMIDAS functions, working modes, and target nuclei
In this section, we list the functions of the AMIDAS (package and) website and different working (simulation and data analysis) modes for these functions. The default options for the target nuclei used for different AMIDAS functions as well as the use of intrinsically saved element data to set information of users' favorite target nuclei will also be described.

AMIDAS functions
Based on our works on the model-independent data analysis methods for extracting properties of Galactic WIMP DM particles [4,5,6,7,8], AMIDAS has so far the following functions:

Reconstruction modes
Corresponding to each of the above listed AMIDAS functions, there are several different reconstruction modes for users to choose.

For the WIMP-nucleus interaction
For generating WIMP signals (with/without background events), one needs to choose either the SI scalar WIMP-nucleus interaction or the SD axial-vector one is dominated:

For the needed WIMP mass
For (Bayesian) reconstructing the one-dimensional WIMP velocity distribution function f 1 (v) and estimating the SI WIMP-nucleon coupling |f p | 2 , one needs the WIMP mass m χ as an input parameter [4,5,7]. This information could be obtained either from e.g. collider experiments or from two (other) direct DM detection experiments [6]. For these two cases, AMIDAS has three options of the input WIMP mass:

For the reconstruction of the WIMP mass
In addition, AMIDAS offers two modes for reconstructing the (required) WIMP mass m χ [6]:

For the reconstruction of the ratio between two SD WIMP-nucleon couplings
Based on the assumption about the (dominated) WIMP-nucleus interaction, we obtained two expressions for reconstructing the ratio between two SD WIMP-nucleon couplings a n /a p [8]:

For the reconstructions of the ratios between SD and SI WIMP-nucleon cross sections
Similarly, by using different detector materials with different spin sensitivities with (un-paired) protons or neutrons, we have also two ways for reconstructing the ratios between the SD and SI WIMP-nucleon cross sections σ SD χ(p,n) /σ SI χp [8]:

Target nuclei
Four frequently used detector materials: 28 Si, 76 Ge, 40 Ar and 136 Xe are given as default options of target nuclei for simulations and data analyses by using AMIDAS package. Meanwhile, since September 2009 it is achieved to let users set the target nuclei freely, with (corresponding) atomic number Z and atomic mass number A as well as the total nuclear spin J and the expectation values of the proton and neutron group spins S p,n for each target nucleus.

Only one required target nucleus
For generating WIMP signals as well as (Bayesian) reconstructing the one-dimensional WIMP velocity distribution function and estimating the SI WIMP-nucleon coupling with an input WIMP mass (from other/collider experiments), only one target nucleus is required and users can choose it from the four default options or type the element symbol of the target nucleus, and give the corresponding atomic information: Z, A, J, S p,n by hand on the website directly: Note that, firstly, only for the AMIDAS function of generating WIMP signals with either only the SD axial-vector cross section or both of the SI and SD cross sections, the typing cells for the total nuclear spin J and the expectation values of the proton and neutron group spins S p,n for each target nucleus will appear, in order to remind users that these data are required 2 . Secondly, the given value for the total nuclear spin J is only the numerator of the actually value. This means that, for instance, for the use of 127 I one needs only give "5" in the typing cell between "J =" and "/2" for assigning its J value of 5/2 (see Table 1).  Table 1: List of the intrinsically defined nuclear spin data in the AMIDAS-II package. More details can be found in e.g. Refs. [1,16,17,18].

Intrinsically defined nuclear spin data
In the upgraded AMIDAS-II package, we have further saved the basic atomic data for all 118 elements as well as the nuclear spin data (J and S p,n values) for 17 frequently used detector nuclei (listed in Table 1). Hence, for setting user-required target nuclei for e.g. generating WIMP-nucleus scattering events, users need only simply to give either the atomic symbol or the atomic number Z (since these two items are one-to-one corresponding). Then all other atomic and nuclear spin information about this chosen nucleus will be shown automatically in the following typing cells. Moreover, according to the users' assumption about the WIMP-nucleus interaction (SI, SD or both), the AMIDAS website will choose automatically the isotope of the chosen nucleus without or with spin sensitivity with the highest natural abundance. For example, when one types for either the defined target "Xe" or the atomic number Z "54", in the cell of the atomic mass number A "132" or "129" will appear under the choice of the SI or SD (or both) WIMP-nucleus interaction(s). For the latter case, once the nuclear spin data of the chosen nucleus is given intrinsically in the AMIDAS-II package (listed in Table 1), the rest required information about the J and S p,n values will also appear directly: Note that, firstly, while the one-to-one corresponding atomic symbol and atomic number Z appear simultaneously, one could modify the atomic mass number A by hand: Secondly, for one target nucleus, the expected proton and neutron group spins are sometimes model-dependent: e.g. for 129 Xe and 131 Xe nuclei, S p 129 Xe = −0.002, S n 129 Xe = 0.273 and S p 131 Xe = −0.0007, S n 131 Xe = −0.125 are also often used [19,20,21,22]. These modeldependent values are however not saved in the AMIDAS package yet and thus have to be given by hand: Moreover, once the J and S p,n values of the chosen nucleus are not defined intrinsically in the AMIDAS-II package, "undefined" would be shown in these cells:

For the determination of the WIMP mass
For determining the WIMP mass m χ , two combinations have been considered and programmed in the AMIDAS package [6]: Note here that the lighter (heavier) nucleus of the user-chosen target combination should be given in the first (second) line of the item "user-defined" combination 3 .

For the determination of the ratio between two SD WIMP-nucleon couplings
For determining the ratio between two SD WIMP-nucleon couplings a n /a p , two combinations have been considered and programmed in the AMIDAS package [8]: Remind here that two user-chosen target nuclei should be spin-sensitive and their total nuclear spin J and expectation proton and neutron group spins S (p,n) are also required. As described in Sec. 2.3.2, the intrinsically defined nuclear spin data can be used here directly or modified by hand.

For the determination of the ratio between SD and SI WIMP-proton cross section
For determining the ratio between SD and SI WIMP-proton cross section σ SD χp /σ SI χp , only one combination of target nuclei has been considered and programmed in the AMIDAS package [8]: Note here that the first nucleus of the user-chosen target combination should be spin-sensitive with a (very) small or even negligible expectation value of the neutron group spin, whereas the second one should be spin-nonsensitive (without unpaired protons nor neutrons).

For the determination of the ratio between SD and SI WIMP-neutron cross section
For determining the ratio between SD and SI WIMP-neutron cross section σ SD χn /σ SI χp , two combinations of target nuclei has been considered and programmed in the AMIDAS package [8]: Note here that the first nucleus of the user-chosen target combination should be spin-sensitive with a (very) small or even negligible expectation value of the proton group spin, whereas the second one should be spin-nonsensitive (without unpaired protons nor neutrons).

Data type
The probably most important and useful design of the AMIDAS package and website is the ability of not only doing simulations with self-generated events based on Monte Carlo method, but also analyzing user-uploaded (real/pseudo-) data set(s) either generated by other event generators or recorded in direct DM detection experiments without modifying the source code.

Data type
Corresponding to our design of the ability of doing Monte Carlo simulations as well as analyzing (real/pseudo-) data set(s), users have two options for the data type: More detailed descriptions about the preparation of data files and the uploading/analyzing procedure on the AMIDAS website will be given in Sec. 4.

Simulation mode
One can run numerical Monte Carlo simulations with all AMIDAS(-II) functions (given in Sec. 2.1) 4 . Meanwhile, since the running time of the algorithmic procedure for the reconstruction of the WIMP mass m χ , needed also for the (Bayesian) reconstruction of the one-dimensional WIMP velocity distribution function f 1 (v) and the estimation of the SI WIMP-nucleon coupling |f p | 2 , is pretty long, AMIDAS also offers users faster theoretical estimations as an alternative option: Here, instead of the summations of the (moments of the) measured recoil energies required in our model-independent data analysis procedures [4,6,7,8], numerical integrals over the theoretically predicted recoil spectrum will be used. Note however that, firstly, since for these estimations the statistical fluctuations have not been taken into account, these pure theoretically estimated results, especially for cases with only (very) few events, could be (fairly) different from results obtained by more realistic Monte Carlo simulations. Secondly, as the alternative option for Monte Carlo simulations with much shorter required executing time, the total event number used for these theoretical estimations is fixed 5 and the calculations are limited to be done for only a few times. These restrictions could sometimes cause unexpected zigzags on the result curves.
Note also here that, once residue background events are taken into account, users have to choose "Monte Carlo simulation"!

Output plots
In our work on the reconstruction of the WIMP mass, we discussed also the statistical fluctuation of the reconstructed m χ in the simulated experiments [6]. Users can thus choose whether and for what WIMP mass they need the plot of the statistical fluctuation of the reconstructed WIMP mass: 2.4.4 Simulation mode for a n /a p and σ SD χ(p,n) /σ SI χp In our works on the determinations of ratios between different WIMP-nucleon couplings/cross sections, we considered two cases separately:

Background events
After the development of our model-independent methods for reconstructing different WIMP properties, we worked also on effects of residue background events in analyzed data sets [23,24,25,26]. Hence, users have the option to do simulations with or without an intrinsically or user-defined (uploaded) background spectrum: More detailed descriptions about intrinsically defined background spectra as well as the file preparation of users' own artificial/experimental background spectrum will be given in Sec. 3.5.

Generated events
As an extra service, users can receive all WIMP-signal (and background) events generated by AMIDAS in separate text files for different target nuclei: Note hare that, for the determination of the WIMP mass, the estimation of the SI WIMP-nucleon coupling as well as the determinations of ratios between different WIMP-nucleon couplings/cross sections with several different input WIMP masses, the required value of the input WIMP mass has to be chosen: Similarly, for the determinations of ratios between different WIMP-nucleon couplings/cross sections with several different input SD WIMP-nucleon coupling ratios, users have to choose the required a n /a p value:

Running simulations
In this section, we describe the meanings (and options) of all input parameters/factors needed in principle only for predicting the recoil and background spectra for generating WIMP signal and residue background events and for drawing the output plots. Some commonly used and/or standard AMIDAS simulation/analysis values used in our works presented in Refs. [4,5,6,7,8,23,24,25,26] have been given as default, but users can choose or modify all these parameters/options by hand. Moreover, the preparation of uploaded files for defining the one-dimensional WIMP velocity distribution function, the elastic nuclear form factors for SI and SD WIMP-nucleus cross sections as well as artificial/experimental background spectrum will be particularly described.

WIMP properties
The following information on WIMP properties is required for predicting the recoil spectrum and/or analyzing user-uploaded data:

Symbol
Meaning Remarks m χ The input WIMP mass GeV/c 2 σ(m χ ) An overall uncertainty on the input WIMP mass The SI WIMP-proton cross section pb f n /f p The ratio of the SI WIMP coupling on neutrons to that on protons a p The SD WIMP-proton coupling a n /a p The ratio of the SD WIMP coupling on neutrons to that on protons Note that, firstly, not all of these items are needed for every AMIDAS function. The website will give the needed items automatically according to users earlier options. Secondly, in case that any required datum is missed, this omission will be detected automatically after the submission and users will be reminded of that with a red block around the table. For this case all data in this setup table will be reset to the default values and should therefore be checked and modified once again to the users' own setup. Remind also that, the overall uncertainty on the input WIMP mass should be between 0 and 1. On the other hand, users can hover the curser onto an item symbol in the setup table for checking its definition.

Astronomical setup
AMIDAS requires also information on the following astronomical parameters for predicting/fitting the velocity distribution function of halo WIMPs as well as for estimating the SI WIMP-nucleon coupling: Remind that, in case that any required datum is missed, this omission will be detected automatically after the submission and users will be reminded of that with a red block around the table. For this case all data in this setup table will be reset to the default values and should therefore be checked and modified once again to the users' own setup. On the other hand, users can hover the curser onto an item symbol in the setup table for checking its definition.

Velocity distribution function of halo WIMPs
For predicting the elastic WIMP-nucleus scattering spectrum in order to generate WIMPinduced signal events, one needs crucially the one-dimensional WIMP velocity distribution function f 1 (v). In the AMIDAS-II package, we define intrinsically three most commonly used theoretical distributions. Meanwhile, users also have the option to define (by uploading/typing) an analytic form of their favorite one-dimensional velocity distribution: Note here that, firstly, for checking the analytic forms of the intrinsically defined velocity distributions, users can hover the cursor onto "analytic form"; users can also click the "analytic form" to open a new webpage with more detailed information and useful references. Secondly, as reminded on the website, the second uploaded file/typing area is only for drawing output plot(s) of the generated WIMP-signal (and background) events and, as a comparison to, the (Bayesian) reconstructed one-dimensional WIMP velocity distribution function. Moreover, consider the normal height of a browser window, we shrink the typing areas as default. However, once users click one of the two typing areas, the clicked one will extend to show the full content; the extended typing area(s) will shrink automatically after users click one of the three default velocity distribution functions.
In this subsection, we give first the definitions of the three default velocity distribution functions in the AMIDAS-II package. Then we will describe how to (modify these definitions to) define user's own velocity distribution.

Default one-dimensional WIMP velocity distribution functions
So far users have three options for the one-dimensional WIMP velocity distribution function defined intrinsically in the AMIDAS-II package [4,5]: 1. the simple Maxwellian velocity distribution function [1] 2. the modified Maxwellian velocity distribution function [27,28,29,30] for k = 1, 2, 3, 4, where N f,k is the normalization constant depending on the value of the power index k; 3. the shifted Maxwellian velocity distribution function [1,31] where the time-dependent Earth's velocity in the Galactic frame is given as v e (t) = v 0 1.05 + 0.07 cos 2π(t − t p ) 1 yr .

User-defining the one-dimensional WIMP velocity distribution function
For defining the one-dimensional WIMP velocity distribution (for generating WIMP signals), users should in practice give the integral over the velocity distribution function: with the name of "Intf1v_v_user". Note here that the lower limit of the integral, the minimal incoming velocity of incident WIMPs that can deposit the energy Q in the detector, v min , should be expressed as a function of the energy Q through v min = α √ Q; the upper limit of the integral, v max , can be set as one of the required astronomical parameters (see Sec. 3.2). Meanwhile, since the transformation constant is defined with the reduced mass of the WIMP mass m χ and that of the target nucleus m N and m N is given as a function of the atomic mass number A in the AMIDAS package, the expression of the integral over the WIMP velocity distribution should thus be a function of m χ and A. Finally, in more general cases, the (integral over the) velocity distribution function should also be a function of time t.
As an example, we give here the AMIDAS-II code for the integral over the simple Maxwellian velocity distribution function. The codes for the (integrals over the) other intrinsically defined one-dimensional WIMP velocity distribution functions will be given in Appendix B.1 for users' references. ); } Note that, firstly, v_U and the function alpha(mchi, A), where mchi and A stand for the WIMP mass m χ and the atomic mass number of the target nucleus, A, are defined intrinsically in the AMIDAS package 6 . Secondly, v_0, standing for v 0 , is an input parameter which users can set separately on the website (see Sec. 3.2). Moreover, QQ and tt stand for the recoil energy Q and time t. Remind also here that, even for a time-independent velocity distribution or a numerical expression with a fixed experimental running date t = t expt , "double tt" should always be declared as the forth parameter of the function Intf1v_v_user(mchi, A, QQ, tt).
On the other hand, an extra file is required for defining the input theoretical one-dimensional velocity distribution function itself (not the integral over it!), for drawing this input velocity distribution, as a comparison, with the Bayesian reconstructed one together in the output plots. Meanwhile, the integral over this input velocity distribution is however needed for drawing the theoretical WIMP scattering spectrum, with the (binned) recorded WIMP-signals (and background) events together in the output plots. Since the Gnuplot software has been adopted in the AMIDAS package for drawing output plots, the (integral over the) velocity distribution function defined in this file must be written in the syntax of Gnuplot with the name of "f1v_user(x)" or "Intf1v_v_user(x)". Below we give our definitions for the (integral over the) simple Maxwellian velocity distribution as examples. The definitions for the (integral over the) other intrinsically defined one-dimensional WIMP velocity distribution function for Gnuplot are given in Appendix B.1 for users' references. Intf1v_v_user(x) \ = (2.0 / sqrt(M_PI) / (v_0 * v_U)) * \ exp(-alpha * alpha * x / ( (v_0 * v_U) * (v_0 * v_U) ) ) Note here that, firstly, "\" (backslash) must be used in order to let the including of the definition(s) given in this file into the other intrinsic commands correctly. Secondly, three flexible-kept parameters: AX, m_chi and v_0 will be read directly from the users' initial (simulation/data analysis) setup set earlier on the website. The meanings of the variables used here can be found in Appendix A.1.
Remind also that two sample files, one for the AMIDAS code and the other one for the Gnuplot package, can be downloaded from the AMIDAS website.

Elastic nuclear form factors for the WIMP-nucleus cross sections
For predicting the elastic WIMP-nucleus scattering spectrum in order to generate WIMPinduced signal events as well as reconstructing different WIMP properties: the one-dimensional velocity distribution function f 1 (v), the mass m χ , the SI coupling on nucleons |f p | 2 and the ratios between different WIMP-nucleon couplings/cross sections a n /a p and σ SD χ(p,n) /σ SI χp , one needs crucially the elastic nuclear form factor for SI WIMP-nucleus interaction, F 2 SI (Q). In the AMIDAS package, we define intrinsically four most commonly used elastic nuclear form factors for the SI cross section. Meanwhile, users also have the option to define (by uploading/typing) an analytic form of their favorite form factor: On the other hand, for generating WIMP-induced signal events (only) with SD WIMPnucleus interaction as well as reconstructing the ratios between different WIMP-nucleon couplings/cross sections a n /a p and σ SD χ(p,n) /σ SI χp , one needs crucially the elastic nuclear form factor for SD WIMP-nucleus interaction, F 2 SD (Q). In the AMIDAS package, so far we define intrinsically only one elastic nuclear form factor for the SD cross section. As usual, users also have the option to define (by uploading/typing) an analytic form of their favorite form factor: Note here that, firstly, for checking the analytic forms of the intrinsically defined SI and SD elastic nuclear form factors, users can hover the cursor onto "analytic form"; users can also click the "analytic form" to open a new webpage with more detailed information and useful references. Secondly, as reminded on the website, the second uploaded file/typing area is only for drawing output plot(s) of the generated WIMP-signal (and background) events.
In this subsection, we give first the definitions of the four default elastic nuclear form factors for the SI WIMP-nucleus cross section and the unique one for the SD cross section in the AMIDAS package. Then we will describe how to (modify these definitions to) define user's own form factor.

Default SI elastic nuclear form factors
So far users have four options for the SI elastic nuclear form factor defined intrinsically in the AMIDAS package [4,32]: 1. the exponential form factor [33,34,1] where is the nuclear coherence energy and is the radius of the nucleus; 2. the Woods-Saxon form factor [35,1,31] where j 1 (x) is a spherical Bessel function, is the transferred 3-momentum, is the effective nuclear radius with and is the nuclear skin thickness, A is the atomic mass number of the nucleus; 3. the Woods-Saxon form factor with a modified nuclear radius [36,31], in which 4. the Helm form factor [37,31] is the effective nuclear radius with and s 0.9 fm (20) is the nuclear skin thickness.

Default SD elastic nuclear form factor
Comparing to the SI case, the nuclear form factor for the SD WIMP-nucleus cross section is more complicated and target-dependent, due to its dependence on the SD WIMP-nucleon couplings as well as on the individual spin structure of target nuclei. Hence, so far in the AMIDAS package we define only one general analytic form for the SD elastic nuclear form factor: 1. the thin-shell form factor [31,38] where j 0 (x) is a spherical Bessel function.

User-defining the elastic nuclear form factor
For defining users' favorite nuclear form factors, not only the definitions of the squared form factor F 2 (Q) but also those of the derivatives of F 2 (Q) with respect to the energy Q: (not F (Q) itself nor dF (Q)/dQ) must be given together in one file with (however) the names of "FQ_SI_user" ("FQ_SD_user") and "dFQdQ_SI_user" ("dFQdQ_SD_user").
As an example, we give here the AMIDAS code for the (derivative of the) exponential form factor. The codes for the (derivatives of the) other intrinsically defined elastic nuclear form factors will be given in Appendix B.2 for users' references. On the other hand, two extra files are required for defining the elastic nuclear form factors themselves (without their derivatives!) for the SI and/or SD WIMP-nucleus cross section(s) separately, for drawing the theoretical WIMP scattering spectrum, as a comparison, with the (binned) recorded WIMP-signals (and background) events together in the output plots. Note that the form factors defined in these two files must be written in the syntax of Gnuplot with the name of "FQ_SI_user(x)" or 'FQ_SD_user(x)". Below we give our definition for the exponential form factor as an example. The definitions for the other intrinsically defined elastic nuclear form factors are given in Appendix B.2 for users' references. Remind that, firstly, "\" (backslash) must be used in order to let the including of the definition given in this file into the other intrinsic commands correctly. Secondly, two flexible-kept parameters: AX and m_chi will be read directly from the users' initial (simulation/data analysis) setup set earlier on the website. The meanings of the variables used here can be found in Appendix A.1.
Remind also that two sample files, one for the AMIDAS code and the other one for the Gnuplot package, can be downloaded from the AMIDAS website.

Background spectrum
As an extra consideration, users have the opportunity to take into account some unrejected background events in numerical simulations with the AMIDAS-II package.
So far in the AMIDAS-II package, we defined intrinsically three analytic forms for the artificial background spectrum. Meanwhile, users also have the option to define (by uploading/typing) an analytic form of their favorite theoretical or experimental background spectrum: Note that, firstly, for checking the analytic forms of the intrinsically defined background spectra, users can hover the cursor onto "analytic form"; users can also click the "analytic form" to open a new webpage with more detailed information and useful references. Secondly, as reminded on the website, the second uploaded file/typing area is only for drawing output plot(s) of the generated WIMP-signal and background events.
In this subsection, we give first the definitions of the three (artificial) background spectra in the AMIDAS-II package. Then we will describe how to (modify these definitions to) define user's own (theoretical or experimental) background spectrum.

Default background spectra
So far users have three options for the (artificial) background spectrum defined intrinsically in the AMIDAS-II package [23, 39]: 1. constant background spectrum [23] dR dQ bg,const = 1 ; 2. exponential background spectrum [23] dR where A is the atomic mass number of the target nucleus; 3. Gaussian-excess background spectrum [39] dR where Q bg,peak and σ Q,bg are the central energy and the width of the Gaussian background excess.

User-defining the background spectrum
For defining users' needed theoretical/experimental background spectrum for generating residue background events, users only have to give the analytic form of the spectrum itself as a function of the recoil energy Q (QQ in the AMIDAS code) in a file with the name of "dRdQ_bg_user".
As an example, we give here the AMIDAS-II code for the target-dependent exponential background spectrum. The codes for the other intrinsically defined background spectra will be given in Appendix B.3 for users' references.
return exp(-QQ / Q_0_bg_user(A)); } Note here that, since we take into account the target (experiment) dependence of (the artificially added) background spectrum, the atomic mass number A is used here as the first function parameter (for detailed discussion see Ref. [23]).
On the other hand, an extra file is required for defining the background spectrum itself for drawing this extra part (with the theoretical WIMP signal spectrum), as a comparison, with the (binned) recorded WIMP-signals and background events together in the output plots. Note that the integral over this background spectrum must also be given in the same file in order to normalize the background spectrum properly according to the user's required background ratio (to the WIMP-induced signals). Remind that the (integral over the) background spectrum defined in this file must be written in the syntax of Gnuplot with the name of "dRdQ_bg_user(x)" and 'IntdRdQ_bg_user(x)". Below we give our definition for the (integral over the) targetdependent exponential background spectrum as an example. The definitions for the other intrinsically defined (integral over the) background spectra are given in Appendix B.3 for users' references.
Code 9: Integral over the target-dependent exponential background spectrum (dR/dQ) bg,ex (A, Q) dQ (for Gnuplot) Remind that, firstly, "\" (backslash) must be used in order to let the including of the definitions given in this file into the other intrinsic commands correctly. Secondly, the flexible-kept parameters: AX will be read directly from the users' initial (simulation/data analysis) setup set earlier on the website. The meanings of the variables used here can be found in Appendix A.1.
Remind also that two sample files, one for the AMIDAS code and the other one for the Gnuplot package, can be downloaded from the AMIDAS website.

Experimental setup
Finally, one needs to set the following experimental information for both numerical (Monte Carlo) simulations and data analyses.

Experimental setup
For generating WIMP signals, running numerical simulations as well as analyzing uploaded data sets, the AMIDAS package needs

Symbol
Meaning Remarks

Q min
The minimal cut-off energy keV The width of the first Q−bin keV The expected total event number between Q min and Q max Max. 5,000

B
The number of Q−bin between Q min and Q max [4,10] N expt The number of simulated experiment or uploaded data set Max. 2,000 Remind that, firstly, the AMIDAS website offers full Monte Carlo simulations with maximal 2,000 experiments and maximal 5,000 events (on average) per one experiment; the number of Q−bin between Q min and Q max should be between 4 and 10 bins. Secondly, users can hover the curser onto an item symbol in the setup table for checking its definition.

Experimental setup for background events
Once users want to take into account background events for their numerical simulations, the following information should be given: Remind that, firstly, the ratio of background events in the whole data set should be between 0 and 1. By setting the total event number N tot and the background ratio r bg , the (average) numbers of WIMP-signals and residue background events, N tot,sg and N tot,bg , will be calculated automatically. Secondly, users can hover the curser onto an item symbol in the setup table for checking its definition.

Running simulations
After giving all the required information for the aimed simulation, users have one more chance to check their choices, modify some of them, and then resubmit the whole setup, before they click the "Simulation start" button to start the AMIDAS program.
Remind that, in case that any required datum is missed, this omission will be detected automatically after the (re)submission and users will be reminded of that with a red block around the options/table. Note that all data in a table with missed information will be reset to the default values and should therefore be checked and modified once again to the users' own setup. Once all the required data have been checked, users have only to click the "Simulation start" button and wait for the simulation results for a few minutes 7 .

Output results (plots)
Simulation results will be presented in form(s) of plot(s) and occasionally table(s). Considering users' different needs of plot formats, we offer four most commonly used file types: PostScript (PS), Encapsulated PostScript (EPS), Portable Document Format (PDF) and Portable Network Graphics (PNG).
In order to let users understand the output results more clearly and use them more conveniently, each output plot or table will be accompanied with a short description.
On the other hand, for users' need of self-producing results for different kinds of presentations, the original TXT file(s) of the simulation results with users' personal simulation setup will also be given and downloadable on the website. Remind that it would be very grateful that a credit of the AMIDAS package and website could be given for using the output results.

Analyzing (real/pseudo-) data
The probably most important and useful design of the AMIDAS package and website is the ability of analyzing user-uploaded (real/pseudo-) data set(s) recorded in direct DM detection experiments without modifying the source code.
In this section, we describe the preparation of data files and the uploading/analyzing procedure on the AMIDAS website. A sample file for the uploaded data sets can be downloaded from the AMIDAS website.

Preparing data set(s)
As mentioned above, on the AMIDAS website users can find and download a sample file for the uploaded data sets. Note that, for comments a "0" (zero) has to be used at the beginning, and all words in the comment lines must be connected by, e.g. "_" (underscores). For instance, Note that, as shown in the above example, it is unnecessary to order the generated/recorded recoil energies ascendingly or descendingly in your uploaded data file(s). The AMIDAS package will order the events in each data set after reading these events. However, the generated/arecorded events with different target nuclei must be saved in separate files.

Uploading data file(s)
Once users have chosen the data type as "real (pseudo-) data" (Sec. 2.4.1), in the table for the experimental setup there will be one column for uploading users' data file(s) (cf. Figure shown in Sec. 3.6.1).
Users can upload their data file(s) as usual. Note only that the maximal size of each uploaded file is 2 MB. In addition, the numbers of data sets in all uploaded files must be equal or set as the smallest one 8 .
After that one or more data files have been uploaded and saved successfully, one extra column will appear in the experimental setup table to show the original name(s) of the uploaded data file(s).
Users can check whether the correct files have been uploaded for the corresponding targets and, if necessary, upload the correct file once again.

Analyzing uploaded data
As for simulations, after giving all the required information for the aimed analysis, users have one more chance to check their choices and the original name(s) of their data file(s), modify some of them and replace the uploaded data file(s), and then resubmit the whole setup, before they click the "Data analysis start" button to start the AMIDAS program.
Remind that, in case that any required datum or data file is missed, this omission will be detected automatically after the (re)submission and users will be reminded of that with a red block around the options/table. Note that, while all data in a table with missed information will be reset to the default values and should therefore be checked and modified once again, users only need to upload the missed data file(s) and/or the replacement(s).
Once all the required data and uploaded file(s) have been checked, users have only to click the "Data analysis start" button and wait for the analyzed results for a few minutes.

Output results (tables)
Reconstructed results will be presented in form(s) of table(s) and occasionally plot(s). For instance, for the reconstruction of the WIMP mass m χ , one can obtain the following result 9 : In order to let users understand the output results more clearly and use them more conveniently, each output plot or table will be accompanied with a short description.
On the other hand, the original TXT file(s) of the reconstructed results with users' personal experimental setup will also be given and downloadable on the website. Remind that it would be very grateful that a credit of the AMIDAS package and website could be given for using the output results.

Bayesian analyses
In Ref. [5], we applied Bayesian analysis technique to the reconstruction of the one-dimensional velocity distribution function of Galactic WIMPs. This newest development is released for both of simulation and (real/pseudo-) data analysis on the AMIDAS website.

Fitting velocity distribution function of halo WIMPs
As the most crucial part in Bayesian analyses, users need to choose one fitting one-dimensional WIMP velocity distribution function. In the AMIDAS-II package, we offer so far five analytic forms for the fitting velocity distribution. Meanwhile, users also have the option to define (by uploading/typing) an analytic form of their favorite fitting one-dimensional velocity distribution: Note here that, firstly, for checking the analytic forms of the intrinsically defined fitting velocity distributions, users can hover the cursor onto "analytic form"; users can also click the "analytic form" to open a new webpage with more detailed information and useful references. Secondly, as reminded on the website, the second uploaded file/typing area is only for drawing output plot(s) of the Bayesian reconstructed one-dimensional WIMP velocity distribution function. Additionally, for defining users own fitting velocity distribution, the number of the fitting parameters must be set simultaneously on the website 10 .
In this subsection, we give first the definitions of the five default fitting one-dimensional WIMP velocity distribution functions in the AMIDAS-II package. Then we will describe how to (modify these definitions to) define user's own fitting velocity distribution.

Default fitting one-dimensional WIMP velocity distribution functions
Except of three default one-dimensional WIMP velocity distributions for generating WIMP signal events (see Sec. 3.3.1), in Ref. [5] two useful variations of the shifted Maxwellian velocity distribution have also been considered. Hence, so far users have five options for the fitting one-dimensional WIMP velocity distribution defined intrinsically in the AMIDAS-II package [5]: 2. the modified Maxwellian velocity distribution function f 1,Gau,k (v) [27,28,29,30]; 3. the one-parameter shifted Maxwellian velocity distribution function with v e = 1.05 v 0 is the time-averaged (time-independent) Earth's velocity in the Galactic frame [5]; 10 So far the AMIDAS-II package allows to fit/scan maximal three fitting parameters. where is the difference between v 0 and the time-dependent Earth's velocity in the Galactic frame v e (t).

User-defining the fitting one-dimensional WIMP velocity distribution function
For defining users' favorite fitting velocity distribution function to include into the AMIDAS-II package, one has to distinguish two cases: an analytic form for the integral over the fitting velocity distribution exists or not.
As an example, we give here the AMIDAS-II code for the (integral over the) simple Maxwellian velocity distribution function for the Bayesian fitting process. The codes for the (integral over the) other intrinsically defined "fitting" one-dimensional velocity distribution functions will be given in Appendix C.1 for users' references.
For the case that an analytic form for the integral over the fitting velocity distribution exists, users have to define this integral with the name of "Int_f1v_Bayesian_fit_user" first: ) / ( Int_f1v_Bayesian_fit_user(v_max, aa, bb, cc) -Int_f1v_Bayesian_fit_user(0.0, aa, bb, cc) ); } Note that, firstly, the function Int_f1v_Bayesian_fit_user for the integral has always four parameters: the velocity vv and three fitting parameters aa, bb and cc. It doesn't matter how many fitting parameters (only one or two or all three) are actually used. Meanwhile, the function f1v_Bayesian_fit_user for the velocity distribution itself has always five parameters: except of vv, aa, bb and cc, an extra parameter N_f has to be included, which plays the role of the normalization constant needed only for the case that an analytic form for the integral over the fitting velocity distribution does not exist (see below).
On the other hand, once it is too complicated or even impossible to give an analytic form for the integral over the fitting velocity distribution, one can first define it as "−1.0": Then the AMIDAS-II package will estimate the fitting-parameter dependent normalization constant N f numerically point-by-point during the Bayesian fitting (scanning) procedure.
Additionally, users have to set the symbol and unit of each fitting parameter, which will be used in the output result files and plots, with the names of " a_Bayesian_Symbol" and " a_Bayesian_Unit" in the same uploaded file: Finally, as for drawing the generating velocity distribution (Sec. 3.3), an extra file is required for defining the "fitting" one-dimensional velocity distribution function itself (the integral over it is not needed anymore) for drawing the Bayesian reconstructed/fitted velocity distribution in the output plots. Remind that, since the Gnuplot package has been adopted in AMIDAS for drawing output plots, the velocity distribution function defined in this file must be written in the syntax of Gnuplot with the name of "f1v_Bayesian_fit_user(x)". Below we give our definition for the simple Maxwellian velocity distribution with and without the known analytic form of the integral over it as examples. The definitions for the other intrinsically defined fitting one-dimensional WIMP velocity distribution function are given in Appendix C.1 for users' references.
Once the analytic form of the integral over the velocity distribution function is known, we have The value of the normalization constant needed (inplicitly in the AMIDAS-II code) here (i.e. N f in Code 13) will be estimated numerically by using the velocity distribution defined in Code 13. 11 Remind here that, firstly, "\" (backslash) must be used in order to let the including of the definitions given in this file into the other intrinsic commands correctly. Secondly, the value of the parameter aa will be given by the fitting result. Moreover, two sample files, one for the AMIDAS code and the other one for the Gnuplot package, can be downloaded from the AMIDAS website.

Distribution function for describing the statistical uncertainty
In this subsection, we discuss the second key factor required in Bayesian analyses: the distribution function for describing the statistical uncertainty on the analyzed/fitted data points, which will in turn be used in the likelihood function (for more details, see Ref. [5] and references therein). In the AMIDAS-II package, we offer so far two analytic forms for the statisticaluncertainty distribution function. Meanwhile, users also have the option to define (by uploading/typing) an analytic form of their needed uncertainty distribution: Note however here that, only the option for a "Gaussian-distributed" statistical uncertainty is considered for our Bayesian reconstruction of the one-dimensional WIMP velocity distribution function. Thus the other one option for a "Poisson-distributed" statistical uncertainty as well as the uploading/typing areas are "unavailable" (locked) currently.
Nevertheless, as the users' guide to the AMIDAS(-II) package and website, in this subsection, we give still first the definition of the intrinsically defined Gaussian uncertainty distribution function used for the Bayesian reconstruction of f 1 (v) [5]. Then we will describe how to (modify this definition to) define user's own statistical-uncertainty distribution.

Default statistical-uncertainty distribution functions
As the most commonly considered cases, in the AMIDAS-II package we define two statisticaluncertainty distribution functions: where (x i , y i ) for i = 1, 2, · · · , N denote the N analyzed/fitted data points and f (x; a j ) is the theoretically predicted/fitting function with the fitting parameters a j , for j = 1, 2, · · · , N Bayesian ; where (x i , y i ± σ(y i )) for i = 1, 2, · · · , N denote the N analyzed/fitted data points with the (measurement) uncertainties on y i , σ(y i ).

User-defining the statistical-uncertainty distribution function
As an example, we give here the AMIDAS-II code for the (double-)Gaussian statistical-uncertainty distribution function used for our Bayesian reconstruction procedure [5] (with the name of "Bayesian_DF_user"). The code for the other intrinsically defined (i.e. Poisson, so far) statisticaluncertainty distribution function will be given in Appendix C.2 for users' references. Note here that we consider in the AMIDAS-II package an asymmetric distribution of the statistical uncertainty. For the case that the analyzed/fitted data point is larger (smaller) than the theoretical value estimated from the fitting (WIMP velocity distribution) function, we take the 1σ lower (upper) (statistical) uncertainty as the uncertainty σ(y i ) in Eq. (31). Remind that, a sample file for the AMIDAS code can be downloaded from the AMIDAS website.

Distribution function of each fitting parameter
In Bayesian analyses, one needs to give a (probability) distribution function for describing no/a prior knowledge about each fitting parameter. In the AMIDAS-II package, we offer so far three probability distribution functions for each fitting parameter for describing the prior knowledge about it. Meanwhile, users also have the option to define (by uploading/typing) an analytic form of their favorite probability distribution: Note that, since the statistical uncertainties on the default fitting parameters used for our Bayesian reconstruction of f 1 (v) are in principle Gaussian, the option for a "Poisson-distributed" probability distribution function is "unavailable" (locked) here. It is however possible to use the intrinsically defined "Poisson" probability distribution (unlocked), once users choose to define their own fitting WIMP velocity distribution function (Sec. 5.2).
In this subsection, we give first the definitions of the three intrinsically defined probability distribution functions for each fitting parameter in the AMIDAS-II package. Then we will describe how to (modify these definitions to) define user's favorite probability distribution.

Default distribution functions for the fitting parameters
As the most commonly considered cases, in the AMIDAS-II package we define three probability distribution functions: 1. Flat-distributed: where a i,min/max denote the minimal and maximal bounds of the scanning interval of the fitting parameter a i ; 2. Poisson-distributed: with the expected value µ a,i of the fitting parameter a i ; 3. Gaussian-distributed: with the expected value µ a,i of and the 1σ uncertainty σ a,i on the fitting parameter a i .

User-defining the distribution function for the fitting parameters
As an example, we give here the AMIDAS-II code for the Gaussian probability distribution function used in our Bayesian analysis procedure [5] (with the name of "Bayesian_DF_a_user"). The codes for the other intrinsically defined probability distribution functions will be given in Appendix C.3 for users' references. Note that there is only one function parameter in the (user-defined) probability distribution function and the parameter name must be "aa", "bb" or "cc" corresponding to the first, second or the third fitting parameter. Remind also that, a sample file for the AMIDAS code can be downloaded from the AMIDAS website.

Bounds of the scanning interval of each fitting parameter
For doing Bayesian fitting (scanning), users need to set the lower and upper bounds of the scanning range for each fitting parameter: Moreover, once the probability distribution function of one fitting parameter has been chosen as, e.g. Gaussian-distributed, it will be required automatically to set also the expected value and the standard deviation (uncertainty) of this parameter: On the other hand, for the case that user-defined probability distribution function has been used for one fitting parameter, users have also to give the notation and the unit of this parameter for the output files and plots: Note that, as remind on the website, for a "dimensionless" parameter (e.g. the ratio v e /v 0 and the power index k) it is required to use "NU" or "nu" in the input cell.

Scanning the parameter space
Finally, as the last information for our Bayesian analysis procedure, users have the opportunity to choose different scanning method.

Method for scanning the parameter space
(So far) in the AMIDAS-II package we programmed three different scanning methods: Here the second option "scan the whole parameter space roughly and then the neighborhood of the valid points more precisely" means that AMIDAS-II scans the whole parameter space to find the valid points; after that one valid point is found, AMIDAS-II will scan immediately and randomly the neighborhood of this point for finding a better (more possible) point 12 .
For a finer scanning, the third option above "scan the whole parameter space roughly and then the neighborhood of the (almost) valid points more precisely" let AMIDAS-II scan immediately 12 Once a valid point, called the "starting" point with the value a * i , is found, we pick randomly one point in the range of max(a * i − ∆ ai , a i,min ), min(a * i + ∆ ai , a i,max ) , where ∆ ai = (a i,max − a i,min ) / (the number of scanning points). We take this point if it is better and set this point as the next starting point for running this fine scanning process further; if this point is however invalid, we through it away, use the old starting point to pick another checking point and run this fine scanning process. Note that, in the fine scanning process, we set twice more scanning points on one parameter-axis around the first starting point (see Sec. 5.4.2 for more details). and randomly the neighborhood of the point for finding a better point, once this point is valid or almost valid 13 .

Number of scanning points for one fitting parameter
Users can set the number of scanning points for one fitting parameter: Note that this point number will be used for the regular scanning (option 1 in Sec. 5.4.1) as well as for the "first step" of the rough scanning (options 2 and 3). For the finer scanning around the (almost) valid points taken by the first step, doubled points (picked randomly around each (almost) valid point) for one parameter will be checked 14 . Hence, the default number of scanning points (for one fitting parameter) needs to set different according to the choice of the scanning method.

Summary
In this paper, we give a detailed user's guide to the AMIDAS (A Model-Independent Data Analysis System) (package and) website, which is developed for online simulations and data analyses for direct Dark Matter detection experiments and phenomenology.
AMIDAS(-II) has the ability to do full Monte Carlo simulations as well as to analyze (real/pseudo-) data sets either generated by another event generating programs or recorded in direct DM detection experiments. Recently, the whole (AMIDAS package and website) system has been upgraded to the second phase: AMIDAS-II, for including the new developed Bayesian analysis technique.
Users can run all functions and adopt the (default) input setup used in our (earlier) works [4,5,6,7,8,23,24,25,26,40,39] for their simulations as well as analyzing their own (real/pseudo-) data sets. The use of the AMIDAS website for users' simulations and data analyses has been explained step-by-step with plots in this paper. The preparations of function/data files to upload for simulations and data analyses have also been described.
Moreover, for more flexible and user-oriented use, users have the option to set their own target nuclei as well as their favorite/needed (fitting) (one-dimensional) WIMP velocity distribution function, (more suitable) elastic nuclear form factors for the SI and SD WIMP-nucleus cross sections and different probability distribution functions needed in the Bayesian reconstruction procedure. As examples, the AMIDAS(-II) codes for all user-uploadable functions are given in Secs. 3 and 5 as well as Appendix B and C. 13 For the Bayesian reconstruction of the one-dimensional WIMP velocity distribution function, we set in AMIDAS-II that the value of the posterior probability distribution function at the checking point is larger than 90% of "so far" largest one, since we only need to find the point, in which the value of the posterior probability distribution function is the largest.
14 This means that, once we set e.g. 100 scanning points (for one fitting parameter), 200 more points (in one parameter-axis) will be scanned in the neighborhood around each (almost) valid point. This means in turn that, for a fitting (velocity distribution) function with "three" parameters to scan, for "each" (almost) valid point, AMIDAS-II needs to check ∼ 8,000,000 more points (and perhaps do 1 or 2 × ∼ 8,000,000 more times three-dimensional numerical integrations for the normalization constant of the fitting velocity distribution!).
In summary, up to now all basic functions of the AMIDAS package and website have been well established. Hopefully this new tool can help our theoretical as well as experimental colleagues to understand properties of halo WIMPs, offer useful information to indirect DM detection as well as collider experiments, and finally discover (the mystery of) Galactic DM particles.

Acknowledgments
The author would like to thank James Yi-Yu Liu for useful discussion about the basic idea of including user-defined functions into the source code. The author appreciates the ILIAS Project and the Physikalisches Institut der Universität Tübingen for kindly providing the opportunity of the collaboration and the technical support of the AMIDAS website. The author would also like to thank the friendly hospitality of the Institute of Physics, National Chiao Tung University, the

A Intrinsically defined constants
In this section, we list all constants as well as the reduced mass m r,N in Eq. (7) and the transformation constant α in Eq. (6) defined intrinsically in the AMIDAS package for users' reference. Users could use these intrinsically defined constants and functions directly and/or include them into their own defined functions.

A.1 Constants and translators
The physical constants and needed translators defined in the AMIDAS package are in natural units as following: Here the mass difference between a proton and a neutron has been neglected. And the reduced mass between the WIMP mass and "something" is given by

A.3 Declared variables and constants
Here we list the short-named variables and constants declared in the AMIDAS(-II) package. Note that these names should be avoided to use in the user-defined function, except that you know their exact meanings and can apply them properly; otherwise, the AMIDAS(-II) package might not work correctly.

B Intrinsically defined functions
In this section, we give all codes for intrinsically defined velocity distribution functions given in Sec. 3.3, elastic nuclear form factors given in Sec. 3.4 as well as simple artificial background spectrum given in Sec. 3.5 in the AMIDAS(-II) package.

B.1 One-dimensional WIMP velocity distribution function
In this subsection, we give first the codes for intrinsically defined velocity distribution functions given in Sec. 3.3 in the AMIDAS-II package.
we can define Remind that firstly, "\" (backslash) must be used in order to let the including of the definition(s) given in this file into the other intrinsic commands correctly. Secondly, three flexible-kept parameters: AX, m_chi and v_0 will be read directly from the users' initial (simulation/data analysis) setup set earlier on the website.

B.1.2 Modified Maxwellian velocity distribution f 1,Gau,k (v)
According to Eq. (2), we can obtain the integral over f 1,Gau,k (v) and then define the normalization constant N f in the AMIDAS-II package as follows. For and then can define N f by  For k = 4, we have Meanwhile, for predicting the WIMP-signal spectrum one needs also that, for k = 1, to define k = 1 double Int_f1v_v_Gau_k(double vv) { return (-(v_0 * v_0) / 2.0 * exp(-(vv * vv ) / (v_0 * v_0) ) -(vv * vv ) / 2.0 * exp(-(v_max * v_max) / (v_0 * v_0) ) ) / Int_f1v_Gau_k; } For k = 2, one has and can define and can define For k = 4, one has where the normalization constant Int_f1v_Gau_k will be estimated directly by Codes A11 to A14, for drawing the output generating WIMP-signal spectrum, we need Remind that firstly, "\" (backslash) must be used in order to let the including of the definition(s) given in this file into the other intrinsic commands correctly. Secondly, all flexible-kept parameters: k_f1v (stands for the power index k of the modified Maxwellian velocity distribution), v_0, v_max as well as AX and m_chi will be read directly from the users' initial (simulation/data analysis) setup set earlier on the website.
we can define Remind here that, firstly, "\" (backslash) must be used in order to let the including of the definition given in this file into the other intrinsic commands correctly. Secondly, all flexiblekept parameters: t_p, t_expt, v_0 as well as AX and m_chi will be read directly from the users' initial (simulation/data analysis) setup set earlier on the website.

B.2 Elastic nuclear form factors
In this subsection, we give the codes for intrinsically defined elastic nuclear form factors given in Sec. 3.4 in the AMIDAS package.

B.2.1 Exponential form factor F ex (Q)
For the exponential form factor F ex (Q), the nuclear radius R 0 (A) and the nuclear coherence energy Q 0 (A) have been defined as functions of the atomic mass number A: Remind here that, firstly, "\" (backslash) must be used in order to let the including of the definition given in this file into the other intrinsic commands correctly. Secondly, two flexiblekept parameters: AX and m_chi will be read directly from the users' initial (simulation/data analysis) setup set earlier on the website.

B.2.2 Woods-Saxon form factor F WS (Q)
For the Woods-Saxon form factor F WS (Q), the nuclear skin thickness s, the radius R A (A), and the effective nuclear radius R 1 (A) are defined as For defining the derivative of the squared Woods-Saxon form factor, dF 2 WS (Q)/dQ, first, we find that where, from the expression (12) for q, we have The expression (A13) can be used for Q > 0. However, for the limit case Q = q = 0, since [42] we can get Then, by letting x = qR 1 , the first two terms in the bracket of the right-hand side of Eq. (A13) (multiply by 1/q) can be written and found that as x → 0. Hence, we can obtain that, for the limit case Q = q = 0, where we use the expression (13) for R 1 and and their derivatives have also been defined in an intrinsic package of the AMIDAS code. We define at first the halfinteger Bessel functions J n+1/2 (x), for n = 0, ± 1, ± 2, · · ·, by Here for the case n ≥ 3 or n ≤ −3 (i.e. ±n ≥ 3), we use the following relation [42]: Then one can derive that For the derivatives of the Bessel functions, since [42] J n (x) = 1 2 we can find that Therefore, according to Eq. (A20), we can first define Code A44: Spherical Bessel functions j n (x) for n = 0, 1, 2, · · · double sphBesselj(int n, double x) { return sqrt(M_PI / 2.0 / x) * BesselJ(2 * n + 1, 2, x); } Meanwhile, from Eqs. (A21) and (A24), we can obtain that and thus define Remind here that, firstly, "\" (backslash) must be used in order to let the including of the definition given in this file into the other intrinsic commands correctly. Secondly, the flexiblekept parameter: AX will be read directly from the users' initial (simulation/data analysis) setup set earlier on the website.

B.2.3 Modified Woods-Saxon form factor F WS,Eder (Q)
First, the modified radius R A given in Eq. (16) has been defined as Remind here that, firstly, "\" (backslash) must be used in order to let the including of the definition given in this file into the other intrinsic commands correctly. Secondly, the flexiblekept parameter: AX will be read directly from the users' initial (simulation/data analysis) setup set earlier on the website.

B.2.4 Helm form factor F Helm (Q)
For the Helm form factor F Helm (Q), the nuclear skin thickness s, the radii r 0 and R A (A), and the effective nuclear radius R 1 (A) are defined as Note here that the expression (17) for R 1 has to be used.
On the other hand, for drawing the output generating WIMP-signal recoil spectrum, we need Remind here that, firstly, "\" (backslash) must be used in order to let the including of the definition given in this file into the other intrinsic commands correctly. Secondly, the flexiblekept parameter: AX will be read directly from the users' initial (simulation/data analysis) setup set earlier on the website.

B.2.5 Thin-shell form factor F TS (Q)
For the thin-shell form factor F TS (Q), the lower and upper bounds of qR 1 given in Eq. (21), between which the form factor is a constant ( 0.047), is defined by For defining the derivative of the squared thin-shell form factor, dF 2 TS (Q)/dQ, first, we find that where we have used Eq. (A14). For the limit case Q = q = 0, since [42] j 0 (x) = π 2x we can get Then, by letting x = qR 1 , the term in the bracket of the right-hand side of Eq. (A27) (multiply by 1/q) can be written and found that as x → 0. Hence, we can obtain that, for the limit case Q = q = 0, where we have used Here we define an auxiliary function Thus we can get and Remind here that, firstly, "\" (backslash) must be used in order to let the including of the definition given in this file into the other intrinsic commands correctly. Secondly, the flexiblekept parameter: AX will be read directly from the users' initial (simulation/data analysis) setup set earlier on the website.

B.3 Background spectrum
In this subsection, we give the codes for intrinsically defined simple artificial background spectrum given in Sec. 3.5 in the AMIDAS package.

B.3.1 Signal and background windows
Similar to the function Ξ(x) defined in Eqs. (A33), (A34a) and (A34b), we define the signal and background windows and vacua for drawing the predicted WIMP-signal and artificial background spectra on the output plots together as following: According to these definitions, AMIDAS will use the given analytic expressions to draw the WIMP-signal and background spectra exactly in the energy range between the minimal and maximal cut-offs Q (min,max) and Q bg,(min,max) , respectively. Note here that the minimal and maximal cut-offs: Qmin_gen, Qmax_gen and Qmin_bgwindow, Qmax_bgwindow will be read directly from the users' initial (simulation/data analysis) setup set earlier on the website. Remind als here that "\" (backslash) must be used in order to let the including of the definition(s) given in this file into the other intrinsic commands correctly.

B.3.2 Constant background spectrum (dR/dQ) bg,const
The simplest considerable (artificial) background spectrum is the constant one (dR/dQ) bg,const given in Eq. Remind als here that "\" (backslash) must be used in order to let the including of the definition(s) given in this file into the other intrinsic commands correctly.

B.3.3 Exponential background spectrum (dR/dQ) bg,ex
More realistically, we considered in our simulations the "target-dependent" exponential background spectrum (dR/dQ) bg,ex given in Eq. Remind that firstly, "\" (backslash) must be used in order to let the including of the definition(s) given in this file into the other intrinsic commands correctly. Secondly, the flexible-kept parameter: AX will be read directly from the users' initial (simulation/data analysis) setup set earlier on the website.

B.3.4 Gaussian-excess background spectrum (dR/dQ) bg,Gau
For describing background events induced by e.g. radioactivity of some nuclei, we introduce in our simulations the Gaussian-excess background spectrum (dR/dQ) bg,Gau given in Eq. (25) [39]: Code A75: Gaussian-excess background spectrum (dR/dQ) bg,Gau (Q bg,peak , σ Q,bg , Q) Remind that firstly, "\" (backslash) must be used in order to let the including of the definition(s) given in this file into the other intrinsic commands correctly. Secondly, the flexible-kept parameters: dRdQ_bg_mu and dRdQ_bg_sigma_mu will be read directly from the users' initial (simulation/data analysis) setup set earlier on the website.
C Intrinsically defined functions for Bayesian analyses C.1 Fitting one-dimensional velocity distribution function In this subsection, we give first the codes for intrinsically defined fitting velocity distribution functions given in Sec. 5.1 in the AMIDAS-II package.

C.1.1 Simple Maxwellian velocity distribution f 1,Gau (v)
From the expression (1) for the simple Maxwellian velocity distribution function f 1,Gau (v), we can obtain that Then we can define ) / ( Int_f1v_Bayesian_fit_Gau(v_max, aa, bb, cc) -Int_f1v_Bayesian_fit_Gau(0.0, aa, bb, cc) ); } and the values of a_Bayesian_fit and b_Bayesian_fit will be given from the fitting result. Remind that "\" (backslash) must be used in order to let the including of the definition(s) given in this file into the other intrinsic commands correctly.

C.2 Distribution function for describing the statistical uncertainty
In this subsection, we give the codes for intrinsically defined distribution functions for describing the statistical uncertainty given in Sec. 5.2 in the AMIDAS-II package, which will in turn be used in the likelihood function in Bayesian analyses.
C.2.1 Poisson statistical-uncertainty distribution Poi(x i , y i ; y i,th ) For describing, e.g. the (expected) signal/background event rates (numbers), one needs usually the Poisson statistical-uncertainty distribution Poi(x i , y i ; a j , j = 1, 2, · · · , N Bayesian ) given in Eq. (30). For this use, we define Here we have used the expression for the Poisson distribution with µ as the expectation value: where the gamma function Γ(x) is defined by and lgamma(x) is the intrinsic C mathematical function defined as lgamma(x) ≡ ln Γ(x) . For the most common case that one (of the) fitting parameter(s) is expected to be with an uncertainty obeying the "Gaussian/normal" distribution, one can use the Gaussian probability distribution function p i,Gau (a i ; µ a,i , σ a,i ) given in Eq. (34): Code A97: Gaussian probability distribution function p i,Gau (a i ; µ a,i , σ a,i ) double Bayesian_DF_a_Gau(double aa) { return exp(-(aa -a_ave_Bayesian) * (aa -a_ave_Bayesian) / (2.0 * sigma_a_ave_Bayesian * sigma_a_ave_Bayesian ) ) / (sigma_a_ave_Bayesian * sqrt(2.0 * M_PI)); }