124 double dist = (Dep::GalacticHalo)->
r_sun;
125 for (
size_t i = 0; i<
r.size(); i++ )
127 rho[i] = profile->bind(
"r")->eval(
r[i]);
129 BEreq::set_halo_profile(0,
r, rho,
byVal(dist));
140 double fraction = *Dep::RD_fraction;
145 std::string version = runOptions->getValueOrDef<std::string>(
"pass8",
"version");
146 if ( version ==
"pass8" ) mode = 1;
147 else if ( version ==
"pass7" ) mode = 0;
154 std::vector<double> y;
157 std::string proc = *Dep::DM_process;
158 if (proc ==
"annihilation")
160 y = ((*Dep::GA_Yield)/8./M_PI*fraction*fraction)->
set(
"v", 0)->bind(
"E")->vect(x);
162 else if (proc ==
"decay")
165 y = ((*Dep::GA_Yield)/4./M_PI*fraction)->bind(
"E")->vect(x);
172 result = BEreq::lnL(
byVal(mode), x, y);
181 double fraction = *Dep::RD_fraction;
186 std::string version = runOptions->getValueOrDef<std::string>(
"spectral_externalJ",
"version");
187 if ( version ==
"integral_fixedJ" ) mode = 6;
188 else if ( version ==
"spectral_fixedJ" ) mode = 7;
189 else if ( version ==
"integral_externalJ" ) mode = 9;
190 else if ( version ==
"spectral_externalJ" ) mode = 10;
197 std::vector<double> y;
200 std::string proc = *Dep::DM_process;
201 if (proc ==
"annihilation")
203 y = ((*Dep::GA_Yield)/8./M_PI*fraction*fraction)->
set(
"v", 0)->bind(
"E")->vect(x);
205 else if (proc ==
"decay")
208 y = ((*Dep::GA_Yield)/4./M_PI*fraction)->bind(
"E")->vect(x);
215 result = BEreq::lnL(
byVal(mode), x, y);
224 double fraction = *Dep::RD_fraction;
231 std::vector<double> y;
234 std::string proc = *Dep::DM_process;
235 if (proc ==
"annihilation")
237 y = ((*Dep::GA_Yield)/8./M_PI*fraction*fraction)->
set(
"v", 0)->bind(
"E")->vect(x);
239 else if (proc ==
"decay")
242 y = ((*Dep::GA_Yield)/4./M_PI*fraction)->bind(
"E")->vect(x);
249 result = BEreq::lnL(5, x, y);
260 double fraction = *Dep::RD_fraction;
265 std::string version = runOptions->getValueOrDef<std::string>(
"externalJ",
"version");
266 if ( version ==
"fixedJ" ) mode = 2;
267 else if ( version ==
"margJ" ) mode = 3;
268 else if ( version ==
"margJ_HEP" ) mode = 4;
269 else if ( version ==
"externalJ" ) mode = 8;
276 std::vector<double> y;
279 std::string proc = *Dep::DM_process;
280 if (proc ==
"annihilation")
282 y = ((*Dep::GA_Yield)/8./M_PI*fraction*fraction)->
set(
"v", 0)->bind(
"E")->vect(x);
284 else if (proc ==
"decay")
287 y = ((*Dep::GA_Yield)/4./M_PI*fraction)->bind(
"E")->vect(x);
294 result = BEreq::lnL(
byVal(mode), x, y);
306 double oh2_theory = *Dep::RD_oh2;
309 double oh2_theoryerr = oh2_theory*runOptions->getValueOrDef<
double>(0.05,
"oh2_fractional_theory_err");
311 double oh2_obs = runOptions->getValueOrDef<
double>(0.1188,
"oh2_obs");
313 double oh2_obserr = runOptions->getValueOrDef<
double>(0.001,
"oh2_obserr");
315 bool profile = runOptions->getValueOrDef<
bool>(
false,
"profile_systematics");
327 double oh2_theory = *Dep::RD_oh2;
330 double oh2_theoryerr = oh2_theory*runOptions->getValueOrDef<
double>(0.05,
"oh2_fractional_theory_err");
332 double oh2_obs = runOptions->getValueOrDef<
double>(0.1188,
"oh2_obs");
334 double oh2_obserr = runOptions->getValueOrDef<
double>(0.001,
"oh2_obserr");
336 bool profile = runOptions->getValueOrDef<
bool>(
false,
"profile_systematics");
351 double sigmas = *Param[
"sigmas"];
352 double sigmal = *Param[
"sigmal"];
354 double sigmas_obs = runOptions->getValueOrDef<
double>(43.,
"sigmas_obs");
356 double sigmas_obserr = runOptions->getValueOrDef<
double>(8.,
"sigmas_obserr");
358 double sigmal_obs = runOptions->getValueOrDef<
double>(58.,
"sigmal_obs");
360 double sigmal_obserr = runOptions->getValueOrDef<
double>(9.,
"sigmal_obserr");
362 bool profile = runOptions->getValueOrDef<
bool>(
false,
"profile_systematics");
381 double deltad = *Param[
"deltad"];
382 double deltau = *Param[
"deltau"];
383 double deltas = *Param[
"deltas"];
384 double a3 = deltau - deltad;
385 double a8 = deltau + deltad - 2*deltas;
388 double a3_obs = runOptions->getValueOrDef<
double>(1.2723,
"a3_obs");
390 double a3_obserr = runOptions->getValueOrDef<
double>(0.0023,
"a3_obserr");
392 double a8_obs = runOptions->getValueOrDef<
double>(0.585,
"a8_obs");
394 double a8_obserr = runOptions->getValueOrDef<
double>(0.025,
"a8_obserr");
396 double deltas_obs = runOptions->getValueOrDef<
double>(-0.09,
"deltas_obs");
398 double deltas_obserr = runOptions->getValueOrDef<
double>(0.03,
"deltas_obserr");
400 bool profile = runOptions->getValueOrDef<
bool>(
false,
"profile_systematics");
416 double rho0 = LocalHaloParameters.
rho0;
418 double rho0_obs = runOptions->getValueOrDef<
double>(.4,
"rho0_obs");
420 double rho0_obserr = runOptions->getValueOrDef<
double>(.15,
"rho0_obserr");
422 bool profile = runOptions->getValueOrDef<
bool>(
false,
"profile_systematics");
425 rho0_obserr, profile);
433 double vrot = LocalHaloParameters.
vrot;
435 double vrot_obs = runOptions->getValueOrDef<
double>(235,
"vrot_obs");
437 double vrot_obserr = runOptions->getValueOrDef<
double>(20,
"vrot_obserr");
439 bool profile = runOptions->getValueOrDef<
bool>(
false,
"profile_systematics");
448 double v0 = LocalHaloParameters.
v0;
450 double v0_obs = runOptions->getValueOrDef<
double>(235,
"v0_obs");
452 double v0_obserr = runOptions->getValueOrDef<
double>(20,
"v0_obserr");
454 bool profile = runOptions->getValueOrDef<
bool>(
false,
"profile_systematics");
463 double vesc = LocalHaloParameters.
vesc;
465 double vesc_obs = runOptions->getValueOrDef<
double>(550,
"vesc_obs");
467 double vesc_obserr = runOptions->getValueOrDef<
double>(35,
"vesc_obserr");
469 bool profile = runOptions->getValueOrDef<
bool>(
false,
"profile_systematics");
481 std::string filename = runOptions->getValueOrDef<std::string>(
482 "dNdE.dat",
"filename");
483 logger() <<
"FILENAME for gamma dump: " << filename <<
EOM;
484 std::ofstream myfile (filename);
485 if (myfile.is_open())
487 for (
int i = 0; i<=1200; i++)
489 double energy =
pow(10., i/200. - 4.);
491 myfile << energy <<
" " << spectrum->bind(
"E")->eval(energy) <<
"\n";
void lnL_FermiGC_gamLike(double &result)
Fermi LAT galactic center likelihoods, using gamLike backend.
void lnL_sigmas_sigmal(double &result)
Likelihoods for spin independent nuclear parameters.
void lnL_oh2_upperlimit(double &result)
Likelihood for cosmological relic density constraints, implemented as an upper limit only Default dat...
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...
void dump_GammaSpectrum(double &result)
Helper function to dump gamma-ray spectra.
void lnL_deltaq(double &result)
Likelihoods for spin dependent nuclear parameters.
void lnL_v0_gaussian(double &result)
void lnL_oh2_Simple(double &result)
Likelihood for cosmological relic density constraints.
Declarations of statistical utilities.
double gaussian_upper_limit(double theory, double obs, double theoryerr, double obserr, bool profile_systematics)
Use a detection to compute a gaussian log-likelihood for an upper limit.
void lnL_FermiLATdwarfs_gamLike(double &result)
Fermi LAT dwarf likelihoods, using gamLike backend.
std::vector< double > logspace(double x0, double x1, unsigned int n)
void lnL_rho0_lognormal(double &result)
Likelihoods for halo parameters.
const Logging::endofmessage EOM
Explicit const instance of the end of message struct in Gambit namespace.
void set_gamLike_GC_halo(bool &result)
Fermi LAT dwarf likelihoods, based on arXiv:1108.2914.
EXPORT_SYMBOLS Logging::LogMaster & logger()
Function to retrieve a reference to the Gambit global log object.
void lnL_vesc_gaussian(double &result)
void lnL_vrot_gaussian(double &result)
Rollcall header for module DarkBit.
void lnL_HESSGC_gamLike(double &result)
double pow(const double &a)
Outputs a^i.
double lognormal_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 log-norm...
std::vector< double > augmentSingl(const std::vector< double > &xgrid, Funk f, int N=100, double sigma=3)
T byVal(T t)
Redirection function to turn an lvalue into an rvalue, so that it is correctly passed by value when d...
def profile(file_name, frac_error=0.1, min_=0., max_=1., log_normal=True)
shared_ptr< FunkBase > Funk
void lnL_CTAGC_gamLike(double &result)
TODO: see if we can use this one: