Axions.cpp
Go to the documentation of this file.
81 const std::map<InterpolationOptions1D, std::string> int_type_name = { { InterpolationOptions1D::linear, "linear" }, { InterpolationOptions1D::cspline, "cspline"} }; 82 // AxionInterpolator class: Provides a general 1-D interpolation container based on the gsl library. 83 // Can be declared static for efficiency & easy one-time initialisation of interpolating functions. 89 AxionInterpolator(const std::vector<double> x, const std::vector<double> y, InterpolationOptions1D type = InterpolationOptions1D::linear); 90 AxionInterpolator(std::string file, InterpolationOptions1D type = InterpolationOptions1D::linear); 105 void init(const std::vector<double> x, const std::vector<double> y, InterpolationOptions1D type); 122 void AxionInterpolator::init(const std::vector<double> x, const std::vector<double> y, InterpolationOptions1D type) 139 DarkBit_error().raise(LOCAL_INFO, "ERROR! Interpolation type not known to class AxionInterpolator."); 145 AxionInterpolator::AxionInterpolator(const std::vector<double> x, const std::vector<double> y, InterpolationOptions1D type) { init(x, y, type); } 155 logger() << LogTags::debug << "Reading data from file '"+file+"' and interpolating it with '"+int_type_name.at(type)+"' method." << EOM; 164 AxionInterpolator::AxionInterpolator(std::string file, InterpolationOptions1D type) { init(file, type); } 198 const std::map<InterpolationOptions2D, std::string> int_2d_type_name = { { InterpolationOptions2D::bilinear, "bilinear" }, { InterpolationOptions2D::bicubic, "bicubic"} }; 200 // Can be declared static for efficiency & easy one-time initialisation of interpolating functions. 206 AxionInterpolator2D(std::string file, InterpolationOptions2D type = InterpolationOptions2D::bilinear); 220 // The gsl objects for the interpolating functions that need to be available to the class routines. 263 logger() << LogTags::debug << "Reading data from file '"+file+"' and interpolating it with '"+int_2d_type_name.at(type)+"' method." << EOM; 282 DarkBit_error().raise(LOCAL_INFO, "ERROR! The number of grid points ("+std::to_string(n_grid_pts)+") for AxionInterpolator2D does not equal the number of unique 'x' and 'y' values ("+std::to_string(nx)+" and "+std::to_string(ny)+")!\n Check formatting of the file: '"+file+"'."); 300 DarkBit_error().raise(LOCAL_INFO, "ERROR! Interpolation type not known to class AxionInterpolator2D."); 323 //std::cout << ind_x << "/" << nx-1 << " " << tab["x"][i] << " vs " << x[ind_x] << " " << ind_y << "/" << ny-1 << " " << tab["y"][i] << " vs " << y[ind_y] << std::endl; 339 AxionInterpolator2D::AxionInterpolator2D(std::string file, InterpolationOptions2D type) { init(file, type); } 342 double AxionInterpolator2D::interpolate(double x, double y) { return gsl_spline2d_eval(spline, x, y, x_acc, y_acc); } 345 bool AxionInterpolator2D::is_inside_box(double x, double y) { return ((x >= x_lo) && (x <= x_up) && (y >= y_lo) && (y <= y_up)); } 351 double parabola(double x, const double params[]) { return params[0]*x*x + params[1]*x + params[2]; } 353 // Auxillary function to return the appropriate intersection between a parabola and a line (needed for H.E.S.S. likelihood). 359 double temp1 = a*a + 4.0*b*pparams[0] - 2.0*a*pparams[1] + pparams[1]*pparams[1] - 4.0*pparams[0]*pparams[2]; 368 // HESS_Interpolator class: Provides a customised interpolation container for the H.E.S.S. likelihood. 393 interp_lnL.setcolnames("lnL16", "lnL15", "lnL14", "lnL13", "lnL12", "lnL11", "lnL10", "lnL9", "lnL8", "lnL7", "lnL6", "lnL5", "lnL4", "lnL3", "lnL2", "lnL1", "lnL0"); 401 const double lnLvals [8] = {0., -2.30259, -2.99573, -4.60517, -4.60517, -2.99573, -2.30259, 0.}; 429 if ((gamma > parabola(epsilon, ppars00)) && (gamma < 1.2) && (epsilon > -4.64) && (epsilon < -2.57)) 431 // Check if we are in the upper part (higher coupling; interpolation using linear and cubic splines). 439 if ( (epsilon > interp_lnL["lnL"+std::to_string(index_lo)].front()) && (epsilon < interp_lnL["lnL"+std::to_string(index_lo)].back()) ) 444 if ( (epsilon > interp_lnL["lnL"+std::to_string(index_hi)].front()) && (epsilon < interp_lnL["lnL"+std::to_string(index_hi)].back()) ) 458 // Gamma values belonging to the likelihood values along symmetry line (in terms of distance to 0.4). 472 // CAVE: There used to be problems with distance > 1.0; these should be fixed now. Otherwise: replace by min(dist,1). 486 // CAVE: There used to be a bug with log-likelihood > 0.0; this is fixed now, but still safeguard the result against roundoff errors. 495 // SolarModel class: Provides a container to store a (tabulated) Solar model and functions to return its properties. 506 // Min. and max. radius of the solar model file (distance r from the centre of the Sun in units of the solar radius) 528 DarkBit_error().raise(LOCAL_INFO, "ERROR! Solar model file '"+file+"' not compatible with GAMBIT!\n" 531 data.setcolnames("mass", "radius", "temperature", "rho", "Pressure", "Luminosity", "X_H1", "X_He4", "X_He3", "X_C12", "X_C13", "X_N14", "X_N15", "X_O16", "X_O17", "X_O18", "X_Ne", "X_Na", "X_Mg", "X_Al", "X_Si", "X_P", "X_S", "X_Cl", "X_Ar", 539 // Extract the temperature from the files (has to be converted into keV) & calculate the screening scale kappa_s_squared. 545 const double factor = 4.0*pi*alpha_EM*gsl_pow_3(1.0E+6*gev2cm)/((1.0E+9*eV2g)*atomic_mass_unit); 546 // Atomic weight of species i (exact weight if isotope is known OR estimate from average solar abundance from data if available OR estimate from natural terrestrial abundance). 547 const double A_vals [29] = {1.007825, 4.002603, 3.016029, 12.000000, 13.003355, 14.003074, 15.000109, 15.994915, 16.999132, 17.999160, 548 20.1312812, 22.989769, 24.3055, 26.9815385, 28.085, 30.973762, 32.0675, 35.4515, 36.275403, 39.0983, 40.078, 44.955908, 47.867, 50.9415, 51.9961, 54.938044, 55.845, 58.933194, 58.6934}; 551 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0}; 554 std::cout << "DEBUGGING INFO for solar models:\nradius/Rsol T/K kappa_s^2/keV^2 omega_pl^2/keV^2" << std::endl; 561 double t_intercept = (1.0E-3*K2eV)*(r0*data["temperature"][1]-r1*data["temperature"][0])/(r0-r1); 581 // Calculate the necessary quantities -- T(r), kappa_s^2(r) and omega_pl^2(r) -- and store them internally. 615 logger() << LogTags::info << "Initialisation of solar model from file '"+file+"' complete!" << std::endl; 616 logger() << LogTags::debug << "Entries in model file: " << pts << " for solar radius in [" << data["radius"][0] << ", " << data["radius"][pts-1] << "]." << EOM; 640 // Routine to return the temperature (in keV) of the zone around the distance r from the centre of the Sun. 641 double SolarModel::temperature_in_keV(double r) { return gsl_spline_eval(linear_interp[0], r, accel[0]); } 643 // Routine to return the screening paramter kappa^2 in units of keV^2 (kappa^-1 = Debye-Hueckel radius). 650 // Routine to return the plasma freqeuency squared (in keV^2) of the zone around the distance r from the centre of the Sun. 651 double SolarModel::omega_pl_squared(double r) { return gsl_spline_eval(linear_interp[2], r, accel[2]); } 659 struct SolarModel_params3 {double rs; double ma0; SolarModel* sol; AxionInterpolator* eff_exp;}; 660 struct SolarModel_params4 {double ma0; AxionInterpolator* eff_exp; AxionInterpolator* gaee_flux;}; 701 gsl_integration_qag (&F, rad, rmax, 1e-2*abs_prec, 1e-2*rel_prec, 1E6, method, w, &result, &error); 735 gsl_integration_qag (&F, rmin, rmax, 1e-1*abs_prec, 1e-1*rel_prec, 1E6, method, w, &result, &error); 760 CAST_SolarModel_Interpolator(std::string solar_model_gagg, std::string solar_model_gaee, std::string data_set); 781 CAST_SolarModel_Interpolator::CAST_SolarModel_Interpolator(std::string solar_model_gagg, std::string solar_model_gaee, std::string data_set) 785 logger() << LogTags::info << "Using solar models '"+solar_model_gagg+"' (axion-photon int.) and '"+solar_model_gaee+"' (axion-electron int.) for experiment '"+data_set+"'." << EOM; 788 user_gagg_file_missing = not(Utils::file_exists(darkbitdata_path+"CAST/"+data_set+"_ReferenceCounts_"+solar_model_gagg+"_gagg.dat")); 789 user_gaee_file_missing = not(Utils::file_exists(darkbitdata_path+"CAST/"+data_set+"_ReferenceCounts_"+solar_model_gaee+"_gaee.dat")); 790 if (not(user_gagg_file_missing)) { logger() << LogTags::info << "Found pre-calculated axion-photon counts file for experiment '"+data_set+"' and solar model '"+solar_model_gagg+"'. Skipping calculation step..." << EOM; } 791 if (not(user_gaee_file_missing)) { logger() << LogTags::info << "Found pre-calculated axion-electron counts file for experiment '"+data_set+"' and solar model '"+solar_model_gaee+"'. Skipping calculation step..." << EOM; } 798 const double log_masses [n_mass_bins] = {-3., -2.8, -2.6, -2.4, -2.2, -2.15, -2.1, -2.05, -2., -1.95, -1.9, -1.85, -1.8475, -1.84, -1.8325, -1.825, -1.8175, -1.81, -1.8025, -1.795, -1.7875, -1.78, -1.7725, -1.765, -1.7575, -1.75, 799 -1.7425, -1.735, -1.7275, -1.72, -1.7125, -1.705, -1.6975, -1.69, -1.6825, -1.675, -1.6675, -1.66, -1.6525, -1.645, -1.6375, -1.63, -1.6225, -1.615, -1.6075, -1.6, -1.5925, -1.585, -1.5775, -1.57, 800 -1.5625, -1.555, -1.5475, -1.54, -1.5325, -1.525, -1.5175, -1.51, -1.5025, -1.495, -1.4875, -1.48, -1.4725, -1.465, -1.4575, -1.45, -1.4425, -1.435, -1.4275, -1.42, -1.4125, -1.405, -1.3975, 801 -1.39, -1.3825, -1.375, -1.3675, -1.36, -1.3525, -1.345, -1.3375, -1.33, -1.3225, -1.315, -1.3075, -1.3, -1.2925, -1.285, -1.2775, -1.27, -1.2625, -1.255, -1.2475, -1.24, -1.2325, -1.225, -1.2175, 802 -1.21, -1.2025, -1.195, -1.1875, -1.18, -1.1725, -1.165, -1.1575, -1.15, -1.1425, -1.135, -1.1275, -1.12, -1.1125, -1.105, -1.0975, -1.09, -1.0825, -1.075, -1.0675, -1.06, -1.0525, -1.045, 803 -1.0375, -1.03, -1.0225, -1.015, -1.0075, -1., -0.9925, -0.985, -0.9775, -0.97, -0.9625, -0.955, -0.9475, -0.94, -0.9325, -0.925, -0.9175, -0.91, -0.9025, -0.895, -0.8875, -0.88, -0.8725, -0.865, 804 -0.8575, -0.85, -0.8425, -0.835, -0.8275, -0.82, -0.8125, -0.805, -0.7975, -0.79, -0.7825, -0.775, -0.7675, -0.76, -0.7525, -0.745, -0.7375, -0.73, -0.7225, -0.715, -0.7075, -0.7, -0.65, -0.6, 808 // prefactor_gagg = (keV/eV)^6 * (1 cm^2/eVcm^2) * (1 day/eVs) * (10^10 cm/eVcm) * (10^-19 eV^-1)^4 * ((9.26 m/eVm) * (9.0 T/(T/eV^2) ))^2 / (128 pi^3) 835 DarkBit_error().raise(LOCAL_INFO, "ERROR! No solar model file found for '"+solar_model_gagg+"'.\n" 840 // Load and interpolate effective exposure and the data for the axion-electron spectrum (with its nasty peaks). 845 if (Utils::file_exists(darkbitdata_path+"CAST/"+"Axion_Spectrum_"+solar_model_gaee+"_gaee.dat")) 847 gaee_spectrum = AxionInterpolator(darkbitdata_path+"CAST/"+"Axion_Spectrum_"+solar_model_gaee+"_gaee.dat"); 849 DarkBit_error().raise(LOCAL_INFO, "ERROR! No spectrum file found for axion-electron interactions and model '"+solar_model_gaee+"'.\n" 853 double all_peaks [32] = {0.653029, 0.779074, 0.920547, 0.956836, 1.02042, 1.05343, 1.3497, 1.40807, 1.46949, 1.59487, 1.62314, 1.65075, 1.72461, 1.76286, 1.86037, 2.00007, 2.45281, 2.61233, 3.12669, 3.30616, 3.88237, 4.08163, 5.64394, 864 logger() << LogTags::info << "Calculating reference counts for dataset '"+data_set+"'..." << EOM; 896 gsl_integration_qag (&F, erg_lo, erg_hi, abs_prec, rel_prec, 1E6, method, v, &gagg_result, &gagg_error); 899 printf("gagg | % 6.4f [%3.2f, %3.2f] % 4.3e\n", log10(m_ax), erg_lo, erg_hi, log10(temp*gagg_result)); 909 gsl_integration_qagp(&G, &relevant_peaks[0], relevant_peaks.size(), abs_prec, rel_prec, 1E6, w, &gaee_result, &gaee_error); 912 printf("gaee | % 6.4f [%3.2f, %3.2f] % 4.3e\n", log10(m_ax), erg_lo, erg_hi, log10(0.826*prefactor_gaee*gaee_result)); 928 std::string header = "########################################################################\n" 929 "# Reference Counts for Solar Model "+solar_model_gagg+std::string(std::max(0,36-static_cast<int>(solar_model_gagg.length())),' ')+"#\n" 933 std::ofstream gagg_file (darkbitdata_path+"CAST/"+data_set+"_ReferenceCounts_"+solar_model_gagg+"_gagg.dat"); 943 logger() << LogTags::info << "Output file '"+darkbitdata_path+"CAST/"+data_set+"_ReferenceCounts_"+solar_model_gagg+"_gagg.dat"+"' written for axion-photon interactions." << EOM; 948 std::string header = "########################################################################\n" 949 "# Reference Counts for Solar Model "+solar_model_gaee+std::string(std::max(0,36-static_cast<int>(solar_model_gaee.length())),' ')+"#\n" 953 std::ofstream gaee_file (darkbitdata_path+"CAST/"+data_set+"_ReferenceCounts_"+solar_model_gaee+"_gaee.dat"); 963 logger() << LogTags::info << "Output file '"+darkbitdata_path+"CAST/"+data_set+"_ReferenceCounts_"+solar_model_gaee+"_gagg.dat"+"' written for axion-electron interactions." << EOM; 969 gagg_data = ASCIItableReader(darkbitdata_path+"CAST/"+data_set+"_ReferenceCounts_"+solar_model_gagg+"_gagg.dat"); 970 gaee_data = ASCIItableReader(darkbitdata_path+"CAST/"+data_set+"_ReferenceCounts_"+solar_model_gaee+"_gaee.dat"); 995 CAST_SolarModel_Interpolator::CAST_SolarModel_Interpolator(CAST_SolarModel_Interpolator &&interp) : 1030 for (int i = 0; i < n_bins; i++) { result.push_back(gsl_spline_eval(gagg_linear_interp[i], lgm, gagg_acc[i])); } 1048 for (int i = 0; i < n_bins; i++) { result.push_back(gsl_spline_eval(gaee_linear_interp[i], lgm, gaee_acc[i])); } 1057 double gaussian_nuisance_lnL(double theo, double obs, double sigma) { return Stats::gaussian_loglikelihood(theo, obs, 0, sigma, false); } 1081 static AxionInterpolator gR (GAMBIT_DIR "/DarkBit/data/gR_WantzShellard.dat", InterpolationOptions1D::cspline); 1094 // Function to provide the effective relativistic entropic degrees of freedom (for the Standard Model). 1101 static AxionInterpolator gS (GAMBIT_DIR "/DarkBit/data/gS_WantzShellard.dat", InterpolationOptions1D::cspline); 1155 // Capability function to provide a lieklihood for the temperature dependence of the QCD axion mass (doi:10.1038/nature20115). 1163 // We normalised their findings by dividing out their value for chi(T=0) and removed its contribution to the error. 1164 const double temp_vals [20] = {100, 120, 140, 170, 200, 240, 290, 350, 420, 500, 600, 720, 860, 1000, 1200, 1500, 1800, 2100, 2500, 3000}; 1165 const double log_chi_vals [20] = {0.00554625, 0.0255462, -0.0844538, -0.484454, -1.00445, -1.75445, -2.45445, -3.07445, -3.66445, -4.22445, -4.80445, -5.39445, -5.96445, -6.45445, -7.05445, -7.79445, -8.40445, -8.93445, -9.53445, -10.1545}; 1166 const double log_chi_err_vals [20] = {0.014468, 0.0361846, 0.014468, 0.014468, 0.064104, 0.064104, 0.0510815, 0.0361846, 0.0510815, 0.064104, 0.0878027, 0.110042, 0.142159, 0.163124, 0.183873, 0.224965, 0.255557, 0.286023, 0.316401, 0.356804}; 1169 for (int i = 0; i < 20; i++) { dummy = dummy + gaussian_nuisance_lnL(log_chi_vals[i], log_chi(temp_vals[i],beta,Tchi), log_chi_err_vals[i]); } 1227 // Specific capability to provide the expected signal from data run 3 (8 data frames; 0.18 mbar). 1237 // General likelihood function for the ALPS 1 experiment (given expected signal s = obs - bkg). 1283 static std::string solar_model_gagg = runOptions->getValueOrDef<std::string> ("AGSS09met", "solar_model_gagg"); 1284 static std::string solar_model_gaee = runOptions->getValueOrDef<std::string> ("AGSS09met_old", "solar_model_gaee"); 1285 static CAST_SolarModel_Interpolator lg_ref_counts (solar_model_gagg, solar_model_gaee, "CAST2007"); 1294 dummy = gsl_pow_2(gagg*1E19)*pow(10,lg_ref_counts_gagg[i]) + gsl_pow_2(gaee*gaee_conversion)*pow(10,lg_ref_counts_gaee[i]); 1312 static std::string solar_model_gagg = runOptions->getValueOrDef<std::string> ("AGSS09met", "solar_model_gagg"); 1313 static std::string solar_model_gaee = runOptions->getValueOrDef<std::string> ("AGSS09met_old", "solar_model_gaee"); 1317 const std::string exp_names [n_exps] = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"}; 1324 CAST_SolarModel_Interpolator dummy (solar_model_gagg, solar_model_gaee, "CAST2017_"+exp_names[e]); 1339 dummy = gsl_pow_2(gagg*1E19)*pow(10,lg_ref_counts_gagg[bin]) + gsl_pow_2(gaee*gaee_conversion)*pow(10,lg_ref_counts_gaee[bin]); 1350 double CAST_lnL_general(std::vector<double> s, const std::vector<double> bkg_counts, const std::vector<int> sig_counts) 1373 const std::vector<double> bkg_vac {2.286801272, 1.559182673, 2.390746817, 1.559182673, 2.598637835, 1.039455092, 0.727618599, 1.559182673, 1.247346181, 1.455237199, 1.871019235, 0.831564073, 1.663128217, 1.247346181, 1.143400636, 1.663128217, 1411 const std::vector<std::vector<double>> bkg_vac_all { {0.926256, 1.96148, 1.79803, 1.30766, 1.30766, 1.96148, 2.61531, 2.77877, 2.94223, 2.07045}, 1421 {0.0150685, 0.0568493, 0.060274, 0.0150685, 0.0150685, 0.00753425, 0.0267123, 0.0150685, 0.0267123, 0.0116438}, 1422 {0.0409574, 0.226904, 0.243287, 0.0532447, 0.0188404, 0.0344043, 0.0417766, 0.0409574, 0.0409574, 0.0286702} }; 1437 for (int e = 0; e < n_exps; e++) { result = result + CAST_lnL_general(sig_vac[e], bkg_vac_all[e], dat_vac_all[e]); } 1446 // All current haloscope likelihoods are approximated. We only need the predicted signal power up to a constant of proportionality. 1520 // Get limit and rescale it to 1 sigma from the appropriate number of sigmas for 90% C.L. (1 d.o.f.). 1532 // University of Florida (UF) approximated likelihood function; Hagmann+ Phys. Rev. D 42, 1297(R) (1990). 1542 // Likelihood parameters based on information from Phys. Rev. D 42, 1297(R) (1990); correspond to power in 10^-22 W. 1556 // Rochester-Brookhaven-Fermi (RBF) approximated likelihood function; Phys. Rev. D 40, 3153 (1989). 1565 //const std::vector<double> bins = {4.507875, 5.037241, 5.459079, 5.851967, 5.996715, 6.257262, 6.617065, 6.976868, 7.113345, 7.295314, 7.857765, 8.631134, 8.684898, 9.259755, 9.760171, 10.173737, 1568 //const double N_sigma [21] = {5.0, 5.0, 5.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 0.0, 5.0, 4.0, 4.0, 4.0, 4.0}; 1570 //const double eff_sigma [21] = {8.3030524510E+01, 3.5789241789E+02, 5.3457189090E+02, 8.3673921774E+02, 7.3205267295E+02, 7.1850356207E+02, 7.0099211538E+02, 9.3243407987E+02, 1.3132694610E+03, 1.9447760075E+03, 2.4028734743E+03, 1571 // 3.5992849457E+03, 5.8433323192E+03, 1.2415907565E+03, 1.1487509033E+03, 1.0000000000E+99, 2.6768234439E+03, 9.1546564260E+04, 1.7208310692E+04, 4.2462784870E+04, 2.8794160844E+04}; 1573 const std::vector<double> bins = {4.400841, 4.960600, 5.209095, 5.668611, 6.934590, 7.445686, 8.041207, 8.898392, 9.570607, 10.067396, 11.213613, 11.626834, 12.773085, 13.450179, 14.704884, 16.170394}; 1575 const double eff_sigma [15] = {7.794388E+01, 3.808827E+02, 5.328136E+02, 6.765588E+02, 1.772892E+03, 2.752458E+03, 5.945156E+03, 2.025315E+03, 1.546855E+03, 1.022957E+13, 5.464075E+03, 9.621171E+04, 2.023187E+04, 5.201449E+04, 3.597168E+04}; 1578 // Note that there are no limits between 10.1 and 11.2 ueV; the tabulated value in that bin is just a placeholder, which is never used. 1581 // Use the standard search algorthim to identify the bin index and use the appropriate values for the likelihood. 1584 // Uncomment and comment out lines below to swap between implementations using Table I and Figure 14, respectively. 1621 static AxionInterpolator F1 (GAMBIT_DIR "/DarkBit/data/Axion_DiffEqnFun1.dat", InterpolationOptions1D::linear); 1633 static AxionInterpolator F3 (GAMBIT_DIR "/DarkBit/data/Axion_DiffEqnFun3.dat", InterpolationOptions1D::linear); 1658 // Auxillary function with root Tosc, the temperature where the axion field oscillations start (defined by mA = 3H). 1659 // Note that this is only to set the temperature scale of the problem. The differential equation is solved numerically around 1670 double result = 1.0 - gStar(T)*gsl_pow_2(T*T*pi/(ma0*m_pl*axion_mass_temp(T, beta, Tchi)))/10.0; 1746 f[1] = -gsl_pow_2(SpecialFun1(-tau*Tosc) * ma0*axion_mass_temp(-tau*Tosc,beta,Tchi) / (hubble_rad_dom(-tau*Tosc) * (-tau))) * gsl_sf_sin(y[0]*thetai)/thetai; 1766 gsl_matrix_set (m, 1, 0, -gsl_pow_2(SpecialFun1(-tau*Tosc) * ma0*axion_mass_temp(-tau*Tosc,beta,Tchi) / (hubble_rad_dom(-tau*Tosc) * (-tau))) * gsl_sf_cos(y[0]*thetai)); 1774 // Capability function to solve the differential equation for the energy density in axions today (in terms of the critical density). 1785 if ( (thetai<-pi) || (thetai>3.0*pi) ) { DarkBit_error().raise(LOCAL_INFO, "ERROR! The parameter 'thetai' should be chosen from the interval [-pi,3pi]."); } 1786 // If thetai in (pi,3pi): map it back to its equivalent value in (-pi,pi]. This is to allow sampling around pi and easier averaging. 1808 // Other possible choices: gsl_odeiv2_step_rk4 (classic), gsl_odeiv2_step_rk8pd, gsl_odeiv2_step_rkf45 (standard choices). 1809 gsl_odeiv2_driver * d = gsl_odeiv2_driver_alloc_y_new (&sys, gsl_odeiv2_step_bsimp, -0.1*tau1, 1E-8, 1E-8); 1811 // Numerically solve ODE by continuing the integration well into the harmonic and adiabatic regime (stopping conditions 1828 check1 = fabs(thetai)*sqrt(gsl_pow_2( fabs(y[0]) ) + gsl_pow_2( fabs((-new_step)*y[1]*hubble_rad_dom(-new_step*Tosc)/(ma0*axion_mass_temp(-new_step*Tosc,beta,Tchi))) )); 1841 buffer << "T_end: " << -new_step << " | theta_hat_val: " << check1 << ", theta_der: "<< -tau2*y[1]*thetai << ", 3H/m_osc: " << 3.0*hubble_rad_dom(Tosc)/(ma0*axion_mass_temp(-new_step*Tosc,beta,Tchi)) << ", 3H/m: " << check2 << " .\n"; 1842 DarkBit_warning().raise(LOCAL_INFO, "WARNING! Maximum number of integration steps reached for energy density calculator!\n "+buffer.str()); 1846 double ede = 1E+18*gsl_pow_2(fa)*(0.5*gsl_pow_2(y[1]*thetai*hubble_rad_dom(-new_step*Tosc)*(-new_step)) + gsl_pow_2(ma0*axion_mass_temp(-new_step*Tosc,beta,Tchi))*(1.0 - gsl_sf_cos(y[0]*thetai))); 1847 // Use conservation of entropy to scale the axion energy density to its present value (relative to the critical energy density). 1848 double OmegaAh2 = ede*gsl_pow_3(TCMB/(-new_step*Tosc))*(gStar_S(TCMB)/gStar_S(-new_step*Tosc))*(1.0/axion_mass_temp(-new_step*Tosc,beta,Tchi))/ede_crit_today; 1872 // Based and extending on Refs [11, 12, 13, 75] and 10.3204/DESY-PROC-2015-02/straniero_oscar in 1512.08108 . 1882 static AxionInterpolator correction (GAMBIT_DIR "/DarkBit/data/Axions_RParameterCorrection.dat", InterpolationOptions1D::linear); 1888 if ((ma0 > m_min) && (ma0 < m_max)) { geff *= pow(10, 0.5*correction.interpolate(log10(ma0))); } 1891 // Expressions only valid for gaee2 < 35.18 but limits should become stronger for gaee2 > 35.18 (but perhaps not gaee2 >> 35.18). 1895 result = -0.421824 - 0.0948659*(-4.675 + sqrt(21.8556 + 21.0824*geff)) - 0.00533169*gaee2 - 0.0386834*(-1.23 - 0.137991*pow(gaee2,0.75) + sqrt(1.5129 + gaee2)) + 7.3306*Y; 1922 WDInterpolator(const std::vector<double> x, const std::vector<double> y, std::string correction_file, InterpolationOptions1D type = InterpolationOptions1D::linear) 1939 // We only have predictions up to x2 = max value. Limits should get stronger for x2 > max value, so 1951 // Capability function to compute the cooling likelihood of G117-B15A (1205.6180; observations from Kepler+ (2011)). 1960 const std::vector<double> x2vals = {0.0, 1.0, 6.25, 25.0, 56.25, 100.0, 156.25, 225.0, 306.25, 404.0, 506.25, 625.0, 756.25, 900.0}; 1961 const std::vector<double> dPidts = {1.235687, 1.244741, 1.299579, 1.470017, 1.796766, 2.260604, 2.795575, 3.484570, 4.232738, 5.056075, 6.113390, 7.342085, 8.344424, 9.775156}; 1966 static WDInterpolator dPidt (x2vals, dPidts, GAMBIT_DIR "/DarkBit/data/Axions_WDCorrection_G117B15A.dat"); 1977 // Capability function to compute the cooling likelihood of R548 (1211.3389 using T = 11630 K; observations from Mukadam+ (2012)). 1986 const std::vector<double> x2vals = {0.0, 1.0, 6.25, 25.0, 56.25, 100.0, 156.25, 225.0, 306.25, 400.0, 506.25, 625.0, 756.25, 900.0}; 1987 const std::vector<double> dPidts = {1.075373, 1.095319, 1.123040, 1.289434, 1.497666, 1.869437, 2.300523, 2.844954, 3.379978, 4.086028, 4.847149, 5.754807, 6.714841, 7.649140}; 1992 static WDInterpolator dPidt (x2vals, dPidts, GAMBIT_DIR "/DarkBit/data/Axions_WDCorrection_R548.dat"); 2003 // Capability function to compute the cooling likelihood of PG1351+489 (1605.07668 & 1406.6034; using observations from Redaelli+ (2011)). 2012 const std::vector<double> x2vals = {0.0, 4.0, 16.0, 36.0, 64.0, 100.0, 144.0, 196.0, 256.0, 324.0, 400.0}; 2013 const std::vector<double> dPidts = {0.90878126, 0.96382008, 1.2022906, 1.5712931, 2.1220619, 2.8002354, 3.6172605, 4.5000560, 5.5256592, 6.5055283, 7.5341296}; 2018 static WDInterpolator dPidt (x2vals, dPidts, GAMBIT_DIR "/DarkBit/data/Axions_WDCorrection_PG1351489.dat"); 2029 // Capability function to compute the cooling likelihood of L192 (1605.06458 using l=1 & k=2; observations from Sullivan+Chote (2015)). 2038 const std::vector<double> x2vals = {0.0, 1.0, 4.0, 9.0, 16.0, 25.0, 36.0, 49.0, 64.0, 81.0, 100.0, 121.0, 144.0, 169.0, 196.0, 225.0, 256.0, 289.0, 324.0, 361.0, 400.0, 441.0, 484.0, 529.0, 576.0, 625.0, 676.0, 729.0, 784.0, 841.0, 900.0}; 2039 const std::vector<double> dPidts = {2.41, 2.40, 2.44, 2.42, 2.50, 2.57, 2.63, 2.74, 2.83, 2.99, 3.15, 3.32, 3.52, 3.70, 3.90, 4.08, 4.42, 4.69, 4.98, 5.34, 5.62, 6.02, 6.27, 6.62, 7.04, 7.38, 7.89, 8.09, 8.65, 9.16, 9.62}; 2044 static WDInterpolator dPidt (x2vals, dPidts, GAMBIT_DIR "/DarkBit/data/Axions_WDCorrection_L192.dat"); 2056 // SN 1987A limits (from axion-photon conversion in the B-field of the Milky Way or axion-photon decay) // 2059 // Capability function to calculate the likelihood for SN 1987A (based on data from 25 to 100 MeV photons, interpreted 2078 // Capability function to calculate the photon fluence from SN 1987A as a result of axion-photon 2094 // Calculate the likelihood for H.E.S.S. data assuming conversion in the galaxy cluster magnetic field (GCMF, "Conservative" limits, 1311.3148). 2101 // Compute the domensionless parameters Epsilon and Gamma from the axion mass and axion-photon coupling (see 1311.3148). 2122 // Rescale couplings and 3H abundance to the reference values used in 2006.10035 for convenience. 2130 static bool include_inverse_Primakoff = runOptions->getValueOrDef<bool> (true, "include_inverse_Primakoff"); 2232 static AxionInterpolator efficiency (GAMBIT_DIR "/DarkBit/data/XENON1T/efficiency.txt", InterpolationOptions1D::cspline); 2242 // Rescale couplings and 3H abundance to the reference values used in 2006.10035 for convenience. 2289 double amplitude = dm_fraction * (rho0/0.3) * exposure * gae*gae * ma * photoel_eff_conversion*sigma_pe.interpolate(ma/1000.0); 2318 result = -0.5 * ( gsl_pow_2(*Param["delta_bkg"]/0.026) + gsl_pow_2(*Param["delta_eff"]/0.030) );
error & DarkBit_error() Definition: halo_types.hpp:33 void QCDAxion_TemperatureDependence_Nuisance_lnL(double &result) Definition: Axions.cpp:1156 void setcolnames(std::vector< std::string > names) Definition: ascii_table_reader.cpp:52 double log_chi(double T, double beta, double Tchi) Definition: Axions.cpp:1147 Simple reader for ASCII tables. int scal_field_eq(double tau, const double y[], double f[], void *params) Definition: Axions.cpp:1736 const double gagg_conversion Supporting classes and functions for the axion module. Definition: Axions.cpp:70 void QCDAxion_ZeroTemperatureMass_Nuisance_lnL(double &result) Definition: Axions.cpp:1120 InterpolationOptions2D Two-dimensional integration container for bilinear interpolation and bicubic splines. Definition: Axions.cpp:197 void calc_Haloscope_signal(double &result) Definition: Axions.cpp:1447 double gaussian_loglikelihood(double theory, double obs, double theoryerr, double obserr, bool profile_systematics) Use a detection to compute a simple chi-square-like log likelihood, for the case when obs is Gaussian... Definition: statistics.cpp:133 void calc_lnL_WDVar_L192(double &result) Definition: Axions.cpp:2030 void calc_CAST2007_signal_vac(std::vector< double > &result) Definition: Axions.cpp:1274 double erg_integrand(double erg, void *params) Definition: Axions.cpp:710 void calc_lnL_Haloscope_ADMX2(double &result) Definition: Axions.cpp:1506 void swap(Spectrum &first, Spectrum &second) Swap resources of two Spectrum objects Note: Not a member function! This is an external function whic... Definition: spectrum.cpp:57 void calc_RParameter(double &result) Capabilities relating to astrophysical observations (R-parameter, H.E.S.S. telescope search... Definition: Axions.cpp:1873 int scal_field_eq_jac(double tau, const double y[], double *dfdy, double dfdt[], void *params) Definition: Axions.cpp:1752 void calc_ALPS1_signal_vac(double &result) Definition: Axions.cpp:1218 void QCDAxion_AxionPhotonConstant_Nuisance_lnL(double &result) Definition: Axions.cpp:1134 double gStar(double T) Various capabilities and functions to provide SM physics as well as QCD input for axions... Definition: Axions.cpp:1075 void calc_lnL_Haloscope_ADMX1(double &result) Definition: Axions.cpp:1466 General small utility functions. void calc_ALPS1_signal_gas(double &result) Definition: Axions.cpp:1228 void calc_CAST2017_signal_vac(std::vector< std::vector< double >> &result) Definition: Axions.cpp:1302 Definition: log_tags.hpp:35 const std::map< InterpolationOptions1D, std::string > int_type_name Definition: Axions.cpp:81 void calc_lnL_RParameter(double &result) Definition: Axions.cpp:1899 Declarations of statistical utilities. bool check2(const str &s1, const str &s2) Sub-check for are_similar. Definition: util_functions.cpp:371 MATH_OPERATION(Dif,-) MATH_OPERATION(pow) MATH_OPERATION(fmin) MATH_OPERATION(fmax) class FunkInterp shared_ptr< FunkInterp > interp(T f, std::vector< double > x, std::vector< double > y) Definition: daFunk.hpp:1349 EXPORT_SYMBOLS bool file_exists(const std::string &filename) Check if a file exists. Definition: util_functions.cpp:241 double alt_erg_integrand(double erg, void *params) Definition: Axions.cpp:741 void calc_lnL_XENON1T_Anomaly_NuisanceParameters(double &result) Definition: Axions.cpp:2314 Definition: log_tags.hpp:36 double rho_integrand(double rho, void *params) Definition: Axions.cpp:662 const Logging::endofmessage EOM Explicit const instance of the end of message struct in Gambit namespace. Definition: logger.hpp:100 double CAST_lnL_general(std::vector< double > s, const std::vector< double > bkg_counts, const std::vector< int > sig_counts) Definition: Axions.cpp:1350 Basic set of known mathematical and physical constants for GAMBIT. Header file that includes all GAMBIT headers required for a module source file. EXPORT_SYMBOLS Logging::LogMaster & logger() Function to retrieve a reference to the Gambit global log object. Definition: logger.cpp:95 void calc_lnL_HESS_GCMF(double &result) Definition: Axions.cpp:2095 Simple header file for turning compiler warnings back on after having included one of the begin_ignor... double ALPS1_lnL_general(double s, double mu, double sigma) Definition: Axions.cpp:1238 void calc_lnL_WDVar_G117B15A(double &result) Definition: Axions.cpp:1952 const std::map< InterpolationOptions2D, std::string > int_2d_type_name Definition: Axions.cpp:198 void calc_lnL_WDVar_R548(double &result) Definition: Axions.cpp:1978 Pragma directives to suppress compiler warnings coming from including Eigen library headers... Rollcall header for module DarkBit. void calc_lnL_XENON1T_Anomaly(double &result) Capability for the XENON1T likelihood from 2006.10035. Definition: Axions.cpp:2118 warning & DarkBit_warning() bool check1(const str &s1, const str &s2) Sub-check for are_similar. Definition: util_functions.cpp:354 InterpolationOptions1D Generic one-dimensional integration container for linear interpolation and cubic splines. Definition: Axions.cpp:80 double equation_Tosc(double T, void *params) Definition: Axions.cpp:1661 double parabola(double x, const double params[]) H.E.S.S.-likelihood-related interpolation routines. Definition: Axions.cpp:351 void calc_lnL_WDVar_PG1351489(double &result) Definition: Axions.cpp:2004 double ALPS1_signal_general(double power, double nm1, double m_ax, double gagg) Likelihoods for ALPS 1 (LSW), CAST (helioscopes), and ADMX, UF, RBF (haloscopes). ... Definition: Axions.cpp:1191 double rad_integrand(double rad, void *params) Definition: Axions.cpp:685 void calc_PhotonFluence_SN1987A_Conversion(double &result) Definition: Axions.cpp:2080 void calc_lnL_XENON1T_DM_Anomaly(double &result) Definition: Axions.cpp:2236 void calc_lnL_Haloscope_UF(double &result) Definition: Axions.cpp:1533 double axion_mass_temp(double T, double beta, double Tchi) Definition: Axions.cpp:1648 double E(const double x, const double y) Definition: flav_loop_functions.hpp:280 void calc_AxionOscillationTemperature(double &result) Definition: Axions.cpp:1676 void calc_lnL_Haloscope_RBF(double &result) Definition: Axions.cpp:1557 double gaussian_nuisance_lnL(double theo, double obs, double sigma) Definition: Axions.cpp:1057 double SpecialFun1(double T) Capabilities relating to axion cosmology. Currently only provides the energy density in axions today ... Definition: Axions.cpp:1616 double intersect_parabola_line(double a, double b, double sign, const double pparams[]) Definition: Axions.cpp:354 Utility functions for DarkBit. |